[ScopInfo] Expect the OriginalBaseAddr when looking at underlying instructions [NFC]
[polly-mirror.git] / test / DependenceInfo / reduction_simple_iv.ll
blob53553b27cc08d86cc253392012eec50e0e340e96
1 ; RUN: opt %loadPolly -polly-dependences -analyze < %s | FileCheck %s
3 ; CHECK:      RAW dependences:
4 ; CHECK-NEXT:     {  }
5 ; CHECK-NEXT: WAR dependences:
6 ; CHECK-NEXT:     {  }
7 ; CHECK-NEXT: WAW dependences:
8 ; CHECK-NEXT:     {  }
9 ; CHECK-NEXT: Reduction dependences:
10 ; CHECK-NEXT:     { Stmt_for_cond[i0] -> Stmt_for_cond[1 + i0] : 0 <= i0 <= 99 }
12 ; void f(int* sum) {
13 ;   for (int i = 0; i <= 100; i++)
14 ;     sum += i * 3;
15 ; }
16 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
18 define void @f(i32* %sum) {
19 entry:
20   br label %entry.split1
22 entry.split1:                                     ; preds = %entry
23   br label %entry.split
25 entry.split:                                      ; preds = %entry.split1
26   br label %for.cond
28 for.cond:                                         ; preds = %for.cond, %entry.split
29   %i1.0 = phi i32 [ 0, %entry.split ], [ %inc, %for.cond ]
30   %sum.reload = load i32, i32* %sum
31   %mul = mul nsw i32 %i1.0, 3
32   %add = add nsw i32 %sum.reload, %mul
33   %inc = add nsw i32 %i1.0, 1
34   store i32 %add, i32* %sum
35   %cmp = icmp slt i32 %i1.0, 100
36   br i1 %cmp, label %for.cond, label %for.end
38 for.end:                                          ; preds = %for.cond
39   ret void