summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Sparc/SparcRegClassInfo.cpp
diff options
context:
space:
mode:
authorVikram S. Adve <vadve@cs.uiuc.edu>2002-05-19 15:25:51 +0000
committerVikram S. Adve <vadve@cs.uiuc.edu>2002-05-19 15:25:51 +0000
commite9327f0082410c2f2256f85d3204c6d77302e21d (patch)
treefd1c7afbfa5161f3c0507d4a020ca5d247c526e2 /llvm/lib/Target/Sparc/SparcRegClassInfo.cpp
parent5b3057bb82da0023f82316ca9e116d09952c11f1 (diff)
downloadbcm5719-llvm-e9327f0082410c2f2256f85d3204c6d77302e21d.tar.gz
bcm5719-llvm-e9327f0082410c2f2256f85d3204c6d77302e21d.zip
Numerous bug fixes:
-- correct sign extensions for integer casts and for shift-by-constant instructions generated for integer multiply -- 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 stack frame size when padding a section -- folding getelementptr operations with mixed array and struct indexes -- use uint64_t instead of uint for constant offsets in mem operands -- 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: 2640
Diffstat (limited to 'llvm/lib/Target/Sparc/SparcRegClassInfo.cpp')
-rw-r--r--llvm/lib/Target/Sparc/SparcRegClassInfo.cpp55
1 files changed, 17 insertions, 38 deletions
diff --git a/llvm/lib/Target/Sparc/SparcRegClassInfo.cpp b/llvm/lib/Target/Sparc/SparcRegClassInfo.cpp
index 6f645b1df7c..11a82511587 100644
--- a/llvm/lib/Target/Sparc/SparcRegClassInfo.cpp
+++ b/llvm/lib/Target/Sparc/SparcRegClassInfo.cpp
@@ -20,22 +20,6 @@ using std::cerr;
//-----------------------------------------------------------------------------
void SparcIntRegClass::colorIGNode(IGNode * Node, bool IsColorUsedArr[]) const {
LiveRange *LR = Node->getParentLR();
- unsigned NumNeighbors = Node->getNumOfNeighbors(); // total # of neighbors
-
- for (unsigned n=0; n < NumNeighbors; n++) { // for each neigh
- IGNode *NeighIGNode = Node->getAdjIGNode(n);
- LiveRange *NeighLR = NeighIGNode->getParentLR();
-
- if(NeighLR->hasColor()) // if has a color
- IsColorUsedArr[NeighLR->getColor()] = true; // record that color
-
- else if (NeighLR->hasSuggestedColor()) {
-
- // if the neighbout can use the suggested color
- if(NeighLR->isSuggestedColorUsable())
- IsColorUsedArr[NeighLR->getSuggestedColor()] = true;
- }
- }
if( DEBUG_RA ) {
cerr << "\nColoring LR [CallInt=" << LR->isCallInterference() <<"]:";
@@ -148,38 +132,35 @@ void SparcIntRegClass::colorIGNode(IGNode * Node, bool IsColorUsedArr[]) const {
//----------------------------------------------------------------------------
void SparcFloatRegClass::colorIGNode(IGNode * Node,bool IsColorUsedArr[]) const{
LiveRange *LR = Node->getParentLR();
- unsigned NumNeighbors = Node->getNumOfNeighbors(); // total # of neighbors
+ // Mark the second color for double-precision registers:
+ // This is UGLY and should be merged into nearly identical code
+ // in RegClass::colorIGNode that handles the first color.
+ //
+ unsigned NumNeighbors = Node->getNumOfNeighbors(); // total # of neighbors
for(unsigned n=0; n < NumNeighbors; n++) { // for each neigh
IGNode *NeighIGNode = Node->getAdjIGNode(n);
LiveRange *NeighLR = NeighIGNode->getParentLR();
-
- if( NeighLR->hasColor() ) { // if neigh has a color
- IsColorUsedArr[ NeighLR->getColor() ] = true; // record that color
- if (NeighLR->getType() == Type::DoubleTy)
- IsColorUsedArr[ (NeighLR->getColor()) + 1 ] = true;
- }
- else if( NeighLR->hasSuggestedColor() ) { // if neigh has sugg color
-
- if( NeighLR-> isSuggestedColorUsable() ) {
-
- // if the neighbout can use the suggested color
-
+
+ if( NeighLR->hasColor() &&
+ NeighLR->getType() == Type::DoubleTy) {
+ IsColorUsedArr[ (NeighLR->getColor()) + 1 ] = true;
+
+ } else if (NeighLR->hasSuggestedColor() &&
+ NeighLR-> isSuggestedColorUsable() ) {
+
+ // if the neighbour can use the suggested color
IsColorUsedArr[ NeighLR->getSuggestedColor() ] = true;
if (NeighLR->getType() == Type::DoubleTy)
IsColorUsedArr[ (NeighLR->getSuggestedColor()) + 1 ] = true;
- }
-
- }
-
+ }
}
-
// **NOTE: We don't check for call interferences in allocating suggested
// color in this class since ALL registers are volatile. If this fact
// changes, we should change the following part
//- see SparcIntRegClass::colorIGNode()
-
+ //
if( LR->hasSuggestedColor() ) {
if( ! IsColorUsedArr[ LR->getSuggestedColor() ] ) {
LR->setColor( LR->getSuggestedColor() );
@@ -244,10 +225,8 @@ void SparcFloatRegClass::colorIGNode(IGNode * Node,bool IsColorUsedArr[]) const{
IsColorUsedArr);
}
-
-
if( ColorFound >= 0 ) {
- LR->setColor(ColorFound); // first color found in preffered order
+ LR->setColor(ColorFound); // first color found in prefered order
LR->markForSaveAcrossCalls();
} else {
// we are here because no color could be found
OpenPOWER on IntegriCloud