<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/117337>117337</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[llvm][Hexagon] Crash in `llvm::DAGTypeLegalizer::PromoteFloatResult()` for `freeze half`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
alexrp
</td>
</tr>
</table>
<pre>
This is very similar to #107791.
```llvm
define half @freeze_half_poison(half %maybe.poison) {
%y1 = freeze half %maybe.poison
%t1 = fadd half %y1, %y1
ret half %t1
}
```
```console
❯ llc --version | head -n2
LLVM (http://llvm.org/):
LLVM version 19.1.2
❯ llc test.ll -mtriple hexagon-linux
PromoteFloatResult #0: t5: f16 = freeze t4
LLVM ERROR: Do not know how to promote this operator's result!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: llc test.ll -mtriple hexagon-linux
1. Running pass 'Function Pass Manager' on module 'test.ll'.
2. Running pass 'Hexagon DAG->DAG Pattern Instruction Selection' on function '@freeze_half_poison'
#0 0x00007c530544faa2 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/alexrp/Source/llvm-project/llvm/lib/Support/Unix/Signals.inc:727:3
#1 0x00007c530544d40f llvm::sys::RunSignalHandlers() /home/alexrp/Source/llvm-project/llvm/lib/Support/Signals.cpp:105:20
#2 0x00007c530544d7a6 SignalHandler(int) /home/alexrp/Source/llvm-project/llvm/lib/Support/Unix/Signals.inc:413:1
#3 0x00007c5303e42990 (/lib/x86_64-linux-gnu/libc.so.6+0x42990)
#4 0x00007c5303e99a1b __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
#5 0x00007c5303e99a1b __pthread_kill_internal ./nptl/pthread_kill.c:78:10
#6 0x00007c5303e99a1b pthread_kill ./nptl/pthread_kill.c:89:10
#7 0x00007c5303e428e6 gsignal ./signal/../sysdeps/posix/raise.c:27:6
#8 0x00007c5303e268b7 abort ./stdlib/abort.c:81:7
#9 0x00007c5305180c78 std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>::_M_replace(unsigned long, unsigned long, char const*, unsigned long) /usr/include/c++/13/bits/basic_string.tcc:540:21
#10 0x00007c5305180c78 std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>::assign(char const*) (.isra.0.cold) /usr/include/c++/13/bits/basic_string.h:1672:19
#11 0x00007c530536fa05 (/opt/llvm-19/bin/../lib/libLLVM.so.19.1+0xd6fa05)
#12 0x00007c5305e7cd2e llvm::DAGTypeLegalizer::PromoteFloatResult(llvm::SDNode*, unsigned int) /home/alexrp/Source/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp:2588:25
#13 0x00007c5305ebee8f llvm::DAGTypeLegalizer::run() /home/alexrp/Source/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp:291:14
#14 0x00007c5305ec00f4 llvm::SelectionDAG::LegalizeTypes() /home/alexrp/Source/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp:1057:10
#15 0x00007c5306031313 llvm::TimeRegion::~TimeRegion() /home/alexrp/Source/llvm-project/llvm/include/llvm/Support/Timer.h:155:9
#16 0x00007c5306031313 llvm::NamedRegionTimer::~NamedRegionTimer() /home/alexrp/Source/llvm-project/llvm/include/llvm/Support/Timer.h:163:8
#17 0x00007c5306031313 llvm::SelectionDAGISel::CodeGenAndEmitDAG() /home/alexrp/Source/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:954:3
#18 0x00007c5306035d20 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) /home/alexrp/Source/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1868:33
#19 0x00007c53060375fc llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) /home/alexrp/Source/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:632:22
#20 0x00007c5308bdca94 llvm::HexagonDAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) /home/alexrp/Source/llvm-project/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.h:47:17
#21 0x00007c5306022b77 llvm::OptLevelChanger::~OptLevelChanger() /home/alexrp/Source/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:268:11
#22 0x00007c5306022b77 llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) /home/alexrp/Source/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:375:1
#23 0x00007c5306022b77 llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) /home/alexrp/Source/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:346:6
#24 0x00007c5305996e7f llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) /home/alexrp/Source/llvm-project/llvm/lib/CodeGen/MachineFunctionPass.cpp:94:33
#25 0x00007c530560d687 llvm::FPPassManager::runOnFunction(llvm::Function&) /home/alexrp/Source/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1450:7
#26 0x00007c530560d8c1 llvm::ilist_detail::node_base_prevnext<llvm::ilist_node_base<true, void>, true>::getNext() const /home/alexrp/Source/llvm-project/llvm/include/llvm/ADT/ilist_node_base.h:42:38
#27 0x00007c530560d8c1 llvm::ilist_node_impl<llvm::ilist_detail::node_options<llvm::Function, true, false, void, false, void>>::getNext() /home/alexrp/Source/llvm-project/llvm/include/llvm/ADT/ilist_node.h:117:66
#28 0x00007c530560d8c1 llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Function, true, false, void, false, void>, false, false>::operator++() /home/alexrp/Source/llvm-project/llvm/include/llvm/ADT/ilist_iterator.h:187:25
#29 0x00007c530560d8c1 llvm::FPPassManager::runOnModule(llvm::Module&) /home/alexrp/Source/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1485:22
#30 0x00007c530560e144 runOnModule /home/alexrp/Source/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1562:7
#31 0x00007c530560e144 llvm::legacy::PassManagerImpl::run(llvm::Module&) /home/alexrp/Source/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:541:55
#32 0x0000595f1b31ca3c compileModule(char**, llvm::LLVMContext&) /home/alexrp/Source/llvm-project/llvm/tools/llc/llc.cpp:742:34
#33 0x0000595f1b310f77 main /home/alexrp/Source/llvm-project/llvm/tools/llc/llc.cpp:409:35
#34 0x00007c5303e28150 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#35 0x00007c5303e28209 call_init ./csu/../csu/libc-start.c:128:20
#36 0x00007c5303e28209 __libc_start_main ./csu/../csu/libc-start.c:347:5
#37 0x0000595f1b311cf5 _start (/opt/llvm-19/bin/llc+0x13cf5)
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzcWV1T47gS_TXiRYVLlr8feAiEzE4V7FLA3deUbCuJ7iiSS5IZ2If722-1bMd2yDKzswP3g6LAbstH57RarZbMrBVbxfkFSi5Rsjxjrdtpc8EkfzbNWanrl4vHnbBYWPzEzQu2Yi8kM9hpjGgUkiwrwgCRJSKL_m9Kul8pn_adqeYboTjeMbnBKCYbw_kffA2360YLqxWiefeQJnv2UvJgMBcYZZcdCIanLyFG0RJ3CPjkO2Nj1zdmdX1o-hIietVf9C0Nd4fHrreibHmk5qTESiurJe-t1xQVS7RYYSkrfH7-xI0VWmGUXeEdZzU-V7RreXPz-y0Gzc41KFogukJ0Be4KtNn6uwLMPT_fegALiyAM6KkOHbcukBKf750RjeR4x5_ZVqtzKVT73L1xZ_ReO76Smrl7blvpYBAJihbYJfB3E6ZTB7t4KtsTub6__-0emi41VtrhL0p_xTv9FQKi6eCxg4DRDTfMaYNoZrHxnSHau_fu5nrxcI1tW-6FwwyX7RYb3mjjAAbcYg9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