From a9da1cee40b72787b18f2dbef55420c97fece3f8 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Mon, 23 Mar 2015 18:45:41 +0000 Subject: [PATCH] R600/SI: Merge tables for commuting Don't use a separate table for compares anymore, and use the same VOP2_REV class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232992 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/R600/SIInstrInfo.cpp | 20 -------------------- lib/Target/R600/SIInstrInfo.h | 4 ---- lib/Target/R600/SIInstrInfo.td | 11 +++-------- 3 files changed, 3 insertions(+), 32 deletions(-) diff --git a/lib/Target/R600/SIInstrInfo.cpp b/lib/Target/R600/SIInstrInfo.cpp index b0952e357f1..88f9ee08c9e 100644 --- a/lib/Target/R600/SIInstrInfo.cpp +++ b/lib/Target/R600/SIInstrInfo.cpp @@ -426,29 +426,9 @@ SIInstrInfo::copyPhysReg(MachineBasicBlock &MBB, } } -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 diff --git a/lib/Target/R600/SIInstrInfo.h b/lib/Target/R600/SIInstrInfo.h index 62140086bb6..a9aa99fc227 100644 --- a/lib/Target/R600/SIInstrInfo.h +++ b/lib/Target/R600/SIInstrInfo.h @@ -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); diff --git a/lib/Target/R600/SIInstrInfo.td b/lib/Target/R600/SIInstrInfo.td index 3288d33f1cf..a5a6d66c150 100644 --- a/lib/Target/R600/SIInstrInfo.td +++ b/lib/Target/R600/SIInstrInfo.td @@ -829,11 +829,6 @@ class VOP2_REV { bit IsOrig = isOrig; } -class VOPC_REV { - string RevOp = revOp; - bit IsOrig = isOrig; -} - class AtomicNoRet { string NoRetOp = noRetOp; bit IsRet = isRet; @@ -1077,7 +1072,7 @@ multiclass VOP3_C_m { def "" : VOP3_Pseudo , - VOPC_REV; + VOP2_REV; def _si : VOP3_Real_si , 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"];