//
for( ; MInstIterator != MIVec.end(); ++MInstIterator) {
- const MachineInstr * MInst = *MInstIterator;
+ const MachineInstr *MInst = *MInstIterator;
// get the LV set after the instruction
//
- const ValueSet *LVSetAI = LVI->getLiveVarSetAfterMInst(MInst, *BBI);
+ const ValueSet &LVSetAI = LVI->getLiveVarSetAfterMInst(MInst, *BBI);
const bool isCallInst = TM.getInstrInfo().isCall(MInst->getOpCode());
// coloring algo to avoid allocating volatile colors to live ranges
// that span across calls (since they have to be saved/restored)
//
- setCallInterferences( MInst, LVSetAI);
+ setCallInterferences(MInst, &LVSetAI);
}
if( OpI.isDef() ) {
// create a new LR iff this operand is a def
//
- addInterference(*OpI, LVSetAI, isCallInst );
+ addInterference(*OpI, &LVSetAI, isCallInst);
}
// Calculate the spill cost of each live range
if( NumOfImpRefs > 0 ) {
for(unsigned z=0; z < NumOfImpRefs; z++)
if( MInst->implicitRefIsDefined(z) )
- addInterference( MInst->getImplicitRef(z), LVSetAI, isCallInst );
+ addInterference( MInst->getImplicitRef(z), &LVSetAI, isCallInst );
}
//----------------------------------------------------------------------------
void PhyRegAlloc::addInterferencesForArgs() {
// get the InSet of root BB
- const ValueSet *InSet = LVI->getInSetOfBB(Meth->front());
+ const ValueSet &InSet = LVI->getInSetOfBB(Meth->front());
// get the argument list
const Method::ArgumentListType& ArgList = Meth->getArgumentList();
for( ; ArgIt != ArgList.end() ; ++ArgIt) { // for each argument
- addInterference((Value*)*ArgIt, InSet, false); // add interferences between
+ addInterference((Value*)*ArgIt, &InSet, false);// add interferences between
// args and LVars at start
if( DEBUG_RA > 1)
cerr << " - %% adding interference for argument "
unsigned RegType = MRI.getRegType( LR );
int SpillOff = LR->getSpillOffFromFP();
RegClass *RC = LR->getRegClass();
- const ValueSet *LVSetBef = LVI->getLiveVarSetBeforeMInst(MInst, BB);
+ const ValueSet &LVSetBef = LVI->getLiveVarSetBeforeMInst(MInst, BB);
mcInfo.pushTempValue(TM, MRI.getSpilledRegSize(RegType) );
MachineInstr *MIBef=NULL, *AdIMid=NULL, *MIAft=NULL;
- int TmpRegU = getUsableUniRegAtMI(RC, RegType, MInst,LVSetBef, MIBef, MIAft);
+ int TmpRegU = getUsableUniRegAtMI(RC, RegType, MInst,&LVSetBef, MIBef, MIAft);
// get the added instructions for this instruciton
AddedInstrns *AI = AddedInstrMap[ MInst ];