summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/early-ifcvt.ll
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-08-13 20:49:04 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-08-13 20:49:04 +0000
commitbc70ff3cb977fd69e120d89b0e04f316d87cdbef (patch)
tree0fede6c992792ca0cd0d49926ec4731d9d964f7d /test/CodeGen/X86/early-ifcvt.ll
parentd252aa43c91027f3f6234c06c7a05c498d73a954 (diff)
downloadllvm-bc70ff3cb977fd69e120d89b0e04f316d87cdbef.tar.gz
llvm-bc70ff3cb977fd69e120d89b0e04f316d87cdbef.tar.bz2
llvm-bc70ff3cb977fd69e120d89b0e04f316d87cdbef.tar.xz
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/CodeGen/X86/early-ifcvt.ll')
-rw-r--r--test/CodeGen/X86/early-ifcvt.ll30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/CodeGen/X86/early-ifcvt.ll b/test/CodeGen/X86/early-ifcvt.ll
index ce1fe04f98..7883ffabd5 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