[llvm-commits] [llvm] r73423 - in /llvm/trunk: lib/CodeGen/IfConversion.cpp test/CodeGen/ARM/ifcvt9.ll
Evan Cheng
evan.cheng at apple.com
Mon Jun 15 14:24:34 PDT 2009
Author: evancheng
Date: Mon Jun 15 16:24:34 2009
New Revision: 73423
URL: http://llvm.org/viewvc/llvm-project?rev=73423&view=rev
Log:
ifcvt should ignore cfg where true and false successors are the same.
Added:
llvm/trunk/test/CodeGen/ARM/ifcvt9.ll
Modified:
llvm/trunk/lib/CodeGen/IfConversion.cpp
Modified: llvm/trunk/lib/CodeGen/IfConversion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/IfConversion.cpp?rev=73423&r1=73422&r2=73423&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/IfConversion.cpp (original)
+++ llvm/trunk/lib/CodeGen/IfConversion.cpp Mon Jun 15 16:24:34 2009
@@ -547,7 +547,11 @@
// fallthrough.
if (!BBI.FalseBB)
BBI.FalseBB = findFalseBlock(BBI.BB, BBI.TrueBB);
- assert(BBI.FalseBB && "Expected to find the fallthrough block!");
+ if (!BBI.FalseBB) {
+ // Malformed bcc? True and false blocks are the same?
+ BBI.IsUnpredicable = true;
+ return;
+ }
}
// Then scan all the instructions.
@@ -663,6 +667,13 @@
return BBI;
}
+ // Do not ifcvt if true and false fallthrough blocks are the same.
+ if (!BBI.FalseBB) {
+ BBI.IsBeingAnalyzed = false;
+ BBI.IsAnalyzed = true;
+ return BBI;
+ }
+
BBInfo &TrueBBI = AnalyzeBlock(BBI.TrueBB, Tokens);
BBInfo &FalseBBI = AnalyzeBlock(BBI.FalseBB, Tokens);
Added: llvm/trunk/test/CodeGen/ARM/ifcvt9.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/ifcvt9.ll?rev=73423&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/ifcvt9.ll (added)
+++ llvm/trunk/test/CodeGen/ARM/ifcvt9.ll Mon Jun 15 16:24:34 2009
@@ -0,0 +1,12 @@
+; RUN: llvm-as < %s | llc -march=arm
+
+define fastcc void @t() nounwind {
+entry:
+ br i1 undef, label %bb.i.i3, label %growMapping.exit
+
+bb.i.i3: ; preds = %entry
+ unreachable
+
+growMapping.exit: ; preds = %entry
+ unreachable
+}
More information about the llvm-commits
mailing list