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

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 8 08:48:05 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)};
----------------
topperc wrote:

Yes, though that's probably impossible given current FrameIndex usage.

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


More information about the llvm-commits mailing list