Issue |
135776
|
Summary |
Instruction selection failure when targetting aarch64 architecture with 16bit vector types
|
Labels |
new issue
|
Assignees |
|
Reporter |
JustinKim98
|
While I was trying to cross-compile following llvm IR bit cast using llc with following command in debug mode towards aarch64 architecture.
```bash
llc example2.ll --mtriple=aarch64-linux-gnu
```
(LLVM IR I'm trying to compile)
```llvm
; example.ll
target triple = "aarch64-unknown-linux-gnu"
define i32 @bitcast_failure(ptr %0, <1 x i16> %1) {
%3 = bitcast <1 x i16> %1 to <1 x half>
%4 = extractelement <1 x half> %3, i64 0
store half %4, ptr %0, align 2
ret i32 0
}
```
I'm encountering some kind of weird error. Is this a bug in LLVM? It seems like there's a problem when trying to scalarize 16 bit data types.
I'm using the newest llvm version that I just cloned from main branch.
```
# llc --version
LLVM (http://llvm.org/):
LLVM version 21.0.0git
DEBUG build with assertions.
Default target: x86_64-unknown-linux-gnu
Host CPU: znver4
```
Is this a bug in LLVM? or am I doing something wrong?
Here's the error log
```
llc: /home/jwkim98/llvm_test/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h:161: const llvm::SDValue& llvm::DAGTypeLegalizer::getSDValue(llvm::DAGTypeLegalizer::TableId&): Assertion `Id && "TableId should be non-zero"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: ./llvm-build-debug/bin/llc example2.ll --mtriple=aarch64-linux-gnu
1. Running pass 'Function Pass Manager' on module 'example2.ll'.
2. Running pass 'AArch64 Instruction Selection' on function '@bitcast_failure'
#0 0x000064116e051396 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/jwkim98/llvm_test/llvm-project/llvm/lib/Support/Unix/Signals.inc:804:22
#1 0x000064116e0517b7 PrintStackTraceSignalHandler(void*) /home/jwkim98/llvm_test/llvm-project/llvm/lib/Support/Unix/Signals.inc:880:1
#2 0x000064116e04ebe5 llvm::sys::RunSignalHandlers() /home/jwkim98/llvm_test/llvm-project/llvm/lib/Support/Signals.cpp:105:20
#3 0x000064116e050c05 SignalHandler(int, siginfo_t*, void*) /home/jwkim98/llvm_test/llvm-project/llvm/lib/Support/Unix/Signals.inc:418:13
#4 0x0000782303a42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#5 0x0000782303a969fc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
#6 0x0000782303a969fc __pthread_kill_internal ./nptl/pthread_kill.c:78:10
#7 0x0000782303a969fc pthread_kill ./nptl/pthread_kill.c:89:10
#8 0x0000782303a42476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
#9 0x0000782303a287f3 abort ./stdlib/abort.c:81:7
#10 0x0000782303a2871b _nl_load_domain ./intl/loadmsgcat.c:1177:9
#11 0x0000782303a39e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#12 0x000064116de34302 llvm::DAGTypeLegalizer::getSDValue(unsigned int&) /home/jwkim98/llvm_test/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h:162:31
#13 0x000064116de92ad3 llvm::DAGTypeLegalizer::GetScalarizedVector(llvm::SDValue) /home/jwkim98/llvm_test/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h:851:51
#14 0x000064116de53763 llvm::DAGTypeLegalizer::ScalarizeVecRes_BITCAST(llvm::SDNode*) /home/jwkim98/llvm_test/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp:406:29
#15 0x000064116de51b47 llvm::DAGTypeLegalizer::ScalarizeVectorResult(llvm::SDNode*, unsigned int) /home/jwkim98/llvm_test/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp:57:59
#16 0x000064116de2eeaa llvm::DAGTypeLegalizer::run() /home/jwkim98/llvm_test/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp:281:17
#17 0x000064116de33624 llvm::SelectionDAG::LegalizeTypes() /home/jwkim98/llvm_test/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp:1060:37
#18 0x000064116dd8250e llvm::SelectionDAGISel::CodeGenAndEmitDAG() /home/jwkim98/llvm_test/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:979:36
#19 0x000064116dd81a23 llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator_w_bits<llvm::ilist_detail::node_options<llvm::Instruction, true, false, void, true, llvm::BasicBlock>, false, true>, llvm::ilist_iterator_w_bits<llvm::ilist_detail::node_options<llvm::Instruction, true, false, void, true, llvm::BasicBlock>, false, true>, bool&) /home/jwkim98/llvm_test/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:877:1
#20 0x000064116dd878ed llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) /home/jwkim98/llvm_test/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1906:33
#21 0x000064116dd8010b llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) /home/jwkim98/llvm_test/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:615:7
#22 0x0000641169bb141a (anonymous namespace)::AArch64DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) /home/jwkim98/llvm_test/llvm-project/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp:61:0
#23 0x000064116dd7ee62 llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) /home/jwkim98/llvm_test/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:374:40
#24 0x000064116c98b2dc llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /home/jwkim98/llvm_test/llvm-project/llvm/lib/CodeGen/MachineFunctionPass.cpp:108:30
#25 0x000064116d248162 llvm::FPPassManager::runOnFunction(llvm::Function&) /home/jwkim98/llvm_test/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1406:20
#26 0x000064116d248438 llvm::FPPassManager::runOnModule(llvm::Module&) /home/jwkim98/llvm_test/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1452:13
#27 0x000064116d248899 (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) /home/jwkim98/llvm_test/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1521:20
#28 0x000064116d2438e1 llvm::legacy::PassManagerImpl::run(llvm::Module&) /home/jwkim98/llvm_test/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:539:13
#29 0x000064116d24918f llvm::legacy::PassManager::run(llvm::Module&) /home/jwkim98/llvm_test/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1649:1
#30 0x000064116955118a compileModule(char**, llvm::LLVMContext&) /home/jwkim98/llvm_test/llvm-project/llvm/tools/llc/llc.cpp:755:34
#31 0x000064116954e810 main /home/jwkim98/llvm_test/llvm-project/llvm/tools/llc/llc.cpp:400:35
#32 0x0000782303a29d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#33 0x0000782303a29e40 call_init ./csu/../csu/libc-start.c:128:20
#34 0x0000782303a29e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#35 0x000064116954d3e5 _start (./llvm-build-debug/bin/llc+0xf613e5)
Aborted
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs