[llvm] [SLP] More accurately cost RISCV scalar splats (PR #213104)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 11 04:25:50 PDT 2026
================
@@ -3594,6 +3609,31 @@ bool RISCVTTIImpl::canSplatOperand(Instruction *I, int Operand) const {
}
}
+TargetTransformInfo::VectorInstrContext RISCVTTIImpl::getBuildVectorContextHint(
+ ArrayRef<int> Mask, ArrayRef<Value *> Scalars,
+ function_ref<bool(SmallVectorImpl<TargetTransformInfo::BuildVectorUseOp> &)>
+ GatherUseOps) const {
----------------
lukel97 wrote:
I think this API changed since the last I reviewed it. Passing a function_ref through TTI is pretty gnarly, these are internal details of SLP leaking into TTI. Other passes won't be able to use this interface since they don't have the notion of BuildVectorUseOp.
It doesn't look like any part of this is particularly specific to RISC-V. Can we just move this into SLPCostAnalysis?
https://github.com/llvm/llvm-project/pull/213104
More information about the llvm-commits
mailing list