[all-commits] [llvm/llvm-project] adb6ef: [SLP] Fix cost estimation of external uses with wr...

Gaëtan Bossu via All-commits all-commits at lists.llvm.org
Tue Jul 15 03:39:30 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: adb6efeac92ba13d65ecacc12f8f84e83a2286d0
      https://github.com/llvm/llvm-project/commit/adb6efeac92ba13d65ecacc12f8f84e83a2286d0
  Author: Gaëtan Bossu <gaetan.bossu at arm.com>
  Date:   2025-07-15 (Tue, 15 Jul 2025)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
    M llvm/test/Transforms/SLPVectorizer/RISCV/segmented-loads.ll

  Log Message:
  -----------
  [SLP] Fix cost estimation of external uses with wrong VF (#148185)

It assumed that the VF remains constant throughout the tree. That's not
always true. This meant that we could query the extraction cost for a
lane that is out of bounds.

While experimenting with re-vectorisation for AArch64, we ran into this
issue. We cannot add a proper AArch64 test as more changes would need to
be brought in.

This commit is only fixing the computation of VF and adding an assert.
Some tests were failing after adding the assert:
 - foo() in llvm/test/Transforms/SLPVectorizer/X86/horizontal.ll
- test() in
llvm/test/Transforms/SLPVectorizer/X86/reduction-with-removed-extracts.ll
- test_with_extract() in
llvm/test/Transforms/SLPVectorizer/RISCV/segmented-loads.ll



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