mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-03-05 02:49:18 +00:00
Count correctly when a COPY turns into a spill or reload.
The number of spills could go negative since a folded COPY is just a spill, and it may be eliminated. llvm-svn: 139815
This commit is contained in:
parent
9d7aa9bcbc
commit
74cb8c037a
@ -1002,6 +1002,7 @@ bool InlineSpiller::coalesceStackAccess(MachineInstr *MI, unsigned Reg) {
|
||||
bool InlineSpiller::foldMemoryOperand(MachineBasicBlock::iterator MI,
|
||||
const SmallVectorImpl<unsigned> &Ops,
|
||||
MachineInstr *LoadMI) {
|
||||
bool WasCopy = MI->isCopy();
|
||||
// TargetInstrInfo::foldMemoryOperand only expects explicit, non-tied
|
||||
// operands.
|
||||
SmallVector<unsigned, 8> FoldOps;
|
||||
@ -1031,7 +1032,12 @@ bool InlineSpiller::foldMemoryOperand(MachineBasicBlock::iterator MI,
|
||||
VRM.addSpillSlotUse(StackSlot, FoldMI);
|
||||
MI->eraseFromParent();
|
||||
DEBUG(dbgs() << "\tfolded: " << *FoldMI);
|
||||
++NumFolded;
|
||||
if (!WasCopy)
|
||||
++NumFolded;
|
||||
else if (Ops.front() == 0)
|
||||
++NumSpills;
|
||||
else
|
||||
++NumReloads;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user