<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/106756>106756</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
*** Scheduling failed! ***
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
DigOrDog
</td>
</tr>
</table>
<pre>
# Description
When using a Fuzzer tool, I noticed that this IR causes an error on the x86_64 backend, but not on the aarch64 backend. I'm curious why there's an inconsistency. Thank you for your answer.
# Minimal Reproduction
https://godbolt.org/z/T7798qMnM
## Code
```
define i16 @f(i32 %0, ptr %G.3) {
BB:
%L3 = load i32, ptr null, align 4
%L2 = load i32, ptr addrspace(1) null, align 4
%LGV1 = load i32, ptr %G.3, align 4
%B = xor i32 %L3, %LGV1
%C = icmp slt i32 %0, 0
%C1 = icmp ult i32 %B, 1
%B9 = sub i32 %0, %L3
store i1 %C, ptr %G.3, align 1
store i1 %C1, ptr null, align 1
store i1 false, ptr %G.3, align 1
store i32 %B9, ptr null, align 4
%C2 = icmp eq i32 %0, %L2
store i1 %C2, ptr null, align 1
ret i16 0
}
```
## Stack Trace
```
*** Scheduling failed! ***
SU(8): t46: ch = SETCCm<Mem:(store (s8) into `ptr null`)> Register:i64 $noreg, TargetConstant:i8<1>, Register:i64 $noreg, TargetConstant:i32<0>, Register:i16 $noreg, TargetConstant:i8<4>, t63, t63:1
t63: ch,glue = CopyToReg t51, Register:i32 $eflags, t47:1
has been released too many times!
UNREACHABLE executed at /root/llvm-project/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp:408!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/llc -o /app/output.s -x86-asm-syntax=intel -mtriple=x86_64 -O=2 <source>
1. Running pass 'Function Pass Manager' on module '<source>'.
2. Running pass 'X86 DAG->DAG Instruction Selection' on function '@f'
#0 0x0000000003af5cf8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3af5cf8)
#1 0x0000000003af343c SignalHandler(int) Signals.cpp:0:0
#2 0x00007a9d9ac42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#3 0x00007a9d9ac969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#4 0x00007a9d9ac42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#5 0x00007a9d9ac287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#6 0x0000000003a4a1ea (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3a4a1ea)
#7 0x00000000037ab290 (anonymous namespace)::ScheduleDAGRRList::ReleasePredecessors(llvm::SUnit*) ScheduleDAGRRList.cpp:0:0
#8 0x00000000037ab90a (anonymous namespace)::ScheduleDAGRRList::Schedule() ScheduleDAGRRList.cpp:0:0
#9 0x00000000038ad1f9 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x38ad1f9)
#10 0x00000000038b0242 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x38b0242)
#11 0x00000000038b1551 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x38b1551)
#12 0x00000000038a235f llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x38a235f)
#13 0x0000000002a8dfb9 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#14 0x0000000003082cdd llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3082cdd)
#15 0x0000000003083071 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3083071)
#16 0x000000000308236c llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x308236c)
#17 0x000000000084854c compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#18 0x0000000000738d76 main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x738d76)
#19 0x00007a9d9ac29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#20 0x00007a9d9ac29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#21 0x000000000083f52e _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x83f52e)
Program terminated with signal: SIGSEGV
Compiler returned: 139
```
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMWF1v2zrS_jXMzcCGROrzwhf-iHMCJG-DOO27dwEt0TI3FKlDUqdxf_2ClOxIjrttzgaLLdxYomaeeeaDM6KpMbySjM1QvEDx6oq2dq_0bMWrL3qlqqutKg8zhAmsmCk0byxXEgUrFMz_f88ktIbLCiis2x8_mAarlEB4CbcgleUFK8HuqQW75wZuH6GgrWEGqASmtdKgJNg9g9cseU4i2NLihcnS6W9b6xCOApTqYv8mMYVbhNMailZz1Rr4vj84Mc0QTj06l4WShhvLZHGYwtOeyhc4qBZ2SrtvDVSa70xPO0_6v5jAPZe8pgIeWaNV2RZv3u6tbQwic4TXCK8rVW6VsFOlK4TXPxBeP6Vpnv15L-_PIB3qUpWsX0iC_uNvS7bjkgEPE0BRsEM44wQDwnHggtBY7a5vpgThHFC66JQWC0fDX4J7fkcAkRUIRUvgBB81ZSt8KqjglYRoqIAvKtCy1KahBUM4C53FywgO4OZbeBHiyPaS1YXXeFUaeh_vvGAPNxBcekFe1A0YYWEYkWAoFr7JtW9yCyc3hFvkXs602xFUR6AXM1ZplwaP-zNnwovS4e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