<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/87053>87053</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
The "fast" instruction selector options crash `llc`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
TyeYeah
</td>
</tr>
</table>
<pre>
the option `--fast-isel` and `--fast-isel-abort` conflict and crash.
The value of `--fast-isel-abort` should be greater than `1`, like `2` or `3`.
Crash can still be triggerd with `--fast-isel-abort` alone, but different stack dumps.
Crash has be reproduced in `llvm-18.1.2`, `llvm-16` and `llvm-14`.
Reproduced with:
`/mnt/llvm-project-llvmorg-18.1.2/build/bin/llc --fast-isel --fast-isel-abort=2 /mnt/data/acpi_listen.bc -o /mnt/data/acpi_listen.s`
trace:
```s
LLVM ERROR: FastISel didn't lower all arguments: i32 (i32, ptr, ...) (in function: acpid_log)
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: /mnt/llvm-project-llvmorg-18.1.2/build/bin/llc --fast-isel --fast-isel-abort=2 /mnt/data/acpi_listen.bc -o /mnt/data/acpi_listen.s
1. Running pass 'Function Pass Manager' on module '/mnt/data/acpi_listen.bc'.
2. Running pass 'X86 DAG->DAG Instruction Selection' on function '@acpid_log'
#0 0x000064996aabacb8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/Support/Unix/Signals.inc:723:22
#1 0x000064996aabb0d9 PrintStackTraceSignalHandler(void*) /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/Support/Unix/Signals.inc:798:1
#2 0x000064996aab8529 llvm::sys::RunSignalHandlers() /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/Support/Signals.cpp:105:20
#3 0x000064996aaba550 SignalHandler(int) /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/Support/Unix/Signals.inc:413:1
#4 0x000074f8f3c42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#5 0x000074f8f3c969fc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
#6 0x000074f8f3c969fc __pthread_kill_internal ./nptl/pthread_kill.c:78:10
#7 0x000074f8f3c969fc pthread_kill ./nptl/pthread_kill.c:89:10
#8 0x000074f8f3c42476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
#9 0x000074f8f3c287f3 abort ./stdlib/abort.c:81:7
#10 0x000064996a9e0e4b llvm::report_fatal_error(llvm::Twine const&, bool) /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/Support/ErrorHandling.cpp:125:9
#11 0x000064996a837f00 reportFastISelFailure(llvm::MachineFunction&, llvm::OptimizationRemarkEmitter&, llvm::OptimizationRemarkMissed&, bool) /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:711:11
#12 0x000064996a83cbc6 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1529:21
#13 0x000064996a836b46 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:517:7
#14 0x000064996841d82f (anonymous namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:192:0
#15 0x00006499695b3992 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/CodeGen/MachineFunctionPass.cpp:93:33
#16 0x0000649969d94692 llvm::FPPassManager::runOnFunction(llvm::Function&) /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/IR/LegacyPassManager.cpp:1443:20
#17 0x0000649969d94968 llvm::FPPassManager::runOnModule(llvm::Module&) /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/IR/LegacyPassManager.cpp:1489:13
#18 0x0000649969d94dc9 (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/IR/LegacyPassManager.cpp:1558:20
#19 0x0000649969d8fa44 llvm::legacy::PassManagerImpl::run(llvm::Module&) /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/IR/LegacyPassManager.cpp:541:13
#20 0x0000649969d956bf llvm::legacy::PassManager::run(llvm::Module&) /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/IR/LegacyPassManager.cpp:1686:1
#21 0x00006499667c5ac2 compileModule(char**, llvm::LLVMContext&) /mnt/llvm-project-llvmorg-18.1.2/llvm/tools/llc/llc.cpp:745:34
#22 0x00006499667c32da main /mnt/llvm-project-llvmorg-18.1.2/llvm/tools/llc/llc.cpp:412:35
#23 0x000074f8f3c29d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#24 0x000074f8f3c29e40 call_init ./csu/../csu/libc-start.c:128:20
#25 0x000074f8f3c29e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#26 0x00006499667c1fa5 _start (/mnt/llvm-project-llvmorg-18.1.2/build/bin/llc+0xae0fa5)
Aborted (core dumped)
```
Reproduced:
`/mnt/llvm-project-llvmorg-18.1.2/build/bin/llc --fast-isel-abort=2 /mnt/data/acpi_listen.bc -o /mnt/data/acpi_listen.s`
trace:
```s
llc: /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:415: virtual bool llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&): Assertion `(!EnableFastISelAbort || TM.Options.EnableFastISel) && "-fast-isel-abort > 0 requires -fast-isel"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: /mnt/llvm-project-llvmorg-18.1.2/build/bin/llc --fast-isel-abort=2 /mnt/data/acpi_listen.bc -o /mnt/data/acpi_listen.s
1. Running pass 'Function Pass Manager' on module '/mnt/data/acpi_listen.bc'.
2. Running pass 'X86 DAG->DAG Instruction Selection' on function '@main'
#0 0x000058732bd9bcb8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/Support/Unix/Signals.inc:723:22
#1 0x000058732bd9c0d9 PrintStackTraceSignalHandler(void*) /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/Support/Unix/Signals.inc:798:1
#2 0x000058732bd99529 llvm::sys::RunSignalHandlers() /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/Support/Signals.cpp:105:20
#3 0x000058732bd9b550 SignalHandler(int) /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/Support/Unix/Signals.inc:413:1
#4 0x00007dd489c42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#5 0x00007dd489c969fc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
#6 0x00007dd489c969fc __pthread_kill_internal ./nptl/pthread_kill.c:78:10
#7 0x00007dd489c969fc pthread_kill ./nptl/pthread_kill.c:89:10
#8 0x00007dd489c42476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
#9 0x00007dd489c287f3 abort ./stdlib/abort.c:81:7
#10 0x00007dd489c2871b _nl_load_domain ./intl/loadmsgcat.c:1177:9
#11 0x00007dd489c39e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#12 0x000058732bb17274 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:418:38
#13 0x00005873296fe82f (anonymous namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:192:0
#14 0x000058732a894992 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/CodeGen/MachineFunctionPass.cpp:93:33
#15 0x000058732b075692 llvm::FPPassManager::runOnFunction(llvm::Function&) /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/IR/LegacyPassManager.cpp:1443:20
#16 0x000058732b075968 llvm::FPPassManager::runOnModule(llvm::Module&) /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/IR/LegacyPassManager.cpp:1489:13
#17 0x000058732b075dc9 (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/IR/LegacyPassManager.cpp:1558:20
#18 0x000058732b070a44 llvm::legacy::PassManagerImpl::run(llvm::Module&) /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/IR/LegacyPassManager.cpp:541:13
#19 0x000058732b0766bf llvm::legacy::PassManager::run(llvm::Module&) /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/IR/LegacyPassManager.cpp:1686:1
#20 0x0000587327aa6ac2 compileModule(char**, llvm::LLVMContext&) /mnt/llvm-project-llvmorg-18.1.2/llvm/tools/llc/llc.cpp:745:34
#21 0x0000587327aa42da main /mnt/llvm-project-llvmorg-18.1.2/llvm/tools/llc/llc.cpp:412:35
#22 0x00007dd489c29d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#23 0x00007dd489c29e40 call_init ./csu/../csu/libc-start.c:128:20
#24 0x00007dd489c29e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#25 0x0000587327aa2fa5 _start (/mnt/llvm-project-llvmorg-18.1.2/build/bin/llc+0xae0fa5)
Aborted (core dumped)
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzkWl1v2zzS_TXMDWFBIvV54Qs3ifsWSNAizfuge2VQFCVzQ5NekmqT_fULUrL1Ubfp0yRts1sUjiVRM-fMDMnhgY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