[all-commits] [llvm/llvm-project] b36188: [RISCV][IA] Check nuw on multiply when analyzing E...

Philip Reames via All-commits all-commits at lists.llvm.org
Wed Jul 16 19:11:53 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b36188514a76ba979439a1dcab58e68478e3f0ad
      https://github.com/llvm/llvm-project/commit/b36188514a76ba979439a1dcab58e68478e3f0ad
  Author: Philip Reames <preames at rivosinc.com>
  Date:   2025-07-16 (Wed, 16 Jul 2025)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVInterleavedAccess.cpp
    M llvm/test/CodeGen/RISCV/rvv/vp-vector-interleaved-access.ll

  Log Message:
  -----------
  [RISCV][IA] Check nuw on multiply when analyzing EVL (#149205)

If we're checking to see if a number is a multiple of a small constant,
we need to be sure the multiply doesn't overflow for the mul logic to
hold. The VL is a unsigned number, so we care about unsigned overflow.
Once we've proven a number of a multiple, we can also use an
exact udiv as we know we're not discarding any bits.

This fixes what is technically a miscompile with EVL vectorization, but
I doubt we'd ever have seen it in practice since most EVLs are going to
much less than UINT_MAX.



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