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

Igor Wodiany llvmlistbot at llvm.org
Mon Aug 11 03:06:05 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 = "";
----------------
IgWod-IMG wrote:

You can either specify `foo` so it'll create `foo0, foo1 ... fooN` files in the working directory, but you can also specify `my/dir/foo` to get the same files (`foo0, foo1 ... fooN`) written in `my/dir` directory. So, I guess it's both in a way. Should I call it `validationPathPrefix`? Clarify this in the comment? Or do you have any other suggestions?

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


More information about the Mlir-commits mailing list