Evgeny Stupachenko | 3e2f389 | 2016-06-08 20:21:24 +0000 | [diff] [blame^] | 1 | ; RUN: opt < %s -S -loop-unroll -unroll-count=2 | FileCheck %s |
| 2 | ; Checks that "llvm.loop.unroll.disable" is set when |
| 3 | ; unroll with count set by user has been applied. |
| 4 | ; |
| 5 | ; CHECK-LABEL: @foo( |
| 6 | ; CHECK: llvm.loop.unroll.disable |
| 7 | |
| 8 | define void @foo(i32* nocapture %a) { |
| 9 | entry: |
| 10 | br label %for.body |
| 11 | |
| 12 | for.body: ; preds = %for.body, %entry |
| 13 | %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] |
| 14 | %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv |
| 15 | %0 = load i32, i32* %arrayidx, align 4 |
| 16 | %inc = add nsw i32 %0, 1 |
| 17 | store i32 %inc, i32* %arrayidx, align 4 |
| 18 | %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 |
| 19 | %exitcond = icmp eq i64 %indvars.iv.next, 64 |
| 20 | br i1 %exitcond, label %for.end, label %for.body |
| 21 | |
| 22 | for.end: ; preds = %for.body |
| 23 | ret void |
| 24 | } |
| 25 | |