[all-commits] [llvm/llvm-project] 873a25: [SPIRV] Fix trunc nonstandard int types (#191393)

idubinov via All-commits all-commits at lists.llvm.org
Fri Apr 17 04:43:21 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 873a2597118c473fd0038d6b9270503b79dbce69
      https://github.com/llvm/llvm-project/commit/873a2597118c473fd0038d6b9270503b79dbce69
  Author: idubinov <idubinov at amd.com>
  Date:   2026-04-17 (Fri, 17 Apr 2026)

  Changed paths:
    M llvm/lib/Target/SPIRV/SPIRVPreLegalizer.cpp
    M llvm/test/CodeGen/SPIRV/trunc-nonstd-bitwidth.ll

  Log Message:
  -----------
  [SPIRV] Fix trunc nonstandard int types  (#191393)

In some cases, the trunc dst type was widened to higher bit size, which
changes behavior of the instruction.

Now, in case of need of widening, the trunc instruction is replaced with
AND with appropriate mask.

Assisted-by: Claude Code.

---------

Co-authored-by: Marcos Maronas <mmaronas at amd.com>
Co-authored-by: Arseniy Obolenskiy <gooddoog at student.su>



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