Andrew Top | 61a8495 | 2019-04-30 15:07:33 -0700 | [diff] [blame] | 1 | ; RUN: opt %loadPolly -polly-dependences -analyze < %s | FileCheck %s |
| 2 | ; |
| 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 } |
| 11 | ; |
| 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" |
| 17 | |
| 18 | define void @f(i32* %sum) { |
| 19 | entry: |
| 20 | br label %entry.split1 |
| 21 | |
| 22 | entry.split1: ; preds = %entry |
| 23 | br label %entry.split |
| 24 | |
| 25 | entry.split: ; preds = %entry.split1 |
| 26 | br label %for.cond |
| 27 | |
| 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 |
| 37 | |
| 38 | for.end: ; preds = %for.cond |
| 39 | ret void |
| 40 | } |