crash: Assertion failed: (Val.getLLTTy(*getMRI()).isValid() && "invalid operand type"), function buildStore, file MachineIRBuilder.cpp

Run:explore-d9924131a4-20261128-105811
Kind:crash
Category:Assertion failed: (Val.getLLTTy(*getMRI()).isValid() && "invalid operand type"), function buildStore, file MachineIRBuilder.cpp M
Occurrences:3 in 3 configs, 3 test files, 2 more counted only
Snippet from:vlsegff-rv64-dead.7a21ea114f.ll (mutant of vlsegff-rv64-dead.ll) @test_vlseg2ff_dead_all via llvm-extract
Config:-mtriple=riscv64 -verify-machineinstrs -mattr=+zve64x,+zbb -O0
Local check:reproduces at d9924131a4
Compiler Explorer:not uploaded (over --godbolt-limit or disabled)

Snippet:

define void @test_vlseg2ff_dead_all(ptr %base, i64 %vl) {
entry:
  %A = alloca target("riscv.vector.tuple", <vscale x 32 x i8>, 2), align 64
  store target("riscv.vector.tuple", <vscale x 32 x i8>, 2) poison, ptr %A, align 64
  %0 = tail call { target("riscv.vector.tuple", <vscale x 32 x i8>, 2), i64 } @llvm.riscv.vlseg2ff.triscv.vector.tuple_nxv32i8_2t.i64.p0(target("riscv.vector.tuple", <vscale x 32 x i8>, 2) poison, ptr %base, i64 %vl, i64 4)
  %E = extractvalue { target("riscv.vector.tuple", <vscale x 32 x i8>, 2), i64 } %0, 0
  store target("riscv.vector.tuple", <vscale x 32 x i8>, 2) %E, ptr %A, align 64
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare { target("riscv.vector.tuple", <vscale x 32 x i8>, 2), i64 } @llvm.riscv.vlseg2ff.triscv.vector.tuple_nxv32i8_2t.i64.p0(target("riscv.vector.tuple", <vscale x 32 x i8>, 2), ptr captures(none), i64, i64 immarg) #0

attributes #0 = { nocallback nofree nosync nounwind willreturn }

Reproduce:

llc -mtriple=riscv64 -verify-machineinstrs -mattr=+zve64x,+zbb -O0 -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel.* snippet.ll -o -
llc -mtriple=riscv64 -verify-machineinstrs -mattr=+zve64x,+zbb -O0 -global-isel=0 snippet.ll -o -

Local llc output:

llc: /home/runner/work/llvm-fuzz/llvm-fuzz/llvm-project/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp:522: MachineInstrBuilder llvm::MachineIRBuilder::buildStore(const SrcOp &, const SrcOp &, MachineMemOperand &): Assertion `Val.getLLTTy(*getMRI()).isValid() && "invalid operand type"' 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: /home/runner/work/llvm-fuzz/llvm-fuzz/llvm-project/build/bin/llc -mtriple=riscv64 -verify-machineinstrs -mattr=+zve64x,+zbb -O0 -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel.* -o -
1.	Running pass 'Function Pass Manager' on module '<stdin>'.
2.	Running pass 'IRTranslator' on function '@test_vlseg2ff_dead_all'
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  llc       0x0000557fb0781b5b llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 43
1  llc       0x0000557fb077eb31 llvm::sys::RunSignalHandlers() + 369
2  llc       0x0000557fb07825db
3  libc.so.6 0x00007f9cf0c45330
4  libc.so.6 0x00007f9cf0c9ebec pthread_kill + 284
5  libc.so.6 0x00007f9cf0c4527e gsignal + 30
6  libc.so.6 0x00007f9cf0c288ff abort + 223
7  libc.so.6 0x00007f9cf0c2881b
8  libc.so.6 0x00007f9cf0c3b517
9  llc       0x0000557fb10f2419 llvm::MachineIRBuilder::buildStore(llvm::SrcOp const&, llvm::SrcOp const&, llvm::MachineMemOperand&) + 265
10 llc       0x0000557fb105f97d llvm::IRTranslatorImpl::translateStore(llvm::User const&, llvm::MachineIRBuilder&) + 1277
11 llc       0x0000557fb106e583 llvm::IRTranslatorImpl::translate(llvm::Instruction const&) + 611
12 llc       0x0000557fb107113d llvm::IRTranslatorImpl::runOnMachineFunction(llvm::MachineFunction&, llvm::function_ref<llvm::GISelCSEInfo* ()>, bool, llvm::function_ref<llvm::AAResults* ()>, llvm::function_ref<llvm::BranchProbabilityInfo* ()>, llvm::function_ref<llvm::AssumptionCache* ()>, llvm::TargetLibraryInfo*, llvm::LibcallLoweringInfo const*, llvm::SSPLayoutInfo*) + 4205
13 llc       0x0000557fb107212d llvm::IRTranslatorLegacy::runOnMachineFunction(llvm::MachineFunction&) + 733
14 llc       0x0000557faf3fa891 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 513
15 llc       0x0000557faf9967f7 llvm::FPPassManager::runOnFunction(llvm::Function&) + 871
16 llc       0x0000557faf99ed12 llvm::FPPassManager::runOnModule(llvm::Module&) + 50
17 llc       0x0000557faf9975a0 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 2000
18 llc       0x0000557faebf18c9
19 llc       0x0000557faebeea53 main + 1747
20 libc.so.6 0x00007f9cf0c2a1ca
21 libc.so.6 0x00007f9cf0c2a28b __libc_start_main + 139
22 llc       0x0000557faebedb65 _start + 37

Occurrences (3):

InputFunctionConfig
rv64-spill-zvlsseg.b4fdd28a7f.ll (mutant of rv64-spill-zvlsseg.ll)-mtriple=riscv64 -mattr=+v,+m,+prefer-vsetvli-over-read-vlenb,+c,+zvfh -O1 -code-model=medium -verify-machineinstrs
vlsegff-rv64-dead.7a21ea114f.ll (mutant of vlsegff-rv64-dead.ll)-mtriple=riscv64 -verify-machineinstrs -mattr=+zve64x,+zbb -O0
zvlsseg-zero-vl.f6a11e8fb9.ll (mutant of zvlsseg-zero-vl.ll)-mtriple=riscv64 -verify-machineinstrs -mattr=+zve32x -O3

Generated 2026-11-29 14:49 UTC.