summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-06-19 21:45:13 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-06-19 21:45:13 +0000
commita955c02c9b689f429876181b4618980f42023ac2 (patch)
tree0a1f6f6430c7f936e7e56eb4dd371f0dfc9e70f7 /llvm/lib/CodeGen
parentc3c949b473b8ceea221e23bfa6b162d00553785e (diff)
downloadbcm5719-llvm-a955c02c9b689f429876181b4618980f42023ac2.tar.gz
bcm5719-llvm-a955c02c9b689f429876181b4618980f42023ac2.zip
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.
llvm-svn: 37660
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/IfConversion.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/IfConversion.cpp b/llvm/lib/CodeGen/IfConversion.cpp
index 965cf6af191..64328d6e04f 100644
--- a/llvm/lib/CodeGen/IfConversion.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud