236
|
1 ; RUN: opt %loadPolly -basic-aa -polly-print-detect -disable-output < %s | FileCheck %s
|
150
|
2 ;
|
|
3 ; Verify that we allow the misc intrinsics.
|
|
4 ;
|
|
5 ; CHECK: Valid Region for Scop: for.cond => for.end13
|
|
6 ;
|
|
7 ; int A[1024];
|
|
8 ; void jd() {
|
|
9 ; for (int i = 0; i < 1024; i++) {
|
|
10 ; int tmp[1024];
|
|
11 ; for (int j = i; j < 1024; j++)
|
|
12 ; tmp[i] += A[j];
|
|
13 ; A[i] = tmp[i];
|
|
14 ; }
|
|
15 ; }
|
|
16 ;
|
|
17 ; ModuleID = 'test/Isl/CodeGen/lifetime_intrinsics.ll'
|
|
18 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
|
19
|
|
20 @A = common global [1024 x i32] zeroinitializer, align 16
|
|
21
|
|
22 ; Function Attrs: nounwind uwtable
|
|
23 define void @jd() #0 {
|
|
24 entry:
|
|
25 %tmp = alloca [1024 x i32], align 16
|
|
26 br label %for.cond
|
|
27
|
|
28 for.cond: ; preds = %for.inc11, %entry
|
|
29 %indvars.iv3 = phi i64 [ %indvars.iv.next4, %for.inc11 ], [ 0, %entry ]
|
|
30 %exitcond5 = icmp ne i64 %indvars.iv3, 1024
|
|
31 br i1 %exitcond5, label %for.body, label %for.end13
|
|
32
|
|
33 for.body: ; preds = %for.cond
|
252
|
34 %lis = call ptr @llvm.invariant.start(i64 4096, ptr @A) #1
|
150
|
35 br label %for.cond2
|
|
36
|
|
37 for.cond2: ; preds = %for.inc, %for.body
|
|
38 %indvars.iv1 = phi i64 [ %indvars.iv.next2, %for.inc ], [ %indvars.iv3, %for.body ]
|
|
39 %lftr.wideiv = trunc i64 %indvars.iv1 to i32
|
|
40 %exitcond = icmp ne i32 %lftr.wideiv, 1024
|
|
41 br i1 %exitcond, label %for.body4, label %for.end
|
|
42
|
|
43 for.body4: ; preds = %for.cond2
|
|
44 call void @llvm.assume(i1 %exitcond)
|
|
45 call i1 @llvm.expect.i1(i1 %exitcond, i1 1)
|
252
|
46 %arrayidx = getelementptr inbounds [1024 x i32], ptr @A, i64 0, i64 %indvars.iv1
|
|
47 %tmp6 = load i32, ptr %arrayidx, align 4
|
|
48 %arrayidx6 = getelementptr inbounds [1024 x i32], ptr %tmp, i64 0, i64 %indvars.iv3
|
150
|
49 call void @llvm.donothing()
|
252
|
50 %tmp7 = load i32, ptr %arrayidx6, align 4
|
150
|
51 %add = add nsw i32 %tmp7, %tmp6
|
252
|
52 store i32 %add, ptr %arrayidx6, align 4
|
150
|
53 br label %for.inc
|
|
54
|
|
55 for.inc: ; preds = %for.body4
|
|
56 %indvars.iv.next2 = add nuw nsw i64 %indvars.iv1, 1
|
|
57 br label %for.cond2
|
|
58
|
|
59 for.end: ; preds = %for.cond2
|
252
|
60 %arrayidx8 = getelementptr inbounds [1024 x i32], ptr %tmp, i64 0, i64 %indvars.iv3
|
|
61 %tmp8 = load i32, ptr %arrayidx8, align 4
|
|
62 %arrayidx10 = getelementptr inbounds [1024 x i32], ptr @A, i64 0, i64 %indvars.iv3
|
|
63 call void @llvm.invariant.end(ptr %lis, i64 4096, ptr @A) #1
|
|
64 store i32 %tmp8, ptr %arrayidx10, align 4
|
150
|
65 br label %for.inc11
|
|
66
|
|
67 for.inc11: ; preds = %for.end
|
|
68 %indvars.iv.next4 = add nuw nsw i64 %indvars.iv3, 1
|
|
69 br label %for.cond
|
|
70
|
|
71 for.end13: ; preds = %for.cond
|
|
72 ret void
|
|
73 }
|
|
74
|
|
75 ; Function Attrs: nounwind
|
|
76 declare void @llvm.donothing() #1
|
|
77
|
|
78 ; Function Attrs: nounwind
|
|
79 declare void @llvm.assume(i1) #1
|
|
80
|
|
81 ; Function Attrs: nounwind
|
|
82 declare i1 @llvm.expect.i1(i1, i1) #1
|
|
83
|
|
84 ; Function Attrs: nounwind
|
252
|
85 declare ptr @llvm.invariant.start(i64, ptr nocapture) #1
|
150
|
86
|
|
87 ; Function Attrs: nounwind
|
252
|
88 declare void @llvm.invariant.end(ptr, i64, ptr nocapture) #1
|
150
|
89
|
|
90 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" }
|
|
91 attributes #1 = { nounwind }
|