<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/95291>95291</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[X86] Call result #3 has unhandled type f16
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
nurmukhametov
</td>
</tr>
</table>
<pre>
Consider the following code
```llvm-ir
declare <4 x half> @foo()
declare void @use(<4 x half>)
define void @boo() noinline optnone {
%v = call <4 x half> @foo()
call void @use(<4 x half> %v)
ret void
}
```
that hits UNREACHABLE when compiled with the following command
```bash
$ llc -mcpu=corei7-avx test.ll -o -
Call result #3 has unhandled type f16
UNREACHABLE executed at /root/llvm-project/llvm/lib/CodeGen/CallingConvLower.cpp:172!
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 -mcpu=corei7-avx <source>
1. Running pass 'Function Pass Manager' on module '<source>'.
2. Running pass 'X86 DAG->DAG Instruction Selection' on function '@boo'
#0 0x0000000003a01548 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3a01548)
#1 0x00000000039fec9c SignalHandler(int) Signals.cpp:0:0
#2 0x000070ba28c42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#3 0x000070ba28c969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#4 0x000070ba28c42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#5 0x000070ba28c287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#6 0x000000000394fb3a (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x394fb3a)
#7 0x0000000002803063 llvm::CCState::AnalyzeCallResult(llvm::SmallVectorImpl<llvm::ISD::InputArg> const&, bool (*)(unsigned int, llvm::MVT, llvm::MVT, llvm::CCValAssign::LocInfo, llvm::ISD::ArgFlagsTy, llvm::CCState&)) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2803063)
#8 0x000000000211168f (anonymous namespace)::X86FastISel::fastLowerCall(llvm::FastISel::CallLoweringInfo&) X86FastISel.cpp:0:0
#9 0x000000000366b734 llvm::FastISel::lowerCallTo(llvm::FastISel::CallLoweringInfo&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x366b734)
#10 0x000000000366c9a2 llvm::FastISel::lowerCall(llvm::CallInst const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x366c9a2)
#11 0x00000000036724c9 llvm::FastISel::selectCall(llvm::User const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x36724c9)
#12 0x000000000366d23c llvm::FastISel::selectOperator(llvm::User const*, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x366d23c)
#13 0x0000000003674661 llvm::FastISel::selectInstruction(llvm::Instruction const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3674661)
#14 0x00000000037c27e2 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x37c27e2)
#15 0x00000000037c4308 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x37c4308)
#16 0x00000000037b54ff llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x37b54ff)
#17 0x00000000029f2a59 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#18 0x0000000002fbe363 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2fbe363)
#19 0x0000000002fbe5a1 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2fbe5a1)
#20 0x0000000002fbee05 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2fbee05)
#21 0x00000000008381cc compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#22 0x000000000072e0ee main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x72e0ee)
#23 0x000070ba28c29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#24 0x000070ba28c29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#25 0x000000000082ecee _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x82ecee)
Program terminated with signal: SIGSEGV
Compiler returned: 139
```
Compiler explorer link: https://godbolt.org/z/8W3Psdq55
It started to crash somewhere in between LLVM 14 and 15. It looks like this was introduced by https://github.com/llvm/llvm-project/commit/f18794816270244f9942e9217b96e23a94a7f32c
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMmF1T4zjWxz-NcqNKypbfL3JhEsJQBc9QnR6evqNk-Tj2IkteSYYwn35LtgNRYJpmN7O1FBBHL-f8_jp686FaNzsBsETRBYrWM9qbWqql6FXbP9a0BSOfZoUsX5YrKXRTgsKmBlxJzuVzI3aYyRKQt0ZePv2PvfGX86d23qixtATGqQKMglWI97imvELBJUahV0mJSIpI5jZ8kk1pq3sNttrp9tr40KVqxFuP4mAQC9kIbqtkZ4QUgFFyMXbBGJHoCaNgjRnl_HMsPLb7GdVg8qiDAjO0n1CT9cn4HEswNTW4bozGf_zft8t89Vt-cXOJn2sQmMm2aziU-Lkx9buxb1sqyhPDBdX1VERCzDnD85Z1PQrWTCpokjl92mMD2iw4x3OJ58ckKytTge65wYgEAa6pxr2oqSgthHnpAFd-PDY-hoU9sN5AiantuFFSGkQ2wyTolPwHsMNX-9EUiGxWsoQrEPaJct6I3UqKpxv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