[llvm] [AArch64] Lower factor-of-2 interleaved stores to STNP (PR #177938)
Tomer Shafir via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 10 06:54:32 PST 2026
================
@@ -18573,6 +18610,30 @@ bool AArch64TargetLowering::lowerInterleavedStore(Instruction *Store,
BaseAddr, DL)))
return false;
+ // Conditionally skip nontemporal stores, because in that case we should
+ // prioritize emitting non-temporal store instructions, but AArch64 doesn't
+ // have non-temporal interleaved stores.
+ //
+ // Currently, STNP lowering can only either keep or increase code size,
+ // thus we predicate it to not apply when optimizing for code size.
+ //
+ // The check is conservative:
+ //
+ // - Don't skip if the interleaving factor is greater than 2, as the shuffling
+ // overhead becomes higher.
+ // - Don't skip if the store value types which are not directly legal. They
+ // may theoratically be split by legalization and lowered to STNPs, but they
+ // can also match only partially in the worst case and actually emit temporal
+ // stores.
+ //
+ // We may need to revisit this heuristic using an approximated cost model,
+ // also for higher factors.
----------------
tomershafir wrote:
At this moment the direction is pretty abstract, so removing
https://github.com/llvm/llvm-project/pull/177938
More information about the llvm-commits
mailing list