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
This commit is contained in:
Evan Cheng 2007-06-19 21:45:13 +00:00
parent c3c949b473
commit a955c02c9b
1 changed files with 4 additions and 1 deletions

View File

@ -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