[llvm] [AArch64] Lower factor-of-2 interleaved stores to STNP (PR #177938)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 10 05:47:27 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.
----------------
fhahn wrote:
I think you could make this wording a bit more compact, removing the bit about splitting etc.
https://github.com/llvm/llvm-project/pull/177938
More information about the llvm-commits
mailing list