radeonsi/llvm: Move lowering of RETURN to ConvertToISA pass
authorTom Stellard <thomas.stellard@amd.com>
Thu, 10 May 2012 19:29:00 +0000 (15:29 -0400)
committerTom Stellard <thomas.stellard@amd.com>
Thu, 10 May 2012 19:41:32 +0000 (15:41 -0400)
src/gallium/drivers/radeon/SIInstrInfo.cpp
src/gallium/drivers/radeon/SILowerShaderInstructions.cpp

index e733aa856e4e320197944e90be9eed4a47811d7e..0cb97643a7fa52b2e1c3090e999a7962aeaeaa27 100644 (file)
@@ -107,6 +107,8 @@ unsigned SIInstrInfo::getISAOpcode(unsigned AMDILopcode) const
 {
   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);
   }
 }
index c66b8f3f9e12dc318048c1bba47ecc859ca0d0e6..0c5a831440b92d587fed721c8d70ea01fbad29af 100644 (file)
@@ -35,7 +35,6 @@ namespace {
 
     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);
   };
@@ -57,9 +56,6 @@ bool SILowerShaderInstructionsPass::runOnMachineFunction(MachineFunction &MF)
          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;
@@ -72,13 +68,6 @@ bool SILowerShaderInstructionsPass::runOnMachineFunction(MachineFunction &MF)
   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)
 {