diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-06-19 21:45:13 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-06-19 21:45:13 +0000 |
commit | 9ffd340daf00fb6e2bbfe6dafd5b7130070b1578 (patch) | |
tree | 7f8501bdbe1d7b5d4cb93f1f736ee74f8db77840 /lib/CodeGen/IfConversion.cpp | |
parent | 277f0741c5ea123b30360c382a153df238c31cae (diff) | |
download | external_llvm-9ffd340daf00fb6e2bbfe6dafd5b7130070b1578.zip external_llvm-9ffd340daf00fb6e2bbfe6dafd5b7130070b1578.tar.gz external_llvm-9ffd340daf00fb6e2bbfe6dafd5b7130070b1578.tar.bz2 |
Avoid if-converting simple block that ends with unconditional branch or fallthrough unless it branches / falls to the 'false' block. Not profitable, may end up increasing code size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37660 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/IfConversion.cpp')
-rw-r--r-- | lib/CodeGen/IfConversion.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/IfConversion.cpp b/lib/CodeGen/IfConversion.cpp index 965cf6a..64328d6 100644 --- a/lib/CodeGen/IfConversion.cpp +++ b/lib/CodeGen/IfConversion.cpp @@ -399,6 +399,9 @@ bool IfConverter::ValidSimple(BBInfo &TrueBBI, unsigned &Dups) const { if (TrueBBI.IsBeingAnalyzed || TrueBBI.IsDone) return false; + if (TrueBBI.IsBrAnalyzable) + return false; + if (TrueBBI.BB->pred_size() > 1) { if (TrueBBI.CannotBeCopied || TrueBBI.NonPredSize > TLI->getIfCvtDupBlockSizeLimit()) @@ -406,7 +409,7 @@ bool IfConverter::ValidSimple(BBInfo &TrueBBI, unsigned &Dups) const { Dups = TrueBBI.NonPredSize; } - return !blockAlwaysFallThrough(TrueBBI) && TrueBBI.BrCond.size() == 0; + return true; } /// ValidTriangle - Returns true if the 'true' and 'false' blocks (along |