diff options
author | Ruchira Sasanka <sasanka@students.uiuc.edu> | 2001-10-28 18:15:12 +0000 |
---|---|---|
committer | Ruchira Sasanka <sasanka@students.uiuc.edu> | 2001-10-28 18:15:12 +0000 |
commit | 20c82b12c909ed643e9b47f93a60fefc46753bcd (patch) | |
tree | 33a79f1f904506d430e191c17e0194511875dfd4 /lib/CodeGen/RegAlloc/LiveRange.h | |
parent | 78d63ee3136b74c7ee3eae1e7362d3b642fabf0c (diff) |
Added support for spilling
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@992 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAlloc/LiveRange.h')
-rw-r--r-- | lib/CodeGen/RegAlloc/LiveRange.h | 38 |
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; } }; |