diff --git a/llvm/lib/Target/Mips/MicroMipsDSPInstrInfo.td b/llvm/lib/Target/Mips/MicroMipsDSPInstrInfo.td --- a/llvm/lib/Target/Mips/MicroMipsDSPInstrInfo.td +++ b/llvm/lib/Target/Mips/MicroMipsDSPInstrInfo.td @@ -374,7 +374,6 @@ string AsmString = !strconcat("wrdsp", "\t$rt, $mask"); list Pattern = [(int_mips_wrdsp GPR32Opnd:$rt, timmZExt7:$mask)]; InstrItinClass Itinerary = NoItinerary; - bit isMoveReg = 1; } class BPOSGE32C_MMR3_DESC { diff --git a/llvm/lib/Target/Mips/MipsDSPInstrInfo.td b/llvm/lib/Target/Mips/MipsDSPInstrInfo.td --- a/llvm/lib/Target/Mips/MipsDSPInstrInfo.td +++ b/llvm/lib/Target/Mips/MipsDSPInstrInfo.td @@ -452,7 +452,6 @@ list Pattern = [(set GPR32Opnd:$rd, (OpNode timmZExt10:$mask))]; InstrItinClass Itinerary = itin; string BaseOpcode = instr_asm; - bit isMoveReg = 1; } class WRDSP_DESC_BASE Pattern = [(OpNode GPR32Opnd:$rs, timmZExt10:$mask)]; InstrItinClass Itinerary = itin; string BaseOpcode = instr_asm; - bit isMoveReg = 1; } class DPA_W_PH_DESC_BASE { diff --git a/llvm/lib/Target/Mips/MipsSEInstrInfo.cpp b/llvm/lib/Target/Mips/MipsSEInstrInfo.cpp --- a/llvm/lib/Target/Mips/MipsSEInstrInfo.cpp +++ b/llvm/lib/Target/Mips/MipsSEInstrInfo.cpp @@ -200,44 +200,14 @@ return false; } -/// If @MI is WRDSP/RRDSP instruction return true with @isWrite set to true -/// if it is WRDSP instruction. -static bool isReadOrWriteToDSPReg(const MachineInstr &MI, bool &isWrite) { - switch (MI.getOpcode()) { - default: - return false; - case Mips::WRDSP: - case Mips::WRDSP_MM: - isWrite = true; - break; - case Mips::RDDSP: - case Mips::RDDSP_MM: - isWrite = false; - break; - } - return true; -} - /// We check for the common case of 'or', as it's MIPS' preferred instruction /// for GPRs but we have to check the operands to ensure that is the case. /// Other move instructions for MIPS are directly identifiable. std::optional MipsSEInstrInfo::isCopyInstrImpl(const MachineInstr &MI) const { - bool isDSPControlWrite = false; - // Condition is made to match the creation of WRDSP/RDDSP copy instruction - // from copyPhysReg function. - if (isReadOrWriteToDSPReg(MI, isDSPControlWrite)) { - if (!MI.getOperand(1).isImm() || MI.getOperand(1).getImm() != (1 << 4)) - return std::nullopt; - else if (isDSPControlWrite) { - return DestSourcePair{MI.getOperand(2), MI.getOperand(0)}; - - } else { - return DestSourcePair{MI.getOperand(0), MI.getOperand(2)}; - } - } else if (MI.isMoveReg() || isORCopyInst(MI)) { + if (MI.isMoveReg() || isORCopyInst(MI)) return DestSourcePair{MI.getOperand(0), MI.getOperand(1)}; - } + return std::nullopt; }