[llvm] [AArch64][LV] Adjust costs for low-VF interleaved access (PR #209441)

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 17 06:04:55 PDT 2026


================
@@ -5463,14 +5463,17 @@ InstructionCost AArch64TTIImpl::getInterleavedMemoryOpCost(
       // operations. The tree has Log2(Factor) levels, with Factor UZP/ZIP
       // operations at each level, giving a total shuffle cost of
       // Factor * Log2(Factor).
-      llvm::InstructionCost LegalizationCost =
-          getTypeLegalizationCost(SubVecTy).first;
-
-      // For stores, account for an additional legalization cost when
-      // repacking the legalized subvectors into the narrow interleaved
-      // vector.
-      if (Opcode == Instruction::Store)
-        LegalizationCost *= 2;
+      auto SubVecCost = getTypeLegalizationCost(SubVecTy);
+      auto ResultCost = getTypeLegalizationCost(VecTy);
+      llvm::InstructionCost LegalizationCost = SubVecCost.first;
+
+      // A temporary fix to increase the cost in cases where the input element
----------------
sdesmalen-arm wrote:

nit: maybe add `FIXME` to it, to make it clear this must be removed.

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


More information about the llvm-commits mailing list