mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-05 09:44:30 +00:00
VirtRegMap is counting spill slots, not register spills.
Fix the stats counters to reflect that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139819 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0c4b9ff077
commit
01afdb3a45
@ -41,8 +41,8 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
STATISTIC(NumSpills , "Number of register spills");
|
STATISTIC(NumSpillSlots, "Number of spill slots allocated");
|
||||||
STATISTIC(NumIdCopies, "Number of identity moves eliminated after rewriting");
|
STATISTIC(NumIdCopies, "Number of identity moves eliminated after rewriting");
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// VirtRegMap implementation
|
// VirtRegMap implementation
|
||||||
@ -111,6 +111,7 @@ unsigned VirtRegMap::createSpillSlot(const TargetRegisterClass *RC) {
|
|||||||
unsigned Idx = SS-LowSpillSlot;
|
unsigned Idx = SS-LowSpillSlot;
|
||||||
while (Idx >= SpillSlotToUsesMap.size())
|
while (Idx >= SpillSlotToUsesMap.size())
|
||||||
SpillSlotToUsesMap.resize(SpillSlotToUsesMap.size()*2);
|
SpillSlotToUsesMap.resize(SpillSlotToUsesMap.size()*2);
|
||||||
|
++NumSpillSlots;
|
||||||
return SS;
|
return SS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,7 +131,6 @@ int VirtRegMap::assignVirt2StackSlot(unsigned virtReg) {
|
|||||||
assert(Virt2StackSlotMap[virtReg] == NO_STACK_SLOT &&
|
assert(Virt2StackSlotMap[virtReg] == NO_STACK_SLOT &&
|
||||||
"attempt to assign stack slot to already spilled register");
|
"attempt to assign stack slot to already spilled register");
|
||||||
const TargetRegisterClass* RC = MF->getRegInfo().getRegClass(virtReg);
|
const TargetRegisterClass* RC = MF->getRegInfo().getRegClass(virtReg);
|
||||||
++NumSpills;
|
|
||||||
return Virt2StackSlotMap[virtReg] = createSpillSlot(RC);
|
return Virt2StackSlotMap[virtReg] = createSpillSlot(RC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
; RUN: llc < %s -march=x86 -stats -regalloc=linearscan |& grep {Number of loads added} | grep 2
|
; RUN: llc < %s -march=x86 -stats -regalloc=linearscan |& grep {Number of loads added} | grep 2
|
||||||
; RUN: llc < %s -march=x86 -stats -regalloc=linearscan |& grep {Number of register spills} | grep 1
|
; RUN: llc < %s -march=x86 -stats -regalloc=linearscan |& grep {Number of spill slots allocated} | grep 1
|
||||||
; RUN: llc < %s -march=x86 -stats -regalloc=linearscan |& grep {Number of machine instrs printed} | grep 34
|
; RUN: llc < %s -march=x86 -stats -regalloc=linearscan |& grep {Number of machine instrs printed} | grep 34
|
||||||
; PR3495
|
; PR3495
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user