summaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/LiveStackAnalysis.h
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-01-09 21:17:37 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-01-09 21:17:37 +0000
commitbe97e906e03dd9b22e14f6749157c9d5f9701dd5 (patch)
tree406cc2412d1b65c21943b0b90db00d24160f8c26 /include/llvm/CodeGen/LiveStackAnalysis.h
parent96b1b6c1356a70f99e133331c470ba7caf48de21 (diff)
downloadllvm-be97e906e03dd9b22e14f6749157c9d5f9701dd5.tar.gz
llvm-be97e906e03dd9b22e14f6749157c9d5f9701dd5.tar.bz2
llvm-be97e906e03dd9b22e14f6749157c9d5f9701dd5.tar.xz
Teach TargetRegisterInfo how to cram stack slot indexes in with the virtual and
physical register numbers. This makes the hack used in LiveInterval official, and lets LiveInterval be oblivious of stack slots. The isPhysicalRegister() and isVirtualRegister() predicates don't know about this, so when a variable may contain a stack slot, isStackSlot() should always be tested first. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123128 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/LiveStackAnalysis.h')
-rw-r--r--include/llvm/CodeGen/LiveStackAnalysis.h14
1 files changed, 1 insertions, 13 deletions
diff --git a/include/llvm/CodeGen/LiveStackAnalysis.h b/include/llvm/CodeGen/LiveStackAnalysis.h
index 9310a30a4d..8a8dcaf572 100644
--- a/include/llvm/CodeGen/LiveStackAnalysis.h
+++ b/include/llvm/CodeGen/LiveStackAnalysis.h
@@ -52,19 +52,7 @@ namespace llvm {
unsigned getNumIntervals() const { return (unsigned)S2IMap.size(); }
- LiveInterval &getOrCreateInterval(int Slot, const TargetRegisterClass *RC) {
- assert(Slot >= 0 && "Spill slot indice must be >= 0");
- SS2IntervalMap::iterator I = S2IMap.find(Slot);
- if (I == S2IMap.end()) {
- I = S2IMap.insert(I,std::make_pair(Slot, LiveInterval(Slot,0.0F,true)));
- S2RCMap.insert(std::make_pair(Slot, RC));
- } else {
- // Use the largest common subclass register class.
- const TargetRegisterClass *OldRC = S2RCMap[Slot];
- S2RCMap[Slot] = getCommonSubClass(OldRC, RC);
- }
- return I->second;
- }
+ LiveInterval &getOrCreateInterval(int Slot, const TargetRegisterClass *RC);
LiveInterval &getInterval(int Slot) {
assert(Slot >= 0 && "Spill slot indice must be >= 0");