Update Polly tests to handle explicitly typed gep changes in LLVM
[polly-mirror.git] / test / Isl / Ast / reduction_loop_reversal.ll
blob81a53e18596b4a1ab0fc55c61ddece71caf56360
1 ; RUN: opt %loadPolly -polly-detect-unprofitable -polly-import-jscop-dir=%S -polly-import-jscop -polly-ast -polly-ast-detect-parallel -analyze < %s | FileCheck %s
3 ; CHECK-NOT: #pragma simd{{\s*$}}
4 ; CHECK: #pragma simd reduction
5 ; CHECK: Stmt_S0(n - c1)
6 ; CHECK: #pragma simd{{\s*$}}
7 ; CHECK: Stmt_S1(n - c1)
9 ;    void rlr(int *A, long n) {
10 ;      for (long i = 0; i < 2 * n; i++)
11 ; S0:    A[0] += i;
12 ;      for (long i = 0; i < 2 * n; i++)
13 ; S1:    A[i + 1] = 1;
14 ;    }
16 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
18 define void @rlr(i32* %A, i32 %n) {
19 entry:
20   br label %for.cond
22 for.cond:                                         ; preds = %for.inc, %entry
23   %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
24   %mul = shl nsw i32 %n, 1
25   %cmp = icmp slt i32 %i.0, %mul
26   br i1 %cmp, label %for.body, label %for.end
28 for.body:                                         ; preds = %for.cond
29   br label %S0
31 S0:                                               ; preds = %for.body
32   %tmp = load i32* %A, align 4
33   %add = add nsw i32 %tmp, %i.0
34   store i32 %add, i32* %A, align 4
35   br label %for.inc
37 for.inc:                                          ; preds = %S0
38   %inc = add nsw i32 %i.0, 1
39   br label %for.cond
41 for.end:                                          ; preds = %for.cond
42   br label %for.cond2
44 for.cond2:                                        ; preds = %for.inc8, %for.end
45   %i1.0 = phi i32 [ 0, %for.end ], [ %inc9, %for.inc8 ]
46   %mul3 = shl nsw i32 %n, 1
47   %cmp4 = icmp slt i32 %i1.0, %mul3
48   br i1 %cmp4, label %for.body5, label %for.end10
50 for.body5:                                        ; preds = %for.cond2
51   br label %S1
53 S1:                                               ; preds = %for.body5
54   %add6 = add nsw i32 %i1.0, 1
55   %arrayidx7 = getelementptr inbounds i32, i32* %A, i32 %add6
56   store i32 1, i32* %arrayidx7, align 4
57   br label %for.inc8
59 for.inc8:                                         ; preds = %S1
60   %inc9 = add nsw i32 %i1.0, 1
61   br label %for.cond2
63 for.end10:                                        ; preds = %for.cond2
64   ret void