summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit2780d2dacb28540e26bc1f9f80243ca4d991e9e0 (patch)
treeaab5ba188f54b595f07827e3bfbd41848a7443e8 /llvm/lib/CodeGen/RegAlloc/RegClass.cpp
parent8b831746be13259668faa32f9a37afbc3353c7a6 (diff)
downloadbcm5719-llvm-2780d2dacb28540e26bc1f9f80243ca4d991e9e0.tar.gz
bcm5719-llvm-2780d2dacb28540e26bc1f9f80243ca4d991e9e0.zip
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 llvm-svn: 2642
Diffstat (limited to 'llvm/lib/CodeGen/RegAlloc/RegClass.cpp')
-rw-r--r--llvm/lib/CodeGen/RegAlloc/RegClass.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/RegAlloc/RegClass.cpp b/llvm/lib/CodeGen/RegAlloc/RegClass.cpp
index 249b8db2664..c680bbfc31b 100644
--- a/llvm/lib/CodeGen/RegAlloc/RegClass.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud