aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegAlloc/RegClass.cpp
diff options
context:
space:
mode:
authorVikram S. Adve <vadve@cs.uiuc.edu>2002-05-19 15:29:31 +0000
committerVikram S. Adve <vadve@cs.uiuc.edu>2002-05-19 15:29:31 +0000
commitdabb41d93de9b2d8f2d506caf611311bce6a188c (patch)
tree4eab334b86a66d7392015d5a01f4200f38de30dc /lib/CodeGen/RegAlloc/RegClass.cpp
parentf66723fc4b8bfebc17c8efa0753701d1c2840d5c (diff)
Numerous bug fixes:
-- passing FP arguments to functions with more than 6 arguments -- passing FP arguments to varargs functions -- passing FP arguments to functions with no prototypes -- incorrect coloring for CC registers (both int and FP): interferences were being completely ignored for int CC and were considered but no spills were marked for fp CC! Also some code improvements: -- better interface to generating machine instr for common cases (many places still need to be updated to use this interface) -- annotations on MachineInstr to communicate information from one codegen phase to another (now used to pass information about CALL/JMPLCALL operands from selection to register allocation) -- all sizes and offests in class TargetData are uint64_t instead of uint git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2642 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAlloc/RegClass.cpp')
-rw-r--r--lib/CodeGen/RegAlloc/RegClass.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/CodeGen/RegAlloc/RegClass.cpp b/lib/CodeGen/RegAlloc/RegClass.cpp
index 249b8db266..c680bbfc31 100644
--- a/lib/CodeGen/RegAlloc/RegClass.cpp
+++ b/lib/CodeGen/RegAlloc/RegClass.cpp
@@ -210,6 +210,22 @@ void RegClass::colorIGNode(IGNode *const Node)
IsColorUsedArr[ (*ReservedColorList)[i] ] = true;
}
+ // initialize all colors used by neighbors of this node to true
+ LiveRange *LR = Node->getParentLR();
+ unsigned NumNeighbors = Node->getNumOfNeighbors();
+ for (unsigned n=0; n < NumNeighbors; n++) {
+ IGNode *NeighIGNode = Node->getAdjIGNode(n);
+ LiveRange *NeighLR = NeighIGNode->getParentLR();
+
+ if (NeighLR->hasColor()) { // if has a color
+ IsColorUsedArr[NeighLR->getColor()] = true; // mark color as used
+ } else if (NeighLR->hasSuggestedColor() &&
+ NeighLR->isSuggestedColorUsable()) {
+ // this color is suggested for the neighbour, so don't use it
+ IsColorUsedArr[NeighLR->getSuggestedColor()] = true;
+ }
+ }
+
// call the target specific code for coloring
//
MRC->colorIGNode(Node, IsColorUsedArr);