llvm / llvm/llvm-project

[AArch64] getCopyFromPartsVector "Cannot narrow, it would be a lossy transformation" assertion lowering a `<3 x float>` argument

Open
#198,107 2 comments 0 reactions 1 assignee View on GitHub

@puneetdixit200 is already working on this.

Since May 21, 2026.

backend:AArch64 confirmed crash-on-valid generated by fuzzer
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Live Reproducer: https://godbolt.org/z/h115oeY4s

Compiling the following LLVM IR with llc asserts Assertion ... "Cannot narrow, it would be a lossy transformation" in getCopyFromPartsVector.
The trigger is a function whose ninth vector argument is <3 x float> and is returned directly.

target triple = "aarch64-unknown-linux-gnu"

define <3 x float> @repro(<3 x i32> %a0, <3 x i32> %a1, <3 x i32> %a2,
                           <3 x i32> %a3, <3 x i32> %a4, <3 x i32> %a5,
                           <3 x i32> %a6, <3 x i32> %a7, <3 x float> %a8) {
  ret <3 x float> %a8
}

llc command:

llc repro.ll

Error output:

llc: /root/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:423:
llvm::SDValue getCopyFromPartsVector(llvm::SelectionDAG&, const llvm::SDLoc&, const llvm::SDValue*, unsigned int, llvm::MVT, llvm::EVT, const llvm::Value*, llvm::SDValue, std::optional<unsigned int>):
Assertion `(PartEVT.getVectorElementCount().getKnownMinValue() > ValueVT.getVectorElementCount().getKnownMinValue())
           && (PartEVT.getVectorElementCount().isScalable() == ValueVT.getVectorElementCount().isScalable())
           && "Cannot narrow, it would be a lossy transformation"' failed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.