radeon/llvm: Don't lower RETURN to S_ENDPGM on SI

Instead create an S_ENDPGM instruction in the CodeEmitter and emit
it after all the other instructions.
This commit is contained in:
Tom Stellard 2012-06-02 07:57:54 -04:00
parent de7366701d
commit 8cc9b463de
2 changed files with 4 additions and 1 deletions

View file

@ -172,6 +172,10 @@ bool SICodeEmitter::runOnMachineFunction(MachineFunction &MF)
}
}
}
// Emit S_END_PGM
MachineInstr * End = BuildMI(MF, DebugLoc(),
TM->getInstrInfo()->get(AMDIL::S_ENDPGM));
emitInstr(*End);
return false;
}

View file

@ -100,7 +100,6 @@ unsigned SIInstrInfo::getISAOpcode(unsigned AMDILopcode) const
{
switch (AMDILopcode) {
//XXX We need a better way of detecting end of program
case AMDIL::RETURN: return AMDIL::S_ENDPGM;
case AMDIL::MOVE_f32: return AMDIL::V_MOV_B32_e32;
default: return AMDILopcode;
}