mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-23 04:28:30 +00:00
Trivially re-materializable instructions have spill weights that are half of what it would be otherwise.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35658 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
776964ac32
commit
710216275b
@ -164,13 +164,13 @@ bool LiveIntervals::runOnMachineFunction(MachineFunction &fn) {
|
||||
unsigned reg = rep(mop.getReg());
|
||||
mii->getOperand(i).setReg(reg);
|
||||
|
||||
// If the definition instruction is re-materializable, its spill
|
||||
// weight is zero.
|
||||
LiveInterval &RegInt = getInterval(reg);
|
||||
if (!RegInt.remat) {
|
||||
RegInt.weight +=
|
||||
(mop.isUse() + mop.isDef()) * pow(10.0F, (int)loopDepth);
|
||||
}
|
||||
float w = (mop.isUse()+mop.isDef()) * powf(10.0F, (float)loopDepth);
|
||||
// If the definition instruction is re-materializable, its spill
|
||||
// weight is half of what it would have been normally.
|
||||
if (RegInt.remat)
|
||||
w /= 2;
|
||||
RegInt.weight += w;
|
||||
}
|
||||
}
|
||||
++mii;
|
||||
|
Loading…
Reference in New Issue
Block a user