[llvm] [SLP]Vectorize unique scalars of splat gather nodes as separate subtrees (PR #218250)

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 05:25:54 PDT 2026


bgra8 wrote:

@alexey-bataev we still see a crash after the latest recommit. Please take a look.

`/tmp/repro.ll`:

```ll
target triple = "aarch64-unknown-linux-gnu"

define double @widget() {
bbl:
  %select = select i1 false, i64 0, i64 0
  %and = and i64 %select, 0
  %icmp = icmp eq i64 %and, 0
  %select1 = select i1 %icmp, double 0.000000e+00, double 0.000000e+00
  %bitcast = bitcast double %select1 to i64
  %xor = xor i64 %select, %bitcast
  %bitcast2 = bitcast i64 %xor to double
  %select3 = select i1 %icmp, double 0.000000e+00, double 0.000000e+00
  %select4 = select i1 false, i64 0, i64 0
  %icmp5 = icmp eq i64 %select4, 0
  %select6 = select i1 %icmp5, double 0.000000e+00, double 0.000000e+00
  %bitcast7 = bitcast double %select6 to i64
  %xor8 = xor i64 %select4, %bitcast7
  %bitcast9 = bitcast i64 %xor8 to double
  %select10 = select i1 %icmp5, double 0.000000e+00, double 0.000000e+00
  %bitcast11 = bitcast double %select10 to i64
  %select12 = select i1 false, i64 0, i64 0
  %icmp13 = icmp eq i64 %select12, 0
  %select14 = select i1 %icmp13, double 0.000000e+00, double 0.000000e+00
  %bitcast15 = bitcast double %select14 to i64
  %xor16 = xor i64 %select12, %bitcast15
  %select17 = select i1 %icmp13, double 0.000000e+00, double 0.000000e+00
  %bitcast18 = bitcast double %select17 to i64
  %bitcast19 = bitcast double %select3 to i64
  %xor20 = xor i64 %select, %bitcast19
  %bitcast21 = bitcast i64 %xor20 to double
  %xor22 = xor i64 %select4, %bitcast11
  %bitcast23 = bitcast i64 %xor22 to double
  %fmul = fmul double %bitcast21, %bitcast23
  %xor24 = xor i64 %select12, %bitcast18
  %bitcast25 = bitcast i64 %xor24 to double
  %fmul26 = fmul double %fmul, %bitcast25
  %fmul27 = fmul double %bitcast2, %bitcast9
  %bitcast28 = bitcast i64 %xor16 to double
  %fmul29 = fmul double %fmul27, %bitcast28
  %fadd = fadd double %fmul26, %fmul29
  ret double %fadd
}
```

```shell
# Before this, build `opt` after the latest recommit.
$ opt -passes=slp-vectorizer /tmp/repro.ll -o /dev/null
```


https://github.com/llvm/llvm-project/pull/218250


More information about the llvm-commits mailing list