[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:15:27 PDT 2026


================
@@ -1074,10 +1076,34 @@ class TargetTransformInfo {
 
   using VectorInstrContext = llvm::VectorInstrContext;
 
+  /// Combines 2 context hints into a single value. If both are equal, keep the
+  /// shared context, otherwise fall back to no specific context.
+  LLVM_ABI static TargetTransformInfo::VectorInstrContext
+  combineVectorInstrContexts(TargetTransformInfo::VectorInstrContext Ctx1,
+                             TargetTransformInfo::VectorInstrContext Ctx2);
----------------
lukel97 wrote:

I know @alexey-bataev mentioned moving this into a TTI, but for a single use site I really don't think it's worth exposing this in TTI. The definition is so simple you could just inline this in SLPVectorizer.cpp. 

TargetTransformInfo.h is pulled in from a lot of places so it's nice to keep it as lean as possible. 

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


More information about the llvm-commits mailing list