diff options
author | Owen Anderson <resistor@mac.com> | 2010-09-28 18:32:13 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2010-09-28 18:32:13 +0000 |
commit | b20b85168c0e9819e6545f08281e9b83c82108f0 (patch) | |
tree | ba75b27d14400c20576dcdb80960a9b138e9e4ef /lib/CodeGen/IfConversion.cpp | |
parent | f2d7b7c879548090beae51b21c4b363da7dbbaad (diff) |
Part one of switching to using a more sane heuristic for determining if-conversion profitability.
Rather than having arbitrary cutoffs, actually try to cost model the conversion.
For now, the constants are tuned to more or less match our existing behavior, but these will be
changed to reflect realistic values as this work proceeds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114973 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/IfConversion.cpp')
-rw-r--r-- | lib/CodeGen/IfConversion.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/CodeGen/IfConversion.cpp b/lib/CodeGen/IfConversion.cpp index d73cd538f3..c9c56dd86d 100644 --- a/lib/CodeGen/IfConversion.cpp +++ b/lib/CodeGen/IfConversion.cpp @@ -191,13 +191,13 @@ namespace { void MergeBlocks(BBInfo &ToBBI, BBInfo &FromBBI, bool AddEdges = true); bool MeetIfcvtSizeLimit(MachineBasicBlock &BB, unsigned Size) const { - return Size > 0 && TII->isProfitableToIfCvt(BB, Size); + return Size > 0 && TII->isProfitableToIfCvt(BB, Size, 0.5); } bool MeetIfcvtSizeLimit(MachineBasicBlock &TBB, unsigned TSize, MachineBasicBlock &FBB, unsigned FSize) const { return TSize > 0 && FSize > 0 && - TII->isProfitableToIfCvt(TBB, TSize, FBB, FSize); + TII->isProfitableToIfCvt(TBB, TSize, FBB, FSize, 0.5); } // blockAlwaysFallThrough - Block ends without a terminator. @@ -444,7 +444,7 @@ bool IfConverter::ValidSimple(BBInfo &TrueBBI, unsigned &Dups) const { if (TrueBBI.BB->pred_size() > 1) { if (TrueBBI.CannotBeCopied || - !TII->isProfitableToDupForIfCvt(*TrueBBI.BB, TrueBBI.NonPredSize)) + !TII->isProfitableToDupForIfCvt(*TrueBBI.BB, TrueBBI.NonPredSize, 0.5)) return false; Dups = TrueBBI.NonPredSize; } @@ -481,7 +481,7 @@ bool IfConverter::ValidTriangle(BBInfo &TrueBBI, BBInfo &FalseBBI, ++Size; } } - if (!TII->isProfitableToDupForIfCvt(*TrueBBI.BB, Size)) + if (!TII->isProfitableToDupForIfCvt(*TrueBBI.BB, Size, 0.5)) return false; Dups = Size; } |