radeon/llvm: Remove obselete hooks for the ConvertToISA pass
authorTom Stellard <thomas.stellard@amd.com>
Wed, 6 Jun 2012 00:10:31 +0000 (20:10 -0400)
committerTom Stellard <thomas.stellard@amd.com>
Wed, 6 Jun 2012 17:46:04 +0000 (13:46 -0400)
We can't remove this pass yet, because we need it to convert AMDIL
registers in BRANCH* instructions, but we don't need it for
instruction conversion any more.

src/gallium/drivers/radeon/AMDGPUInstrInfo.cpp
src/gallium/drivers/radeon/AMDGPUInstrInfo.h
src/gallium/drivers/radeon/R600InstrInfo.cpp
src/gallium/drivers/radeon/R600InstrInfo.h
src/gallium/drivers/radeon/SIInstrInfo.cpp
src/gallium/drivers/radeon/SIInstrInfo.h

index 3c94c3da817360085d5cea5e2590e9afe50454bf..d2bb4e16b475b6e1f5ac402013d20a2fa57b88b5 100644 (file)
@@ -29,10 +29,9 @@ MachineInstr * AMDGPUInstrInfo::convertToISA(MachineInstr & MI, MachineFunction
   MachineInstrBuilder newInstr;
   MachineRegisterInfo &MRI = MF.getRegInfo();
   const AMDGPURegisterInfo & RI = getRegisterInfo();
-  unsigned ISAOpcode = getISAOpcode(MI.getOpcode());
 
   // Create the new instruction
-  newInstr = BuildMI(MF, DL, TM.getInstrInfo()->get(ISAOpcode));
+  newInstr = BuildMI(MF, DL, TM.getInstrInfo()->get(MI.getOpcode()));
 
   for (unsigned i = 0; i < MI.getNumOperands(); i++) {
     MachineOperand &MO = MI.getOperand(i);
index b0d4e8a519c3350fafb5c74c753eac2845386b79..e6b79c867a84709ac967b4a9d977a4eff5534b25 100644 (file)
@@ -36,10 +36,6 @@ public:
 
   virtual const AMDGPURegisterInfo &getRegisterInfo() const = 0;
 
-  /// getISAOpcode - This function takes an AMDIL opcode as an argument and
-  /// returns an equivalent ISA opcode.
-  virtual unsigned getISAOpcode(unsigned AMDILopcode) const = 0;
-
   /// convertToISA - Convert the AMDIL MachineInstr to a supported ISA
   /// MachineInstr
   virtual MachineInstr * convertToISA(MachineInstr & MI, MachineFunction &MF,
index 363c814886356dd6b7fd6d744531952d8dcd57a9..3d65e7373c9b4940fc81ebe298b72705e798c03e 100644 (file)
@@ -61,46 +61,6 @@ R600InstrInfo::copyPhysReg(MachineBasicBlock &MBB,
   }
 }
 
-unsigned R600InstrInfo::getISAOpcode(unsigned opcode) const
-{
-  switch (opcode) {
-    default: return opcode;
-    case AMDIL::IEQ:
-      return AMDIL::SETE_INT;
-    case AMDIL::INE:
-      return AMDIL::SETNE_INT;
-    case AMDIL::IGE:
-      return AMDIL::SETGE_INT;
-    case AMDIL::MOVE_f32:
-    case AMDIL::MOVE_i32:
-      return AMDIL::MOV;
-    case AMDIL::UGE:
-      return AMDIL::SETGE_UINT;
-    case AMDIL::UGT:
-      return AMDIL::SETGT_UINT;
-  }
-}
-
-unsigned R600InstrInfo::getASHRop() const
-{
-       unsigned gen = TM.getSubtarget<AMDILSubtarget>().device()->getGeneration();
-       if (gen < AMDILDeviceInfo::HD5XXX) {
-               return AMDIL::ASHR_r600;
-       } else {
-               return AMDIL::ASHR_eg;
-       }
-}
-
-unsigned R600InstrInfo::getLSHRop() const
-{
-  unsigned gen = TM.getSubtarget<AMDILSubtarget>().device()->getGeneration();
-  if (gen < AMDILDeviceInfo::HD5XXX) {
-    return AMDIL::LSHR_r600;
-  } else {
-    return AMDIL::LSHR_eg;
-  }
-}
-
 MachineInstr * R600InstrInfo::getMovImmInstr(MachineFunction *MF,
                                              unsigned DstReg, int64_t Imm) const
 {
index 2db10addef44cf31afba61757030d78769380f72..a7a65d5f3a177f0cd7a242db4c8bae4584c01392 100644 (file)
@@ -41,12 +41,8 @@ namespace llvm {
                            unsigned DestReg, unsigned SrcReg,
                            bool KillSrc) const;
 
-  virtual unsigned getISAOpcode(unsigned opcode) const;
   bool isTrig(const MachineInstr &MI) const;
 
-  unsigned getLSHRop() const;
-  unsigned getASHRop() const;
-
   virtual MachineInstr * getMovImmInstr(MachineFunction *MF, unsigned DstReg,
                                         int64_t Imm) const;
 
index 058c772e620a80d9a48f7a49c04d274a18241feb..1d464fec033b50dac6aeb61982009643d67e3177 100644 (file)
@@ -77,34 +77,6 @@ unsigned SIInstrInfo::getEncodingBytes(const MachineInstr &MI) const
   }
 }
 
-MachineInstr * SIInstrInfo::convertToISA(MachineInstr & MI, MachineFunction &MF,
-    DebugLoc DL) const
-{
-  MachineInstr * newMI = AMDGPUInstrInfo::convertToISA(MI, MF, DL);
-  const MCInstrDesc &newDesc = get(newMI->getOpcode());
-
-  /* If this instruction was converted to a VOP3, we need to add the extra
-   * operands for abs, clamp, omod, and negate. */
-  if (getEncodingType(*newMI) == SIInstrEncodingType::VOP3
-      && newMI->getNumOperands() < newDesc.getNumOperands()) {
-    MachineInstrBuilder builder(newMI);
-    for (unsigned op_idx = newMI->getNumOperands();
-                  op_idx < newDesc.getNumOperands(); op_idx++) {
-      builder.addImm(0);
-    }
-  }
-  return newMI;
-}
-
-unsigned SIInstrInfo::getISAOpcode(unsigned AMDILopcode) const
-{
-  switch (AMDILopcode) {
-  //XXX We need a better way of detecting end of program
-  case AMDIL::MOVE_f32: return AMDIL::V_MOV_B32_e32;
-  default: return AMDILopcode;
-  }
-}
-
 MachineInstr * SIInstrInfo::getMovImmInstr(MachineFunction *MF, unsigned DstReg,
                                            int64_t Imm) const
 {
index 6cfbaf4623b002554193c266a6b0783956edd8d1..aa567b6c8ea107dce2128654940f9d8a0bad41eb 100644 (file)
@@ -42,15 +42,6 @@ public:
   /// number of bytes.
   unsigned getEncodingBytes(const MachineInstr &MI) const;
 
-  /// convertToISA - Convert the AMDIL MachineInstr to a supported SI
-  ///MachineInstr
-  virtual MachineInstr * convertToISA(MachineInstr & MI, MachineFunction &MF,
-                                        DebugLoc DL) const;
-
-  /// getISAOpcode - This function takes an AMDIL opcode as an argument and
-  /// returns an equivalent SI opcode.
-  virtual unsigned getISAOpcode(unsigned AMDILopcode) const;
-
   virtual MachineInstr * getMovImmInstr(MachineFunction *MF, unsigned DstReg,
                                         int64_t Imm) const;