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

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 2 13:58:20 PDT 2025


================
@@ -1616,6 +1616,11 @@ class TargetTransformInfo {
       TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput,
       bool UseMaskForCond = false, bool UseMaskForGaps = false) const;
 
+  /// \return The cost of vp intrinsic vp.load.ff.
+  LLVM_ABI InstructionCost getFirstFaultLoadCost(
----------------
fhahn wrote:

Thanks @arcbbb!

> I think that's reasonable. We should probably also consolidate all the different memory costing hooks that can go 
> into getIntrinsicInstrCost? E.g.
> 
>     getMaskedMemoryOpCost -> llvm.masked.load/store
>     getGatherScatterOpCost -> llvm.masked.gather/scatter
>     getExpandCompressMemoryOpCost -> llvm.masked.expandload/llvm.masked.compressstore
>     getStridedMemoryOpCost -> llvm.experimental.vp.strided.load/store

I think that would be an ideal outcome, but I am not sure how easy it would be to pass the required info through.

 Depending on that, it would probably be OK to add another hook like in this PR (at least `getVPMemoryOpCost` is gone now), but would be great to check if the general direction would be feasible.

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


More information about the llvm-commits mailing list