[llvm] [TTI][Vectorize] Migrate masked/gather-scatter/strided/expand-compress costing (NFCI) (PR #165532)
Shih-Po Hung via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 5 04:11:13 PST 2025
arcbbb wrote:
> The getMemIntrinsicInstrCost hook is fine by me. But I also wonder if it would be possible to store the Instruction + VariableMask inside `IntrinsicCostAttributes` and reuse getIntrinsicInstCost. Is that difficult to do? Not strongly opinionated on this either way
It is tempting to reuse getIntrinsicInstrCost by stuffing the memory extras into IntrinsicCostAttributes, but I only figure out two imperfect ways to do it:
- Option 1: Reuse ParamTys and Arguments in ICA
- At callsite, Store takes something like: getIntrinsicInstrCost({IID, getVoidTy(), {Data, Ptr}, VariableMask, Align}, ...)
- Load: getIntrinsicInstrCost({IID, DataTy, {Ptr}, VariableMask, Align}, ...)
- Downside: Not ergonomic and now users have to fabricate pseudo-args and the tuple differs for loads vs stores.
- Option 2: Ignore the ParamTys and Arguments in ICA
- At callsite it will be getIntrinsicInstrCost({Ptr, DataTy, Align, VariableMask}, ...)
- Downside: Need a exclusive mode in ICA because ParamTys & Arguments are not used. and the shared parts in ICA are little.
And so far I am not satisfied with either of these.
https://github.com/llvm/llvm-project/pull/165532
More information about the llvm-commits
mailing list