Update Polly tests to handle explicitly typed gep changes in LLVM
[polly-mirror.git] / test / Isl / CodeGen / MemAccess / simple_analyze.ll
blob1636af22dc20e21ec786381cd94d8058f59dffc7
1 ;RUN: opt %loadPolly -polly-detect-unprofitable -polly-import-jscop -analyze -polly-import-jscop-dir=%S -polly-import-jscop-postfix=transformed < %s | FileCheck %s
2 ;RUN: opt %loadPolly -polly-detect-unprofitable -polly-import-jscop -polly-import-jscop-dir=%S -polly-import-jscop-postfix=transformed -polly-codegen-isl -polly-vectorizer=polly -S < %s | FileCheck %s --check-prefix=JSCOPVEC
3 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32"
5 @A = common global [100 x i32] zeroinitializer, align 4
6 @B = common global [100 x i32] zeroinitializer, align 4
8 define i32 @simple() nounwind {
9 entry:
10   br label %for.cond
12 for.cond:                                         ; preds = %for.inc, %entry
13   %0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
14   %arrayidx = getelementptr [100 x i32], [100 x i32]* @A, i32 0, i32 %0
15   %exitcond1 = icmp ne i32 %0, 12
16   br i1 %exitcond1, label %for.body, label %for.end
18 for.body:                                         ; preds = %for.cond
19   store i32 %0, i32* %arrayidx
20   br label %for.inc
22 for.inc:                                          ; preds = %for.body
23   %inc = add nsw i32 %0, 1
24   br label %for.cond
26 for.end:                                          ; preds = %for.cond
27   fence seq_cst
28   br label %for.cond4
30 for.cond4:                                        ; preds = %for.inc11, %for.end
31   %1 = phi i32 [ 0, %for.end ], [ %inc13, %for.inc11 ]
32   %arrayidx10 = getelementptr [100 x i32], [100 x i32]* @B, i32 0, i32 %1
33   %exitcond = icmp ne i32 %1, 12
34   br i1 %exitcond, label %for.body7, label %for.end14
36 for.body7:                                        ; preds = %for.cond4
37   store i32 %1, i32* %arrayidx10
38   br label %for.inc11
40 for.inc11:                                        ; preds = %for.body7
41   %inc13 = add nsw i32 %1, 1
42   br label %for.cond4
44 for.end14:                                        ; preds = %for.cond4
45   ret i32 0
47 ; CHECK-DAG: New access function '{ Stmt_for_body7[i0] -> MemRef_B[0] }'detected in JSCOP file
48 ; CHECK-DAG: New access function '{ Stmt_for_body[i0] -> MemRef_A[0] }'detected in JSCOP file
50 ; Verify that the new access function (see above) is actually used during vector code generation.
52 ; JSCOPVEC:  store i32 0, i32* getelementptr inbounds ([100 x i32]* @B, i32 0, i32 0)
53 ; JSCOPVEC:  store i32 1, i32* getelementptr inbounds ([100 x i32]* @B, i32 0, i32 0)
54 ; JSCOPVEC:  store i32 2, i32* getelementptr inbounds ([100 x i32]* @B, i32 0, i32 0)
55 ; JSCOPVEC:  store i32 3, i32* getelementptr inbounds ([100 x i32]* @B, i32 0, i32 0)
56 ; JSCOPVEC:  store i32 4, i32* getelementptr inbounds ([100 x i32]* @B, i32 0, i32 0)
57 ; JSCOPVEC:  store i32 5, i32* getelementptr inbounds ([100 x i32]* @B, i32 0, i32 0)
58 ; JSCOPVEC:  store i32 6, i32* getelementptr inbounds ([100 x i32]* @B, i32 0, i32 0)
59 ; JSCOPVEC:  store i32 7, i32* getelementptr inbounds ([100 x i32]* @B, i32 0, i32 0)
60 ; JSCOPVEC:  store i32 8, i32* getelementptr inbounds ([100 x i32]* @B, i32 0, i32 0)
61 ; JSCOPVEC:  store i32 9, i32* getelementptr inbounds ([100 x i32]* @B, i32 0, i32 0)
62 ; JSCOPVEC:  store i32 10, i32* getelementptr inbounds ([100 x i32]* @B, i32 0, i32 0)
63 ; JSCOPVEC:  store i32 11, i32* getelementptr inbounds ([100 x i32]* @B, i32 0, i32 0)
65 ; JSCOPVEC:  store i32 0, i32* getelementptr inbounds ([100 x i32]* @A, i32 0, i32 0)
66 ; JSCOPVEC:  store i32 1, i32* getelementptr inbounds ([100 x i32]* @A, i32 0, i32 0)
67 ; JSCOPVEC:  store i32 2, i32* getelementptr inbounds ([100 x i32]* @A, i32 0, i32 0)
68 ; JSCOPVEC:  store i32 3, i32* getelementptr inbounds ([100 x i32]* @A, i32 0, i32 0)
69 ; JSCOPVEC:  store i32 4, i32* getelementptr inbounds ([100 x i32]* @A, i32 0, i32 0)
70 ; JSCOPVEC:  store i32 5, i32* getelementptr inbounds ([100 x i32]* @A, i32 0, i32 0)
71 ; JSCOPVEC:  store i32 6, i32* getelementptr inbounds ([100 x i32]* @A, i32 0, i32 0)
72 ; JSCOPVEC:  store i32 7, i32* getelementptr inbounds ([100 x i32]* @A, i32 0, i32 0)
73 ; JSCOPVEC:  store i32 8, i32* getelementptr inbounds ([100 x i32]* @A, i32 0, i32 0)
74 ; JSCOPVEC:  store i32 9, i32* getelementptr inbounds ([100 x i32]* @A, i32 0, i32 0)
75 ; JSCOPVEC:  store i32 10, i32* getelementptr inbounds ([100 x i32]* @A, i32 0, i32 0)
76 ; JSCOPVEC:  store i32 11, i32* getelementptr inbounds ([100 x i32]* @A, i32 0, i32 0)