[all-commits] [llvm/llvm-project] 6df2bf: [AArch64, TTI] Remove RealUse check for vector inse...

Florian Hahn via All-commits all-commits at lists.llvm.org
Mon Jul 28 00:28:37 PDT 2025


  Branch: refs/heads/release/21.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 6df2bfd66b3930e848a4906a000624ce199825b9
      https://github.com/llvm/llvm-project/commit/6df2bfd66b3930e848a4906a000624ce199825b9
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2025-07-28 (Mon, 28 Jul 2025)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
    M llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h
    M llvm/test/Analysis/CostModel/AArch64/reduce-and.ll
    M llvm/test/Analysis/CostModel/AArch64/reduce-or.ll
    M llvm/test/Analysis/CostModel/AArch64/reduce-xor.ll
    M llvm/test/Analysis/CostModel/AArch64/shuffle-other.ll
    M llvm/test/Analysis/CostModel/AArch64/shuffle-select.ll
    M llvm/test/Analysis/CostModel/AArch64/sve-intrinsics.ll
    M llvm/test/Transforms/SLPVectorizer/AArch64/ext-trunc.ll
    M llvm/test/Transforms/SLPVectorizer/AArch64/external-use-icmp.ll
    A llvm/test/Transforms/SLPVectorizer/AArch64/extract-subvector-long-input.ll
    M llvm/test/Transforms/SLPVectorizer/AArch64/extractelements-to-shuffle.ll
    M llvm/test/Transforms/SLPVectorizer/AArch64/gather-buildvector-with-minbitwidth-user.ll
    M llvm/test/Transforms/SLPVectorizer/AArch64/getelementptr.ll
    M llvm/test/Transforms/SLPVectorizer/AArch64/getelementptr2.ll
    M llvm/test/Transforms/SLPVectorizer/AArch64/memory-runtime-checks.ll
    M llvm/test/Transforms/SLPVectorizer/AArch64/multiple_reduction.ll
    A llvm/test/Transforms/SLPVectorizer/AArch64/phi-node-bitwidt-op-not.ll
    M llvm/test/Transforms/SLPVectorizer/AArch64/splat-loads.ll
    M llvm/test/Transforms/SLPVectorizer/AArch64/unreachable-blocks-with-phis.ll
    M llvm/test/Transforms/SLPVectorizer/AArch64/vector-getelementptr.ll
    M llvm/test/Transforms/SLPVectorizer/AArch64/vectorizable-selects-uniform-cmps.ll
    A llvm/test/Transforms/SLPVectorizer/X86/extract-subvector-long-input.ll
    A llvm/test/Transforms/SLPVectorizer/X86/icmp-altopcode-after-reordering.ll
    A llvm/test/Transforms/SLPVectorizer/X86/phi-node-bitwidt-op-not.ll
    M llvm/test/Transforms/SLPVectorizer/alternate-opcode-sindle-bv.ll
    R llvm/test/Transforms/SLPVectorizer/extract-subvector-long-input.ll
    R llvm/test/Transforms/SLPVectorizer/icmp-altopcode-after-reordering.ll
    R llvm/test/Transforms/SLPVectorizer/phi-node-bitwidt-op-not.ll
    M llvm/test/Transforms/VectorCombine/AArch64/load-extractelement-scalarization.ll

  Log Message:
  -----------
  [AArch64,TTI] Remove RealUse check for vector insert/extract costs. (#146526)

getVectorInstrCostHelper would return costs of zero for vector
inserts/extracts that move data between GPR and vector registers, if
there was no 'real' use, i.e. there was no corresponding existing
instruction.

This meant that passes like LoopVectorize and SLPVectorizer, which
likely are the main users of the interface, would understimate the cost
of insert/extracts that move data between GPR and vector registers,
which has non-trivial costs.

The patch removes the special case and only returns costs of zero for
lane 0 if it there is no need to transfer between integer and vector
registers.

This impacts a number of SLP test, and most of them look like general
improvements.I think the change should make things more accurate for any
AArch64 target, but if not it could also just be Apple CPU specific.

I am seeing +2% end-to-end improvements on SLP-heavy workloads.

PR: https://github.com/llvm/llvm-project/pull/146526



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