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

Andrea Faulds llvmlistbot at llvm.org
Mon Aug 19 05:08:56 PDT 2024


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

This looks good. Ideally the major, minor and patch version should be included, but I don't think 16 bits is enough to fit all of those safely, and it'd be hard to read in something like `spirv-dis`, so this is probably fine. Thanks for the contribution.

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


More information about the Mlir-commits mailing list