aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/LiveIntervalAnalysis.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-03-26 18:53:38 +0000
committerOwen Anderson <resistor@mac.com>2009-03-26 18:53:38 +0000
commit5bfe6e8673cc52383c0184fe08bdb39a70625630 (patch)
tree707bc462fca3bfc739b5a6f07c350b915591779c /lib/CodeGen/LiveIntervalAnalysis.cpp
parentda95ec859c996b81bcf855f1606fce847635bcdb (diff)
downloadexternal_llvm-5bfe6e8673cc52383c0184fe08bdb39a70625630.zip
external_llvm-5bfe6e8673cc52383c0184fe08bdb39a70625630.tar.gz
external_llvm-5bfe6e8673cc52383c0184fe08bdb39a70625630.tar.bz2
Don't assign a new stack slot if the pre-alloc splitter already assigned one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67764 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r--lib/CodeGen/LiveIntervalAnalysis.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp
index cd6f81c..8c7fa1b 100644
--- a/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -1973,8 +1973,15 @@ addIntervalsForSpills(const LiveInterval &li,
}
// One stack slot per live interval.
- if (NeedStackSlot && vrm.getPreSplitReg(li.reg) == 0)
- Slot = vrm.assignVirt2StackSlot(li.reg);
+ if (NeedStackSlot && vrm.getPreSplitReg(li.reg) == 0) {
+ if (vrm.getStackSlot(li.reg) == VirtRegMap::NO_STACK_SLOT)
+ Slot = vrm.assignVirt2StackSlot(li.reg);
+
+ // This case only occurs when the prealloc splitter has already assigned
+ // a stack slot to this vreg.
+ else
+ Slot = vrm.getStackSlot(li.reg);
+ }
// Create new intervals and rewrite defs and uses.
for (LiveInterval::Ranges::const_iterator