summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorRuchira Sasanka <sasanka@students.uiuc.edu>2001-10-19 21:42:06 +0000
committerRuchira Sasanka <sasanka@students.uiuc.edu>2001-10-19 21:42:06 +0000
commit53516cd05b92355fd7030d1d8eaf4335d945eada (patch)
tree7f616c8a9db61609d6169f71638abc433737aaae /llvm/lib/CodeGen
parent6a073498ba45bbc83d5265704e4a6fa1a5f7acf8 (diff)
downloadbcm5719-llvm-53516cd05b92355fd7030d1d8eaf4335d945eada.tar.gz
bcm5719-llvm-53516cd05b92355fd7030d1d8eaf4335d945eada.zip
Added code to support unusable Suggested Colors.
llvm-svn: 922
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/RegAlloc/LiveRange.h39
-rw-r--r--llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.h2
2 files changed, 26 insertions, 15 deletions
diff --git a/llvm/lib/CodeGen/RegAlloc/LiveRange.h b/llvm/lib/CodeGen/RegAlloc/LiveRange.h
index c0548d7fb9d..0d0f8ae1b84 100644
--- a/llvm/lib/CodeGen/RegAlloc/LiveRange.h
+++ b/llvm/lib/CodeGen/RegAlloc/LiveRange.h
@@ -49,6 +49,12 @@ class LiveRange : public ValueSet
int SuggestedColor; // The suggested color for this LR
+ // if this LR has a suggested color, can it be really alloated?
+ // A suggested color cannot be allocated when the suggested color is
+ // volatile and when there are call interferences.
+
+ bool CanUseSuggestedCol;
+
public:
@@ -70,22 +76,14 @@ class LiveRange : public ValueSet
{ Color = (int) Col ; }
- inline void setCallInterference()
- { doesSpanAcrossCalls = 1;
- //CallInterferenceList.push_back( Inst );
- }
-
-
-
- /*
- inline const Instruction *const getCallInterference(const unsigned i) const {
- assert( i < CallInterferenceList.size() );
- return CallInterferenceList[i];
+ inline void setCallInterference() {
+ doesSpanAcrossCalls = 1;
}
- */
- inline bool isCallInterference() const
- { return (doesSpanAcrossCalls == 1); }
+
+ inline bool isCallInterference() const {
+ return (doesSpanAcrossCalls == 1);
+ }
inline void markForSpill() { mustSpill = true; }
@@ -126,6 +124,17 @@ class LiveRange : public ValueSet
return ( SuggestedColor > -1);
}
+ inline bool isSuggestedColorUsable() const {
+ assert( hasSuggestedColor() && "No suggested color");
+ return CanUseSuggestedCol;
+ }
+
+ inline void setSuggestedColorUsable(const bool val) {
+ assert( hasSuggestedColor() && "No suggested color");
+ CanUseSuggestedCol = val;
+ }
+
+
inline LiveRange() : ValueSet() /* , CallInterferenceList() */
{
Color = SuggestedColor = -1; // not yet colored
@@ -133,7 +142,7 @@ class LiveRange : public ValueSet
MyRegClass = NULL;
UserIGNode = NULL;
doesSpanAcrossCalls = false;
-
+ CanUseSuggestedCol = true;
}
};
diff --git a/llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.h b/llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.h
index bd41c8882c3..998fa116c59 100644
--- a/llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.h
+++ b/llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.h
@@ -87,6 +87,8 @@ class PhyRegAlloc
void setCallInterferences(const MachineInstr *MInst,
const LiveVarSet *const LVSetAft );
+ void markUnusableSugColors();
+
inline void constructLiveRanges()
{ LRI.constructLiveRanges(); }
OpenPOWER on IntegriCloud