mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 06:29:05 +00:00
Added code so that colorIGNode does not unnecessarily reserve unusable
Suggested colors for neighbors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@921 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -31,8 +31,12 @@ void SparcIntRegClass::colorIGNode(IGNode * Node, bool IsColorUsedArr[]) const
|
||||
if( NeighLR->hasColor() ) // if has a color
|
||||
IsColorUsedArr[ NeighLR->getColor() ] = true; // record that color
|
||||
|
||||
else if( NeighLR->hasSuggestedColor() ) // or has a suggest col
|
||||
else if( NeighLR->hasSuggestedColor() ) {
|
||||
|
||||
// if the neighbout can use the suggested color
|
||||
if( NeighLR-> isSuggestedColorUsable() )
|
||||
IsColorUsedArr[ NeighLR->getSuggestedColor() ] = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -49,7 +53,7 @@ void SparcIntRegClass::colorIGNode(IGNode * Node, bool IsColorUsedArr[]) const
|
||||
|
||||
if( ! IsColorUsedArr[ SugCol ] ) {
|
||||
|
||||
if(! (isRegVolatile( SugCol ) && LR->isCallInterference()) ) {
|
||||
if( LR->isSuggestedColorUsable() ) {
|
||||
|
||||
// if the suggested color is volatile, we should use it only if
|
||||
// there are no call interferences. Otherwise, it will get spilled.
|
||||
@@ -205,6 +209,11 @@ void SparcFloatRegClass::colorIGNode(IGNode * Node,bool IsColorUsedArr[]) const
|
||||
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
|
||||
|
||||
IsColorUsedArr[ NeighLR->getSuggestedColor() ] = true;
|
||||
if( NeighLR->getTypeID() == Type::DoubleTyID )
|
||||
IsColorUsedArr[ (NeighLR->getSuggestedColor()) + 1 ] = true;
|
||||
@@ -212,6 +221,8 @@ void SparcFloatRegClass::colorIGNode(IGNode * Node,bool IsColorUsedArr[]) const
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// **NOTE: We don't check for call interferences in allocating suggested
|
||||
// color in this class since ALL registers are volatile. If this fact
|
||||
|
@@ -61,7 +61,6 @@ void UltraSparcRegInfo::suggestReg4CallAddr(const MachineInstr * CallMI) const
|
||||
|
||||
MachineOperand & MO = ( MachineOperand &) CallMI->getOperand(2);
|
||||
MO.setRegForValue( getUnifiedRegNum( IntRegClassID,SparcIntRegOrder::o7) );
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user