[llvm] [RISCV] Handle ADD in RISCVInstrInfo::isCopyInstrImpl (PR #81123)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 8 08:40:39 PST 2024


================
@@ -1579,6 +1579,12 @@ RISCVInstrInfo::isCopyInstrImpl(const MachineInstr &MI) const {
   switch (MI.getOpcode()) {
   default:
     break;
+  case RISCV::ADD:
+    if (MI.getOperand(1).isReg() && MI.getOperand(1).getReg() == RISCV::X0)
+      return DestSourcePair{MI.getOperand(0), MI.getOperand(2)};
----------------
preames wrote:

Isn't that implied by the instruction opcode?  It can't be an immediate.  Are you thinking a frame index or something like that?

https://github.com/llvm/llvm-project/pull/81123


More information about the llvm-commits mailing list