aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegAlloc/LiveRange.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/RegAlloc/LiveRange.h')
-rw-r--r--lib/CodeGen/RegAlloc/LiveRange.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/lib/CodeGen/RegAlloc/LiveRange.h b/lib/CodeGen/RegAlloc/LiveRange.h
index 0d0f8ae1b8..23c217cd7a 100644
--- a/lib/CodeGen/RegAlloc/LiveRange.h
+++ b/lib/CodeGen/RegAlloc/LiveRange.h
@@ -55,6 +55,11 @@ class LiveRange : public ValueSet
bool CanUseSuggestedCol;
+ // if this LR is spilled, its stack offset from *FP*. The spilled offsets
+ // must always be relative to the FP.
+ int SpilledStackOffsetFromFP;
+ bool HasSpillOffset;
+
public:
@@ -88,6 +93,33 @@ class LiveRange : public ValueSet
inline void markForSpill() { mustSpill = true; }
+ inline bool isMarkedForSpill() { return mustSpill; }
+
+ inline void setSpillOffFromFP(int StackOffset) {
+ assert( mustSpill && "This LR is not spilled");
+ SpilledStackOffsetFromFP = StackOffset;
+ HasSpillOffset = true;
+ }
+
+ inline void modifySpillOffFromFP(int StackOffset) {
+ assert( mustSpill && "This LR is not spilled");
+ SpilledStackOffsetFromFP = StackOffset;
+ HasSpillOffset = true;
+ }
+
+
+
+ inline bool hasSpillOffset() {
+ return HasSpillOffset;
+ }
+
+
+ inline int getSpillOffFromFP() const {
+ assert( HasSpillOffset && "This LR is not spilled");
+ return SpilledStackOffsetFromFP;
+ }
+
+
inline void markForSaveAcrossCalls() { mustSaveAcrossCalls = true; }
// inline void markForLoadFromStack() { mustLoadFromStack = true;
@@ -135,6 +167,11 @@ class LiveRange : public ValueSet
}
+
+
+
+
+
inline LiveRange() : ValueSet() /* , CallInterferenceList() */
{
Color = SuggestedColor = -1; // not yet colored
@@ -143,6 +180,7 @@ class LiveRange : public ValueSet
UserIGNode = NULL;
doesSpanAcrossCalls = false;
CanUseSuggestedCol = true;
+ HasSpillOffset = false;
}
};