{
switch (AMDILopcode) {
case AMDIL::MAD_f32: return AMDIL::V_MAD_LEGACY_F32;
+ //XXX We need a better way of detecting end of program
+ case AMDIL::RETURN: return AMDIL::S_ENDPGM;
default: return AMDGPUInstrInfo::getISAOpcode(AMDILopcode);
}
}
const char *getPassName() const { return "SI Lower Shader Instructions"; }
- void lowerRETURN(MachineBasicBlock &MBB, MachineBasicBlock::iterator I);
void lowerSET_M0(MachineInstr &MI, MachineBasicBlock &MBB,
MachineBasicBlock::iterator I);
};
I != MBB.end(); I = Next, Next = llvm::next(I) ) {
MachineInstr &MI = *I;
switch (MI.getOpcode()) {
- case AMDIL::RETURN:
- lowerRETURN(MBB, I);
- break;
case AMDIL::SET_M0:
lowerSET_M0(MI, MBB, I);
break;
return false;
}
-void SILowerShaderInstructionsPass::lowerRETURN(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator I)
-{
- const struct TargetInstrInfo * TII = TM.getInstrInfo();
- BuildMI(MBB, I, MBB.findDebugLoc(I), TII->get(AMDIL::S_ENDPGM));
-}
-
void SILowerShaderInstructionsPass::lowerSET_M0(MachineInstr &MI,
MachineBasicBlock &MBB, MachineBasicBlock::iterator I)
{