[llvm] r232992 - R600/SI: Merge tables for commuting

Matt Arsenault Matthew.Arsenault at amd.com
Mon Mar 23 11:45:42 PDT 2015


Author: arsenm
Date: Mon Mar 23 13:45:41 2015
New Revision: 232992

URL: http://llvm.org/viewvc/llvm-project?rev=232992&view=rev
Log:
R600/SI: Merge tables for commuting

Don't use a separate table for compares anymore,
and use the same VOP2_REV class.

Modified:
    llvm/trunk/lib/Target/R600/SIInstrInfo.cpp
    llvm/trunk/lib/Target/R600/SIInstrInfo.h
    llvm/trunk/lib/Target/R600/SIInstrInfo.td

Modified: llvm/trunk/lib/Target/R600/SIInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/SIInstrInfo.cpp?rev=232992&r1=232991&r2=232992&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/SIInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/R600/SIInstrInfo.cpp Mon Mar 23 13:45:41 2015
@@ -426,29 +426,9 @@ SIInstrInfo::copyPhysReg(MachineBasicBlo
   }
 }
 
-static unsigned commuteCompareOpcode(unsigned Opcode) {
-  // Compares have arbitrarily selected that < is the "original" and > is the
-  // "reverse"
-
-  int NewOpc;
-
-  NewOpc = AMDGPU::getCommuteCmpRev(Opcode);
-  if (NewOpc != -1)
-    return NewOpc;
-
-  NewOpc = AMDGPU::getCommuteCmpOrig(Opcode);
-  if (NewOpc != -1)
-    return NewOpc;
-
-  return Opcode;
-}
-
 unsigned SIInstrInfo::commuteOpcode(const MachineInstr &MI) const {
   const unsigned Opcode = MI.getOpcode();
 
-  if (MI.isCompare())
-    return commuteCompareOpcode(Opcode);
-
   int NewOpc;
 
   // Try to map original to commuted opcode

Modified: llvm/trunk/lib/Target/R600/SIInstrInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/SIInstrInfo.h?rev=232992&r1=232991&r2=232992&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/SIInstrInfo.h (original)
+++ llvm/trunk/lib/Target/R600/SIInstrInfo.h Mon Mar 23 13:45:41 2015
@@ -349,10 +349,6 @@ namespace AMDGPU {
   int getVOPe32(uint16_t Opcode);
   int getCommuteRev(uint16_t Opcode);
   int getCommuteOrig(uint16_t Opcode);
-
-  int getCommuteCmpRev(uint16_t Opcode);
-  int getCommuteCmpOrig(uint16_t Opcode);
-
   int getAddr64Inst(uint16_t Opcode);
   int getAtomicRetOp(uint16_t Opcode);
   int getAtomicNoRetOp(uint16_t Opcode);

Modified: llvm/trunk/lib/Target/R600/SIInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/SIInstrInfo.td?rev=232992&r1=232991&r2=232992&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/SIInstrInfo.td (original)
+++ llvm/trunk/lib/Target/R600/SIInstrInfo.td Mon Mar 23 13:45:41 2015
@@ -829,11 +829,6 @@ class VOP2_REV <string revOp, bit isOrig
   bit IsOrig = isOrig;
 }
 
-class VOPC_REV <string revOp, bit isOrig> {
-  string RevOp = revOp;
-  bit IsOrig = isOrig;
-}
-
 class AtomicNoRet <string noRetOp, bit isRet> {
   string NoRetOp = noRetOp;
   bit IsRet = isRet;
@@ -1077,7 +1072,7 @@ multiclass VOP3_C_m <vop op, dag outs, d
                      bit HasMods, bit defExec, string revOp> {
 
   def "" : VOP3_Pseudo <outs, ins, pattern, opName>,
-           VOPC_REV<revOp#"_e64", !eq(revOp, opName)>;
+           VOP2_REV<revOp#"_e64", !eq(revOp, opName)>;
 
   def _si : VOP3_Real_si <op.SI3, outs, ins, asm, opName>,
             VOP3DisableFields<1, 0, HasMods> {
@@ -2246,7 +2241,7 @@ def getCommuteRev : InstrMapping {
 }
 
 def getCommuteCmpOrig : InstrMapping {
-  let FilterClass = "VOPC_REV";
+  let FilterClass = "VOP2_REV";
   let RowFields = ["RevOp"];
   let ColFields = ["IsOrig"];
   let KeyCol = ["0"];
@@ -2255,7 +2250,7 @@ def getCommuteCmpOrig : InstrMapping {
 
 // Maps an original opcode to its commuted version
 def getCommuteCmpRev : InstrMapping {
-  let FilterClass = "VOPC_REV";
+  let FilterClass = "VOP2_REV";
   let RowFields = ["RevOp"];
   let ColFields = ["IsOrig"];
   let KeyCol = ["1"];





More information about the llvm-commits mailing list