diff options
author | Max Kazantsev <max.kazantsev@azul.com> | 2018-02-07 11:16:29 +0000 |
---|---|---|
committer | Max Kazantsev <max.kazantsev@azul.com> | 2018-02-07 11:16:29 +0000 |
commit | b299ade2c5fe57a9f56849a412d1e39907c94dbb (patch) | |
tree | 4e807de022bb552d691ffad73d7460c91cd02362 /llvm/test/Transforms/IndVarSimplify/loop-invariant-conditions.ll | |
parent | 986b39b61f804b4783774a9024fab0bcc124af86 (diff) | |
download | bcm5719-llvm-b299ade2c5fe57a9f56849a412d1e39907c94dbb.tar.gz bcm5719-llvm-b299ade2c5fe57a9f56849a412d1e39907c94dbb.zip |
Re-enable "[SCEV] Make isLoopEntryGuardedByCond a bit smarter"
The failures happened because of assert which was overconfident about
SCEV's proving capabilities and is generally not valid.
Differential Revision: https://reviews.llvm.org/D42835
llvm-svn: 324473
Diffstat (limited to 'llvm/test/Transforms/IndVarSimplify/loop-invariant-conditions.ll')
-rw-r--r-- | llvm/test/Transforms/IndVarSimplify/loop-invariant-conditions.ll | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/llvm/test/Transforms/IndVarSimplify/loop-invariant-conditions.ll b/llvm/test/Transforms/IndVarSimplify/loop-invariant-conditions.ll index 70cf714ba9f..30249828107 100644 --- a/llvm/test/Transforms/IndVarSimplify/loop-invariant-conditions.ll +++ b/llvm/test/Transforms/IndVarSimplify/loop-invariant-conditions.ll @@ -325,6 +325,36 @@ exit: ret void } +; check that we can figure out that iv.next > 1 from the facts that iv >= 0 and +; iv.start != 0. +define void @test11(i64* %inc_ptr) { +; CHECK-LABEL: @test11 +entry: + %inc = load i64, i64* %inc_ptr, !range !0 + %ne.cond = icmp ne i64 %inc, 0 + br i1 %ne.cond, label %loop, label %exit + +loop: + %iv = phi i64 [ %inc, %entry ], [ %iv.next, %backedge ] + %iv.next = add i64 %iv, 1 + %brcond = icmp sgt i64 %iv.next, 1 + ; CHECK: br i1 true, label %if.true, label %if.false + br i1 %brcond, label %if.true, label %if.false + +if.true: + br label %backedge + +if.false: + br label %backedge + +backedge: + %loopcond = icmp slt i64 %iv, 200 + br i1 %loopcond, label %loop, label %exit + +exit: + ret void +} + !1 = !{i64 -1, i64 100} |