[llvm] [AArch64] Increase fixed-length SVE scalarization costs (PR #226120)

David Green via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 29 10:55:01 PDT 2026


================
@@ -4891,12 +4891,23 @@ InstructionCost AArch64TTIImpl::getScalarizationOverhead(
     TTI::VectorInstrContext VIC) const {
   if (isa<ScalableVectorType>(Ty))
     return InstructionCost::getInvalid();
+
+  // Fixed-length SVE vectors assembled from constants and scalars may be
+  // materialized through the constant pool or stack. Per-lane insertion costs
+  // do not account for the shared setup cost, so add a conservative overhead.
+  // TODO: Model the scalarization overhead of wide fixed-length SVE vectors
+  // accurately.
+  std::pair<InstructionCost, MVT> LT = getTypeLegalizationCost(Ty);
+  unsigned FixedLengthSVECost =
+      ST->useSVEForFixedLengthVectors(LT.second) ? 5 : 0;
----------------
davemgreen wrote:

Where does 5 come from? Why isn't it dependant on the size of the vector?

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


More information about the llvm-commits mailing list