Use hysteresis for local live range splitting as well.

llvm-svn: 130596
This commit is contained in:
Jakob Stoklund Olesen 2011-04-30 05:07:46 +00:00
parent 2f31fb99ef
commit 357dd36136
1 changed files with 4 additions and 4 deletions

View File

@ -1225,13 +1225,13 @@ unsigned RAGreedy::tryLocalSplit(LiveInterval &VirtReg, AllocationOrder &Order,
PrevSlot[SplitBefore].distance(Uses[SplitAfter]));
// Would this split be possible to allocate?
// Never allocate all gaps, we wouldn't be making progress.
float Diff = EstWeight - MaxGap;
DEBUG(dbgs() << " w=" << EstWeight << " d=" << Diff);
if (Diff > 0) {
DEBUG(dbgs() << " w=" << EstWeight);
if (EstWeight * Hysteresis >= MaxGap) {
Shrink = false;
float Diff = EstWeight - MaxGap;
if (Diff > BestDiff) {
DEBUG(dbgs() << " (best)");
BestDiff = Diff;
BestDiff = Hysteresis * Diff;
BestBefore = SplitBefore;
BestAfter = SplitAfter;
}