1; RUN: opt %loadPolly -polly-process-unprofitable -polly-codegen-ppcg \ 2; RUN: -polly-acc-dump-kernel-ir -disable-output < %s | \ 3; RUN: FileCheck -check-prefix=KERNEL %s 4 5; REQUIRES: pollyacc 6 7; KERNEL: define ptx_kernel void @FUNC_foo_SCOP_0_KERNEL_0(i8 addrspace(1)* %MemRef_arg1, i32 %arg) #0 { 8; KERNEL: define ptx_kernel void @FUNC_foo_SCOP_1_KERNEL_0(i8 addrspace(1)* %MemRef_arg1, i32 %arg) #0 { 9; KERNEL: define ptx_kernel void @FUNC_foo2_SCOP_0_KERNEL_0(i8 addrspace(1)* %MemRef_arg1, i32 %arg) #0 { 10 11target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 12 13; Function Attrs: nounwind uwtable 14define void @foo(i32 %arg, i32* %arg1) #0 { 15bb: 16 br label %bb2 17 18bb2: ; preds = %bb 19 %tmp = icmp sgt i32 %arg, 0 20 br i1 %tmp, label %bb3, label %bb13 21 22bb3: ; preds = %bb2 23 br label %bb4 24 25bb4: ; preds = %bb4, %bb3 26 %tmp5 = phi i64 [ 0, %bb3 ], [ %tmp9, %bb4 ] 27 %tmp6 = getelementptr inbounds i32, i32* %arg1, i64 %tmp5 28 %tmp7 = load i32, i32* %tmp6, align 4, !tbaa !2 29 %tmp8 = add nsw i32 %tmp7, 1 30 store i32 %tmp8, i32* %tmp6, align 4, !tbaa !2 31 %tmp9 = add nuw nsw i64 %tmp5, 1 32 %tmp10 = zext i32 %arg to i64 33 %tmp11 = icmp ne i64 %tmp9, %tmp10 34 br i1 %tmp11, label %bb4, label %bb12 35 36bb12: ; preds = %bb4 37 br label %bb13 38 39bb13: ; preds = %bb12, %bb2 40 %tmp14 = tail call i64 @clock() #3 41 %tmp15 = icmp eq i64 %tmp14, 0 42 br i1 %tmp15, label %bb16, label %bb29 43 44bb16: ; preds = %bb13 45 %tmp17 = icmp sgt i32 %arg, 0 46 br i1 %tmp17, label %bb18, label %bb28 47 48bb18: ; preds = %bb16 49 br label %bb19 50 51bb19: ; preds = %bb19, %bb18 52 %tmp20 = phi i64 [ 0, %bb18 ], [ %tmp24, %bb19 ] 53 %tmp21 = getelementptr inbounds i32, i32* %arg1, i64 %tmp20 54 %tmp22 = load i32, i32* %tmp21, align 4, !tbaa !2 55 %tmp23 = add nsw i32 %tmp22, 1 56 store i32 %tmp23, i32* %tmp21, align 4, !tbaa !2 57 %tmp24 = add nuw nsw i64 %tmp20, 1 58 %tmp25 = zext i32 %arg to i64 59 %tmp26 = icmp ne i64 %tmp24, %tmp25 60 br i1 %tmp26, label %bb19, label %bb27 61 62bb27: ; preds = %bb19 63 br label %bb28 64 65bb28: ; preds = %bb27, %bb16 66 br label %bb29 67 68bb29: ; preds = %bb28, %bb13 69 ret void 70} 71 72; Function Attrs: argmemonly nounwind 73declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #1 74 75; Function Attrs: nounwind 76declare i64 @clock() #2 77 78; Function Attrs: argmemonly nounwind 79declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #1 80 81; Function Attrs: nounwind uwtable 82define void @foo2(i32 %arg, i32* %arg1) #0 { 83bb: 84 br label %bb2 85 86bb2: ; preds = %bb 87 %tmp = icmp sgt i32 %arg, 0 88 br i1 %tmp, label %bb3, label %bb13 89 90bb3: ; preds = %bb2 91 br label %bb4 92 93bb4: ; preds = %bb4, %bb3 94 %tmp5 = phi i64 [ 0, %bb3 ], [ %tmp9, %bb4 ] 95 %tmp6 = getelementptr inbounds i32, i32* %arg1, i64 %tmp5 96 %tmp7 = load i32, i32* %tmp6, align 4, !tbaa !2 97 %tmp8 = add nsw i32 %tmp7, 1 98 store i32 %tmp8, i32* %tmp6, align 4, !tbaa !2 99 %tmp9 = add nuw nsw i64 %tmp5, 1 100 %tmp10 = zext i32 %arg to i64 101 %tmp11 = icmp ne i64 %tmp9, %tmp10 102 br i1 %tmp11, label %bb4, label %bb12 103 104bb12: ; preds = %bb4 105 br label %bb13 106 107bb13: ; preds = %bb12, %bb2 108 ret void 109} 110 111attributes #0 = { nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } 112attributes #1 = { argmemonly nounwind } 113attributes #2 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } 114attributes #3 = { nounwind } 115 116!llvm.module.flags = !{!0} 117!llvm.ident = !{!1} 118 119!0 = !{i32 1, !"wchar_size", i32 4} 120!1 = !{!"clang version 5.0.0"} 121!2 = !{!3, !3, i64 0} 122!3 = !{!"int", !4, i64 0} 123!4 = !{!"omnipotent char", !5, i64 0} 124!5 = !{!"Simple C/C++ TBAA"} 125