llvm-project
0121a8e4 - Reland "[mlir][spirv] Fix int type declaration duplication when serializing" (#145687)

Commit
102 days ago
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@arm.com>
Parents
Loading