Skip to content
Snippets Groups Projects
Commit 432f7656 authored by Prakalp Srivastava's avatar Prakalp Srivastava
Browse files

Fixed unit testcases

parent d3fcec36
No related branches found
No related tags found
No related merge requests found
; 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 -o %t.bin
; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -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 = 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
......@@ -34,18 +36,18 @@ 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 { i32, %rtype }
%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 { i32, %rtype }* %in.addr to i32*
%1 = bitcast %struct.arg* %in.addr to i32*
store i32 %conv.i, i32* %1
%args = bitcast { i32, %rtype }* %in.addr to i8*
%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 { i32, %rtype }* %in.addr, i32 0, i32 1
%2 = getelementptr %struct.arg* %in.addr, i32 0, i32 1
%outputstruct = load %rtype* %2
%output1 = extractvalue %rtype %outputstruct, 0
%output2 = extractvalue %rtype %outputstruct, 1
......@@ -54,35 +56,35 @@ entry:
ret i32 0
}
define { i32 } @producer(i32 %id) {
define %rtype_internal @producer(i32 %id) {
%sum = add i32 4, %id
%output = insertvalue { i32 } undef, i32 %sum, 0
ret { i32 } %output
%output = insertvalue %rtype_internal undef, i32 %sum, 0
ret %rtype_internal %output
}
define { i32 } @consumer(i32 %id) {
define %rtype_internal @consumer(i32 %id) {
%sum = add i32 10, %id
%output = insertvalue { i32 } undef, i32 %sum, 0
ret { i32 } %output
%output = insertvalue %rtype_internal undef, i32 %sum, 0
ret %rtype_internal %output
}
define { i32 } @foo(i32 %id) {
define %rtype_internal @foo(i32 %id) {
%sum = add i32 15, %id
%output = insertvalue { i32 } undef, i32 %sum, 0
ret { i32 } %output
%output = insertvalue %rtype_internal undef, i32 %sum, 0
ret %rtype_internal %output
}
define { i32 } @subNode(i32 %id) {
%foo_node = call i8* @llvm.visc.createNode(i8* bitcast ({ i32 } (i32)* @foo to i8*))
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 { i32 } zeroinitializer
ret %rtype_internal zeroinitializer
}
define %rtype @Root(i32 %id) {
%p_node = call i8* @llvm.visc.createNode(i8* bitcast ({ i32 } (i32)* @producer to i8*))
%c_node = call i8* @llvm.visc.createNode(i8* bitcast ({ i32 } (i32)* @consumer to i8*))
%sub_node = call i8* @llvm.visc.createNode(i8* bitcast ({ i32 } (i32)* @subNode to i8*))
%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)
......
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*
; 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 -o %t.bin
; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -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 }
%rtype = type <{i32}>
%struct.arg = type <{ i32, %rtype }>
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
......@@ -23,70 +24,68 @@ declare i8* @llvm.visc.createNode2D(i8*, i32, i32) #0
declare i8* @llvm.visc.createEdge(i8*, i8*, i1, i32, i32) #0
; Function Attrs: nounwind
declare i32 @llvm.visc.launch(i8**, i8*, i8*) #0
declare i8* @llvm.visc.launch(i8*, i8*) #0
; Function Attrs: nounwind
declare i32 @llvm.visc.wait(i8*) #0
declare void @llvm.visc.wait(i8*) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.getNode() #0
declare void @llvm.visc.bind.input(i8*, i32, i32)
; Function Attrs: nounwind
declare i8* @llvm.visc.getParentNode(i8*) #0
declare void @llvm.visc.bind.output(i8*, i32, i32)
; Function Attrs: nounwind
declare i32 @llvm.visc.getNumDims(i8*) #0
declare i8* @llvm.visc.getNode() #0
; Function Attrs: nounwind
declare i32 @llvm.visc.getNumNodeInstances.x(i8*) #0
declare i8* @llvm.visc.getParentNode(i8*) #0
; Function Attrs: nounwind
declare void @llvm.visc.bind.input(i8*, i32, i32)
declare i32 @llvm.visc.getNumDims(i8*) #0
; Function Attrs: nounwind
declare void @llvm.visc.bind.output(i8*, i32, i32)
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 { i32, %rtype }
%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 { i32, %rtype }* %in.addr to i32*
%1 = bitcast %struct.arg* %in.addr to i32*
store i32 %conv.i, i32* %1
%args = bitcast { i32, %rtype }* %in.addr to i8*
%graphIDloc = alloca i8*
%launch = call i32 @llvm.visc.launch(i8** %graphIDloc, i8* bitcast (%rtype (i32)* @Root to i8*), i8* %args)
%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
%graphID = load i8** %graphIDloc
%wait = call i32 @llvm.visc.wait(i8* %graphID)
%2 = getelementptr { i32, %rtype }* %in.addr, i32 0, i32 1
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
ret i32 0
}
define { i32 } @producer(i32 %id) {
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 { i32 } undef, i32 %sum2, 0
ret { i32 } %output
%output = insertvalue %rtype undef, i32 %sum2, 0
ret %rtype %output
}
define { i32 } @consumer(i32 %id) {
define %rtype @consumer(i32 %id) {
%sum = add i32 10, %id
%output = insertvalue { i32 } undef, i32 %sum, 0
ret { i32 } %output
%output = insertvalue %rtype undef, i32 %sum, 0
ret %rtype %output
}
define %rtype @Root(i32 %dimension) {
%p_node = call i8* @llvm.visc.createNode2D(i8* bitcast ({ i32 } (i32)* @producer to i8*), i32 %dimension, i32 %dimension)
%c_node = call i8* @llvm.visc.createNode(i8* bitcast ({ i32 } (i32)* @consumer to i8*))
%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)
......
; 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 -o %t.bin
; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -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 }
%rtype = type <{i32}>
%struct.arg = type <{ i32, %rtype }>
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
......@@ -26,10 +27,16 @@ declare i8* @llvm.visc.createNode3D(i8*, i32, i32, i32) #0
declare i8* @llvm.visc.createEdge(i8*, i8*, i1, i32, i32) #0
; Function Attrs: nounwind
declare i32 @llvm.visc.launch(i8**, i8*, i8*) #0
declare i8* @llvm.visc.launch(i8*, i8*) #0
; Function Attrs: nounwind
declare i32 @llvm.visc.wait(i8*) #0
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
......@@ -44,52 +51,47 @@ declare i32 @llvm.visc.getNumDims(i8*) #0
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)
declare i32 @llvm.visc.getNumNodeInstances.y(i8*) #0
; Function Attrs: nounwind uwtable
define i32 @main(i32 %argc, i8** nocapture %argv) #1 {
entry:
%in.addr = alloca { i32, %rtype }
%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 { i32, %rtype }* %in.addr to i32*
%1 = bitcast %struct.arg* %in.addr to i32*
store i32 %conv.i, i32* %1
%args = bitcast { i32, %rtype }* %in.addr to i8*
%graphIDloc = alloca i8*
%launch = call i32 @llvm.visc.launch(i8** %graphIDloc, i8* bitcast (%rtype (i32)* @Root to i8*), i8* %args)
%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
%graphID = load i8** %graphIDloc
%wait = call i32 @llvm.visc.wait(i8* %graphID)
%2 = getelementptr { i32, %rtype }* %in.addr, i32 0, i32 1
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
ret i32 0
}
define { i32 } @producer(i32 %id) {
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)
%dim = call i32 @llvm.visc.getNumNodeInstances.y(i8* %this_node)
%sum2 = add i32 %sum, %dim
%output = insertvalue { i32 } undef, i32 %sum2, 0
ret { i32 } %output
%output = insertvalue %rtype undef, i32 %sum2, 0
ret %rtype %output
}
define { i32 } @consumer(i32 %id) {
define %rtype @consumer(i32 %id) {
%sum = add i32 10, %id
%output = insertvalue { i32 } undef, i32 %sum, 0
ret { i32 } %output
%output = insertvalue %rtype undef, i32 %sum, 0
ret %rtype %output
}
define %rtype @Root(i32 %dimension) {
%p_node = call i8* @llvm.visc.createNode3D(i8* bitcast ({ i32 } (i32)* @producer to i8*), i32 %dimension, i32 10, i32 30)
%c_node = call i8* @llvm.visc.createNode(i8* bitcast ({ i32 } (i32)* @consumer to i8*))
%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)
......
; 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 -o %t.bin
; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -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 }
%rtype = type <{i32}>
%struct.arg = type <{ i32, %rtype }>
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
......@@ -17,67 +18,63 @@ declare i8* @llvm.visc.createNode(i8*) #0
declare i8* @llvm.visc.createEdge(i8*, i8*, i1, i32, i32) #0
; Function Attrs: nounwind
declare i32 @llvm.visc.launch(i8**, i8*, i8*) #0
declare i8* @llvm.visc.launch(i8*, i8*) #0
; Function Attrs: nounwind
declare i32 @llvm.visc.wait(i8*) #0
declare void @llvm.visc.wait(i8*) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.getNode() #0
declare void @llvm.visc.bind.input(i8*, i32, i32)
; Function Attrs: nounwind
declare i8* @llvm.visc.getParentNode(i8*) #0
declare void @llvm.visc.bind.output(i8*, i32, i32)
; Function Attrs: nounwind
declare i32 @llvm.visc.getNumDims(i8*) #0
declare i8* @llvm.visc.getNode() #0
; Function Attrs: nounwind
declare void @llvm.visc.bind.input(i8*, i32, i32)
declare i32 @llvm.visc.getNumDims(i8*) #0
; 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 { i32, %rtype }
%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 { i32, %rtype }* %in.addr to i32*
%1 = bitcast %struct.arg* %in.addr to i32*
store i32 %conv.i, i32* %1
%args = bitcast { i32, %rtype }* %in.addr to i8*
%graphIDloc = alloca i8*
%launch = call i32 @llvm.visc.launch(i8** %graphIDloc, i8* bitcast (%rtype (i32)* @Root to i8*), i8* %args)
%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
%graphID = load i8** %graphIDloc
%wait = call i32 @llvm.visc.wait(i8* %graphID)
%2 = getelementptr { i32, %rtype }* %in.addr, i32 0, i32 1
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
ret i32 0
}
define { i32 } @producer(i32 %id) {
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 { i32 } undef, i32 %sum, 0
ret { i32 } %output
%output = insertvalue %rtype undef, i32 %sum, 0
ret %rtype %output
}
define { i32 } @consumer(i32 %id) {
define %rtype @consumer(i32 %id) {
%sum = add i32 10, %id
%output = insertvalue { i32 } undef, i32 %sum, 0
ret { i32 } %output
%output = insertvalue %rtype undef, i32 %sum, 0
ret %rtype %output
}
define %rtype @Root(i32 %id) {
%p_node = call i8* @llvm.visc.createNode(i8* bitcast ({ i32 } (i32)* @producer to i8*))
%c_node = call i8* @llvm.visc.createNode(i8* bitcast ({ i32 } (i32)* @consumer to i8*))
%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)
......
; 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 -o %t.bin
; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -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 }
%rtype = type <{i32}>
%struct.arg = type <{ i32, %rtype }>
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
......@@ -17,10 +18,10 @@ declare i8* @llvm.visc.createNode(i8*) #0
declare i8* @llvm.visc.createEdge(i8*, i8*, i1, i32, i32) #0
; Function Attrs: nounwind
declare i32 @llvm.visc.launch(i8**, i8*, i8*) #0
declare i8* @llvm.visc.launch(i8*, i8*) #0
; Function Attrs: nounwind
declare i32 @llvm.visc.wait(i8*) #0
declare void @llvm.visc.wait(i8*) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.getNode() #0
......@@ -40,44 +41,42 @@ 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 { i32, %rtype }
%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 { i32, %rtype }* %in.addr to i32*
%1 = bitcast %struct.arg* %in.addr to i32*
store i32 %conv.i, i32* %1
%args = bitcast { i32, %rtype }* %in.addr to i8*
%graphIDloc = alloca i8*
%launch = call i32 @llvm.visc.launch(i8** %graphIDloc, i8* bitcast (%rtype (i32)* @Root to i8*), i8* %args)
%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
%graphID = load i8** %graphIDloc
%wait = call i32 @llvm.visc.wait(i8* %graphID)
%2 = getelementptr { i32, %rtype }* %in.addr, i32 0, i32 1
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
ret i32 0
}
define { i32 } @producer(i32 %id) {
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 { i32 } undef, i32 %sum, 0
ret { i32 } %output
%output = insertvalue %rtype undef, i32 %sum, 0
ret %rtype %output
}
define { i32 } @consumer(i32 %id) {
define %rtype @consumer(i32 %id) {
%sum = add i32 10, %id
%output = insertvalue { i32 } undef, i32 %sum, 0
ret { i32 } %output
%output = insertvalue %rtype undef, i32 %sum, 0
ret %rtype %output
}
define %rtype @Root(i32 %id) {
%p_node = call i8* @llvm.visc.createNode(i8* bitcast ({ i32 } (i32)* @producer to i8*))
%c_node = call i8* @llvm.visc.createNode(i8* bitcast ({ i32 } (i32)* @consumer to i8*))
%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)
......
; 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 -o %t.bin
; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -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 }
%rtype = type <{i32}>
%struct.arg = type <{ i32, %rtype }>
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
......@@ -20,10 +21,10 @@ declare i8* @llvm.visc.createNode1D(i8*, i32) #0
declare i8* @llvm.visc.createEdge(i8*, i8*, i1, i32, i32) #0
; Function Attrs: nounwind
declare i32 @llvm.visc.launch(i8**, i8*, i8*) #0
declare i8* @llvm.visc.launch(i8*, i8*) #0
; Function Attrs: nounwind
declare i32 @llvm.visc.wait(i8*) #0
declare void @llvm.visc.wait(i8*) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.getNode() #0
......@@ -46,44 +47,42 @@ 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 { i32, %rtype }
%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 { i32, %rtype }* %in.addr to i32*
%1 = bitcast %struct.arg* %in.addr to i32*
store i32 %conv.i, i32* %1
%args = bitcast { i32, %rtype }* %in.addr to i8*
%graphIDloc = alloca i8*
%launch = call i32 @llvm.visc.launch(i8** %graphIDloc, i8* bitcast (%rtype (i32)* @Root to i8*), i8* %args)
%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
%graphID = load i8** %graphIDloc
%wait = call i32 @llvm.visc.wait(i8* %graphID)
%2 = getelementptr { i32, %rtype }* %in.addr, i32 0, i32 1
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
ret i32 0
}
define { i32 } @producer(i32 %id) {
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 { i32 } undef, i32 %sum2, 0
ret { i32 } %output
%output = insertvalue %rtype undef, i32 %sum2, 0
ret %rtype %output
}
define { i32 } @consumer(i32 %id) {
define %rtype @consumer(i32 %id) {
%sum = add i32 10, %id
%output = insertvalue { i32 } undef, i32 %sum, 0
ret { i32 } %output
%output = insertvalue %rtype undef, i32 %sum, 0
ret %rtype %output
}
define %rtype @Root(i32 %dimension) {
%p_node = call i8* @llvm.visc.createNode1D(i8* bitcast ({ i32 } (i32)* @producer to i8*), i32 %dimension)
%c_node = call i8* @llvm.visc.createNode(i8* bitcast ({ i32 } (i32)* @consumer to i8*))
%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)
......
; 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 -o %t.bin
; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -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 { }
%rtype = type <{i32}>
%struct.arg = type <{ %rtype }>
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
......@@ -17,36 +18,41 @@ declare i8* @llvm.visc.createNode(i8*) #0
declare i8* @llvm.visc.createEdge(i8*, i8*, i1, i32, i32) #0
; Function Attrs: nounwind
declare i32 @llvm.visc.launch(i8**, i8*, i8*) #0
declare i8* @llvm.visc.launch(i8*, i8*) #0
; Function Attrs: nounwind
declare i32 @llvm.visc.wait(i8*) #0
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:
%in.addr = alloca { %rtype }
%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 { %rtype }* %in.addr to i8*
%graphIDloc = alloca i8*
%launch = call i32 @llvm.visc.launch(i8** %graphIDloc, i8* bitcast (%rtype ()* @Root to i8*), i8* %args)
%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
%graphID = load i8** %graphIDloc
%wait = call i32 @llvm.visc.wait(i8* %graphID)
call void @llvm.visc.wait(i8* %graphID)
ret i32 0
}
define { i32 } @foo() {
define %rtype @foo() {
%sum = add i32 4, 10
%output = insertvalue { i32 } undef, i32 %sum, 0
ret { i32 } %output
%output = insertvalue %rtype undef, i32 %sum, 0
ret %rtype %output
}
define %rtype @Root() {
%node = call i8* @llvm.visc.createNode(i8* bitcast ({ i32 } ()* @foo to i8*))
%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
}
......
; 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 -o %t.bin
; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -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 { }
%rtype = type <{i32}>
%struct.arg = type <{ %rtype }>
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
......@@ -17,46 +17,51 @@ declare i8* @llvm.visc.createNode(i8*) #0
declare i8* @llvm.visc.createEdge(i8*, i8*, i1, i32, i32) #0
; Function Attrs: nounwind
declare i32 @llvm.visc.launch(i8**, i8*, i8*) #0
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 i32 @llvm.visc.wait(i8*) #0
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 { i32, %rtype }
%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 { i32, %rtype }* %in.addr to i32*
%1 = bitcast %struct.arg* %in.addr to i32*
store i32 %conv.i, i32* %1
%args = bitcast { i32, %rtype }* %in.addr to i8*
%graphIDloc = alloca i8*
%launch = call i32 @llvm.visc.launch(i8** %graphIDloc, i8* bitcast (%rtype (i32)* @Root to i8*), i8* %args)
%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
%graphID = load i8** %graphIDloc
%wait = call i32 @llvm.visc.wait(i8* %graphID)
call void @llvm.visc.wait(i8* %graphID)
ret i32 0
}
define { i32 } @producer() {
define %rtype @producer() {
%sum = add i32 4, 10
%output = insertvalue { i32 } undef, i32 %sum, 0
ret { i32 } %output
%output = insertvalue %rtype undef, i32 %sum, 0
ret %rtype %output
}
define { i32 } @consumer(i32 %id) {
define %rtype @consumer(i32 %id) {
%sum = add i32 10, %id
%output = insertvalue { i32 } undef, i32 %sum, 0
ret { i32 } %output
%output = insertvalue %rtype undef, i32 %sum, 0
ret %rtype %output
}
define %rtype @Root(i32 %id) {
%p_node = call i8* @llvm.visc.createNode(i8* bitcast ({ i32 } ()* @producer to i8*))
%c_node = call i8* @llvm.visc.createNode(i8* bitcast ({ i32 } (i32)* @consumer to i8*))
%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
}
......
; 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 -o %t.bin
; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -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 }
%rtype = type <{i32}>
%struct.arg = type <{ i32, %rtype }>
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
......@@ -17,13 +17,10 @@ declare i8* @llvm.visc.createNode(i8*) #0
declare i8* @llvm.visc.createEdge(i8*, i8*, i1, i32, i32) #0
; Function Attrs: nounwind
declare i32 @llvm.visc.launch(i8**, i8*, i8*) #0
; Function Attrs: nounwind
declare i32 @llvm.visc.wait(i8*) #0
declare i8* @llvm.visc.launch(i8*, i8*) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.getNode() #0
declare void @llvm.visc.wait(i8*) #0
; Function Attrs: nounwind
declare void @llvm.visc.bind.input(i8*, i32, i32)
......@@ -34,41 +31,39 @@ 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 { i32, %rtype }
%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 { i32, %rtype }* %in.addr to i32*
%1 = bitcast %struct.arg* %in.addr to i32*
store i32 %conv.i, i32* %1
%args = bitcast { i32, %rtype }* %in.addr to i8*
%graphIDloc = alloca i8*
%launch = call i32 @llvm.visc.launch(i8** %graphIDloc, i8* bitcast (%rtype (i32)* @Root to i8*), i8* %args)
%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
%graphID = load i8** %graphIDloc
%wait = call i32 @llvm.visc.wait(i8* %graphID)
%2 = getelementptr { i32, %rtype }* %in.addr, i32 0, i32 1
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
ret i32 0
}
define { i32 } @producer(i32 %id) {
define %rtype @producer(i32 %id) {
%sum = add i32 4, %id
%output = insertvalue { i32 } undef, i32 %sum, 0
ret { i32 } %output
%output = insertvalue %rtype undef, i32 %sum, 0
ret %rtype %output
}
define { i32 } @consumer(i32 %id) {
define %rtype @consumer(i32 %id) {
%sum = add i32 10, %id
%output = insertvalue { i32 } undef, i32 %sum, 0
ret { i32 } %output
%output = insertvalue %rtype undef, i32 %sum, 0
ret %rtype %output
}
define %rtype @Root(i32 %id) {
%p_node = call i8* @llvm.visc.createNode(i8* bitcast ({ i32 } (i32)* @producer to i8*))
%c_node = call i8* @llvm.visc.createNode(i8* bitcast ({ i32 } (i32)* @consumer to i8*))
%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)
......
; 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 -o %t.bin
; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -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 }
%rtype = type <{i32}>
%struct.arg = type <{ i32, %rtype }>
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
......@@ -17,67 +17,65 @@ declare i8* @llvm.visc.createNode(i8*) #0
declare i8* @llvm.visc.createEdge(i8*, i8*, i1, i32, i32) #0
; Function Attrs: nounwind
declare i32 @llvm.visc.launch(i8**, i8*, i8*) #0
declare i8* @llvm.visc.launch(i8*, i8*) #0
; Function Attrs: nounwind
declare i32 @llvm.visc.wait(i8*) #0
declare void @llvm.visc.wait(i8*) #0
; Function Attrs: nounwind
declare i8* @llvm.visc.getNode() #0
declare void @llvm.visc.bind.input(i8*, i32, i32)
; Function Attrs: nounwind
declare i8* @llvm.visc.getParentNode(i8*) #0
declare void @llvm.visc.bind.output(i8*, i32, i32)
; Function Attrs: nounwind
declare i32 @llvm.visc.getNumDims(i8*) #0
declare i8* @llvm.visc.getNode() #0
; Function Attrs: nounwind
declare void @llvm.visc.bind.input(i8*, i32, i32)
declare i8* @llvm.visc.getParentNode(i8*) #0
; Function Attrs: nounwind
declare void @llvm.visc.bind.output(i8*, i32, i32)
declare i32 @llvm.visc.getNumDims(i8*) #0
; Function Attrs: nounwind uwtable
define i32 @main(i32 %argc, i8** nocapture %argv) #1 {
entry:
%in.addr = alloca { i32, %rtype }
%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 { i32, %rtype }* %in.addr to i32*
%1 = bitcast %struct.arg* %in.addr to i32*
store i32 %conv.i, i32* %1
%args = bitcast { i32, %rtype }* %in.addr to i8*
%graphIDloc = alloca i8*
%launch = call i32 @llvm.visc.launch(i8** %graphIDloc, i8* bitcast (%rtype (i32)* @Root to i8*), i8* %args)
%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
%graphID = load i8** %graphIDloc
%wait = call i32 @llvm.visc.wait(i8* %graphID)
%2 = getelementptr { i32, %rtype }* %in.addr, i32 0, i32 1
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
ret i32 0
}
define { i32 } @producer(i32 %id) {
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 { i32 } undef, i32 %sum, 0
ret { i32 } %output
%output = insertvalue %rtype undef, i32 %sum, 0
ret %rtype %output
}
define { i32 } @consumer(i32 %id) {
define %rtype @consumer(i32 %id) {
%sum = add i32 10, %id
%output = insertvalue { i32 } undef, i32 %sum, 0
ret { i32 } %output
%output = insertvalue %rtype undef, i32 %sum, 0
ret %rtype %output
}
define %rtype @Root(i32 %id) {
%p_node = call i8* @llvm.visc.createNode(i8* bitcast ({ i32 } (i32)* @producer to i8*))
%c_node = call i8* @llvm.visc.createNode(i8* bitcast ({ i32 } (i32)* @consumer to i8*))
%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)
......
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