Update Polly tests to handle explicitly typed gep changes in LLVM
[polly-mirror.git] / test / ScopDetect / intrinsics_3.ll
blob94c3aed66254daf10f77e45dca67407d15a42511
1 ; RUN: opt %loadPolly -polly-detect-unprofitable -basicaa -polly-detect -analyze < %s | FileCheck %s
3 ; Verify that we allow the misc intrinsics.
5 ; CHECK: Valid Region for Scop: for.cond => for.end13
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 ;    }
17 ; ModuleID = 'test/Isl/CodeGen/lifetime_intrinsics.ll'
18 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
19 target triple = "x86_64-unknown-linux-gnu"
21 @A = common global [1024 x i32] zeroinitializer, align 16
23 ; Function Attrs: nounwind uwtable
24 define void @jd() #0 {
25 entry:
26   %tmp = alloca [1024 x i32], align 16
27   %tmp3 = bitcast [1024 x i32]* @A to i8*
28   br label %for.cond
30 for.cond:                                         ; preds = %for.inc11, %entry
31   %indvars.iv3 = phi i64 [ %indvars.iv.next4, %for.inc11 ], [ 0, %entry ]
32   %exitcond5 = icmp ne i64 %indvars.iv3, 1024
33   br i1 %exitcond5, label %for.body, label %for.end13
35 for.body:                                         ; preds = %for.cond
36   %lis = call {}* @llvm.invariant.start(i64 4096, i8* %tmp3) #1
37   br label %for.cond2
39 for.cond2:                                        ; preds = %for.inc, %for.body
40   %indvars.iv1 = phi i64 [ %indvars.iv.next2, %for.inc ], [ %indvars.iv3, %for.body ]
41   %lftr.wideiv = trunc i64 %indvars.iv1 to i32
42   %exitcond = icmp ne i32 %lftr.wideiv, 1024
43   br i1 %exitcond, label %for.body4, label %for.end
45 for.body4:                                        ; preds = %for.cond2
46   call void @llvm.assume(i1 %exitcond)
47   call i1 @llvm.expect.i1(i1 %exitcond, i1 1)
48   %arrayidx = getelementptr inbounds [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvars.iv1
49   %tmp6 = load i32* %arrayidx, align 4
50   %arrayidx6 = getelementptr inbounds [1024 x i32], [1024 x i32]* %tmp, i64 0, i64 %indvars.iv3
51   call void @llvm.donothing()
52   %tmp7 = load i32* %arrayidx6, align 4
53   %add = add nsw i32 %tmp7, %tmp6
54   store i32 %add, i32* %arrayidx6, align 4
55   br label %for.inc
57 for.inc:                                          ; preds = %for.body4
58   %indvars.iv.next2 = add nuw nsw i64 %indvars.iv1, 1
59   br label %for.cond2
61 for.end:                                          ; preds = %for.cond2
62   %arrayidx8 = getelementptr inbounds [1024 x i32], [1024 x i32]* %tmp, i64 0, i64 %indvars.iv3
63   %tmp8 = load i32* %arrayidx8, align 4
64   %arrayidx10 = getelementptr inbounds [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvars.iv3
65   call void @llvm.invariant.end({}* %lis, i64 4096, i8* %tmp3) #1
66   store i32 %tmp8, i32* %arrayidx10, align 4
67   br label %for.inc11
69 for.inc11:                                        ; preds = %for.end
70   %indvars.iv.next4 = add nuw nsw i64 %indvars.iv3, 1
71   br label %for.cond
73 for.end13:                                        ; preds = %for.cond
74   ret void
77 ; Function Attrs: nounwind
78 declare void @llvm.donothing() #1
80 ; Function Attrs: nounwind
81 declare void @llvm.assume(i1) #1
83 ; Function Attrs: nounwind
84 declare i1 @llvm.expect.i1(i1, i1) #1
86 ; Function Attrs: nounwind
87 declare {}* @llvm.invariant.start(i64, i8* nocapture) #1
89 ; Function Attrs: nounwind
90 declare void @llvm.invariant.end({}*, i64, i8* nocapture) #1
92 attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" "use-soft-float"="false" }
93 attributes #1 = { nounwind }