Update Polly tests to handle explicitly typed gep changes in LLVM
[polly-mirror.git] / test / Isl / Ast / reduction_in_one_dimension.ll
blob5aec5835ac02ff29aaadeee6ba577e98e87a74f1
1 ; RUN: opt %loadPolly -polly-detect-unprofitable -polly-ast -polly-ast-detect-parallel -analyze < %s | FileCheck %s
3 ; Verify that we won't privatize anything in the outer dimension
5 ; CHECK:    #pragma known-parallel
6 ; CHECK:    for (int c0 = 0; c0 < 2 * n; c0 += 1)
7 ; CHECK:      #pragma simd reduction
8 ; CHECK:      for (int c1 = 0; c1 <= 1023; c1 += 1)
9 ; CHECK:        Stmt_for_body3(c0, c1);
11 ;    void foo(int *A, long n) {
12 ;      for (long i = 0; i < 2 * n; i++)
13 ;        for (long j = 0; j < 1024; j++)
14 ;          A[i] += i;
15 ;    }
17 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
19 define void @foo(i32* %A, i32 %n) {
20 entry:
21   br label %for.cond
23 for.cond:                                         ; preds = %for.inc4, %entry
24   %i.0 = phi i32 [ 0, %entry ], [ %inc5, %for.inc4 ]
25   %mul = shl nsw i32 %n, 1
26   %cmp = icmp slt i32 %i.0, %mul
27   br i1 %cmp, label %for.body, label %for.end6
29 for.body:                                         ; preds = %for.cond
30   br label %for.cond1
32 for.cond1:                                        ; preds = %for.inc, %for.body
33   %j.0 = phi i32 [ 0, %for.body ], [ %inc, %for.inc ]
34   %exitcond = icmp ne i32 %j.0, 1024
35   br i1 %exitcond, label %for.body3, label %for.end
37 for.body3:                                        ; preds = %for.cond1
38   %arrayidx = getelementptr inbounds i32, i32* %A, i32 %i.0
39   %tmp = load i32* %arrayidx, align 4
40   %add = add nsw i32 %tmp, %i.0
41   store i32 %add, i32* %arrayidx, align 4
42   br label %for.inc
44 for.inc:                                          ; preds = %for.body3
45   %inc = add nsw i32 %j.0, 1
46   br label %for.cond1
48 for.end:                                          ; preds = %for.cond1
49   br label %for.inc4
51 for.inc4:                                         ; preds = %for.end
52   %inc5 = add nsw i32 %i.0, 1
53   br label %for.cond
55 for.end6:                                         ; preds = %for.cond
56   ret void