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

Added test case for multiple launch

parent af287da4
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: %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 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:
%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)
%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)
%graphID_2 = call i8* @llvm.visc.launch(i8* bitcast (%rtype ()* @Root_2 to i8*), i8* %args_2)
call void @llvm.visc.wait(i8* %graphID_2)
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"}
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