crash: Assertion failed: (DstTy.isVector() && SubVecTy.isVector() && "Insert subvector VTs must be vectors!"), function buildInstr, file MachineIRBuilder.cpp

Run:explore-d9924131a4-20261128-105811
Kind:crash
Category:Assertion failed: (DstTy.isVector() && SubVecTy.isVector() && "Insert subvector VTs must be vectors!"), function buildInstr, file MachineIRBuilder.cpp
Occurrences:20 in 16 configs, 5 test files, 395 more counted only
Snippet from:fixed-vectors-mask-buildvec.ll @buildvec_mask_nonconst_v1i1 via llvm-extract
Config:-mtriple=riscv32 -mattr=+f,+zve32f,+zvl128b -verify-machineinstrs
Local check:reproduces at d9924131a4
Compiler Explorer:https://godbolt.org/z/sK3zzbbWY (llc-assertions-trunk, checked 2026-10-26 12:20 UTC): G reproduces

Snippet:

define <1 x i1> @buildvec_mask_nonconst_v1i1(i1 %x) {
  %1 = insertelement <1 x i1> poison, i1 %x, i32 0
  ret <1 x i1> %1
}

Compiler Explorer panes:

PaneOptionsExitInstsstderr
GlobalISel-mtriple=riscv32 -mattr=+f,+zve32f,+zvl128b -verify-machineinstrs -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel.*1340llc: /root/llvm-project/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp:1484: virtual llvm::MachineInstrBuilder llvm::MachineIRBuilder::buildInstr(unsigned int, llvm::ArrayRef<llvm::DstOp>, llvm::ArrayRef<llvm::SrcOp>, std::optional<unsigned int>): Assertion `DstTy.isVector() && SubVecTy.isVector() && "Insert subvector VTs must be vectors!"' 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:
SelectionDAG (control)-mtriple=riscv32 -mattr=+f,+zve32f,+zvl128b -verify-machineinstrs -global-isel=005-

Reproduce:

llc -mtriple=riscv32 -mattr=+f,+zve32f,+zvl128b -verify-machineinstrs -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel.* snippet.ll -o -
llc -mtriple=riscv32 -mattr=+f,+zve32f,+zvl128b -verify-machineinstrs -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:1496: virtual MachineInstrBuilder llvm::MachineIRBuilder::buildInstr(unsigned int, ArrayRef<DstOp>, ArrayRef<SrcOp>, std::optional<unsigned int>): Assertion `DstTy.isVector() && SubVecTy.isVector() && "Insert subvector VTs must be vectors!"' 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=riscv32 -mattr=+f,+zve32f,+zvl128b -verify-machineinstrs -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 '@buildvec_mask_nonconst_v1i1'
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       0x000055d1cb1c9b5b llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 43
1  llc       0x000055d1cb1c6b31 llvm::sys::RunSignalHandlers() + 369
2  llc       0x000055d1cb1ca5db
3  libc.so.6 0x00007fdff0045330
4  libc.so.6 0x00007fdff009ebec pthread_kill + 284
5  libc.so.6 0x00007fdff004527e gsignal + 30
6  libc.so.6 0x00007fdff00288ff abort + 223
7  libc.so.6 0x00007fdff002881b
8  libc.so.6 0x00007fdff003b517
9  llc       0x000055d1cbb42840 llvm::MachineIRBuilder::buildInstr(unsigned int, llvm::ArrayRef<llvm::DstOp>, llvm::ArrayRef<llvm::SrcOp>, std::optional<unsigned int>) + 11568
10 llc       0x000055d1cba4ef8d llvm::CSEMIRBuilder::buildInstr(unsigned int, llvm::ArrayRef<llvm::DstOp>, llvm::ArrayRef<llvm::SrcOp>, std::optional<unsigned int>) + 2989
11 llc       0x000055d1cbb3e50c llvm::MachineIRBuilder::buildInsertSubvector(llvm::DstOp const&, llvm::SrcOp const&, llvm::SrcOp const&, unsigned int) + 92
12 llc       0x000055d1c9833d17
13 llc       0x000055d1cba45c71 llvm::CallLowering::handleAssignments(llvm::CallLowering::ValueHandler&, llvm::SmallVectorImpl<llvm::CallLowering::ArgInfo>&, llvm::CCState&, llvm::SmallVectorImpl<llvm::CCValAssign>&, llvm::MachineIRBuilder&, llvm::ArrayRef<llvm::Register>) const + 5377
14 llc       0x000055d1c982ff4d
15 llc       0x000055d1cbaa128f llvm::IRTranslatorImpl::translateRet(llvm::User const&, llvm::MachineIRBuilder&) + 239
16 llc       0x000055d1cbab913d 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
17 llc       0x000055d1cbaba12d llvm::IRTranslatorLegacy::runOnMachineFunction(llvm::MachineFunction&) + 733
18 llc       0x000055d1c9e42891 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 513
19 llc       0x000055d1ca3de7f7 llvm::FPPassManager::runOnFunction(llvm::Function&) + 871
20 llc       0x000055d1ca3e6d12 llvm::FPPassManager::runOnModule(llvm::Module&) + 50
21 llc       0x000055d1ca3df5a0 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 2000
22 llc       0x000055d1c96398c9
23 llc       0x000055d1c9636a53 main + 1747
24 libc.so.6 0x00007fdff002a1ca
25 libc.so.6 0x00007fdff002a28b __libc_start_main + 139
26 llc       0x000055d1c9635b65 _start + 37

Occurrences (20) (first 15):

InputFunctionConfig
fixed-vectors-binop-splats.ll-mtriple=riscv32 -mattr=+v,+zvfh -verify-machineinstrs
fixed-vectors-binop-splats.ll-mtriple=riscv64 -mattr=+v,+zvfh -verify-machineinstrs
fixed-vectors-int-buildvec.ll-mtriple=riscv32 -mattr=+v -verify-machineinstrs
fixed-vectors-int-buildvec.ll-mtriple=riscv32 -mattr=+v,+zba,+zbb -verify-machineinstrs
fixed-vectors-int-buildvec.ll-mtriple=riscv32 -mattr=+v,+zba,+zbb,+zbkb -verify-machineinstrs
fixed-vectors-int-buildvec.ll-mtriple=riscv64 -mattr=+v -verify-machineinstrs
fixed-vectors-int-buildvec.ll-mtriple=riscv64 -mattr=+v,+rva22u64 -verify-machineinstrs
fixed-vectors-int-buildvec.ll-mtriple=riscv64 -mattr=+v,+rva22u64,+zbkb -verify-machineinstrs
fixed-vectors-int-buildvec.ll-mtriple=riscv64 -mattr=+zve32x,+zvl128b -verify-machineinstrs
fixed-vectors-mask-buildvec.ll-mtriple=riscv32 -mattr=+f,+zve32f,+zvl128b -verify-machineinstrs
fixed-vectors-mask-buildvec.ll-mtriple=riscv32 -mattr=+v -verify-machineinstrs
fixed-vectors-mask-buildvec.ll-mtriple=riscv64 -mattr=+f,+zve32f,+zvl128b -verify-machineinstrs
fixed-vectors-mask-buildvec.ll-mtriple=riscv64 -mattr=+v -verify-machineinstrs
fixed-vectors-zvdot4a8i.ll-mtriple=riscv32 -mattr=+v -verify-machineinstrs
fixed-vectors-zvdot4a8i.ll-mtriple=riscv32 -mattr=+v,+experimental-zvdot4a8i -verify-machineinstrs

Generated 2026-11-29 14:49 UTC.