[llvm] [RISCV][GISel] Support select G_INSERT_VECTOR_ELT (PR #176687)

Jianjian Guan via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 28 23:39:35 PDT 2026


================
@@ -522,6 +522,23 @@ RISCVRegisterBankInfo::getInstrMapping(const MachineInstr &MI) const {
       OpdsMapping[1] = GPRValueMapping;
     break;
   }
+  case RISCV::G_VMV_S_VL: {
+    OpdsMapping[0] = getVRBValueMapping(MRI.getType(MI.getOperand(2).getReg())
+                                            .getSizeInBits()
+                                            .getKnownMinValue());
+    OpdsMapping[1] = OpdsMapping[0];
+
+    // The element may be either a GPR or FPR. Preserve that behaviour.
+    if (getRegBank(MI.getOperand(2).getReg(), MRI, TRI) == &RISCV::FPRBRegBank)
+      OpdsMapping[2] = getFPValueMapping(
+          MRI.getType(MI.getOperand(2).getReg()).getSizeInBits());
+    else
+      OpdsMapping[2] = GPRValueMapping;
+
+    // Index needs to be a GPR.
----------------
jacquesguan wrote:

Addressed.

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


More information about the llvm-commits mailing list