mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 22:28:18 +00:00
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
This commit is contained in:
@@ -399,6 +399,9 @@ bool IfConverter::ValidSimple(BBInfo &TrueBBI, unsigned &Dups) const {
|
|||||||
if (TrueBBI.IsBeingAnalyzed || TrueBBI.IsDone)
|
if (TrueBBI.IsBeingAnalyzed || TrueBBI.IsDone)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (TrueBBI.IsBrAnalyzable)
|
||||||
|
return false;
|
||||||
|
|
||||||
if (TrueBBI.BB->pred_size() > 1) {
|
if (TrueBBI.BB->pred_size() > 1) {
|
||||||
if (TrueBBI.CannotBeCopied ||
|
if (TrueBBI.CannotBeCopied ||
|
||||||
TrueBBI.NonPredSize > TLI->getIfCvtDupBlockSizeLimit())
|
TrueBBI.NonPredSize > TLI->getIfCvtDupBlockSizeLimit())
|
||||||
@@ -406,7 +409,7 @@ bool IfConverter::ValidSimple(BBInfo &TrueBBI, unsigned &Dups) const {
|
|||||||
Dups = TrueBBI.NonPredSize;
|
Dups = TrueBBI.NonPredSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
return !blockAlwaysFallThrough(TrueBBI) && TrueBBI.BrCond.size() == 0;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// ValidTriangle - Returns true if the 'true' and 'false' blocks (along
|
/// ValidTriangle - Returns true if the 'true' and 'false' blocks (along
|
||||||
|
Reference in New Issue
Block a user