From dabb41d93de9b2d8f2d506caf611311bce6a188c Mon Sep 17 00:00:00 2001 From: "Vikram S. Adve" Date: Sun, 19 May 2002 15:29:31 +0000 Subject: 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 --- lib/CodeGen/RegAlloc/RegClass.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lib/CodeGen/RegAlloc/RegClass.cpp') 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); -- cgit v1.2.3-18-g5258