[Mlir-commits] [mlir] [ViewOpGraph] Re-use `AsmState` to significantly speed-up printing. (PR #208240)

Jacques Pienaar llvmlistbot at llvm.org
Mon Jul 20 03:18:08 PDT 2026


================
@@ -448,6 +452,9 @@ class PrintOpPass : public impl::ViewOpGraphPassBase<PrintOpPass> {
 
   /// Output stream to write DOT file to.
   raw_indented_ostream os;
+  /// Re-usable assembly printer state for efficient printing. Initialized
+  /// on each pass run.
+  std::optional<AsmState> asmState;
----------------
jpienaar wrote:

I was wondering about just making this a non-optional class member. I don't think it changes anything wrt this pass: below we already have a map from Value to Node, also having the map (via AsmState) of Value to textual would be consistent with the existing. And if this actually needs to be reset, then those below probably also needs a reset.

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


More information about the Mlir-commits mailing list