1 ; RUN: opt %loadPolly -basic-aa -polly-codegen -S < %s | FileCheck %s
3 ; Verify that we remove the misc intrinsics from the optimized SCoP.
6 ; CHECK: call ptr @llvm.invariant.start
8 ; CHECK: call void @llvm.assume
9 ; CHECK: call i1 @llvm.expect.i1
10 ; CHECK: call void @llvm.donothing
12 ; CHECK: call void @llvm.invariant.end
13 ; CHECK-NOT: call void @llvm.{{.*}}
17 ; for (int i = 0; i < 1024; i++) {
19 ; for (int j = i; j < 1024; j++)
25 ; ModuleID = 'test/Isl/CodeGen/lifetime_intrinsics.ll'
26 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
28 @A = common global [1024 x i32] zeroinitializer, align 16
30 ; Function Attrs: nounwind uwtable
31 define void @jd() #0 {
33 %tmp = alloca [1024 x i32], align 16
36 for.cond: ; preds = %for.inc11, %entry
37 %indvars.iv3 = phi i64 [ %indvars.iv.next4, %for.inc11 ], [ 0, %entry ]
38 %exitcond5 = icmp ne i64 %indvars.iv3, 1024
39 br i1 %exitcond5, label %for.body, label %for.end13
41 for.body: ; preds = %for.cond
42 %lis = call ptr @llvm.invariant.start(i64 4096, ptr @A) #1
45 for.cond2: ; preds = %for.inc, %for.body
46 %indvars.iv1 = phi i64 [ %indvars.iv.next2, %for.inc ], [ %indvars.iv3, %for.body ]
47 %lftr.wideiv = trunc i64 %indvars.iv1 to i32
48 %exitcond = icmp ne i32 %lftr.wideiv, 1024
49 br i1 %exitcond, label %for.body4, label %for.end
51 for.body4: ; preds = %for.cond2
52 call void @llvm.assume(i1 %exitcond)
53 call i1 @llvm.expect.i1(i1 %exitcond, i1 1)
54 %arrayidx = getelementptr inbounds [1024 x i32], ptr @A, i64 0, i64 %indvars.iv1
55 %tmp6 = load i32, ptr %arrayidx, align 4
56 %arrayidx6 = getelementptr inbounds [1024 x i32], ptr %tmp, i64 0, i64 %indvars.iv3
57 call void @llvm.donothing()
58 %tmp7 = load i32, ptr %arrayidx6, align 4
59 %add = add nsw i32 %tmp7, %tmp6
60 store i32 %add, ptr %arrayidx6, align 4
63 for.inc: ; preds = %for.body4
64 %indvars.iv.next2 = add nuw nsw i64 %indvars.iv1, 1
67 for.end: ; preds = %for.cond2
68 %arrayidx8 = getelementptr inbounds [1024 x i32], ptr %tmp, i64 0, i64 %indvars.iv3
69 %tmp8 = load i32, ptr %arrayidx8, align 4
70 %arrayidx10 = getelementptr inbounds [1024 x i32], ptr @A, i64 0, i64 %indvars.iv3
71 call void @llvm.invariant.end(ptr %lis, i64 4096, ptr @A) #1
72 store i32 %tmp8, ptr %arrayidx10, align 4
75 for.inc11: ; preds = %for.end
76 %indvars.iv.next4 = add nuw nsw i64 %indvars.iv3, 1
79 for.end13: ; preds = %for.cond
83 ; Function Attrs: nounwind
84 declare void @llvm.donothing() #1
86 ; Function Attrs: nounwind
87 declare void @llvm.assume(i1) #1
89 ; Function Attrs: nounwind
90 declare i1 @llvm.expect.i1(i1, i1) #1
92 ; Function Attrs: nounwind
93 declare ptr @llvm.invariant.start(i64, ptr nocapture) #1
95 ; Function Attrs: nounwind
96 declare void @llvm.invariant.end(ptr, i64, ptr nocapture) #1
98 attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" "use-soft-float"="false" }
99 attributes #1 = { nounwind }