added suggesting color support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@673 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/RegAlloc/LiveRange.h b/lib/CodeGen/RegAlloc/LiveRange.h
index d8e130a..9c4d450 100644
--- a/lib/CodeGen/RegAlloc/LiveRange.h
+++ b/lib/CodeGen/RegAlloc/LiveRange.h
@@ -39,6 +39,9 @@
// bool mustLoadFromStack; // must load from stack at start of method
+
+ int SuggestedColor; // The suggested color for this LR
+
public:
@@ -92,9 +95,27 @@
}
+ inline void setSuggestedColor(int Col) {
+ //assert( (SuggestedColor == -1) && "Changing an already suggested color");
+
+ if(SuggestedColor == -1 )
+ SuggestedColor = Col;
+ else if (DEBUG_RA)
+ cout << "Already has a suggested color " << Col << endl;
+ }
+
+ inline unsigned getSuggestedColor() const {
+ assert( SuggestedColor != -1); // only a valid color is obtained
+ return (unsigned) SuggestedColor;
+ }
+
+ inline bool hasSuggestedColor() const {
+ return ( SuggestedColor > -1);
+ }
+
inline LiveRange() : ValueSet() , CallInterferenceList()
{
- Color = -1; // not yet colored
+ Color = SuggestedColor = -1; // not yet colored
mustSpill = mustSaveAcrossCalls = false;
MyRegClass = NULL;
UserIGNode = NULL;