return CallMI->getImplicitRef(NumOfImpRefs-2);
}
- else if( OpCode == JMPL) {
+ else if( OpCode == JMPLCALL) {
// The last implicit operand is the return value of a JMPL in
if( NumOfImpRefs > 0 )
return CallMI->getImplicitRef(NumOfImpRefs-1);
}
- else if( OpCode == JMPL ) {
+ else if( OpCode == JMPLCALL ) {
MachineOperand & MO = ( MachineOperand &) CallMI->getOperand(2);
return MO.getVRegValue();
//---------------------------------------------------------------------------
-// Finds the # of actaul arguments of the call instruction
+// Finds the # of actual arguments of the call instruction
//---------------------------------------------------------------------------
const unsigned
}
}
- else if( OpCode == JMPL ) {
+ else if( OpCode == JMPLCALL ) {
// The last implicit operand is the return value of a JMPL instr
if( NumOfImpRefs > 0 ) {
//---------------------------------------------------------------------------
// Suggests a register for the ret address in the RET machine instruction
//---------------------------------------------------------------------------
+
void UltraSparcRegInfo::suggestReg4RetAddr(const MachineInstr * RetMI,
LiveRangeInfo& LRI) const {
- assert( (RetMI->getNumOperands() == 2) && "RETURN must have 2 operands");
+ assert( (RetMI->getNumOperands() >= 2)
+ && "JMPL/RETURN must have 3 and 2 operands respectively");
+
MachineOperand & MO = ( MachineOperand &) RetMI->getOperand(0);
MO.setRegForValue( getUnifiedRegNum( IntRegClassID, SparcIntRegOrder::i7) );
-
- // ***TODO: If the JMPL can be also used as a return instruction,
- // change the assertion. The return address register of JMPL will still
- // be Operand(0)
-
-
+
// TODO (Optimize):
// Instead of setting the color, we can suggest one. In that case,
// we have to test later whether it received the suggested color.