diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-08-13 20:49:04 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-08-13 20:49:04 +0000 |
commit | bc70ff3cb977fd69e120d89b0e04f316d87cdbef (patch) | |
tree | 0fede6c992792ca0cd0d49926ec4731d9d964f7d /test | |
parent | d252aa43c91027f3f6234c06c7a05c498d73a954 (diff) | |
download | external_llvm-bc70ff3cb977fd69e120d89b0e04f316d87cdbef.zip external_llvm-bc70ff3cb977fd69e120d89b0e04f316d87cdbef.tar.gz external_llvm-bc70ff3cb977fd69e120d89b0e04f316d87cdbef.tar.bz2 |
Handle extra Tail predecessors in if-conversion.
It is still possible to if-convert if the tail block has extra
predecessors, but the tail phis must be rewritten instead of being
removed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161781 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/X86/early-ifcvt.ll | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/CodeGen/X86/early-ifcvt.ll b/test/CodeGen/X86/early-ifcvt.ll index ce1fe04..7883ffa 100644 --- a/test/CodeGen/X86/early-ifcvt.ll +++ b/test/CodeGen/X86/early-ifcvt.ll @@ -37,3 +37,33 @@ do.end: %sub = sub nsw i32 %max.1, %min.1 ret i32 %sub } + +; CHECK: multipreds +; Deal with alternative tail predecessors +; CHECK-NOT: LBB +; CHECK: cmov +; CHECK-NOT: LBB +; CHECK: cmov +; CHECK-NOT: LBB +; CHECK: fprintf + +define void @multipreds(i32 %sw) nounwind uwtable ssp { +entry: + switch i32 %sw, label %if.then29 [ + i32 0, label %if.then37 + i32 127, label %if.end41 + ] + +if.then29: + br label %if.end41 + +if.then37: + br label %if.end41 + +if.end41: + %exit_status.0 = phi i32 [ 2, %if.then29 ], [ 0, %if.then37 ], [ 66, %entry ] + call void (...)* @fprintf(i32 %exit_status.0) nounwind + unreachable +} + +declare void @fprintf(...) nounwind |