[Mlir-commits] [mlir] [mlir][spirv] Fix incorrect metadata in SPIR-V Header (PR #104242)

Andrea Faulds llvmlistbot at llvm.org
Thu Aug 15 05:43:52 PDT 2024


================
@@ -51,7 +51,7 @@ void spirv::appendModuleHeader(SmallVectorImpl<uint32_t> &header,
   // | 0 (reserved for instruction schema)                                     |
   // +-------------------------------------------------------------------------+
   header.push_back(spirv::kMagicNumber);
-  header.push_back((majorVersion << 16) | (minorVersion << 8));
+  header.push_back((majorVersion << 8) | minorVersion);
   header.push_back(kGeneratorNumber);
----------------
andfau-amd wrote:

Maybe to clarify a bit: a SPIR-V module consists of a series of 32-bit words. The header has a magic number word, a version word containing the version _of SPIR-V_ (that the module conforms to), and a word containing information about what software generated the module (in this case, that would be MLIR). This last "generator" word also contains a version number. It's not the SPIR-V version number that was the issue.

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


More information about the Mlir-commits mailing list