[llvm] [RISCV][GlobalISel] Legalize Scalable Vector Loads and Stores (PR #84965)

Michael Maitland via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 28 09:09:13 PDT 2024


================
@@ -649,6 +680,61 @@ bool RISCVLegalizerInfo::legalizeExt(MachineInstr &MI,
   return true;
 }
 
+bool RISCVLegalizerInfo::legalizeLoadStore(MachineInstr &MI,
+                                           MachineIRBuilder &MIB) const {
+  MachineRegisterInfo &MRI = *MIB.getMRI();
+  MachineFunction *MF = MI.getParent()->getParent();
+  const DataLayout &DL = MIB.getDataLayout();
+  LLVMContext &Ctx = MF->getFunction().getContext();
+
+  Register DstReg = MI.getOperand(0).getReg();
+  Register PtrReg = MI.getOperand(1).getReg();
+  LLT DataTy = MRI.getType(DstReg);
+  assert(DataTy.isVector() && "Expect vector load.");
+  assert(STI.hasVInstructions() &&
----------------
michaelmaitland wrote:

Same here, this should be a `return false` if a vector type was passed in but it was not supported by the allowed vector configuration.

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


More information about the llvm-commits mailing list