[llvm] [VP][RISCV] Add a vp.load.ff intrinsic for fault only first load. (PR #128593)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 14 01:18:08 PDT 2025


================
@@ -8473,6 +8473,35 @@ void SelectionDAGBuilder::visitVPLoad(
   setValue(&VPIntrin, LD);
 }
 
+void SelectionDAGBuilder::visitVPLoadFF(
+    const VPIntrinsic &VPIntrin, EVT VT, EVT EVLVT,
+    const SmallVectorImpl<SDValue> &OpValues) {
+  assert(OpValues.size() == 3);
+  SDLoc DL = getCurSDLoc();
+  Value *PtrOperand = VPIntrin.getArgOperand(0);
+  MaybeAlign Alignment = VPIntrin.getPointerAlignment();
+  AAMDNodes AAInfo = VPIntrin.getAAMetadata();
+  const MDNode *Ranges = VPIntrin.getMetadata(LLVMContext::MD_range);
+  SDValue LD;
+  bool AddToChain = true;
+  // Do not serialize variable-length loads of constant memory with
+  // anything.
+  if (!Alignment)
+    Alignment = DAG.getEVTAlign(VT);
+  MemoryLocation ML = MemoryLocation::getAfter(PtrOperand, AAInfo);
+  AddToChain = !BatchAA || !BatchAA->pointsToConstantMemory(ML);
----------------
lukel97 wrote:

Remove the AddToChain = true above?

```suggestion
  bool AddToChain = !BatchAA || !BatchAA->pointsToConstantMemory(ML);
```

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


More information about the llvm-commits mailing list