summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/VirtRegMap.cpp
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2008-05-22 21:12:21 +0000
committerDavid Greene <greened@obbligato.org>2008-05-22 21:12:21 +0000
commitcff860801e8cac730c3b171e1dc8b66b7900dec6 (patch)
tree551f7ef2d25fd66bb891d29eb9bc70666c0157b8 /lib/CodeGen/VirtRegMap.cpp
parent785c6af9797fcf551feef70f2ecb5cd075b6e3c4 (diff)
downloadexternal_llvm-cff860801e8cac730c3b171e1dc8b66b7900dec6.zip
external_llvm-cff860801e8cac730c3b171e1dc8b66b7900dec6.tar.gz
external_llvm-cff860801e8cac730c3b171e1dc8b66b7900dec6.tar.bz2
Don't attempt to update SpillSlotToUsesMap for stack slots that aren't
generated by the spiller. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51439 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/VirtRegMap.cpp')
-rw-r--r--lib/CodeGen/VirtRegMap.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/CodeGen/VirtRegMap.cpp b/lib/CodeGen/VirtRegMap.cpp
index 3793af0..5755767 100644
--- a/lib/CodeGen/VirtRegMap.cpp
+++ b/lib/CodeGen/VirtRegMap.cpp
@@ -147,8 +147,14 @@ int VirtRegMap::getEmergencySpillSlot(const TargetRegisterClass *RC) {
void VirtRegMap::addSpillSlotUse(int FI, MachineInstr *MI) {
if (!MF.getFrameInfo()->isFixedObjectIndex(FI)) {
- assert(FI >= 0 && "Spill slot index should not be negative!");
- SpillSlotToUsesMap[FI-LowSpillSlot].insert(MI);
+ // If FI < LowSpillSlot, this stack reference was produced by
+ // instruction selection and is not a spill
+ if (FI >= LowSpillSlot) {
+ assert(FI >= 0 && "Spill slot index should not be negative!");
+ assert(FI-LowSpillSlot < SpillSlotToUsesMap.size()
+ && "Invalid spill slot");
+ SpillSlotToUsesMap[FI-LowSpillSlot].insert(MI);
+ }
}
}
@@ -179,6 +185,12 @@ void VirtRegMap::RemoveMachineInstrFromMaps(MachineInstr *MI) {
int FI = MO.getIndex();
if (MF.getFrameInfo()->isFixedObjectIndex(FI))
continue;
+ // This stack reference was produced by instruction selection and
+ // is not a spill
+ if (FI < LowSpillSlot)
+ continue;
+ assert(FI-LowSpillSlot < SpillSlotToUsesMap.size()
+ && "Invalid spill slot");
SpillSlotToUsesMap[FI-LowSpillSlot].erase(MI);
}
MI2VirtMap.erase(MI);