Update Polly tests to handle explicitly typed gep changes in LLVM
[polly-mirror.git] / test / Isl / Ast / reduction_multiple_dimensions.ll
blob24e6467518c8444e87b07701bf3b2dbc454b9d89
1 ; RUN: opt %loadPolly -polly-detect-unprofitable -polly-ast -polly-ast-detect-parallel -analyze < %s | FileCheck %s
3 ; CHECK-NOT:#pragma known-parallel reduction
4 ; CHECK:    #pragma known-parallel
5 ; CHECK:    for (int c0 = 0; c0 <= 2047; c0 += 1)
6 ; CHECK:      for (int c1 = 0; c1 <= 1023; c1 += 1)
7 ; CHECK:        #pragma simd reduction
8 ; CHECK:        for (int c2 = 0; c2 <= 511; c2 += 1)
9 ; CHECK:          Stmt_for_body6(c0, c1, c2);
11 ;    void rmd(int *A) {
12 ;      for (long i = 0; i < 2048; i++)
13 ;        for (long j = 0; j < 1024; j++)
14 ;          for (long k = 0; k < 512; k++)
15 ;            A[i] += i;
16 ;    }
18 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
20 define void @rmd(i32* %A) {
21 entry:
22   br label %for.cond
24 for.cond:                                         ; preds = %for.inc10, %entry
25   %i.0 = phi i32 [ 0, %entry ], [ %inc11, %for.inc10 ]
26   %exitcond2 = icmp ne i32 %i.0, 2048
27   br i1 %exitcond2, label %for.body, label %for.end12
29 for.body:                                         ; preds = %for.cond
30   br label %for.cond1
32 for.cond1:                                        ; preds = %for.inc7, %for.body
33   %j.0 = phi i32 [ 0, %for.body ], [ %inc8, %for.inc7 ]
34   %exitcond1 = icmp ne i32 %j.0, 1024
35   br i1 %exitcond1, label %for.body3, label %for.end9
37 for.body3:                                        ; preds = %for.cond1
38   br label %for.cond4
40 for.cond4:                                        ; preds = %for.inc, %for.body3
41   %k.0 = phi i32 [ 0, %for.body3 ], [ %inc, %for.inc ]
42   %exitcond = icmp ne i32 %k.0, 512
43   br i1 %exitcond, label %for.body6, label %for.end
45 for.body6:                                        ; preds = %for.cond4
46   %arrayidx = getelementptr inbounds i32, i32* %A, i32 %i.0
47   %tmp = load i32* %arrayidx, align 4
48   %add = add nsw i32 %tmp, %i.0
49   store i32 %add, i32* %arrayidx, align 4
50   br label %for.inc
52 for.inc:                                          ; preds = %for.body6
53   %inc = add nsw i32 %k.0, 1
54   br label %for.cond4
56 for.end:                                          ; preds = %for.cond4
57   br label %for.inc7
59 for.inc7:                                         ; preds = %for.end
60   %inc8 = add nsw i32 %j.0, 1
61   br label %for.cond1
63 for.end9:                                         ; preds = %for.cond1
64   br label %for.inc10
66 for.inc10:                                        ; preds = %for.end9
67   %inc11 = add nsw i32 %i.0, 1
68   br label %for.cond
70 for.end12:                                        ; preds = %for.cond
71   ret void