Issue 203968
Summary AArch64 InstructionSelect crash with fptosi <16 x float> to <16 x i32> at -O0
Labels
Assignees
Reporter aneshlya
    AArch64 backend crashes (segfault) during the `InstructionSelect` pass when compiling IR with `fptosi <16 x float> to <16 x i32>` at `-O0` optimization level. The same IR compiles successfully with LLVM 22 or with `-O1`/higher optimization levels.
Running `opt -O1` on the IR before `llc -O0` avoids the crash

```
target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32"
target triple = "arm64-apple-macosx11.0"

define void @f_fu___un_3C_unf_3E_un_3C_unf_3E_unf() {
allocas:
  %mul__a_load18 = fmul <16 x float> splat (float 2.000000e+00), zeroinitializer
 %mul__a_load18_to_int32 = fptosi <16 x float> %mul__a_load18 to <16 x i32>
 store <16 x i32> %mul__a_load18_to_int32, ptr null, align 64
  ret void
}
```
Run: `llc -march=aarch64 -O0 test.ll -o test.s`
```
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0.	Program arguments: /opt/compiler-explorer/clang-trunk/bin/llc -o /app/output.s -x86-asm-syntax=intel -march=aarch64 -O0 <source>
1.	Running pass 'Function Pass Manager' on module '<source>'.
2.	Running pass 'InstructionSelect' on function '@f_fu___un_3C_unf_3E_un_3C_unf_3E_unf'
#0 0x0000000003c2dd48 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-trunk/bin/llc+0x3c2dd48)
#1 0x0000000003c2ae84 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#2 0x000073c980c45330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
Program terminated with signal: SIGSEGV
Compiler returned: 139
```
https://godbolt.org/z/qhvoKdd3s
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to