[all-commits] [llvm/llvm-project] 0121a8: Reland "[mlir][spirv] Fix int type declaration dup...

Davide Grohmann via All-commits all-commits at lists.llvm.org
Mon Jul 28 09:34:52 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0121a8e4319619527c9c28bbc01c74f794cc2255
      https://github.com/llvm/llvm-project/commit/0121a8e4319619527c9c28bbc01c74f794cc2255
  Author: Davide Grohmann <davide.grohmann at arm.com>
  Date:   2025-07-28 (Mon, 28 Jul 2025)

  Changed paths:
    M llvm/tools/spirv-tools/CMakeLists.txt
    M mlir/lib/Target/SPIRV/Serialization/Serializer.cpp
    M mlir/test/CMakeLists.txt
    M mlir/test/Target/SPIRV/constant.mlir
    A mlir/test/Target/SPIRV/lit.local.cfg
    M mlir/test/lit.cfg.py
    M mlir/test/lit.site.cfg.py.in
    M utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel

  Log Message:
  -----------
  Reland "[mlir][spirv] Fix int type declaration duplication when serializing" (#145687)

This relands PRs #143108 and #144538.

The original PR was reverted due to a mistake that made all the mlir
tests run only if SPIRV target was enabled. This is now resolved since
enabling spirv-tools does not required SPIRV target any longer.

spirv-tools are not required by default to run SPIRV mlir tests, but
they can be optionally enabled in some SPIRV mlir test to verify that
the produced SPIRV assembly pass validation.

The other reverted PR #144685 is not longer needed and not part of this
relanding.

Original commit message:

> At the MLIR level unsigned integer and signless integers are different
types. Indeed when looking up the two types in type definition cache
they do not match.
> Hence when translating a SPIR-V module which contains both usign and
signless integers will contain the same type declaration twice
(something like OpTypeInt 32 0) which is not permitted in SPIR-V and
such generated modules fail validation.
> This patch solves the problem by mapping unisgned integer types to
singless integer types before looking up in the type definition cache.

---------

Signed-off-by: Davide Grohmann <davide.grohmann at arm.com>



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