236
|
1 ; RUN: opt %loadPolly -basic-aa -polly-codegen -S < %s | FileCheck %s
|
|
2 ;
|
|
3 ; Verify that we remove the misc intrinsics from the optimized SCoP.
|
|
4 ;
|
|
5 ; CHECK: for.body:
|
252
|
6 ; CHECK: call ptr @llvm.invariant.start
|
236
|
7 ; CHECK: for.body4:
|
|
8 ; CHECK: call void @llvm.assume
|
|
9 ; CHECK: call i1 @llvm.expect.i1
|
|
10 ; CHECK: call void @llvm.donothing
|
|
11 ; CHECK: for.end:
|
|
12 ; CHECK: call void @llvm.invariant.end
|
|
13 ; CHECK-NOT: call void @llvm.{{.*}}
|
|
14 ;
|
|
15 ; int A[1024];
|
|
16 ; void jd() {
|
|
17 ; for (int i = 0; i < 1024; i++) {
|
|
18 ; int tmp[1024];
|
|
19 ; for (int j = i; j < 1024; j++)
|
|
20 ; tmp[i] += A[j];
|
|
21 ; A[i] = tmp[i];
|
|
22 ; }
|
|
23 ; }
|
|
24 ;
|
|
25 ; ModuleID = 'test/Isl/CodeGen/lifetime_intrinsics.ll'
|
|
26 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
|
27
|
|
28 @A = common global [1024 x i32] zeroinitializer, align 16
|
|
29
|
|
30 ; Function Attrs: nounwind uwtable
|
|
31 define void @jd() #0 {
|
|
32 entry:
|
|
33 %tmp = alloca [1024 x i32], align 16
|
|
34 br label %for.cond
|
|
35
|
|
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
|
|
40
|
|
41 for.body: ; preds = %for.cond
|
252
|
42 %lis = call ptr @llvm.invariant.start(i64 4096, ptr @A) #1
|
236
|
43 br label %for.cond2
|
|
44
|
|
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
|
|
50
|
|
51 for.body4: ; preds = %for.cond2
|
|
52 call void @llvm.assume(i1 %exitcond)
|
|
53 call i1 @llvm.expect.i1(i1 %exitcond, i1 1)
|
252
|
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
|
236
|
57 call void @llvm.donothing()
|
252
|
58 %tmp7 = load i32, ptr %arrayidx6, align 4
|
236
|
59 %add = add nsw i32 %tmp7, %tmp6
|
252
|
60 store i32 %add, ptr %arrayidx6, align 4
|
236
|
61 br label %for.inc
|
|
62
|
|
63 for.inc: ; preds = %for.body4
|
|
64 %indvars.iv.next2 = add nuw nsw i64 %indvars.iv1, 1
|
|
65 br label %for.cond2
|
|
66
|
|
67 for.end: ; preds = %for.cond2
|
252
|
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
|
236
|
73 br label %for.inc11
|
|
74
|
|
75 for.inc11: ; preds = %for.end
|
|
76 %indvars.iv.next4 = add nuw nsw i64 %indvars.iv3, 1
|
|
77 br label %for.cond
|
|
78
|
|
79 for.end13: ; preds = %for.cond
|
|
80 ret void
|
|
81 }
|
|
82
|
|
83 ; Function Attrs: nounwind
|
|
84 declare void @llvm.donothing() #1
|
|
85
|
|
86 ; Function Attrs: nounwind
|
|
87 declare void @llvm.assume(i1) #1
|
|
88
|
|
89 ; Function Attrs: nounwind
|
|
90 declare i1 @llvm.expect.i1(i1, i1) #1
|
|
91
|
|
92 ; Function Attrs: nounwind
|
252
|
93 declare ptr @llvm.invariant.start(i64, ptr nocapture) #1
|
236
|
94
|
|
95 ; Function Attrs: nounwind
|
252
|
96 declare void @llvm.invariant.end(ptr, i64, ptr nocapture) #1
|
236
|
97
|
|
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 }
|