[llvm] [TTI][RISCV] Add cost modelling for intrinsic vp.load.ff (PR #169890)

Shih-Po Hung via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 30 06:58:51 PST 2025


================
@@ -1007,6 +1007,24 @@ InstructionCost RISCVTTIImpl::getScalarizationOverhead(
   return Cost;
 }
 
+InstructionCost
+RISCVTTIImpl::getMemIntrinsicInstrCost(const MemIntrinsicCostAttributes &MICA,
+                                       TTI::TargetCostKind CostKind) const {
+  Type *DataTy = MICA.getDataType();
+  Align Alignment = MICA.getAlignment();
+  switch (MICA.getID()) {
+  case Intrinsic::vp_load_ff: {
+    EVT DataTypeVT = TLI->getValueType(DL, DataTy);
+    if (!TLI->isLegalFirstFaultLoad(DataTypeVT, Alignment))
+      return BaseT::getMemIntrinsicInstrCost(MICA, CostKind);
+
+    return getMemoryOpCost(Instruction::Load, DataTy, Alignment, 0, CostKind,
----------------
arcbbb wrote:

 Nice catch. I missed this during the rebase.

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


More information about the llvm-commits mailing list