| Issue |
169017
|
| Summary |
[RISCV] llc crashed at O1/O2/O3
|
| Labels |
backend:RISC-V,
crash-on-valid
|
| Assignees |
XChy
|
| Reporter |
XChy
|
Reproducer: https://godbolt.org/z/qW9xEcW1x
Testcase:
```llvm
target datalayout = "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128"
target triple = "riscv64-unknown-linux-musl"
define <2 x i8> @g_1189(<4 x i16> %vecinit, <2 x i8> %0) #0 {
entry:
%1 = bitcast <4 x i16> %vecinit to i64
%div.lhs.trunc = trunc i64 %1 to i8
%2 = insertelement <2 x i8> %0, i8 %div.lhs.trunc, i64 0
ret <2 x i8> %2
}
attributes #0 = { "target-features"="+v" }
```
llc dumps:
```
llc: /root/llvm-project/llvm/lib/IR/Type.cpp:803: static llvm::FixedVectorType* llvm::FixedVectorType::get(llvm::Type*, unsigned int): Assertion `NumElts > 0 && "#Elements of a VectorType must be greater than 0"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0. Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/llc -o /app/output.s -x86-asm-syntax=intel -O1 <source>
1. Running pass 'Function Pass Manager' on module '<source>'.
2. Running pass 'RISC-V DAG->DAG Pattern Instruction Selection' on function '@g_1189'
#0 0x00000000041ad568 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x41ad568)
#1 0x00000000041aa414 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#2 0x00007475cf042520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#3 0x00007475cf0969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#4 0x00007475cf042476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#5 0x00007475cf0287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#6 0x00007475cf02871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#7 0x00007475cf039e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#8 0x00000000037635d6 llvm::FixedVectorType::get(llvm::Type*, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x37635d6)
#9 0x00000000034243c7 llvm::EVT::getExtendedVectorVT(llvm::LLVMContext&, llvm::EVT, unsigned int, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x34243c7)
#10 0x0000000003d425e3 (anonymous namespace)::DAGCombiner::visitINSERT_VECTOR_ELT(llvm::SDNode*) DAGCombiner.cpp:0:0
#11 0x0000000003dd2037 (anonymous namespace)::DAGCombiner::visit(llvm::SDNode*) DAGCombiner.cpp:0:0
#12 0x0000000003dd373c (anonymous namespace)::DAGCombiner::combine(llvm::SDNode*) DAGCombiner.cpp:0:0
#13 0x0000000003dd51c0 (anonymous namespace)::DAGCombiner::Run(llvm::CombineLevel) DAGCombiner.cpp:0:0
#14 0x0000000003dd7c13 llvm::SelectionDAG::Combine(llvm::CombineLevel, llvm::BatchAAResults*, llvm::CodeGenOptLevel) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3dd7c13)
#15 0x0000000003f421c4 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3f421c4)
#16 0x0000000003f45a08 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3f45a08)
#17 0x0000000003f4748c llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3f4748c)
#18 0x0000000003f32bff llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3f32bff)
#19 0x000000000309a2a9 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#20 0x00000000036e4a46 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x36e4a46)
#21 0x00000000036e4df1 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x36e4df1)
#22 0x00000000036e565f llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x36e565f)
#23 0x00000000008f8ddf compileModule(char**, llvm::LLVMContext&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&) llc.cpp:0:0
#24 0x00000000007c63b9 main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x7c63b9)
#25 0x00007475cf029d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#26 0x00007475cf029e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#27 0x00000000008ee085 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x8ee085)
Program terminated with signal: SIGSEGV
Compiler returned: 139
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs