diff options
| author | Max Kazantsev <max.kazantsev@azul.com> | 2018-12-28 06:22:39 +0000 |
|---|---|---|
| committer | Max Kazantsev <max.kazantsev@azul.com> | 2018-12-28 06:22:39 +0000 |
| commit | 530ff8f3ccc4bcf9acb27c0dff235e3f3616c675 (patch) | |
| tree | 570ca941c3d14c479ac936d09714e63dde5627dd /llvm/test/Transforms | |
| parent | 80e4b40f3e46e6c824853a0965e505b23293fe58 (diff) | |
| download | bcm5719-llvm-530ff8f3ccc4bcf9acb27c0dff235e3f3616c675.tar.gz bcm5719-llvm-530ff8f3ccc4bcf9acb27c0dff235e3f3616c675.zip | |
Temporarily disable term folding in LoopSimplifyCFG, add tests
llvm-svn: 350117
Diffstat (limited to 'llvm/test/Transforms')
| -rw-r--r-- | llvm/test/Transforms/LoopSimplifyCFG/constant-fold-branch.ll | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/llvm/test/Transforms/LoopSimplifyCFG/constant-fold-branch.ll b/llvm/test/Transforms/LoopSimplifyCFG/constant-fold-branch.ll index 919c10c39ec..db5f0f1f3f2 100644 --- a/llvm/test/Transforms/LoopSimplifyCFG/constant-fold-branch.ll +++ b/llvm/test/Transforms/LoopSimplifyCFG/constant-fold-branch.ll @@ -1,4 +1,7 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py +; XFAIL: * +; Tests complex_dead_subloop_branch and complex_dead_subloop_switch fail an +; assertion, therefore the CFG simplification is temporarily disabled. ; REQUIRES: asserts ; RUN: opt -S -enable-loop-simplifycfg-term-folding=true -loop-simplifycfg -debug-only=loop-simplifycfg -verify-loop-info -verify-dom-info -verify-loop-lcssa 2>&1 < %s | FileCheck %s ; RUN: opt -S -enable-loop-simplifycfg-term-folding=true -passes='require<domtree>,loop(simplify-cfg)' -debug-only=loop-simplifycfg -verify-loop-info -verify-dom-info -verify-loop-lcssa 2>&1 < %s | FileCheck %s @@ -2507,3 +2510,59 @@ loop_1_backedge: exit: ret i32 %i } + +define i32 @complex_dead_subloop_branch(i1 %cond1, i1 %cond2, i1 %cond3) { +entry: + br label %loop + +loop: + br i1 true, label %latch, label %subloop + +subloop: + br i1 %cond1, label %x, label %y + +x: + br label %subloop_latch + +y: + br label %subloop_latch + +subloop_latch: + %dead_phi = phi i32 [ 1, %x ], [ 2, %y ] + br i1 %cond2, label %latch, label %subloop + +latch: + %result = phi i32 [ 0, %loop ], [ %dead_phi, %subloop_latch ] + br i1 %cond3, label %loop, label %exit + +exit: + ret i32 %result +} + +define i32 @complex_dead_subloop_switch(i1 %cond1, i1 %cond2, i1 %cond3) { +entry: + br label %loop + +loop: + switch i32 1, label %latch [ i32 0, label %subloop ] + +subloop: + br i1 %cond1, label %x, label %y + +x: + br label %subloop_latch + +y: + br label %subloop_latch + +subloop_latch: + %dead_phi = phi i32 [ 1, %x ], [ 2, %y ] + br i1 %cond2, label %latch, label %subloop + +latch: + %result = phi i32 [ 0, %loop ], [ %dead_phi, %subloop_latch ] + br i1 %cond3, label %loop, label %exit + +exit: + ret i32 %result +} |

