diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-06-15 21:24:34 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-06-15 21:24:34 +0000 |
commit | b9bff5880a34c105f643fb7660c26a07c4257bf3 (patch) | |
tree | 761b40014439758d3a442e44829c376a6e571f8f /llvm/lib/CodeGen/IfConversion.cpp | |
parent | ad0dba582f94b2d3571b344ff746ab75c4c62b52 (diff) | |
download | bcm5719-llvm-b9bff5880a34c105f643fb7660c26a07c4257bf3.tar.gz bcm5719-llvm-b9bff5880a34c105f643fb7660c26a07c4257bf3.zip |
ifcvt should ignore cfg where true and false successors are the same.
llvm-svn: 73423
Diffstat (limited to 'llvm/lib/CodeGen/IfConversion.cpp')
-rw-r--r-- | llvm/lib/CodeGen/IfConversion.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/IfConversion.cpp b/llvm/lib/CodeGen/IfConversion.cpp index 1d0887f843d..4d5c3c2c7dc 100644 --- a/llvm/lib/CodeGen/IfConversion.cpp +++ b/llvm/lib/CodeGen/IfConversion.cpp @@ -547,7 +547,11 @@ void IfConverter::ScanInstructions(BBInfo &BBI) { // 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 @@ IfConverter::BBInfo &IfConverter::AnalyzeBlock(MachineBasicBlock *BB, 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); |