[all-commits] [llvm/llvm-project] 3e898b: [LV] Fix cost misaligned when gather/scatter w/ ad...

Elvis Wang via All-commits all-commits at lists.llvm.org
Wed Sep 10 16:50:16 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3e898bc40fc344b72cdf6b0ee75eb22b73ee840f
      https://github.com/llvm/llvm-project/commit/3e898bc40fc344b72cdf6b0ee75eb22b73ee840f
  Author: Elvis Wang <elvis.wang at sifive.com>
  Date:   2025-09-11 (Thu, 11 Sep 2025)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
    M llvm/test/Transforms/LoopVectorize/RISCV/gather-scatter-cost.ll

  Log Message:
  -----------
  [LV] Fix cost misaligned when gather/scatter w/ addr is uniform. (#157387)

This patch fix the assertion when the `isUniform` (from legacy model)
and `isSingleScalar`(from Vplan-based model) mismatch.

The simplify test that cause assertion
```
loop:
  loadA = load %a  => %a is loop invariant.
  loadB = load %LoadA
  ...
```
In the legacy cost model, it cannot analysis that addr of `%loadB` is
uniform but in the Vplan-based cost model both addr in `%loadA` and
`loadB` is single scalar.

Full test caused crash: https://llvm.godbolt.org/z/zEG8YKjqh.

---------

Co-authored-by: Luke Lau <luke at igalia.com>



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