loongarch64 half (f16) failure to select with +f
and +d
· Issue #93894 · llvm/llvm-project (original) (raw)
define half @half_add(half %a, half %b) unnamed_addr #0 { start: %_0 = fadd half %a, %b ret half %_0 }
With -mtriple=loongarch64-unknown-linux-gnu -mattr=+f,+d
:
LLVM ERROR: Cannot select: t23: f32 = fp16_to_fp t21
t21: i64 = fp_to_fp16 t4
t4: f32,ch = CopyFromReg t0, Register:f32 %1
t3: f32 = Register %1
In function: half_add
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=loongarch64-unknown-linux-gnu -mattr=+f,+d <source>
1. Running pass 'Function Pass Manager' on module '<source>'.
2. Running pass 'LoongArch DAG->DAG Pattern Instruction Selection' on function '@half_add'
#0 0x00000000039e9678 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x39e9678)
#1 0x00000000039e6dbc SignalHandler(int) Signals.cpp:0:0
#2 0x00007e2b90a42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#3 0x00007e2b90a969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#4 0x00007e2b90a42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#5 0x00007e2b90a287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#6 0x0000000000720e07 (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x720e07)
#7 0x000000000379ccad llvm::SelectionDAGISel::CannotYetSelect(llvm::SDNode*) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x379ccad)
#8 0x00000000037a1c9a llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, unsigned char const*, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x37a1c9a)
#9 0x00000000016a2837 llvm::LoongArchDAGToDAGISel::Select(llvm::SDNode*) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x16a2837)
#10 0x0000000003799aee llvm::SelectionDAGISel::DoInstructionSelection() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3799aee)
#11 0x00000000037a7db6 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x37a7db6)
#12 0x00000000037ab0bd llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x37ab0bd)
#13 0x00000000037acaff llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (.part.0) SelectionDAGISel.cpp:0:0
#14 0x00000000029e6721 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#15 0x0000000002fad603 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2fad603)
#16 0x0000000002fad841 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2fad841)
#17 0x0000000002fae0a5 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2fae0a5)
#18 0x000000000083129c compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#19 0x0000000000728536 main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x728536)
#20 0x00007e2b90a29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#21 0x00007e2b90a29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#22 0x000000000082804e _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x82804e)
Program terminated with signal: SIGSEGV
Compiler returned: 139
There is no error if the -mattr
flag is omitted
Reproduction: https://llvm.godbolt.org/z/faenafnzh