[Mlir-commits] [mlir] [mlir][spirv] Enable serializer to write SPIR-V modules into separate files (PR #152678)

Jakub Kuderski llvmlistbot at llvm.org
Mon Aug 11 06:39:44 PDT 2025


================
@@ -27,6 +28,14 @@ struct SerializationOptions {
   bool emitSymbolName = true;
   /// Whether to emit `OpLine` location information for SPIR-V ops.
   bool emitDebugInfo = false;
+  /// Whether to store a module to an additional file during
+  /// serialization. This is used to store the SPIR-V module to the
+  /// file in addition to writing it to `os` passed from the calling
+  /// tool. This saved file is later used for validation.
+  bool saveModuleForValidation = false;
+  /// A prefix prepended to the file used when `saveModuleForValidation`
+  /// is set to `true`.
+  std::string validationFilePrefix = "";
----------------
kuhar wrote:

I think adding an example or two would help, especially if this can be either.

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


More information about the Mlir-commits mailing list