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

Utpal Bora via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 8 00:59:56 PDT 2026


================
@@ -4611,6 +4599,31 @@ 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()) {
+      InstructionCost Cost = CostKind == TTI::TCK_CodeSize
----------------
utpalbora wrote:

Done.

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


More information about the llvm-commits mailing list