Update Polly tests to handle explicitly typed gep changes in LLVM
[polly-mirror.git] / test / ScopInfo / reduction_alternating_base.ll
blob2bb5add0f12ff546fac74f92a3d86a611442ebbb
1 ; RUN: opt %loadPolly -polly-detect-unprofitable -polly-scops -analyze < %s | FileCheck %s
3 ; FIXME: We cannot detect this SCoP yet but as soon as we can we should check
4 ;        that the reduction is detected!
6 ; CHECK-NOT: Scattering
8 ;    void f(int *A) {
9 ;      for (int i = 0; i < 1024; i++)
10 ;        A[i % 2] += i;
11 ;    }
13 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
15 define void @f(i32* %A) {
16 entry:
17   br label %for.cond
19 for.cond:                                         ; preds = %for.inc, %entry
20   %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
21   %exitcond = icmp ne i32 %i.0, 1024
22   br i1 %exitcond, label %for.body, label %for.end
24 for.body:                                         ; preds = %for.cond
25   %rem = srem i32 %i.0, 2
26   %arrayidx = getelementptr inbounds i32, i32* %A, i32 %rem
27   %tmp = load i32* %arrayidx, align 4
28   %add = add nsw i32 %tmp, %i.0
29   store i32 %add, i32* %arrayidx, align 4
30   br label %for.inc
32 for.inc:                                          ; preds = %for.body
33   %inc = add nsw i32 %i.0, 1
34   br label %for.cond
36 for.end:                                          ; preds = %for.cond
37   ret void