aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/LiveInterval.h
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-06-23 21:03:19 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-06-23 21:03:19 +0000
commit99ec779a93cf7a09ac336b63d2d67818960343a1 (patch)
tree4907ac39f8d6716842d4c2b6fdab0ad1d9ef12b1 /include/llvm/CodeGen/LiveInterval.h
parent300c6c5167d2869d1568d783d0e3e48bf4b03a6c (diff)
Instead of adding an isSS field to LiveInterval to denote stack slot. Use top bit of 'reg' instead. If the top bit is set, than the LiveInterval represents a stack slot live interval.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52639 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/LiveInterval.h')
-rw-r--r--include/llvm/CodeGen/LiveInterval.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/llvm/CodeGen/LiveInterval.h b/include/llvm/CodeGen/LiveInterval.h
index b6f38dfc35..5e5e4b1957 100644
--- a/include/llvm/CodeGen/LiveInterval.h
+++ b/include/llvm/CodeGen/LiveInterval.h
@@ -101,8 +101,8 @@ namespace llvm {
typedef SmallVector<LiveRange,4> Ranges;
typedef SmallVector<VNInfo*,4> VNInfoList;
- bool isSS; // True if this represents a stack slot
unsigned reg; // the register or stack slot of this interval
+ // if the top bits is set, it represents a stack slot.
unsigned preference; // preferred register to allocate for this interval
float weight; // weight of this interval
Ranges ranges; // the ranges in which this register is live
@@ -110,7 +110,9 @@ namespace llvm {
public:
LiveInterval(unsigned Reg, float Weight, bool IsSS = false)
- : isSS(IsSS), reg(Reg), preference(0), weight(Weight) {
+ : reg(Reg), preference(0), weight(Weight) {
+ if (IsSS)
+ reg = reg | (1U << (sizeof(unsigned)*8-1));
}
typedef Ranges::iterator iterator;
@@ -143,13 +145,15 @@ namespace llvm {
/// isStackSlot - Return true if this is a stack slot interval.
///
- bool isStackSlot() const { return isSS; }
+ bool isStackSlot() const {
+ return reg & (1U << (sizeof(unsigned)*8-1));
+ }
/// getStackSlotIndex - Return stack slot index if this is a stack slot
/// interval.
int getStackSlotIndex() const {
assert(isStackSlot() && "Interval is not a stack slot interval!");
- return reg;
+ return reg & ~(1U << (sizeof(unsigned)*8-1));
}
bool containsOneValue() const { return valnos.size() == 1; }