[llvm] [RISCV] Fold vfmv.f.s into load from stack (PR #110129)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 26 08:51:32 PDT 2024


================
@@ -784,6 +784,26 @@ MachineInstr *RISCVInstrInfo::foldMemoryOperandImpl(
       }
       break;
     }
+    if (RISCV::getRVVMCOpcode(MI.getOpcode()) == RISCV::VFMV_F_S) {
+      unsigned Log2SEW =
+          MI.getOperand(RISCVII::getSEWOpNum(MI.getDesc())).getImm();
+      if (STI.getXLen() < (1 << Log2SEW))
----------------
topperc wrote:

Is this XLen checked needed?

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


More information about the llvm-commits mailing list