[llvm] [SLP] Inefficient cost-modelling and codegen for reductions with slp-… (PR #197875)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 11 01:39:49 PDT 2026


Andarwinux wrote:

```llvm
define <16 x float> @a(ptr %0, ptr %1) {
  %3 = load <16 x float>, ptr %0, align 64
  %4 = fadd <16 x float> %3, %3
  %5 = load <16 x float>, ptr %1, align 64
  %6 = fadd <16 x float> %4, %5
  %7 = fadd <16 x float> %6, zeroinitializer
  %8 = fadd <16 x float> %7, splat (float 1.000000e+00)
  ret <16 x float> %8
}
```

```
fatal error: error in backend: Do not know how to split this operator's operand!

PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and dumped files.
Stack dump:
0.      Program arguments: clang -O3 -mllvm -slp-revec -w -c reduced.ll
1.      Code generation
2.      Running pass 'Function Pass Manager' on module 'reduced.ll'.
3.      Running pass 'X86 DAG->DAG Instruction Selection' on function '@a'
#0 0x00005b04c3dd7b96 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) Signals.cpp:0:0
clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
```
```
fatal error: error in backend: Cannot emit physreg copy instruction
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and dumped files.
Stack dump:
0.      Program arguments: clang -march=tigerlake -O3 -mllvm -slp-revec -w -c reduced.ll
1.      Code generation
2.      Running pass 'Function Pass Manager' on module 'reduced.ll'.
3.      Running pass 'Post-RA pseudo instruction expansion pass' on function '@a'
#0 0x00005d4b923d7b96 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) Signals.cpp:0:0
clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
```

Looks like this PR will cause x86 backend crash with -slp-revec.

https://github.com/llvm/llvm-project/issues/203195

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


More information about the llvm-commits mailing list