Commit 13814110 authored by Akash Kothari's avatar Akash Kothari
Browse files

Renamed x86->cpu and nvptx->opencl

parent e0a52f5c
; RUN: opt -load LLVMBuildDFG.so -load LLVMDFG2LLVM_X86.so -load LLVMClearDFG.so -S -dfg2llvm-x86 -clearDFG < %s | FileCheck %s
; RUN: opt -load LLVMBuildDFG.so -load LLVMDFG2LLVM_CPU.so -load LLVMClearDFG.so -S -dfg2llvm-cpu -clearDFG < %s | FileCheck %s
; ModuleID = 'ThreeLevel.ll'
source_filename = "ThreeLevel.c"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
......@@ -13,31 +13,31 @@ target triple = "x86_64-unknown-linux-gnu"
; CHECK-LABEL: i32 @main(
; CHECK-NOT: call void @llvm.hpvm.init()
; CHECK: call i8* @llvm_hpvm_x86_launch(i8* (i8*)* @LaunchDataflowGraph, i8*
; CHECK: call i8* @llvm_hpvm_cpu_launch(i8* (i8*)* @LaunchDataflowGraph, i8*
; CHECK-NOT: call i8* @llvm.hpvm.launch(i8*
; CHECK: call void @llvm_hpvm_x86_wait(i8*
; CHECK: call void @llvm_hpvm_cpu_wait(i8*
; CHECK-LABEL: @Func1_cloned.1_cloned_cloned_cloned_cloned_cloned_cloned
; CHECK: call i8* @llvm_hpvm_x86_argument_ptr(
; CHECK: call i8* @llvm_hpvm_cpu_argument_ptr(
; CHECK-LABEL: @Func3_cloned.2_cloned_cloned_cloned_cloned_cloned_cloned(
; CHECK-LABEL: for.body1:
; CHECK: %index.y = phi i64 [ 0, %for.body ], [ %index.y.inc, %for.body1 ]
; CHECK-NEXT: call void @llvm_hpvm_x86_dstack_push(
; CHECK-NEXT: call void @llvm_hpvm_cpu_dstack_push(
; CHECK-NEXT: @Func1_cloned.1_cloned_cloned_cloned_cloned_cloned_cloned(
; CHECK-NEXT: call void @llvm_hpvm_x86_dstack_pop()
; CHECK-NEXT: call void @llvm_hpvm_cpu_dstack_pop()
; CHECK-LABEL: @Func2_cloned.3_cloned_cloned_cloned_cloned_cloned_cloned(
; CHECK-LABEL: for.body:
; CHECK-NEXT: %index.x = phi i64 [ 0, %entry ], [ %index.x.inc, %for.body ]
; CHECK-NEXT: call void @llvm_hpvm_x86_dstack_push(
; CHECK-NEXT: call void @llvm_hpvm_cpu_dstack_push(
; CHECK-NEXT: @Func3_cloned.2_cloned_cloned_cloned_cloned_cloned_cloned(
; CHECK-NEXT: call void @llvm_hpvm_x86_dstack_pop()
; CHECK-NEXT: call void @llvm_hpvm_cpu_dstack_pop()
; CHECK-LABEL: @PipeRoot_cloned.4(
; CHECK: call void @llvm_hpvm_x86_dstack_push(
; CHECK: call void @llvm_hpvm_cpu_dstack_push(
; CHECK-NEXT: @Func2_cloned.3_cloned_cloned_cloned_cloned_cloned_cloned(
; CHECK-NEXT: call void @llvm_hpvm_x86_dstack_pop()
; CHECK-NEXT: call void @llvm_hpvm_cpu_dstack_pop()
; CHECK-LABEL: @LaunchDataflowGraph(
; CHECK: call %struct.out.PipeRoot @PipeRoot_cloned.4(
......@@ -189,9 +189,9 @@ declare void @llvm.hpvm.wait(i8*) #3
; Function Attrs: nounwind
declare void @llvm.hpvm.cleanup() #3
attributes #0 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="true" "use-soft-float"="false" }
attributes #0 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="cpu-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="true" "use-soft-float"="false" }
attributes #1 = { argmemonly nounwind }
attributes #2 = { nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="false" "no-infs-fp-math"="true" "no-jump-tables"="false" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="true" "use-soft-float"="false" }
attributes #2 = { nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="false" "no-infs-fp-math"="true" "no-jump-tables"="false" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="cpu-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="true" "use-soft-float"="false" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0}
......
; RUN: opt -load LLVMBuildDFG.so -load LLVMLocalMem.so -load LLVMDFG2LLVM_NVPTX.so -load LLVMDFG2LLVM_X86.so -load LLVMClearDFG.so -S -localmem -dfg2llvm-nvptx -dfg2llvm-x86 -clearDFG < %s | FileCheck %s
; RUN: opt -load LLVMBuildDFG.so -load LLVMLocalMem.so -load LLVMDFG2LLVM_OpenCL.so -load LLVMDFG2LLVM_CPU.so -load LLVMClearDFG.so -S -localmem -dfg2llvm-opencl -dfg2llvm-cpu -clearDFG < %s | FileCheck %s
; ModuleID = 'ThreeLevel.ll'
source_filename = "ThreeLevel.c"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
......@@ -37,9 +37,9 @@ declare dso_local i8* @__hpvm__createNodeND(i32, ...) local_unnamed_addr #0
declare dso_local void @__hpvm__bindIn(i8*, i32, i32, i32) local_unnamed_addr #0
; CHECK-LABEL: @Launch(
; CHECK: call i8* @llvm_hpvm_x86_launch(i8*
; CHECK: call i8* @llvm_hpvm_cpu_launch(i8*
; CHECK-NOT: call i8* @llvm.hpvm.launch(i8*
; CHECK: call void @llvm_hpvm_x86_wait(i8*
; CHECK: call void @llvm_hpvm_cpu_wait(i8*
; Function Attrs: noinline nounwind uwtable
define dso_local void @Launch() local_unnamed_addr #2 {
......@@ -90,9 +90,9 @@ declare dso_local void @__hpvm__wait(i8*) local_unnamed_addr #0
; CHECK-NEXT: call void @llvm_hpvm_ocl_free(i8*
; CHECK-LABEL: @PipeRoot_cloned.3(
; CHECK: call void @llvm_hpvm_x86_dstack_push(
; CHECK: call void @llvm_hpvm_cpu_dstack_push(
; CHECK-NEXT: @Func2_cloned.2_cloned_cloned_cloned_cloned_cloned_clone
; CHECK-NEXT: call void @llvm_hpvm_x86_dstack_pop(
; CHECK-NEXT: call void @llvm_hpvm_cpu_dstack_pop(
; CHECK-LABEL: define i8* @LaunchDataflowGraph(i8*
......@@ -219,11 +219,11 @@ declare void @llvm.hpvm.init() #6
; Function Attrs: nounwind
declare void @llvm.hpvm.cleanup() #6
attributes #0 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="true" "use-soft-float"="false" }
attributes #0 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="cpu-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="true" "use-soft-float"="false" }
attributes #1 = { argmemonly nounwind }
attributes #2 = { noinline nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="false" "no-infs-fp-math"="true" "no-jump-tables"="false" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="true" "use-soft-float"="false" }
attributes #3 = { nofree nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="true" "use-soft-float"="false" }
attributes #4 = { nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="false" "no-infs-fp-math"="true" "no-jump-tables"="false" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="true" "use-soft-float"="false" }
attributes #2 = { noinline nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="false" "no-infs-fp-math"="true" "no-jump-tables"="false" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="cpu-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="true" "use-soft-float"="false" }
attributes #3 = { nofree nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="cpu-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="true" "use-soft-float"="false" }
attributes #4 = { nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="false" "no-infs-fp-math"="true" "no-jump-tables"="false" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="cpu-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="true" "use-soft-float"="false" }
attributes #5 = { nounwind readnone }
attributes #6 = { nounwind }
......
; RUN: opt -load LLVMBuildDFG.so -load LLVMLocalMem.so -load LLVMDFG2LLVM_NVPTX.so -load LLVMDFG2LLVM_X86.so -load LLVMClearDFG.so -S -localmem -dfg2llvm-nvptx -dfg2llvm-x86 -clearDFG < %s | FileCheck %s
; RUN: opt -load LLVMBuildDFG.so -load LLVMLocalMem.so -load LLVMDFG2LLVM_OpenCL.so -load LLVMDFG2LLVM_CPU.so -load LLVMClearDFG.so -S -localmem -dfg2llvm-opencl -dfg2llvm-cpu -clearDFG < %s | FileCheck %s
; ModuleID = 'ThreeLevel.opt.ll'
source_filename = "ThreeLevel.opt.c"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
......@@ -44,9 +44,9 @@ declare dso_local void @__hpvm__bindIn(i8*, i32, i32, i32) local_unnamed_addr #0
declare dso_local i8* @__hpvm__edge(i8*, i8*, i32, i32, i32, i32) local_unnamed_addr #0
; CHECK-LABEL: @Launch(
; CHECK: call i8* @llvm_hpvm_x86_launch(i8*
; CHECK: call i8* @llvm_hpvm_cpu_launch(i8*
; CHECK-NOT: call i8* @llvm.hpvm.launch(i8*
; CHECK: call void @llvm_hpvm_x86_wait(i8*
; CHECK: call void @llvm_hpvm_cpu_wait(i8*
; Function Attrs: noinline nounwind uwtable
define dso_local void @Launch() local_unnamed_addr #2 {
......@@ -96,9 +96,9 @@ declare dso_local void @__hpvm__wait(i8*) local_unnamed_addr #0
; CHECK-NEXT: call void @llvm_hpvm_ocl_free(i8*
; CHECK-LABEL: @PipeRoot_cloned.4(
; CHECK: call void @llvm_hpvm_x86_dstack_push(
; CHECK: call void @llvm_hpvm_cpu_dstack_push(
; CHECK-NEXT: @Func2_cloned.3_cloned_cloned_cloned_cloned_cloned_clone
; CHECK-NEXT: call void @llvm_hpvm_x86_dstack_pop(
; CHECK-NEXT: call void @llvm_hpvm_cpu_dstack_pop(
; CHECK-LABEL: define i8* @LaunchDataflowGraph(i8*
......@@ -239,11 +239,11 @@ declare void @llvm.hpvm.init() #6
; Function Attrs: nounwind
declare void @llvm.hpvm.cleanup() #6
attributes #0 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="true" "use-soft-float"="false" }
attributes #0 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="cpu-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="true" "use-soft-float"="false" }
attributes #1 = { argmemonly nounwind }
attributes #2 = { noinline nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="false" "no-infs-fp-math"="true" "no-jump-tables"="false" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="true" "use-soft-float"="false" }
attributes #3 = { nofree nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="true" "use-soft-float"="false" }
attributes #4 = { nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="false" "no-infs-fp-math"="true" "no-jump-tables"="false" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="true" "use-soft-float"="false" }
attributes #2 = { noinline nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="false" "no-infs-fp-math"="true" "no-jump-tables"="false" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="cpu-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="true" "use-soft-float"="false" }
attributes #3 = { nofree nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="cpu-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="true" "use-soft-float"="false" }
attributes #4 = { nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="false" "no-infs-fp-math"="true" "no-jump-tables"="false" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="cpu-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="true" "use-soft-float"="false" }
attributes #5 = { nounwind readnone }
attributes #6 = { nounwind }
......
; RUN: opt -load LLVMBuildDFG.so -load LLVMDFG2LLVM_CPU.so -S -dfg2llvm-cpu < %s | FileCheck %s
; ModuleID = 'CreateNode.ll'
source_filename = "CreateNode.c"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%struct.Root = type { i32*, i64, i32*, i64, i32*, i64 }
%struct.out.Func = type <{ i32* }>
%struct.out.PipeRoot = type <{ i32* }>
; CHECK-LABEL: i32 @main(
; CHECK: call void @llvm.hpvm.init()
; CHECK: call i8* @llvm_hpvm_cpu_launch(i8* (i8*)* @LaunchDataflowGraph, i8*
; CHECK-NEXT: call i8* @llvm.hpvm.launch(i8*
; CHECK-NEXT: call void @llvm_hpvm_cpu_wait(i8*
; CHECK-LABEL: @PipeRoot_cloned(
; CHECK: call i8* @llvm.hpvm.createNode(
; CHECK-NEXT: call void @llvm.hpvm.bind.input(i8* %Func_cloned.node
; CHECK-NEXT: call void @llvm.hpvm.bind.input(i8* %Func_cloned.node
; CHECK-NEXT: call void @llvm.hpvm.bind.input(i8* %Func_cloned.node
; CHECK-NEXT: call void @llvm.hpvm.bind.input(i8* %Func_cloned.node
; CHECK-NEXT: call void @llvm.hpvm.bind.output(i8* %Func_cloned.node
; CHECK-LABEL: @Func_cloned.1_cloned_cloned_cloned_cloned_cloned_cloned
; CHECK: call i8* @llvm_hpvm_cpu_argument_ptr(
; CHECK-LABEL: @PipeRoot_cloned.2(
; CHECK: call void @llvm_hpvm_cpu_dstack_push(
; CHECK-NEXT: @Func_cloned.1_cloned_cloned_cloned_cloned_cloned_cloned(
; CHECK-NEXT: call void @llvm_hpvm_cpu_dstack_pop()
; CHECK-LABEL: @LaunchDataflowGraph(i8*
; call %struct.out.PipeRoot @PipeRoot_cloned.2(
declare dso_local void @__hpvm__hint(i32) local_unnamed_addr #0
declare dso_local void @__hpvm__attributes(i32, ...) local_unnamed_addr #0
declare dso_local void @__hpvm__return(i32, ...) local_unnamed_addr #0
; Function Attrs: argmemonly nounwind
declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1
declare dso_local i8* @__hpvm__createNodeND(i32, ...) local_unnamed_addr #0
declare dso_local void @__hpvm__bindIn(i8*, i32, i32, i32) local_unnamed_addr #0
declare dso_local void @__hpvm__bindOut(i8*, i32, i32, i32) local_unnamed_addr #0
; Function Attrs: argmemonly nounwind
declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%In1 = alloca i32, align 4
%In2 = alloca i32, align 4
%Out = alloca i32, align 4
%RootArgs = alloca %struct.Root, align 8
%0 = bitcast i32* %In1 to i8*
call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %0) #3
store i32 1, i32* %In1, align 4, !tbaa !4
%1 = bitcast i32* %In2 to i8*
call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %1) #3
store i32 2, i32* %In2, align 4, !tbaa !4
%2 = bitcast i32* %Out to i8*
call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %2) #3
store i32 0, i32* %Out, align 4, !tbaa !4
%3 = bitcast %struct.Root* %RootArgs to i8*
call void @llvm.lifetime.start.p0i8(i64 48, i8* nonnull %3) #3
%input1 = getelementptr inbounds %struct.Root, %struct.Root* %RootArgs, i64 0, i32 0
store i32* %In1, i32** %input1, align 8, !tbaa !8
%Insize1 = getelementptr inbounds %struct.Root, %struct.Root* %RootArgs, i64 0, i32 1
store i64 32, i64* %Insize1, align 8, !tbaa !12
%input2 = getelementptr inbounds %struct.Root, %struct.Root* %RootArgs, i64 0, i32 2
store i32* %In2, i32** %input2, align 8, !tbaa !13
%Insize2 = getelementptr inbounds %struct.Root, %struct.Root* %RootArgs, i64 0, i32 3
store i64 32, i64* %Insize2, align 8, !tbaa !14
%output = getelementptr inbounds %struct.Root, %struct.Root* %RootArgs, i64 0, i32 4
store i32* %Out, i32** %output, align 8, !tbaa !15
%Outsize = getelementptr inbounds %struct.Root, %struct.Root* %RootArgs, i64 0, i32 5
store i64 32, i64* %Outsize, align 8, !tbaa !16
call void @llvm.hpvm.init()
%4 = bitcast %struct.Root* %RootArgs to i8*
%graphID = call i8* @llvm.hpvm.launch(i8* bitcast (%struct.out.PipeRoot (i32*, i64, i32*, i64, i32*, i64)* @PipeRoot_cloned to i8*), i8* %4, i1 false)
call void @llvm.hpvm.wait(i8* %graphID)
call void @llvm.hpvm.cleanup()
call void @llvm.lifetime.end.p0i8(i64 48, i8* nonnull %3) #3
call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %2) #3
call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %1) #3
call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %0) #3
ret i32 0
}
declare dso_local void @__hpvm__init(...) local_unnamed_addr #0
declare dso_local i8* @__hpvm__launch(i32, ...) local_unnamed_addr #0
declare dso_local void @__hpvm__wait(i8*) local_unnamed_addr #0
declare dso_local void @__hpvm__cleanup(...) local_unnamed_addr #0
declare i8* @llvm_hpvm_initializeTimerSet()
declare void @llvm_hpvm_switchToTimer(i8**, i32)
declare void @llvm_hpvm_printTimerSet(i8**, i8*)
; Function Attrs: nounwind uwtable
define dso_local %struct.out.Func @Func_cloned(i32* in %In, i64 %Insize, i32* out %Out, i64 %Outsize) #2 {
entry:
%returnStruct = insertvalue %struct.out.Func undef, i32* %Out, 0
ret %struct.out.Func %returnStruct
}
; Function Attrs: nounwind
declare i8* @llvm.hpvm.createNode(i8*) #3
; Function Attrs: nounwind
declare void @llvm.hpvm.bind.input(i8*, i32, i32, i1) #3
; Function Attrs: nounwind
declare void @llvm.hpvm.bind.output(i8*, i32, i32, i1) #3
; Function Attrs: nounwind uwtable
define dso_local %struct.out.PipeRoot @PipeRoot_cloned(i32* in %In1, i64 %Insize1, i32* in %In2, i64 %InSize2, i32* out %Out, i64 %Outsize) #2 {
entry:
%Func_cloned.node = call i8* @llvm.hpvm.createNode(i8* bitcast (%struct.out.Func (i32*, i64, i32*, i64)* @Func_cloned to i8*))
call void @llvm.hpvm.bind.input(i8* %Func_cloned.node, i32 0, i32 0, i1 false)
call void @llvm.hpvm.bind.input(i8* %Func_cloned.node, i32 1, i32 1, i1 false)
call void @llvm.hpvm.bind.input(i8* %Func_cloned.node, i32 2, i32 2, i1 false)
call void @llvm.hpvm.bind.input(i8* %Func_cloned.node, i32 3, i32 3, i1 false)
call void @llvm.hpvm.bind.output(i8* %Func_cloned.node, i32 0, i32 0, i1 false)
ret %struct.out.PipeRoot undef
}
; Function Attrs: nounwind
declare void @llvm.hpvm.init() #3
; Function Attrs: nounwind
declare i8* @llvm.hpvm.launch(i8*, i8*, i1) #3
; Function Attrs: nounwind
declare void @llvm.hpvm.wait(i8*) #3
; Function Attrs: nounwind
declare void @llvm.hpvm.cleanup() #3
attributes #0 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="cpu-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="true" "use-soft-float"="false" }
attributes #1 = { argmemonly nounwind }
attributes #2 = { nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="false" "no-infs-fp-math"="true" "no-jump-tables"="false" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="cpu-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="true" "use-soft-float"="false" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0}
!llvm.ident = !{!1}
!hpvm_hint_cpu = !{!2, !3}
!hpvm_hint_gpu = !{}
!hpvm_hint_spir = !{}
!hpvm_hint_cudnn = !{}
!hpvm_hint_promise = !{}
!hpvm_hint_cpu_gpu = !{}
!hpvm_hint_cpu_spir = !{}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{!"clang version 9.0.0 (https://gitlab.engr.illinois.edu/llvm/hpvm.git 6690f9e7e8b46b96aea222d3e85315cd63545953)"}
!2 = !{%struct.out.Func (i32*, i64, i32*, i64)* @Func_cloned}
!3 = !{%struct.out.PipeRoot (i32*, i64, i32*, i64, i32*, i64)* @PipeRoot_cloned}
!4 = !{!5, !5, i64 0}
!5 = !{!"int", !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !10, i64 0}
!9 = !{!"Root", !10, i64 0, !11, i64 8, !10, i64 16, !11, i64 24, !10, i64 32, !11, i64 40}
!10 = !{!"any pointer", !6, i64 0}
!11 = !{!"long", !6, i64 0}
!12 = !{!9, !11, i64 8}
!13 = !{!9, !10, i64 16}
!14 = !{!9, !11, i64 24}
!15 = !{!9, !10, i64 32}
!16 = !{!9, !11, i64 40}
; RUN: opt -load LLVMBuildDFG.so -load LLVMDFG2LLVM_CPU.so -S -dfg2llvm-cpu < %s | FileCheck %s
; ModuleID = 'oneLaunchAlloca.ll'
source_filename = "oneLaunchAlloca.c"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%struct.Root = type { i32*, i64, i32*, i64 }
%emptyStruct = type <{}>
declare dso_local void @__hpvm__hint(i32) local_unnamed_addr #0
declare dso_local void @__hpvm__attributes(i32, ...) local_unnamed_addr #0
; CHECK-LABEL: i32 @main(
; CHECK: call void @llvm.hpvm.init()
; CHECK: call i8* @llvm_hpvm_cpu_launch(i8* (i8*)* @LaunchDataflowGraph, i8*
; CHECK-NEXT: call i8* @llvm.hpvm.launch(i8*
; CHECK-NEXT: call void @llvm_hpvm_cpu_wait(i8*
; CHECK-LABEL: @PipeRoot_cloned.1(
; CHECK-LABEL: @LaunchDataflowGraph(i8*
; call %struct.out.PipeRoot @PipeRoot_cloned.1(
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%In = alloca i32, align 4
%Out = alloca i32, align 4
%RootArgs = alloca %struct.Root, align 8
%0 = bitcast i32* %In to i8*
call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %0) #3
%1 = bitcast i32* %Out to i8*
call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %1) #3
%2 = bitcast %struct.Root* %RootArgs to i8*
call void @llvm.lifetime.start.p0i8(i64 32, i8* nonnull %2) #3
%input = getelementptr inbounds %struct.Root, %struct.Root* %RootArgs, i64 0, i32 0
store i32* %In, i32** %input, align 8, !tbaa !3
%insize = getelementptr inbounds %struct.Root, %struct.Root* %RootArgs, i64 0, i32 1
store i64 32, i64* %insize, align 8, !tbaa !9
%output = getelementptr inbounds %struct.Root, %struct.Root* %RootArgs, i64 0, i32 2
store i32* %Out, i32** %output, align 8, !tbaa !10
%outsize = getelementptr inbounds %struct.Root, %struct.Root* %RootArgs, i64 0, i32 3
store i64 32, i64* %outsize, align 8, !tbaa !11
call void @llvm.hpvm.init()
%3 = bitcast %struct.Root* %RootArgs to i8*
%graphID = call i8* @llvm.hpvm.launch(i8* bitcast (%emptyStruct (i32*, i64, i32*, i64)* @PipeRoot_cloned to i8*), i8* %3, i1 false)
call void @llvm.hpvm.wait(i8* %graphID)
call void @llvm.hpvm.cleanup()
call void @llvm.lifetime.end.p0i8(i64 32, i8* nonnull %2) #3
call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %1) #3
call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %0) #3
ret i32 0
}
; Function Attrs: argmemonly nounwind
declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #2
declare dso_local void @__hpvm__init(...) local_unnamed_addr #0
declare dso_local i8* @__hpvm__launch(i32, ...) local_unnamed_addr #0
declare dso_local void @__hpvm__wait(i8*) local_unnamed_addr #0
declare dso_local void @__hpvm__cleanup(...) local_unnamed_addr #0
; Function Attrs: argmemonly nounwind
declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #2
declare i8* @llvm_hpvm_initializeTimerSet()
declare void @llvm_hpvm_switchToTimer(i8**, i32)
declare void @llvm_hpvm_printTimerSet(i8**, i8*)
; Function Attrs: nounwind
declare void @llvm.hpvm.init() #3
; Function Attrs: nounwind
declare i8* @llvm.hpvm.launch(i8*, i8*, i1) #3
; Function Attrs: nounwind uwtable
define dso_local %emptyStruct @PipeRoot_cloned(i32* in %In, i64 %insize, i32* out %Out, i64 %outsize) #1 {
entry:
ret %emptyStruct undef
}
; Function Attrs: nounwind
declare void @llvm.hpvm.wait(i8*) #3
; Function Attrs: nounwind
declare void @llvm.hpvm.cleanup() #3
attributes #0 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="cpu-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="true" "use-soft-float"="false" }
attributes #1 = { nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="false" "no-infs-fp-math"="true" "no-jump-tables"="false" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="cpu-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="true" "use-soft-float"="false" }
attributes #2 = { argmemonly nounwind }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0}
!llvm.ident = !{!1}
!hpvm_hint_cpu = !{!2}
!hpvm_hint_gpu = !{}
!hpvm_hint_spir = !{}
!hpvm_hint_cudnn = !{}
!hpvm_hint_promise = !{}
!hpvm_hint_cpu_gpu = !{}
!hpvm_hint_cpu_spir = !{}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{!"clang version 9.0.0 (https://gitlab.engr.illinois.edu/llvm/hpvm.git 6690f9e7e8b46b96aea222d3e85315cd63545953)"}
!2 = !{%emptyStruct (i32*, i64, i32*, i64)* @PipeRoot_cloned}
!3 = !{!4, !5, i64 0}
!4 = !{!"Root", !5, i64 0, !8, i64 8, !5, i64 16, !8, i64 24}
!5 = !{!"any pointer", !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!"long", !6, i64 0}
!9 = !{!4, !8, i64 8}
!10 = !{!4, !5, i64 16}
!11 = !{!4, !8, i64 24}
; RUN: opt -load LLVMBuildDFG.so -load LLVMLocalMem.so -load LLVMDFG2LLVM_OpenCL.so -load LLVMDFG2LLVM_CPU.so -S -localmem -dfg2llvm-opencl -dfg2llvm-cpu < %s | FileCheck %s
; ModuleID = 'ThreeLevel.ll'
source_filename = "ThreeLevel.c"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%struct.Root = type { i32*, i64, i32*, i64 }
%emptyStruct = type <{}>
%emptyStruct.0 = type <{}>
%emptyStruct.1 = type <{}>
%emptyStruct.2 = type <{}>
declare dso_local void @__hpvm__hint(i32) local_unnamed_addr #0
declare dso_local void @__hpvm__attributes(i32, ...) local_unnamed_addr #0
; Function Attrs: argmemonly nounwind
declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1
declare dso_local i8* @__hpvm__getNode(...) local_unnamed_addr #0
declare dso_local i8* @__hpvm__getParentNode(i8*) local_unnamed_addr #0
declare dso_local i64 @__hpvm__getNodeInstanceID_x(i8*) local_unnamed_addr #0
declare dso_local i64 @__hpvm__getNodeInstanceID_y(i8*) local_unnamed_addr #0
declare dso_local i64 @__hpvm__getNumNodeInstances_x(i8*) local_unnamed_addr #0
declare dso_local i64 @__hpvm__getNumNodeInstances_y(i8*) local_unnamed_addr #0
; Function Attrs: argmemonly nounwind
declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1
declare dso_local i8* @__hpvm__createNodeND(i32, ...) local_unnamed_addr #0
declare dso_local void @__hpvm__bindIn(i8*, i32, i32, i32) local_unnamed_addr #0
; CHECK-LABEL: @Launch(
; CHECK: call i8* @llvm_hpvm_cpu_launch(i8*
; CHECK-NEXT: call i8* @llvm.hpvm.launch(i8*
; CHECK-NEXT: call void @llvm_hpvm_cpu_wait(i8*
; Function Attrs: noinline nounwind uwtable
define dso_local void @Launch() local_unnamed_addr #2 {
entry:
%RootArgs = alloca %struct.Root, align 8
%0 = bitcast %struct.Root* %RootArgs to i8*
call void @llvm.lifetime.start.p0i8(i64 32, i8* nonnull %0) #6
%call = tail call noalias i8* @malloc(i64 1024) #6
%1 = bitcast %struct.Root* %RootArgs to i8**
store i8* %call, i8** %1, align 8, !tbaa !6
%Insize = getelementptr inbounds %struct.Root, %struct.Root* %RootArgs, i64 0, i32 1
store i64 1024, i64* %Insize, align 8, !tbaa !12
%output = getelementptr inbounds %struct.Root, %struct.Root* %RootArgs, i64 0, i32 2
%call1 = tail call noalias i8* @malloc(i64 1024) #6
%2 = bitcast i32** %output to i8**
store i8* %call1, i8** %2, align 8, !tbaa !13
%Outsize = getelementptr inbounds %struct.Root, %struct.Root* %RootArgs, i64 0, i32 3
store i64 1024, i64* %Outsize, align 8, !tbaa !14
%3 = bitcast %struct.Root* %RootArgs to i8*
%graphID = call i8* @llvm.hpvm.launch(i8* bitcast (%emptyStruct.2 (i32*, i64, i32*, i64)* @PipeRoot_cloned to i8*), i8* %3, i1 false)
call void @llvm.hpvm.wait(i8* %graphID)
call void @llvm.lifetime.end.p0i8(i64 32, i8* nonnull %0) #6
ret void
}
; Function Attrs: nofree nounwind
declare dso_local noalias i8* @malloc(i64) local_unnamed_addr #3
declare dso_local i8* @__hpvm__launch(i32, ...) local_unnamed_addr #0
declare dso_local void @__hpvm__wait(i8*) local_unnamed_addr #0
; CHECK-LABEL: @main(
; CHECK: call i8* @llvm_hpvm_ocl_initContext(i32
; CHECK: call i8* @llvm_hpvm_ocl_launch(i8*
; CHECK: call void @llvm_hpvm_ocl_clearContext(i8*
; CHECK-LABEL: @Func2_cloned.2_cloned_cloned_cloned_cloned_cloned_cloned(
; CHECK: call i8* @llvm_hpvm_ocl_argument_ptr(i8*
; CHECK: call void @llvm_hpvm_ocl_argument_scalar(i8*
; CHECK: call i8* @llvm_hpvm_ocl_argument_ptr(i8*
; CHECK: call void @llvm_hpvm_ocl_argument_scalar(i8*
; CHECK: call i8* @llvm_hpvm_ocl_executeNode(i8*
; CHECK-NEXT: call void @llvm_hpvm_ocl_wait(i8*
; CHECK-NEXT: call void @llvm_hpvm_ocl_free(i8*
; CHECK-NEXT: call void @llvm_hpvm_ocl_free(i8*
; CHECK-LABEL: @PipeRoot_cloned.3(
; CHECK: call void @llvm_hpvm_cpu_dstack_push(
; CHECK-NEXT: @Func2_cloned.2_cloned_cloned_cloned_cloned_cloned_clone
; CHECK-NEXT: call void @llvm_hpvm_cpu_dstack_pop(
; CHECK-LABEL: define i8* @LaunchDataflowGraph(i8*
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
call void @llvm.hpvm.init()
tail call void @Launch()
call void @llvm.hpvm.cleanup()
ret i32 0
}