Change the heuristics used in the coalescer, register allocator, and within

live intervals itself to use an instruction count approximation that is 
not affected by inserting empty indices.

llvm-svn: 53937
This commit is contained in:
Owen Anderson
2008-07-22 22:46:49 +00:00
parent 0b39845f93
commit 029182f3a3
5 changed files with 29 additions and 14 deletions

View File

@@ -851,7 +851,8 @@ void RALinScan::assignRegOrStackSlotAtInterval(LiveInterval* cur)
if (minWeight == HUGE_VALF) {
// All registers must have inf weight. Just grab one!
minReg = BestPhysReg ? BestPhysReg : *RC->allocation_order_begin(*mf_);
if (cur->weight == HUGE_VALF || cur->getSize() == 1)
if (cur->weight == HUGE_VALF ||
li_->getApproximateInstructionCount(*cur) == 1)
// Spill a physical register around defs and uses.
li_->spillPhysRegAroundRegDefsUses(*cur, minReg, *vrm_);
}