[llvm-commits] [llvm] r139815 - /llvm/trunk/lib/CodeGen/InlineSpiller.cpp
Jakob Stoklund Olesen
stoklund at 2pi.dk
Thu Sep 15 11:22:52 PDT 2011
Author: stoklund
Date: Thu Sep 15 13:22:52 2011
New Revision: 139815
URL: http://llvm.org/viewvc/llvm-project?rev=139815&view=rev
Log:
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.
Modified:
llvm/trunk/lib/CodeGen/InlineSpiller.cpp
Modified: llvm/trunk/lib/CodeGen/InlineSpiller.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/InlineSpiller.cpp?rev=139815&r1=139814&r2=139815&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/InlineSpiller.cpp (original)
+++ llvm/trunk/lib/CodeGen/InlineSpiller.cpp Thu Sep 15 13:22:52 2011
@@ -1002,6 +1002,7 @@
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 @@
VRM.addSpillSlotUse(StackSlot, FoldMI);
MI->eraseFromParent();
DEBUG(dbgs() << "\tfolded: " << *FoldMI);
- ++NumFolded;
+ if (!WasCopy)
+ ++NumFolded;
+ else if (Ops.front() == 0)
+ ++NumSpills;
+ else
+ ++NumReloads;
return true;
}
More information about the llvm-commits
mailing list