X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FTarget%2FSparcV9%2FSparcV9RegClassInfo.cpp;h=4d35f5d3e2b4d8fb047520c84e51c15df2df736a;hb=a2bae305fb5a870c4ef753ed290a7ddea73ec82b;hp=da40826b3e0ff4f0c70336764e5cec9f2aa0c006;hpb=85c5465e072b3bbebb1f5e112fb2db46f7fba148;p=oota-llvm.git diff --git a/lib/Target/SparcV9/SparcV9RegClassInfo.cpp b/lib/Target/SparcV9/SparcV9RegClassInfo.cpp index da40826b3e0..4d35f5d3e2b 100644 --- a/lib/Target/SparcV9/SparcV9RegClassInfo.cpp +++ b/lib/Target/SparcV9/SparcV9RegClassInfo.cpp @@ -1,9 +1,15 @@ +//===-- SparcRegClassInfo.cpp - Register class def'ns for Sparc -----------===// +// +// This file defines the register classes used by the Sparc target description. +// +//===----------------------------------------------------------------------===// + #include "SparcRegClassInfo.h" #include "llvm/CodeGen/RegAllocCommon.h" #include "llvm/Target/Sparc.h" #include "llvm/Type.h" -#include using std::cerr; +using std::vector; //----------------------------------------------------------------------------- // Int Register Class - method for coloring a node in the interference graph. @@ -60,17 +66,17 @@ void SparcIntRegClass::colorIGNode(IGNode * Node, vector &IsColorUsedArr) if( ! LR->isCallInterference() ) { // start with volatiles (we can allocate volatiles safely) - SearchStart = SparcIntRegOrder::StartOfAllRegs; + SearchStart = SparcIntRegClass::StartOfAllRegs; } else { // start with non volatiles (no non-volatiles) - SearchStart = SparcIntRegOrder::StartOfNonVolatileRegs; + SearchStart = SparcIntRegClass::StartOfNonVolatileRegs; } unsigned c=0; // color // find first unused color - for( c=SearchStart; c < SparcIntRegOrder::NumOfAvailRegs; c++) { + for( c=SearchStart; c < SparcIntRegClass::NumOfAvailRegs; c++) { if(!IsColorUsedArr[c] ) { ColorFound = true; break; } } @@ -85,10 +91,10 @@ void SparcIntRegClass::colorIGNode(IGNode * Node, vector &IsColorUsedArr) else if( LR->isCallInterference() ) { // start from 0 - try to find even a volatile this time - SearchStart = SparcIntRegOrder::StartOfAllRegs; + SearchStart = SparcIntRegClass::StartOfAllRegs; // find first unused volatile color - for(c=SearchStart; c < SparcIntRegOrder::StartOfNonVolatileRegs; c++) { + for(c=SearchStart; c < SparcIntRegClass::StartOfNonVolatileRegs; c++) { if( ! IsColorUsedArr[ c ] ) { ColorFound = true; break; } } @@ -199,11 +205,11 @@ void SparcFloatRegClass::colorIGNode(IGNode * Node, //if this Node is between calls (i.e., no call interferences ) if( ! isCallInterf ) { // start with volatiles (we can allocate volatiles safely) - SearchStart = SparcFloatRegOrder::StartOfAllRegs; + SearchStart = SparcFloatRegClass::StartOfAllRegs; } else { // start with non volatiles (no non-volatiles) - SearchStart = SparcFloatRegOrder::StartOfNonVolatileRegs; + SearchStart = SparcFloatRegClass::StartOfNonVolatileRegs; } ColorFound = findFloatColor( LR, SearchStart, 32, IsColorUsedArr ); @@ -221,8 +227,8 @@ void SparcFloatRegClass::colorIGNode(IGNode * Node, // color could be found. // Now try to allocate even a volatile color - ColorFound = findFloatColor( LR, SparcFloatRegOrder::StartOfAllRegs, - SparcFloatRegOrder::StartOfNonVolatileRegs, + ColorFound = findFloatColor( LR, SparcFloatRegClass::StartOfAllRegs, + SparcFloatRegClass::StartOfNonVolatileRegs, IsColorUsedArr); }