mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-03 10:54:42 +00:00
Fix a compile-time regression introduced by my heuristic-changing patch. I forgot
to multiply the instruction count by a constant factor in a few places, which caused the register allocator to require many more iterations. llvm-svn: 53959
This commit is contained in:
parent
8d04607133
commit
58d9213c3a
@ -1793,7 +1793,7 @@ addIntervalsForSpills(const LiveInterval &li,
|
||||
for (unsigned i = 0, e = NewLIs.size(); i != e; ++i) {
|
||||
LiveInterval *LI = NewLIs[i];
|
||||
if (!LI->empty()) {
|
||||
LI->weight /= getApproximateInstructionCount(*LI);
|
||||
LI->weight /= InstrSlots::NUM * getApproximateInstructionCount(*LI);
|
||||
if (!AddedKill.count(LI)) {
|
||||
LiveRange *LR = &LI->ranges[LI->ranges.size()-1];
|
||||
unsigned LastUseIdx = getBaseIndex(LR->end);
|
||||
|
@ -852,7 +852,7 @@ void RALinScan::assignRegOrStackSlotAtInterval(LiveInterval* cur)
|
||||
// All registers must have inf weight. Just grab one!
|
||||
minReg = BestPhysReg ? BestPhysReg : *RC->allocation_order_begin(*mf_);
|
||||
if (cur->weight == HUGE_VALF ||
|
||||
li_->getApproximateInstructionCount(*cur) == 1)
|
||||
li_->getApproximateInstructionCount(*cur) == 0)
|
||||
// Spill a physical register around defs and uses.
|
||||
li_->spillPhysRegAroundRegDefsUses(*cur, minReg, *vrm_);
|
||||
}
|
||||
|
@ -2196,7 +2196,7 @@ bool SimpleRegisterCoalescing::runOnMachineFunction(MachineFunction &fn) {
|
||||
// Divide the weight of the interval by its size. This encourages
|
||||
// spilling of intervals that are large and have few uses, and
|
||||
// discourages spilling of small intervals with many uses.
|
||||
LI.weight /= li_->getApproximateInstructionCount(LI);
|
||||
LI.weight /= li_->getApproximateInstructionCount(LI) * InstrSlots::NUM;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -126,7 +126,8 @@ namespace llvm {
|
||||
unsigned getRepIntervalSize(unsigned Reg) {
|
||||
if (!li_->hasInterval(Reg))
|
||||
return 0;
|
||||
return li_->getApproximateInstructionCount(li_->getInterval(Reg));
|
||||
return li_->getApproximateInstructionCount(li_->getInterval(Reg)) *
|
||||
LiveIntervals::InstrSlots::NUM;
|
||||
}
|
||||
|
||||
/// print - Implement the dump method.
|
||||
|
Loading…
x
Reference in New Issue
Block a user