crash: Assertion failed: (SrcTy.isVector() && "mismatched cast between vector and non-vector"), function validateTruncExt, file MachineIRBuilder.cpp

Run:explore-d9924131a4-20261128-105811
Kind:crash
Category:Assertion failed: (SrcTy.isVector() && "mismatched cast between vector and non-vector"), function validateTruncExt, file MachineIRBuilder.cpp
Occurrences:9 in 9 configs, 5 test files, 365 more counted only
Snippet from:calling-conv-vector-float.ll @callee_v2f32 via llvm-extract
Config:-mtriple=riscv64 -mattr=+f -target-abi=lp64 -verify-machineinstrs
Local check:reproduces at d9924131a4
Compiler Explorer:https://godbolt.org/z/nj4h55jT3 (llc-assertions-trunk, checked 2026-10-26 12:20 UTC): G reproduces

Snippet:

define <2 x float> @callee_v2f32(<2 x float> %x, <2 x float> %y) {
  %z = fadd <2 x float> %x, %y
  ret <2 x float> %z
}

Compiler Explorer panes:

PaneOptionsExitInstsstderr
GlobalISel-mtriple=riscv64 -mattr=+f -target-abi=lp64 -verify-machineinstrs -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel.*1340llc: /root/llvm-project/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp:1271: void llvm::MachineIRBuilder::validateTruncExt(llvm::LLT, llvm::LLT, bool): Assertion `SrcTy.isVector() && "mismatched cast between vector and non-vector"' 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=riscv64 -mattr=+f -target-abi=lp64 -verify-machineinstrs -global-isel=009-

Reproduce:

llc -mtriple=riscv64 -mattr=+f -target-abi=lp64 -verify-machineinstrs -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel.* snippet.ll -o -
llc -mtriple=riscv64 -mattr=+f -target-abi=lp64 -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:1282: void llvm::MachineIRBuilder::validateTruncExt(const LLT, const LLT, bool): Assertion `SrcTy.isVector() && "mismatched cast between vector and non-vector"' 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 -mattr=+f -target-abi=lp64 -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 '@callee_v2f32'
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       0x0000562a29dceb5b llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 43
1  llc       0x0000562a29dcbb31 llvm::sys::RunSignalHandlers() + 369
2  llc       0x0000562a29dcf5db
3  libc.so.6 0x00007f7eabc45330
4  libc.so.6 0x00007f7eabc9ebec pthread_kill + 284
5  libc.so.6 0x00007f7eabc4527e gsignal + 30
6  libc.so.6 0x00007f7eabc288ff abort + 223
7  libc.so.6 0x00007f7eabc2881b
8  libc.so.6 0x00007f7eabc3b517
9  llc       0x0000562a2a744959 llvm::MachineIRBuilder::validateTruncExt(llvm::LLT, llvm::LLT, bool) + 905
10 llc       0x0000562a2a745802 llvm::MachineIRBuilder::buildInstr(unsigned int, llvm::ArrayRef<llvm::DstOp>, llvm::ArrayRef<llvm::SrcOp>, std::optional<unsigned int>) + 3314
11 llc       0x0000562a2a653ff1 llvm::CSEMIRBuilder::buildInstr(unsigned int, llvm::ArrayRef<llvm::DstOp>, llvm::ArrayRef<llvm::SrcOp>, std::optional<unsigned int>) + 3089
12 llc       0x0000562a2a743281 llvm::MachineIRBuilder::buildTrunc(llvm::DstOp const&, llvm::SrcOp const&, std::optional<unsigned int>) + 33
13 llc       0x0000562a284396e4
14 llc       0x0000562a2a649b10 llvm::CallLowering::handleAssignments(llvm::CallLowering::ValueHandler&, llvm::SmallVectorImpl<llvm::CallLowering::ArgInfo>&, llvm::CCState&, llvm::SmallVectorImpl<llvm::CCValAssign>&, llvm::MachineIRBuilder&, llvm::ArrayRef<llvm::Register>) const + 928
15 llc       0x0000562a284361dc
16 llc       0x0000562a2a6bde93 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*) + 3523
17 llc       0x0000562a2a6bf12d llvm::IRTranslatorLegacy::runOnMachineFunction(llvm::MachineFunction&) + 733
18 llc       0x0000562a28a47891 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 513
19 llc       0x0000562a28fe37f7 llvm::FPPassManager::runOnFunction(llvm::Function&) + 871
20 llc       0x0000562a28febd12 llvm::FPPassManager::runOnModule(llvm::Module&) + 50
21 llc       0x0000562a28fe45a0 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 2000
22 llc       0x0000562a2823e8c9
23 llc       0x0000562a2823ba53 main + 1747
24 libc.so.6 0x00007f7eabc2a1ca
25 libc.so.6 0x00007f7eabc2a28b __libc_start_main + 139
26 llc       0x0000562a2823ab65 _start + 37

Occurrences (9):

InputFunctionConfig
calling-conv-vector-float.ll-mtriple=riscv64 -mattr=+f -target-abi=lp64 -verify-machineinstrs
fastcc-half.ll-mtriple=riscv32 -mattr=+zfhmin -target-abi=ilp32 -verify-machineinstrs
nontemporal-vp-scalable.ll-mtriple=riscv32 -mattr=+zihintntl,+f,+d,+zfh,+v
nontemporal-vp-scalable.ll-mtriple=riscv32 -mattr=+zihintntl,+f,+d,+zfh,+v,+c
nontemporal-vp-scalable.ll-mtriple=riscv64 -mattr=+zihintntl,+f,+d,+zfh,+v
nontemporal-vp-scalable.ll-mtriple=riscv64 -mattr=+zihintntl,+f,+d,+zfh,+v,+c
rvv-peephole-vmerge-vops.ll-mtriple=riscv64 -mattr=+v
vsub-sdnode.ll-mtriple=riscv32 -mattr=+v -verify-machineinstrs
vsub-sdnode.ll-mtriple=riscv64 -mattr=+v -verify-machineinstrs

Generated 2026-11-29 14:49 UTC.