[llvm] [AArch64][CostModel] Updated inserelement/extractelement costs (PR #220627)

Utpal Bora via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 9 04:23:51 PDT 2026


================
@@ -4611,6 +4599,28 @@ InstructionCost AArch64TTIImpl::getVectorInstrCostHelper(
     if (Index == 0 && !Ty->getScalarType()->isIntegerTy())
       return 0;
 
+    // SVE has no scalar move to an arbitrary lane above the low 128-bit portion
+    // of a Z register, e.g. there is no equivalent of "mov z0.d[9], d0".
+    // Fixed-length vectors wider than 128 bits therefore need
+    // [splice]/index/pred/splat/cmp/pred-mov when scalarizing inserts for those
+    // lanes, so model them as more expensive than ordinary NEON lane accesses.
+    if (ST->useSVEForFixedLengthVectors()) {
----------------
utpalbora wrote:

Sure.

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


More information about the llvm-commits mailing list