[Mlir-commits] [mlir] [mlir][spirv] Fix int type declaration duplication when serializing (PR #143108)

Davide Grohmann llvmlistbot at llvm.org
Mon Jun 9 01:44:01 PDT 2025


================
@@ -446,6 +446,19 @@ LogicalResult Serializer::processType(Location loc, Type type,
 LogicalResult
 Serializer::processTypeImpl(Location loc, Type type, uint32_t &typeID,
                             SetVector<StringRef> &serializationCtx) {
+
+  // Map unisgned integer types to singless integer types
+  // This is needed otherwise the generated spirv assembly will contain
+  // twice a type declaration (like OpTypeInt 32 0) which is no permitted and
+  // such module could no pass validation. Indeed at MLIR level the two types
+  // are different and lookup in the cache below fails.
+  // Note: This convertion needs to happen here before the type is looked up in
+  // the cache
----------------
davidegrohmann wrote:

Resolved

https://github.com/llvm/llvm-project/pull/143108


More information about the Mlir-commits mailing list