[all-commits] [llvm/llvm-project] 58d59f: [RISCV] Consider truncate semantics in performINSE...

Alex Bradbury via All-commits all-commits at lists.llvm.org
Fri Oct 2 05:03:08 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 58d59f460cd740c50f66f782a87fa2a29f52ff25
      https://github.com/llvm/llvm-project/commit/58d59f460cd740c50f66f782a87fa2a29f52ff25
  Author: Alex Bradbury <asb at igalia.com>
  Date:   2026-10-02 (Fri, 02 Oct 2026)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVISelLowering.cpp
    M llvm/test/CodeGen/RISCV/rvv/fixed-vectors-buildvec-of-binop.ll

  Log Message:
  -----------
  [RISCV] Consider truncate semantics in performINSERT_VECTOR_ELTCombine (#228243)

This fixes a miscompile in performINSERT_VECTOR_ELTCombine dating back
to when it was added (#72675), but only just showing up through testing
when a recent unrelated change triggered vectorisation for a function
that trips it within Clang, leading to broken builds on some of the
two-stage RVV buildbots.

After type legalization the scalar binop can be wider than the vector
element type, with the insert implicitly truncating it. That isn't
equivalent for shifts and a similar bug was found and fixed in a
neighbouring combine in #81168. This patch just applies the same fix
(with the same comment even), avoiding the transform if the scalar type
doesn't match the element type.

I used an LLM to root cause the issue and produce the test case.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list