[all-commits] [llvm/llvm-project] 5456d6: [AArch64] Lower factor-of-2 interleaved stores to ...

Tomer Shafir via All-commits all-commits at lists.llvm.org
Wed Feb 11 05:37:35 PST 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5456d6352a684fcf55ecfc229838dea100f6d359
      https://github.com/llvm/llvm-project/commit/5456d6352a684fcf55ecfc229838dea100f6d359
  Author: Tomer Shafir <tomer.shafir8 at gmail.com>
  Date:   2026-02-11 (Wed, 11 Feb 2026)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
    M llvm/lib/Target/AArch64/AArch64InstrInfo.td
    M llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h
    A llvm/test/CodeGen/AArch64/nontemporal-load-interleaved.ll
    A llvm/test/CodeGen/AArch64/nontemporal-store-interleaved-optsize.ll
    A llvm/test/CodeGen/AArch64/nontemporal-store-interleaved.ll

  Log Message:
  -----------
  [AArch64] Lower factor-of-2 interleaved stores to STNP (#177938)

This patch prioritizes lowering to `stnp` over `st2` store instructions
marked !nontemporal.

>From performance perspective, we should conservatively prioritize STNP
lowering for non-temporal stores, because currently NT stores requires
explicit usage of `__builtin_nontemporal_store()` intrinsic, so I think
its reasonable to assume the developer explicitly intends to optimize
D-cache usage of some hot non-temporal execution. He can rollback if it
doesnt help.

The cost here is it adds a few instructions for code size (thus we
predicate when not optimizing for code size), few extra fast
instructions to execute, few extra short dep chains - should be commonly
handled by OOO execution, I-cache alignment effects, few extra
registers. In the future we can may be able to approximate a cost model
to select by.

The patch implements an AArch64 specific static function to model what
NT stores are directly legal on the backend currently, and
`AArch64TargetLowering::lowerInterleavedStore` to conditionally skip st2
lowering.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list