Skip to content

[RISCV] LLVM ERROR: Cannot scalarize scalable vector stores #171141

@XChy

Description

@XChy

Reproducer: https://godbolt.org/z/bx99W86Th
Testcase (reduced from a valid C program with _BitInt):

target datalayout = "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128"
target triple = "riscv64-unknown-linux-musl"

define <vscale x 16 x i4> @backsmith_pure_0() #0 {
entry:
  ret <vscale x 16 x i4> zeroinitializer
}

attributes #0 = { "target-features"="+v" }

Dump:

LLVM ERROR: Cannot scalarize scalable vector stores
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 <source>
1.	Running pass 'Function Pass Manager' on module '<source>'.
2.	Running pass 'RISC-V DAG->DAG Pattern Instruction Selection' on function '@backsmith_pure_0'
 #0 0x0000000004213598 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x4213598)
 #1 0x0000000004210444 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #2 0x0000753a13e42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x0000753a13e969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #4 0x0000753a13e42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #5 0x0000753a13e287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #6 0x00000000007c10b5 llvm::json::operator==(llvm::json::Value const&, llvm::json::Value const&) (.cold) JSON.cpp:0:0
 #7 0x00000000041597a1 (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x41597a1)
 #8 0x0000000003fe08b5 llvm::TargetLowering::scalarizeVectorStore(llvm::StoreSDNode*, llvm::SelectionDAG&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3fe08b5)
 #9 0x0000000004056dc3 (anonymous namespace)::VectorLegalizer::LegalizeOp(llvm::SDValue) LegalizeVectorOps.cpp:0:0
#10 0x0000000004059fe9 llvm::SelectionDAG::LegalizeVectors() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x4059fe9)
#11 0x0000000003fa8626 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3fa8626)
#12 0x0000000003fabd88 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3fabd88)
#13 0x0000000003fad80c llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3fad80c)
#14 0x0000000003f9900f llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3f9900f)
#15 0x00000000030f3849 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#16 0x000000000374c486 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x374c486)
#17 0x000000000374c831 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x374c831)
#18 0x000000000374d09f llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x374d09f)
#19 0x00000000008fe004 compileModule(char**, llvm::LLVMContext&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&) llc.cpp:0:0
#20 0x00000000007c7c99 main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x7c7c99)
#21 0x0000753a13e29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#22 0x0000753a13e29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#23 0x00000000008f3205 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x8f3205)
Program terminated with signal: SIGSEGV
Compiler returned: 139

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions