Skip to content
Snippets Groups Projects
Commit 424db5b7 authored by Akash Kothari's avatar Akash Kothari :speech_balloon:
Browse files

Moved old .ll unit test files

parent e66cd433
No related branches found
No related tags found
No related merge requests found
Showing
with 1390 additions and 0 deletions
; RUN: opt -load LLVMBuildDFG.so -load LLVMDFG2LLVM_X86.so -load LLVMClearDFG.so -dfg2llvm-x86 -clearDFG -o %t.ll -S < %s
; RUN: llvm-link %t.ll ~/current-src/projects/visc-rt/visc-rt.ll -S -o %t.linked.ll
; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -lrt -o %t.bin
; RUN: %t.bin 5
; ModuleID = '/home/psrivas2/current-test/unitTests/3level.ll'
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%rtype = type <{i32, i32}>
%rtype_internal = type <{i32}>
%struct.arg = type <{ i32, %rtype }>
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nounwind
declare void @llvm.visc.init() #1
; Function Attrs: nounwind
declare void @llvm.visc.cleanup() #1
; Function Attrs: nounwind
declare i8* @llvm.visc.createNode(i8*) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.createEdge(i8*, i8*, i1, i32, i32) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.launch(i8*, i8*) #0
; Function Attrs: nounwind
declare void @llvm.visc.wait(i8*) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.getNode() #0
; Function Attrs: nounwind
declare void @llvm.visc.bind.input(i8*, i32, i32)
; Function Attrs: nounwind
declare void @llvm.visc.bind.output(i8*, i32, i32)
; Function Attrs: nounwind uwtable
define i32 @main(i32 %argc, i8** nocapture %argv) #1 {
entry:
%in.addr = alloca %struct.arg
%arrayidx = getelementptr inbounds i8** %argv, i64 1
%0 = load i8** %arrayidx, align 8, !tbaa !0
%call.i = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10) #0
%conv.i = trunc i64 %call.i to i32
call void @llvm.visc.init()
%1 = bitcast %struct.arg* %in.addr to i32*
store i32 %conv.i, i32* %1
%args = bitcast %struct.arg* %in.addr to i8*
%graphID = call i8* @llvm.visc.launch(i8* bitcast (%rtype (i32)* @Root to i8*), i8* %args)
%call1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %conv.i) #0
call void @llvm.visc.wait(i8* %graphID)
%2 = getelementptr %struct.arg* %in.addr, i32 0, i32 1
%outputstruct = load %rtype* %2
%output1 = extractvalue %rtype %outputstruct, 0
%output2 = extractvalue %rtype %outputstruct, 1
call void @llvm.visc.cleanup()
%call2 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %output1) #0
%call3 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %output2) #0
ret i32 0
}
define %rtype_internal @producer(i32 %id) {
%sum = add i32 4, %id
%output = insertvalue %rtype_internal undef, i32 %sum, 0
ret %rtype_internal %output
}
define %rtype_internal @consumer(i32 %id) {
%sum = add i32 10, %id
%output = insertvalue %rtype_internal undef, i32 %sum, 0
ret %rtype_internal %output
}
define %rtype_internal @foo(i32 %id) {
%sum = add i32 15, %id
%output = insertvalue %rtype_internal undef, i32 %sum, 0
ret %rtype_internal %output
}
define %rtype_internal @subNode(i32 %id) {
%foo_node = call i8* @llvm.visc.createNode(i8* bitcast (%rtype_internal (i32)* @foo to i8*))
call void @llvm.visc.bind.input(i8* %foo_node, i32 0, i32 0)
call void @llvm.visc.bind.output(i8* %foo_node, i32 0, i32 0)
ret %rtype_internal zeroinitializer
}
define %rtype @Root(i32 %id) {
%p_node = call i8* @llvm.visc.createNode(i8* bitcast (%rtype_internal (i32)* @producer to i8*))
%c_node = call i8* @llvm.visc.createNode(i8* bitcast (%rtype_internal (i32)* @consumer to i8*))
%sub_node = call i8* @llvm.visc.createNode(i8* bitcast (%rtype_internal (i32)* @subNode to i8*))
%edge = call i8* @llvm.visc.createEdge(i8* %p_node, i8* %c_node, i1 false, i32 0, i32 0)
call void @llvm.visc.bind.input(i8* %p_node, i32 0, i32 0)
call void @llvm.visc.bind.output(i8* %c_node, i32 0, i32 0)
call void @llvm.visc.bind.input(i8* %sub_node, i32 0, i32 0)
call void @llvm.visc.bind.output(i8* %sub_node, i32 0, i32 1)
ret %rtype zeroinitializer
}
; Function Attrs: nounwind
declare i32 @printf(i8* nocapture, ...) #2
; Function Attrs: nounwind
declare i64 @strtol(i8*, i8** nocapture, i32) #2
attributes #0 = { nounwind }
attributes #1 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #2 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
!0 = metadata !{metadata !"any pointer", metadata !1}
!1 = metadata !{metadata !"omnipotent char", metadata !2}
!2 = metadata !{metadata !"Simple C/C++ TBAA"}
PASSES :=
.PHONY: clean
LLVM_INSTALL:=/home/psrivas2/Hetero/VISC/Code/trunk/llvm-install
LIBCLC:=/home/psrivas2/Hetero/VISC/Code/trunk/libclc
HOST:=gemm_opencl
KERNELS:=matrixMul
LLVM_CC:=$(LLVM_INSTALL)/bin/clang
LLVM_LINK:=$(LLVM_INSTALL)/bin/llvm-link
clean :
rm -f DataflowGraph.dot*
config.suffixes = ['.ll']
; RUN: opt -load LLVMBuildDFG.so -load LLVMDFG2LLVM_X86.so -load LLVMClearDFG.so -dfg2llvm-x86 -clearDFG -o %t.ll -S < %s
; RUN: llvm-link %t.ll ~/current-src/projects/visc-rt/visc-rt.ll -S -o %t.linked.ll
; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -lrt -o %t.bin
; RUN: %t.bin 5
; ModuleID = '/home/psrivas2/current-test/unitTests/query2D.ll'
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%rtype = type <{i32}>
%struct.arg = type <{ i32, %rtype }>
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nounwind
declare void @llvm.visc.init() #1
; Function Attrs: nounwind
declare void @llvm.visc.cleanup() #1
; Function Attrs: nounwind
declare i8* @llvm.visc.createNode(i8*) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.createNode1D(i8*, i32) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.createNode2D(i8*, i32, i32) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.createEdge(i8*, i8*, i1, i32, i32) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.launch(i8*, i8*) #0
; Function Attrs: nounwind
declare void @llvm.visc.wait(i8*) #0
; Function Attrs: nounwind
declare void @llvm.visc.bind.input(i8*, i32, i32)
; Function Attrs: nounwind
declare void @llvm.visc.bind.output(i8*, i32, i32)
; Function Attrs: nounwind
declare i8* @llvm.visc.getNode() #0
; Function Attrs: nounwind
declare i8* @llvm.visc.getParentNode(i8*) #0
; Function Attrs: nounwind
declare i32 @llvm.visc.getNumDims(i8*) #0
; Function Attrs: nounwind
declare i32 @llvm.visc.getNumNodeInstances.x(i8*) #0
; Function Attrs: nounwind uwtable
define i32 @main(i32 %argc, i8** nocapture %argv) #1 {
entry:
%in.addr = alloca %struct.arg
%arrayidx = getelementptr inbounds i8** %argv, i64 1
%0 = load i8** %arrayidx, align 8, !tbaa !0
%call.i = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10) #0
%conv.i = trunc i64 %call.i to i32
call void @llvm.visc.init()
%1 = bitcast %struct.arg* %in.addr to i32*
store i32 %conv.i, i32* %1
%args = bitcast %struct.arg* %in.addr to i8*
%graphID = call i8* @llvm.visc.launch(i8* bitcast (%rtype (i32)* @Root to i8*), i8* %args)
%call1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %conv.i) #0
call void @llvm.visc.wait(i8* %graphID)
%2 = getelementptr %struct.arg* %in.addr, i32 0, i32 1
%outputstruct = load %rtype* %2
%output = extractvalue %rtype %outputstruct, 0
call void @llvm.visc.cleanup()
%call2 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %output) #0
ret i32 0
}
define %rtype @producer(i32 %id) {
%sum = add i32 4, %id
%this_node = call i8* @llvm.visc.getNode()
%dim = call i32 @llvm.visc.getNumNodeInstances.x(i8* %this_node)
%sum2 = add i32 %sum, %dim
%output = insertvalue %rtype undef, i32 %sum2, 0
ret %rtype %output
}
define %rtype @consumer(i32 %id) {
%sum = add i32 10, %id
%output = insertvalue %rtype undef, i32 %sum, 0
ret %rtype %output
}
define %rtype @Root(i32 %dimension) {
%p_node = call i8* @llvm.visc.createNode2D(i8* bitcast (%rtype (i32)* @producer to i8*), i32 %dimension, i32 %dimension)
%c_node = call i8* @llvm.visc.createNode(i8* bitcast (%rtype (i32)* @consumer to i8*))
%edge = call i8* @llvm.visc.createEdge(i8* %p_node, i8* %c_node, i1 false, i32 0, i32 0)
call void @llvm.visc.bind.input(i8* %p_node, i32 0, i32 0)
call void @llvm.visc.bind.output(i8* %c_node, i32 0, i32 0)
ret %rtype zeroinitializer
}
; Function Attrs: nounwind
declare i32 @printf(i8* nocapture, ...) #2
; Function Attrs: nounwind
declare i64 @strtol(i8*, i8** nocapture, i32) #2
attributes #0 = { nounwind }
attributes #1 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #2 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
!0 = metadata !{metadata !"any pointer", metadata !1}
!1 = metadata !{metadata !"omnipotent char", metadata !2}
!2 = metadata !{metadata !"Simple C/C++ TBAA"}
; RUN: opt -load LLVMBuildDFG.so -load LLVMDFG2LLVM_X86.so -load LLVMClearDFG.so -dfg2llvm-x86 -clearDFG -o %t.ll -S < %s
; RUN: llvm-link %t.ll ~/current-src/projects/visc-rt/visc-rt.ll -S -o %t.linked.ll
; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -lrt -o %t.bin
; RUN: %t.bin 5
; ModuleID = '/home/psrivas2/current-test/unitTests/query3D.ll'
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%rtype = type <{i32}>
%struct.arg = type <{ i32, %rtype }>
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nounwind
declare void @llvm.visc.init() #1
; Function Attrs: nounwind
declare void @llvm.visc.cleanup() #1
; Function Attrs: nounwind
declare i8* @llvm.visc.createNode(i8*) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.createNode1D(i8*, i32) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.createNode2D(i8*, i32, i32) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.createNode3D(i8*, i32, i32, i32) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.createEdge(i8*, i8*, i1, i32, i32) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.launch(i8*, i8*) #0
; Function Attrs: nounwind
declare void @llvm.visc.wait(i8*) #0
; Function Attrs: nounwind
declare void @llvm.visc.bind.input(i8*, i32, i32)
; Function Attrs: nounwind
declare void @llvm.visc.bind.output(i8*, i32, i32)
; Function Attrs: nounwind
declare i8* @llvm.visc.getNode() #0
; Function Attrs: nounwind
declare i8* @llvm.visc.getParentNode(i8*) #0
; Function Attrs: nounwind
declare i32 @llvm.visc.getNumDims(i8*) #0
; Function Attrs: nounwind
declare i32 @llvm.visc.getNumNodeInstances.x(i8*) #0
; Function Attrs: nounwind
declare i32 @llvm.visc.getNumNodeInstances.y(i8*) #0
; Function Attrs: nounwind uwtable
define i32 @main(i32 %argc, i8** nocapture %argv) #1 {
entry:
call void @llvm.visc.init()
%in.addr = alloca %struct.arg
%arrayidx = getelementptr inbounds i8** %argv, i64 1
%0 = load i8** %arrayidx, align 8, !tbaa !0
%call.i = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10) #0
%conv.i = trunc i64 %call.i to i32
%1 = bitcast %struct.arg* %in.addr to i32*
store i32 %conv.i, i32* %1
%args = bitcast %struct.arg* %in.addr to i8*
%graphID = call i8* @llvm.visc.launch(i8* bitcast (%rtype (i32)* @Root to i8*), i8* %args)
%call1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %conv.i) #0
call void @llvm.visc.wait(i8* %graphID)
%2 = getelementptr %struct.arg* %in.addr, i32 0, i32 1
%outputstruct = load %rtype* %2
%output = extractvalue %rtype %outputstruct, 0
%call2 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %output) #0
call void @llvm.visc.cleanup()
ret i32 0
}
define %rtype @producer(i32 %id) {
%sum = add i32 4, %id
%this_node = call i8* @llvm.visc.getNode()
%dim = call i32 @llvm.visc.getNumNodeInstances.y(i8* %this_node)
%sum2 = add i32 %sum, %dim
%output = insertvalue %rtype undef, i32 %sum2, 0
ret %rtype %output
}
define %rtype @consumer(i32 %id) {
%sum = add i32 10, %id
%output = insertvalue %rtype undef, i32 %sum, 0
ret %rtype %output
}
define %rtype @Root(i32 %dimension) {
%p_node = call i8* @llvm.visc.createNode3D(i8* bitcast (%rtype (i32)* @producer to i8*), i32 %dimension, i32 10, i32 30)
%c_node = call i8* @llvm.visc.createNode(i8* bitcast (%rtype (i32)* @consumer to i8*))
%edge = call i8* @llvm.visc.createEdge(i8* %p_node, i8* %c_node, i1 false, i32 0, i32 0)
call void @llvm.visc.bind.input(i8* %p_node, i32 0, i32 0)
call void @llvm.visc.bind.output(i8* %c_node, i32 0, i32 0)
ret %rtype zeroinitializer
}
; Function Attrs: nounwind
declare i32 @printf(i8* nocapture, ...) #2
; Function Attrs: nounwind
declare i64 @strtol(i8*, i8** nocapture, i32) #2
attributes #0 = { nounwind }
attributes #1 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #2 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
!0 = metadata !{metadata !"any pointer", metadata !1}
!1 = metadata !{metadata !"omnipotent char", metadata !2}
!2 = metadata !{metadata !"Simple C/C++ TBAA"}
; RUN: opt -load LLVMBuildDFG.so -load LLVMDFG2LLVM_X86.so -load LLVMClearDFG.so -dfg2llvm-x86 -clearDFG -o %t.ll -S < %s
; RUN: llvm-link %t.ll ~/current-src/projects/visc-rt/visc-rt.ll -S -o %t.linked.ll
; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -lrt -o %t.bin
; RUN: %t.bin 5
; ModuleID = '/home/psrivas2/current-test/unitTests/twoNode.ll'
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%rtype = type <{i32}>
%struct.arg = type <{ i32, %rtype }>
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nounwind
declare void @llvm.visc.init() #1
; Function Attrs: nounwind
declare void @llvm.visc.cleanup() #1
; Function Attrs: nounwind
declare i8* @llvm.visc.createNode(i8*) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.createEdge(i8*, i8*, i1, i32, i32) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.launch(i8*, i8*) #0
; Function Attrs: nounwind
declare void @llvm.visc.wait(i8*) #0
; Function Attrs: nounwind
declare void @llvm.visc.bind.input(i8*, i32, i32)
; Function Attrs: nounwind
declare void @llvm.visc.bind.output(i8*, i32, i32)
; Function Attrs: nounwind
declare i8* @llvm.visc.getNode() #0
; Function Attrs: nounwind
declare i32 @llvm.visc.getNumDims(i8*) #0
; Function Attrs: nounwind uwtable
define i32 @main(i32 %argc, i8** nocapture %argv) #1 {
entry:
call void @llvm.visc.init()
%in.addr = alloca %struct.arg
%arrayidx = getelementptr inbounds i8** %argv, i64 1
%0 = load i8** %arrayidx, align 8, !tbaa !0
%call.i = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10) #0
%conv.i = trunc i64 %call.i to i32
%1 = bitcast %struct.arg* %in.addr to i32*
store i32 %conv.i, i32* %1
%args = bitcast %struct.arg* %in.addr to i8*
%graphID = call i8* @llvm.visc.launch(i8* bitcast (%rtype (i32)* @Root to i8*), i8* %args)
%call1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %conv.i) #0
call void @llvm.visc.wait(i8* %graphID)
%2 = getelementptr %struct.arg* %in.addr, i32 0, i32 1
%outputstruct = load %rtype* %2
%output = extractvalue %rtype %outputstruct, 0
%call2 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %output) #0
call void @llvm.visc.cleanup()
ret i32 0
}
define %rtype @producer(i32 %id) {
%sum = add i32 4, %id
%this_node = call i8* @llvm.visc.getNode()
%numDim = call i32 @llvm.visc.getNumDims(i8* %this_node)
%sum2 = add i32 %sum, %numDim
%output = insertvalue %rtype undef, i32 %sum, 0
ret %rtype %output
}
define %rtype @consumer(i32 %id) {
%sum = add i32 10, %id
%output = insertvalue %rtype undef, i32 %sum, 0
ret %rtype %output
}
define %rtype @Root(i32 %id) {
%p_node = call i8* @llvm.visc.createNode(i8* bitcast (%rtype (i32)* @producer to i8*))
%c_node = call i8* @llvm.visc.createNode(i8* bitcast (%rtype (i32)* @consumer to i8*))
%edge = call i8* @llvm.visc.createEdge(i8* %p_node, i8* %c_node, i1 false, i32 0, i32 0)
call void @llvm.visc.bind.input(i8* %p_node, i32 0, i32 0)
call void @llvm.visc.bind.output(i8* %c_node, i32 0, i32 0)
ret %rtype zeroinitializer
}
; Function Attrs: nounwind
declare i32 @printf(i8* nocapture, ...) #2
; Function Attrs: nounwind
declare i64 @strtol(i8*, i8** nocapture, i32) #2
attributes #0 = { nounwind }
attributes #1 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #2 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
!0 = metadata !{metadata !"any pointer", metadata !1}
!1 = metadata !{metadata !"omnipotent char", metadata !2}
!2 = metadata !{metadata !"Simple C/C++ TBAA"}
; RUN: opt -load LLVMBuildDFG.so -load LLVMDFG2LLVM_X86.so -load LLVMClearDFG.so -dfg2llvm-x86 -clearDFG -o %t.ll -S < %s
; RUN: llvm-link %t.ll ~/current-src/projects/visc-rt/visc-rt.ll -S -o %t.linked.ll
; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -lrt -o %t.bin
; RUN: %t.bin 5
; ModuleID = '/home/psrivas2/current-test/unitTests/twoNode.ll'
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%rtype = type <{i32}>
%struct.arg = type <{ i32, %rtype }>
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nounwind
declare void @llvm.visc.init() #1
; Function Attrs: nounwind
declare void @llvm.visc.cleanup() #1
; Function Attrs: nounwind
declare i8* @llvm.visc.createNode(i8*) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.createEdge(i8*, i8*, i1, i32, i32) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.launch(i8*, i8*) #0
; Function Attrs: nounwind
declare void @llvm.visc.wait(i8*) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.getNode() #0
; Function Attrs: nounwind
declare i8* @llvm.visc.getParentNode(i8*) #0
; Function Attrs: nounwind
declare i32 @llvm.visc.getNumDims(i8*) #0
; Function Attrs: nounwind
declare void @llvm.visc.bind.input(i8*, i32, i32)
; Function Attrs: nounwind
declare void @llvm.visc.bind.output(i8*, i32, i32)
; Function Attrs: nounwind uwtable
define i32 @main(i32 %argc, i8** nocapture %argv) #1 {
entry:
call void @llvm.visc.init()
%in.addr = alloca %struct.arg
%arrayidx = getelementptr inbounds i8** %argv, i64 1
%0 = load i8** %arrayidx, align 8, !tbaa !0
%call.i = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10) #0
%conv.i = trunc i64 %call.i to i32
%1 = bitcast %struct.arg* %in.addr to i32*
store i32 %conv.i, i32* %1
%args = bitcast %struct.arg* %in.addr to i8*
%graphID = call i8* @llvm.visc.launch(i8* bitcast (%rtype (i32)* @Root to i8*), i8* %args)
%call1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %conv.i) #0
call void @llvm.visc.wait(i8* %graphID)
%2 = getelementptr %struct.arg* %in.addr, i32 0, i32 1
%outputstruct = load %rtype* %2
%output = extractvalue %rtype %outputstruct, 0
%call2 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %output) #0
call void @llvm.visc.cleanup()
ret i32 0
}
define %rtype @producer(i32 %id) {
%sum = add i32 4, %id
%this_node = call i8* @llvm.visc.getNode()
%numDim = call i32 @llvm.visc.getNumDims(i8* %this_node)
%sum2 = add i32 %sum, %numDim
%output = insertvalue %rtype undef, i32 %sum, 0
ret %rtype %output
}
define %rtype @consumer(i32 %id) {
%sum = add i32 10, %id
%output = insertvalue %rtype undef, i32 %sum, 0
ret %rtype %output
}
define %rtype @Root(i32 %id) {
%p_node = call i8* @llvm.visc.createNode(i8* bitcast (%rtype (i32)* @producer to i8*))
%c_node = call i8* @llvm.visc.createNode(i8* bitcast (%rtype (i32)* @consumer to i8*))
%edge = call i8* @llvm.visc.createEdge(i8* %p_node, i8* %c_node, i1 false, i32 0, i32 0)
call void @llvm.visc.bind.input(i8* %p_node, i32 0, i32 0)
call void @llvm.visc.bind.output(i8* %c_node, i32 0, i32 0)
ret %rtype zeroinitializer
}
; Function Attrs: nounwind
declare i32 @printf(i8* nocapture, ...) #2
; Function Attrs: nounwind
declare i64 @strtol(i8*, i8** nocapture, i32) #2
attributes #0 = { nounwind }
attributes #1 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #2 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
!0 = metadata !{metadata !"any pointer", metadata !1}
!1 = metadata !{metadata !"omnipotent char", metadata !2}
!2 = metadata !{metadata !"Simple C/C++ TBAA"}
; RUN: opt -load LLVMBuildDFG.so -load LLVMDFG2LLVM_X86.so -load LLVMClearDFG.so -dfg2llvm-x86 -clearDFG -o %t.ll -S < %s
; RUN: llvm-link %t.ll ~/current-src/projects/visc-rt/visc-rt.ll -S -o %t.linked.ll
; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -lrt -o %t.bin
; RUN: %t.bin 5
; ModuleID = '/home/psrivas2/current-test/unitTests/twoNode.ll'
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%rtype = type <{i32}>
%struct.arg = type <{ i32, %rtype }>
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nounwind
declare void @llvm.visc.init() #1
; Function Attrs: nounwind
declare void @llvm.visc.cleanup() #1
; Function Attrs: nounwind
declare i8* @llvm.visc.createNode(i8*) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.createNode1D(i8*, i32) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.createEdge(i8*, i8*, i1, i32, i32) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.launch(i8*, i8*) #0
; Function Attrs: nounwind
declare void @llvm.visc.wait(i8*) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.getNode() #0
; Function Attrs: nounwind
declare i8* @llvm.visc.getParentNode(i8*) #0
; Function Attrs: nounwind
declare i32 @llvm.visc.getNumDims(i8*) #0
; Function Attrs: nounwind
declare i32 @llvm.visc.getNumNodeInstances.x(i8*) #0
; Function Attrs: nounwind
declare void @llvm.visc.bind.input(i8*, i32, i32)
; Function Attrs: nounwind
declare void @llvm.visc.bind.output(i8*, i32, i32)
; Function Attrs: nounwind uwtable
define i32 @main(i32 %argc, i8** nocapture %argv) #1 {
entry:
call void @llvm.visc.init()
%in.addr = alloca %struct.arg
%arrayidx = getelementptr inbounds i8** %argv, i64 1
%0 = load i8** %arrayidx, align 8, !tbaa !0
%call.i = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10) #0
%conv.i = trunc i64 %call.i to i32
%1 = bitcast %struct.arg* %in.addr to i32*
store i32 %conv.i, i32* %1
%args = bitcast %struct.arg* %in.addr to i8*
%graphID = call i8* @llvm.visc.launch(i8* bitcast (%rtype (i32)* @Root to i8*), i8* %args)
%call1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %conv.i) #0
call void @llvm.visc.wait(i8* %graphID)
%2 = getelementptr %struct.arg* %in.addr, i32 0, i32 1
%outputstruct = load %rtype* %2
%output = extractvalue %rtype %outputstruct, 0
%call2 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %output) #0
call void @llvm.visc.cleanup()
ret i32 0
}
define %rtype @producer(i32 %id) {
%sum = add i32 4, %id
%this_node = call i8* @llvm.visc.getNode()
%dim = call i32 @llvm.visc.getNumNodeInstances.x(i8* %this_node)
%sum2 = add i32 %sum, %dim
%output = insertvalue %rtype undef, i32 %sum2, 0
ret %rtype %output
}
define %rtype @consumer(i32 %id) {
%sum = add i32 10, %id
%output = insertvalue %rtype undef, i32 %sum, 0
ret %rtype %output
}
define %rtype @Root(i32 %dimension) {
%p_node = call i8* @llvm.visc.createNode1D(i8* bitcast (%rtype (i32)* @producer to i8*), i32 %dimension)
%c_node = call i8* @llvm.visc.createNode(i8* bitcast (%rtype (i32)* @consumer to i8*))
%edge = call i8* @llvm.visc.createEdge(i8* %p_node, i8* %c_node, i1 false, i32 0, i32 0)
call void @llvm.visc.bind.input(i8* %p_node, i32 0, i32 0)
call void @llvm.visc.bind.output(i8* %c_node, i32 0, i32 0)
ret %rtype zeroinitializer
}
; Function Attrs: nounwind
declare i32 @printf(i8* nocapture, ...) #2
; Function Attrs: nounwind
declare i64 @strtol(i8*, i8** nocapture, i32) #2
attributes #0 = { nounwind }
attributes #1 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #2 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
!0 = metadata !{metadata !"any pointer", metadata !1}
!1 = metadata !{metadata !"omnipotent char", metadata !2}
!2 = metadata !{metadata !"Simple C/C++ TBAA"}
; RUN: opt -load LLVMBuildDFG.so -load LLVMDFG2LLVM_X86.so -load LLVMClearDFG.so -dfg2llvm-x86 -clearDFG -o %t.ll -S < %s
; RUN: llvm-link %t.ll ~/current-src/projects/visc-rt/visc-rt.ll -S -o %t.linked.ll
; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -lrt -o %t.bin
; RUN: %t.bin 5
; ModuleID = '/home/psrivas2/current-test/unitTests/singleNode.ll'
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%rtype = type <{i32}>
%struct.arg = type <{ %rtype }>
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nounwind
declare void @llvm.visc.init() #1
; Function Attrs: nounwind
declare void @llvm.visc.cleanup() #1
; Function Attrs: nounwind
declare i8* @llvm.visc.createNode(i8*) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.createEdge(i8*, i8*, i1, i32, i32) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.launch(i8*, i8*) #0
; Function Attrs: nounwind
declare void @llvm.visc.wait(i8*) #0
; Function Attrs: nounwind
declare void @llvm.visc.bind.input(i8*, i32, i32)
; Function Attrs: nounwind
declare void @llvm.visc.bind.output(i8*, i32, i32)
; Function Attrs: nounwind uwtable
define i32 @main(i32 %argc, i8** nocapture %argv) #1 {
entry:
call void @llvm.visc.init()
%in.addr = alloca %struct.arg
%arrayidx = getelementptr inbounds i8** %argv, i64 1
%0 = load i8** %arrayidx, align 8, !tbaa !0
%call.i = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10) #0
%conv.i = trunc i64 %call.i to i32
%args = bitcast %struct.arg* %in.addr to i8*
%graphID = call i8* @llvm.visc.launch(i8* bitcast (%rtype ()* @Root to i8*), i8* %args)
%call1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %conv.i) #0
call void @llvm.visc.wait(i8* %graphID)
call void @llvm.visc.cleanup()
ret i32 0
}
define %rtype @foo() {
%sum = add i32 4, 10
%output = insertvalue %rtype undef, i32 %sum, 0
ret %rtype %output
}
define %rtype @Root() {
%node = call i8* @llvm.visc.createNode(i8* bitcast (%rtype ()* @foo to i8*))
call void @llvm.visc.bind.output(i8* %node, i32 0, i32 0)
ret %rtype zeroinitializer
}
; Function Attrs: nounwind
declare i32 @printf(i8* nocapture, ...) #2
; Function Attrs: nounwind
declare i64 @strtol(i8*, i8** nocapture, i32) #2
attributes #0 = { nounwind }
attributes #1 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #2 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
!0 = metadata !{metadata !"any pointer", metadata !1}
!1 = metadata !{metadata !"omnipotent char", metadata !2}
!2 = metadata !{metadata !"Simple C/C++ TBAA"}
; RUN: opt -load LLVMBuildDFG.so -load LLVMDFG2LLVM_X86.so -load LLVMClearDFG.so -dfg2llvm-x86 -clearDFG -o %t.ll -S < %s
; RUN: llvm-link %t.ll ~/current-src/projects/visc-rt/visc-rt.ll -S -o %t.linked.ll
; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -lrt -o %t.bin
; RUN: %t.bin 5
; ModuleID = '/home/psrivas2/current-test/unitTests/twoNodeConnect.ll'
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%rptype = type <{i32*, i64}>
%struct.arg = type <{ i32*, i64, %rptype }>
@in.str = private unnamed_addr constant [17 x i8] c"Input Value: %d\0A\00", align 1
@out.str = private unnamed_addr constant [18 x i8] c"Output Value: %d\0A\00", align 1
@hex.str = private unnamed_addr constant [19 x i8] c"Pointer Value: %d\0A\00", align 1
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nounwind
declare void @llvm.visc.init() #1
; Function Attrs: nounwind
declare void @llvm.visc.cleanup() #1
; Function Attrs: nounwind
declare i8* @llvm.visc.createNode(i8*) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.createEdge(i8*, i8*, i1, i32, i32, i1) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.launch(i8*, i8*, i1) #0
; Function Attrs: nounwind
declare void @llvm.visc.push(i8*, i8*) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.pop(i8*) #0
; Function Attrs: nounwind
declare void @llvm.visc.wait(i8*) #0
; Function Attrs: nounwind
declare void @llvm.visc.bind.input(i8*, i32, i32, i1)
; Function Attrs: nounwind
declare void @llvm.visc.bind.output(i8*, i32, i32, i1)
; Function Attrs: nounwind uwtable
define i32 @main(i32 %argc, i8** nocapture %argv) #1 {
entry:
call void @llvm.visc.init()
%in.addr = alloca %struct.arg
%num = alloca i32
%arrayidx = getelementptr inbounds i8** %argv, i64 1
%0 = load i8** %arrayidx, align 8, !tbaa !0
%call.i = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10) #0
%conv.i = trunc i64 %call.i to i32
%call1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([17 x i8]* @in.str, i64 0, i64 0), i32 %conv.i) #0
%1 = bitcast %struct.arg* %in.addr to i32**
store i32 %conv.i, i32* %num
store i32* %num, i32** %1
%args = bitcast %struct.arg* %in.addr to i8*
; Launch the pipeline
%graphID = call i8* @llvm.visc.launch(i8* bitcast (%rptype (i32*, i64)* @Root to i8*), i8* %args, i1 1)
; Push arguments into the pipeline
call void @llvm.visc.push(i8* %graphID, i8* %args)
call void @llvm.visc.push(i8* %graphID, i8* %args)
call void @llvm.visc.push(i8* %graphID, i8* %args)
call void @llvm.visc.push(i8* %graphID, i8* %args)
; Pop out arguments and read the output
%graph_output = call i8* @llvm.visc.pop(i8* %graphID)
%graph_output1 = call i8* @llvm.visc.pop(i8* %graphID)
%graph_output2 = call i8* @llvm.visc.pop(i8* %graphID)
%graph_output3 = call i8* @llvm.visc.pop(i8* %graphID)
%output.addr = bitcast i8* %graph_output to %rptype*
%outputstruct = load %rptype* %output.addr
%output = extractvalue %rptype %outputstruct, 0
%output_val = load i32* %output
%call2 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @out.str, i64 0, i64 0), i32 %output_val) #0
call void @llvm.visc.wait(i8* %graphID)
call void @llvm.visc.cleanup()
ret i32 0
}
define %rptype @producer(i32* %id, i64 %size) {
%val = load i32* %id
;%call1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([17 x i8]* @in.str, i64 0, i64 0), i32 %val) #0
%sum = add i32 2, %val
store i32 %sum, i32* %id
%temp = insertvalue %rptype undef, i32* %id, 0
%output = insertvalue %rptype %temp, i64 %size, 1
ret %rptype %output
}
define %rptype @Root(i32* %id, i64 %size) {
%p_node = call i8* @llvm.visc.createNode(i8* bitcast (%rptype (i32*, i64)* @producer to i8*))
call void @llvm.visc.bind.input(i8* %p_node, i32 0, i32 0, i1 1)
call void @llvm.visc.bind.input(i8* %p_node, i32 1, i32 1, i1 1)
call void @llvm.visc.bind.output(i8* %p_node, i32 0, i32 0, i1 1)
call void @llvm.visc.bind.output(i8* %p_node, i32 1, i32 1, i1 1)
ret %rptype zeroinitializer
}
; Function Attrs: nounwind
declare i32 @printf(i8* nocapture, ...) #2
; Function Attrs: nounwind
declare i64 @strtol(i8*, i8** nocapture, i32) #2
attributes #0 = { nounwind }
attributes #1 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #2 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
!0 = metadata !{metadata !"any pointer", metadata !1}
!1 = metadata !{metadata !"omnipotent char", metadata !2}
!2 = metadata !{metadata !"Simple C/C++ TBAA"}
; RUN: opt -load LLVMBuildDFG.so -load LLVMDFG2LLVM_X86.so -load LLVMClearDFG.so -dfg2llvm-x86 -clearDFG -o %t.ll -S < %s
; RUN: llvm-link %t.ll ~/current-src/projects/visc-rt/visc-rt.ll -S -o %t.linked.ll
; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -lrt -o %t.bin
; RUN: %t.bin 5
; ModuleID = '/home/psrivas2/current-test/unitTests/singleNode.ll'
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%rtype = type <{i32}>
%struct.arg = type <{ %rtype }>
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nounwind
declare void @llvm.visc.init() #1
; Function Attrs: nounwind
declare void @llvm.visc.cleanup() #1
; Function Attrs: nounwind
declare i8* @llvm.visc.createNode(i8*) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.createEdge(i8*, i8*, i1, i32, i32) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.launch(i8*, i8*) #0
; Function Attrs: nounwind
declare void @llvm.visc.wait(i8*) #0
; Function Attrs: nounwind
declare void @llvm.visc.bind.input(i8*, i32, i32)
; Function Attrs: nounwind
declare void @llvm.visc.bind.output(i8*, i32, i32)
; Function Attrs: nounwind uwtable
define i32 @main(i32 %argc, i8** nocapture %argv) #1 {
entry:
call void @llvm.visc.init()
%in.addr_1 = alloca %struct.arg
%in.addr_2= alloca %struct.arg
%arrayidx = getelementptr inbounds i8** %argv, i64 1
%0 = load i8** %arrayidx, align 8, !tbaa !0
%call.i = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10) #0
%conv.i = trunc i64 %call.i to i32
%args_1 = bitcast %struct.arg* %in.addr_1 to i8*
%args_2 = bitcast %struct.arg* %in.addr_2 to i8*
%graphID_1 = call i8* @llvm.visc.launch(i8* bitcast (%rtype ()* @Root_1 to i8*), i8* %args_1)
%graphID_2 = call i8* @llvm.visc.launch(i8* bitcast (%rtype ()* @Root_2 to i8*), i8* %args_2)
%call1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %conv.i) #0
call void @llvm.visc.wait(i8* %graphID_1)
call void @llvm.visc.wait(i8* %graphID_2)
call void @llvm.visc.cleanup()
ret i32 0
}
define %rtype @foo_1() {
%sum = add i32 4, 10
%output = insertvalue %rtype undef, i32 %sum, 0
ret %rtype %output
}
define %rtype @foo_2() {
%sum = add i32 4, 10
%output = insertvalue %rtype undef, i32 %sum, 0
ret %rtype %output
}
define %rtype @Root_1() {
%node = call i8* @llvm.visc.createNode(i8* bitcast (%rtype ()* @foo_1 to i8*))
call void @llvm.visc.bind.output(i8* %node, i32 0, i32 0)
ret %rtype zeroinitializer
}
define %rtype @Root_2() {
%node = call i8* @llvm.visc.createNode(i8* bitcast (%rtype ()* @foo_2 to i8*))
call void @llvm.visc.bind.output(i8* %node, i32 0, i32 0)
ret %rtype zeroinitializer
}
; Function Attrs: nounwind
declare i32 @printf(i8* nocapture, ...) #2
; Function Attrs: nounwind
declare i64 @strtol(i8*, i8** nocapture, i32) #2
attributes #0 = { nounwind }
attributes #1 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #2 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
!0 = metadata !{metadata !"any pointer", metadata !1}
!1 = metadata !{metadata !"omnipotent char", metadata !2}
!2 = metadata !{metadata !"Simple C/C++ TBAA"}
; RUN: opt -load LLVMBuildDFG.so -load LLVMDFG2LLVM_X86.so -load LLVMClearDFG.so -dfg2llvm-x86 -clearDFG -o %t.ll -S < %s
; RUN: llvm-link %t.ll ~/current-src/projects/visc-rt/visc-rt.ll -S -o %t.linked.ll
; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -lrt -o %t.bin
; RUN: %t.bin 5
; ModuleID = '/home/psrivas2/current-test/unitTests/twoNode.ll'
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%rtype = type <{i32}>
%struct.arg = type <{ %rtype }>
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nounwind
declare void @llvm.visc.init() #1
; Function Attrs: nounwind
declare void @llvm.visc.cleanup() #1
; Function Attrs: nounwind
declare i8* @llvm.visc.createNode(i8*) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.createEdge(i8*, i8*, i1, i32, i32) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.launch(i8*, i8*) #0
; Function Attrs: nounwind
declare void @llvm.visc.wait(i8*) #0
; Function Attrs: nounwind
declare void @llvm.visc.bind.input(i8*, i32, i32)
; Function Attrs: nounwind
declare void @llvm.visc.bind.output(i8*, i32, i32)
; Function Attrs: nounwind uwtable
define i32 @main(i32 %argc, i8** nocapture %argv) #1 {
entry:
call void @llvm.visc.init()
%in.addr = alloca %struct.arg
%arrayidx = getelementptr inbounds i8** %argv, i64 1
%0 = load i8** %arrayidx, align 8, !tbaa !0
%call.i = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10) #0
%conv.i = trunc i64 %call.i to i32
%1 = bitcast %struct.arg* %in.addr to i32*
store i32 %conv.i, i32* %1
%args = bitcast %struct.arg* %in.addr to i8*
%graphID = call i8* @llvm.visc.launch(i8* bitcast (%rtype (i32)* @Root to i8*), i8* %args)
%call1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %conv.i) #0
call void @llvm.visc.wait(i8* %graphID)
call void @llvm.visc.cleanup()
ret i32 0
}
define %rtype @producer() {
%sum = add i32 4, 10
%output = insertvalue %rtype undef, i32 %sum, 0
ret %rtype %output
}
define %rtype @consumer(i32 %id) {
%sum = add i32 10, %id
%output = insertvalue %rtype undef, i32 %sum, 0
ret %rtype %output
}
define %rtype @Root(i32 %id) {
%p_node = call i8* @llvm.visc.createNode(i8* bitcast (%rtype ()* @producer to i8*))
%c_node = call i8* @llvm.visc.createNode(i8* bitcast (%rtype (i32)* @consumer to i8*))
%edge = call i8* @llvm.visc.createEdge(i8* %p_node, i8* %c_node, i1 false, i32 0, i32 0)
call void @llvm.visc.bind.output(i8* %c_node, i32 0, i32 0)
ret %rtype zeroinitializer
}
; Function Attrs: nounwind
declare i32 @printf(i8* nocapture, ...) #2
; Function Attrs: nounwind
declare i64 @strtol(i8*, i8** nocapture, i32) #2
attributes #0 = { nounwind }
attributes #1 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #2 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
!0 = metadata !{metadata !"any pointer", metadata !1}
!1 = metadata !{metadata !"omnipotent char", metadata !2}
!2 = metadata !{metadata !"Simple C/C++ TBAA"}
; RUN: opt -load LLVMBuildDFG.so -load LLVMDFG2LLVM_X86.so -load LLVMClearDFG.so -dfg2llvm-x86 -clearDFG -o %t.ll -S < %s
; RUN: llvm-link %t.ll ~/current-src/projects/visc-rt/visc-rt.ll -S -o %t.linked.ll
; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -lrt -o %t.bin
; RUN: %t.bin 5
; ModuleID = '/home/psrivas2/current-test/unitTests/twoNodeConnect.ll'
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%rtype = type <{i32}>
%struct.arg = type <{ i32, %rtype }>
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nounwind
declare void @llvm.visc.init() #1
; Function Attrs: nounwind
declare void @llvm.visc.cleanup() #1
; Function Attrs: nounwind
declare i8* @llvm.visc.createNode(i8*) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.createEdge(i8*, i8*, i1, i32, i32) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.launch(i8*, i8*) #0
; Function Attrs: nounwind
declare void @llvm.visc.wait(i8*) #0
; Function Attrs: nounwind
declare void @llvm.visc.bind.input(i8*, i32, i32)
; Function Attrs: nounwind
declare void @llvm.visc.bind.output(i8*, i32, i32)
; Function Attrs: nounwind uwtable
define i32 @main(i32 %argc, i8** nocapture %argv) #1 {
entry:
call void @llvm.visc.init()
%in.addr = alloca %struct.arg
%arrayidx = getelementptr inbounds i8** %argv, i64 1
%0 = load i8** %arrayidx, align 8, !tbaa !0
%call.i = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10) #0
%conv.i = trunc i64 %call.i to i32
%1 = bitcast %struct.arg* %in.addr to i32*
store i32 %conv.i, i32* %1
%args = bitcast %struct.arg* %in.addr to i8*
%graphID = call i8* @llvm.visc.launch(i8* bitcast (%rtype (i32)* @Root to i8*), i8* %args)
%call1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %conv.i) #0
call void @llvm.visc.wait(i8* %graphID)
%2 = getelementptr %struct.arg* %in.addr, i32 0, i32 1
%outputstruct = load %rtype* %2
%output = extractvalue %rtype %outputstruct, 0
%call2 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %output) #0
call void @llvm.visc.cleanup()
ret i32 0
}
define %rtype @producer(i32 %id) {
%sum = add i32 4, %id
%output = insertvalue %rtype undef, i32 %sum, 0
ret %rtype %output
}
define %rtype @consumer(i32 %id) {
%sum = add i32 10, %id
%output = insertvalue %rtype undef, i32 %sum, 0
ret %rtype %output
}
define %rtype @Root(i32 %id) {
%p_node = call i8* @llvm.visc.createNode(i8* bitcast (%rtype (i32)* @producer to i8*))
%c_node = call i8* @llvm.visc.createNode(i8* bitcast (%rtype (i32)* @consumer to i8*))
%edge = call i8* @llvm.visc.createEdge(i8* %p_node, i8* %c_node, i1 false, i32 0, i32 0)
call void @llvm.visc.bind.input(i8* %p_node, i32 0, i32 0)
call void @llvm.visc.bind.output(i8* %c_node, i32 0, i32 0)
ret %rtype zeroinitializer
}
; Function Attrs: nounwind
declare i32 @printf(i8* nocapture, ...) #2
; Function Attrs: nounwind
declare i64 @strtol(i8*, i8** nocapture, i32) #2
attributes #0 = { nounwind }
attributes #1 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #2 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
!0 = metadata !{metadata !"any pointer", metadata !1}
!1 = metadata !{metadata !"omnipotent char", metadata !2}
!2 = metadata !{metadata !"Simple C/C++ TBAA"}
; RUN: opt -load LLVMBuildDFG.so -load LLVMDFG2LLVM_X86.so -load LLVMClearDFG.so -dfg2llvm-x86 -clearDFG -o %t.ll -S < %s
; RUN: llvm-link %t.ll ~/current-src/projects/visc-rt/visc-rt.ll -S -o %t.linked.ll
; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -lrt -o %t.bin
; RUN: %t.bin 5
; ModuleID = '/home/psrivas2/current-test/unitTests/twoNodeQuery.ll'
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%rtype = type <{i32}>
%struct.arg = type <{ i32, %rtype }>
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nounwind
declare void @llvm.visc.init() #1
; Function Attrs: nounwind
declare void @llvm.visc.cleanup() #1
; Function Attrs: nounwind
declare i8* @llvm.visc.createNode(i8*) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.createEdge(i8*, i8*, i1, i32, i32) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.launch(i8*, i8*) #0
; Function Attrs: nounwind
declare void @llvm.visc.wait(i8*) #0
; Function Attrs: nounwind
declare void @llvm.visc.bind.input(i8*, i32, i32)
; Function Attrs: nounwind
declare void @llvm.visc.bind.output(i8*, i32, i32)
; Function Attrs: nounwind
declare i8* @llvm.visc.getNode() #0
; Function Attrs: nounwind
declare i8* @llvm.visc.getParentNode(i8*) #0
; Function Attrs: nounwind
declare i32 @llvm.visc.getNumDims(i8*) #0
; Function Attrs: nounwind uwtable
define i32 @main(i32 %argc, i8** nocapture %argv) #1 {
entry:
call void @llvm.visc.init()
%in.addr = alloca %struct.arg
%arrayidx = getelementptr inbounds i8** %argv, i64 1
%0 = load i8** %arrayidx, align 8, !tbaa !0
%call.i = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10) #0
%conv.i = trunc i64 %call.i to i32
%1 = bitcast %struct.arg* %in.addr to i32*
store i32 %conv.i, i32* %1
%args = bitcast %struct.arg* %in.addr to i8*
%graphID = call i8* @llvm.visc.launch(i8* bitcast (%rtype (i32)* @Root to i8*), i8* %args)
%call1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %conv.i) #0
call void @llvm.visc.wait(i8* %graphID)
%2 = getelementptr %struct.arg* %in.addr, i32 0, i32 1
%outputstruct = load %rtype* %2
%output = extractvalue %rtype %outputstruct, 0
%call2 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %output) #0
call void @llvm.visc.cleanup()
ret i32 0
}
define %rtype @producer(i32 %id) {
%sum = add i32 4, %id
%this_node = call i8* @llvm.visc.getNode()
%numDim = call i32 @llvm.visc.getNumDims(i8* %this_node)
%sum2 = add i32 %sum, %numDim
%output = insertvalue %rtype undef, i32 %sum, 0
ret %rtype %output
}
define %rtype @consumer(i32 %id) {
%sum = add i32 10, %id
%output = insertvalue %rtype undef, i32 %sum, 0
ret %rtype %output
}
define %rtype @Root(i32 %id) {
%p_node = call i8* @llvm.visc.createNode(i8* bitcast (%rtype (i32)* @producer to i8*))
%c_node = call i8* @llvm.visc.createNode(i8* bitcast (%rtype (i32)* @consumer to i8*))
%edge = call i8* @llvm.visc.createEdge(i8* %p_node, i8* %c_node, i1 false, i32 0, i32 0)
call void @llvm.visc.bind.input(i8* %p_node, i32 0, i32 0)
call void @llvm.visc.bind.output(i8* %c_node, i32 0, i32 0)
ret %rtype zeroinitializer
}
; Function Attrs: nounwind
declare i32 @printf(i8* nocapture, ...) #2
; Function Attrs: nounwind
declare i64 @strtol(i8*, i8** nocapture, i32) #2
attributes #0 = { nounwind }
attributes #1 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #2 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
!0 = metadata !{metadata !"any pointer", metadata !1}
!1 = metadata !{metadata !"omnipotent char", metadata !2}
!2 = metadata !{metadata !"Simple C/C++ TBAA"}
; RUN: opt -load LLVMBuildDFG.so -load LLVMDFG2LLVM_X86.so -load LLVMClearDFG.so -dfg2llvm-x86 -clearDFG -o %t.ll -S < %s
; RUN: llvm-link %t.ll ~/current-src/projects/visc-rt/visc-rt.ll -S -o %t.linked.ll
; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -lrt -o %t.bin
; RUN: %t.bin 5
; ModuleID = '/home/psrivas2/current-test/unitTests/twoNodeConnect.ll'
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%rptype = type <{i32*, i64}>
%rctype = type <{i32*, i64}>
%struct.arg = type <{ i32*, i64, %rctype }>
@in.str = private unnamed_addr constant [17 x i8] c"Input Value: %d\0A\00", align 1
@out.str = private unnamed_addr constant [18 x i8] c"Output Value: %d\0A\00", align 1
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nounwind
declare void @llvm.visc.init() #1
; Function Attrs: nounwind
declare void @llvm.visc.cleanup() #1
; Function Attrs: nounwind
declare i8* @llvm.visc.createNode(i8*) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.createEdge(i8*, i8*, i1, i32, i32, i1) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.launch(i8*, i8*, i1) #0
; Function Attrs: nounwind
declare void @llvm.visc.push(i8*, i8*) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.pop(i8*) #0
; Function Attrs: nounwind
declare void @llvm.visc.wait(i8*) #0
; Function Attrs: nounwind
declare void @llvm.visc.bind.input(i8*, i32, i32, i1)
; Function Attrs: nounwind
declare void @llvm.visc.bind.output(i8*, i32, i32, i1)
; Function Attrs: nounwind uwtable
define i32 @main(i32 %argc, i8** nocapture %argv) #1 {
entry:
call void @llvm.visc.init()
%in.addr = alloca %struct.arg
%num = alloca i32
%arrayidx = getelementptr inbounds i8** %argv, i64 1
%0 = load i8** %arrayidx, align 8, !tbaa !0
%call.i = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10) #0
%conv.i = trunc i64 %call.i to i32
%call1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([17 x i8]* @in.str, i64 0, i64 0), i32 %conv.i) #0
%1 = bitcast %struct.arg* %in.addr to i32**
store i32 %conv.i, i32* %num
store i32* %num, i32** %1
%args = bitcast %struct.arg* %in.addr to i8*
; Launch the pipeline
%graphID = call i8* @llvm.visc.launch(i8* bitcast (%rctype (i32*, i64)* @Root to i8*), i8* %args, i1 1)
; Push arguments into the pipeline
call void @llvm.visc.push(i8* %graphID, i8* %args)
; Pop out arguments and read the output
%graph_output = call i8* @llvm.visc.pop(i8* %graphID)
%output.addr = bitcast i8* %graph_output to %rctype*
%outputstruct = load %rctype* %output.addr
%output = extractvalue %rctype %outputstruct, 0
%output_val = load i32* %output
%call2 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @out.str, i64 0, i64 0), i32 %output_val) #0
call void @llvm.visc.wait(i8* %graphID)
call void @llvm.visc.cleanup()
ret i32 0
}
define %rptype @producer(i32* %id, i64 %size) {
%val = load i32* %id
%sum = add i32 2, %val
store i32 %sum, i32* %id
%temp = insertvalue %rptype undef, i32* %id, 0
%output = insertvalue %rptype %temp, i64 %size, 1
ret %rptype %output
}
define %rctype @consumer(i32* %id, i64 %size) {
%val = load i32* %id
%sum = add i32 3, %val
store i32 %sum, i32* %id
%temp = insertvalue %rctype undef, i32* %id, 0
%output = insertvalue %rctype %temp, i64 %size, 1
ret %rctype %output
}
define %rctype @Root(i32* %id, i64 %size) {
%p_node = call i8* @llvm.visc.createNode(i8* bitcast (%rptype (i32*, i64)* @producer to i8*))
%c_node = call i8* @llvm.visc.createNode(i8* bitcast (%rctype (i32*, i64)* @consumer to i8*))
%edge = call i8* @llvm.visc.createEdge(i8* %p_node, i8* %c_node, i1 false, i32 0, i32 0, i1 1)
%edge2 = call i8* @llvm.visc.createEdge(i8* %p_node, i8* %c_node, i1 false, i32 1, i32 1, i1 1)
call void @llvm.visc.bind.input(i8* %p_node, i32 0, i32 0, i1 1)
call void @llvm.visc.bind.input(i8* %p_node, i32 1, i32 1, i1 0)
call void @llvm.visc.bind.output(i8* %c_node, i32 0, i32 0, i1 1)
call void @llvm.visc.bind.output(i8* %c_node, i32 1, i32 1, i1 1)
ret %rctype zeroinitializer
}
; Function Attrs: nounwind
declare i32 @printf(i8* nocapture, ...) #2
; Function Attrs: nounwind
declare i64 @strtol(i8*, i8** nocapture, i32) #2
attributes #0 = { nounwind }
attributes #1 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #2 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
!0 = metadata !{metadata !"any pointer", metadata !1}
!1 = metadata !{metadata !"omnipotent char", metadata !2}
!2 = metadata !{metadata !"Simple C/C++ TBAA"}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment