[llvm] [GISEL][RISCV] RegBank Scalable Vector Load/Store (PR #99932)

Michael Maitland via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 30 11:35:14 PDT 2024


================
@@ -333,10 +339,16 @@ RISCVRegisterBankInfo::getInstrMapping(const MachineInstr &MI) const {
   }
   case TargetOpcode::G_STORE: {
     LLT Ty = MRI.getType(MI.getOperand(0).getReg());
-    OpdsMapping[0] = GPRValueMapping;
+    TypeSize Size = Ty.getSizeInBits();
+    if (Ty.isVector())
+      OpdsMapping[0] = getVRBValueMapping(Size.getKnownMinValue());
+    else
+      OpdsMapping[0] = GPRValueMapping;
+
     OpdsMapping[1] = GPRValueMapping;
     // Use FPR64 for s64 stores on rv32.
-    if (GPRSize == 32 && Ty.getSizeInBits() == 64) {
+    if (!Ty.isVector() && GPRSize == 32 &&
+        Ty.getSizeInBits().getFixedValue() == 64) {
----------------
michaelmaitland wrote:

Size.getFixedValue()

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


More information about the llvm-commits mailing list