[llvm] [TTI][Vectorize] Migrate masked/gather-scatter/strided/expand-compress costing (NFCI) (PR #165532)
David Green via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 10 04:37:30 PST 2025
davemgreen wrote:
> > OK, sounds good. I'm not against this, I was just thinking of things like what the stride was in a StridedMemoryOp (constants / small values could be cheaper on some hypothetical architecture). GatherScatters could do with better cost modelling, including possible whether the addresses are base + vector offset or vector-base + constant offset, etc. This combined interface might make passing that information harder.
>
> I agree that a constant stride helps the cost model. In that cases I’d extend getMemIntrinsicInstrCost to take a MemAttr bag which has a constructor specific for target intrinsic. Callers would look like:
>
> * getMemIntrinsicInstrCost(Intrinsic::masked_load, MemAttr(...), K)
> * getMemIntrinsicInstrCost(Intrinsic::vp_strided_load, MemAttr(..., Stride, ...), K)
>
> This way just resembles getIntrinsicInstrCost. And how to fold MemAttr(...) into IntrinsicCostAttributes is a open question as noted in the reply above to @lukel97.
The constant stride to StridedMemoryOp was just a hypothetical - I don't have a real place that would be useful, so don't worry about it too much. It was more of a general question about higher-level information being passed through to each of the functions and whether this is really better.
https://github.com/llvm/llvm-project/pull/165532
More information about the llvm-commits
mailing list