Mesa (master): radeon/llvm: Don't lower RETURN to S_ENDPGM on SI

Tom Stellard tstellar at kemper.freedesktop.org
Wed Jun 6 13:50:19 UTC 2012


Module: Mesa
Branch: master
Commit: 8cc9b463deae8f6116963e1fea0c62930066b563
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8cc9b463deae8f6116963e1fea0c62930066b563

Author: Tom Stellard <thomas.stellard at amd.com>
Date:   Sat Jun  2 07:57:54 2012 -0400

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.

---

 src/gallium/drivers/radeon/SICodeEmitter.cpp |    4 ++++
 src/gallium/drivers/radeon/SIInstrInfo.cpp   |    1 -
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/radeon/SICodeEmitter.cpp b/src/gallium/drivers/radeon/SICodeEmitter.cpp
index d2ea1fb..1d24706 100644
--- a/src/gallium/drivers/radeon/SICodeEmitter.cpp
+++ b/src/gallium/drivers/radeon/SICodeEmitter.cpp
@@ -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;
 }
 
diff --git a/src/gallium/drivers/radeon/SIInstrInfo.cpp b/src/gallium/drivers/radeon/SIInstrInfo.cpp
index 40a1891..4c7a920 100644
--- a/src/gallium/drivers/radeon/SIInstrInfo.cpp
+++ b/src/gallium/drivers/radeon/SIInstrInfo.cpp
@@ -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;
   }




More information about the mesa-commit mailing list