[Mlir-commits] [mlir] [NFC][mlir] Mark dump() methods with LLVM_DUMP_METHOD (PR #233398)

Andrei Golubev llvmlistbot at llvm.org
Mon Oct 19 03:50:53 PDT 2026


https://github.com/andrey-golubev created https://github.com/llvm/llvm-project/pull/233398

LLVM_DUMP_METHOD is a macro that helps to prevent symbol elimination from the binary. This is particularly useful to preserve "debug" methods such as dump() in order to use them during debugging sessions. In practice, user builds might even force stripping of "unused symbols" and dead code via compiler/linker flags. Yet, ::dump() methods seem to be useful even when that stripping is enabled for debug builds.

As an example, a local build with stripping, running under lldb would result in the following when evaluating stripped
mlir::Operation::dump():
```
expr op->dump()
note: Ran expression as 'C++14'.
error: Couldn't look up symbols:
  $__lldb_func::0x1e:0x400b1f000002d037:_ZN4mlir9Operation4dumpEv
Hint: The expression tried to call a function that is not present in the target, perhaps because it was optimized out by the compiler.
```
As there's also mlir::Operation::dumpPretty() that is marked with LLVM_DUMP_METHOD, in the same session, at the same breakpoint the result for a non-stripped method is:
```
expr op->dumpPretty()
func.func @main(%arg0: tensor<?x?x?x1xf32>) -> tensor<?x1x?x?xf32> {
...
```
that is, non-stripped methods can successfully be called, despite compiler flags / build configuration.

Thus, mark MLIR-related dump() methods with the macro so that they are not stripped away (in Debug or when LLVM_ENABLE_DUMP is defined).

Note: LLVM's documentation suggests to additionally cover methods marked with LLVM_DUMP_METHOD by an #ifdef so that they are still properly stripped in the Release builds. However, mlir::Operation::dumpPretty() is not covered by that. Given that the macro itself resolves into "no inline" in case of Release, it seems it should already be sufficient. At least without an additional wrapping the behaviour seems to be more-or-less exact to the original one when the macro was not used.

>From 9098a6d38d2c34a73409ebf45023d1b04d5f39ef Mon Sep 17 00:00:00 2001
From: "Golubev, Andrey" <andrey.golubev at intel.com>
Date: Mon, 19 Oct 2026 10:16:26 +0000
Subject: [PATCH] [NFC][mlir] Mark dump() methods with LLVM_DUMP_METHOD

LLVM_DUMP_METHOD is a macro that helps to prevent symbol elimination
from the binary. This is particularly useful to preserve "debug" methods
such as dump() in order to use them during debugging sessions. In
practice, user builds might even force stripping of "unused symbols" and
dead code via compiler/linker flags. Yet, ::dump() methods seem to be
useful even when that stripping is enabled for debug builds.

As an example, a local build with stripping, running under lldb would
result in the following when evaluating stripped
mlir::Operation::dump():
```
expr op->dump()
note: Ran expression as 'C++14'.
error: Couldn't look up symbols:
  $__lldb_func::0x1e:0x400b1f000002d037:_ZN4mlir9Operation4dumpEv
Hint: The expression tried to call a function that is not present in the target, perhaps because it was optimized out by the compiler.
```
As there's also mlir::Operation::dumpPretty() that is marked with
LLVM_DUMP_METHOD, in the same session, at the same breakpoint the result
for a non-stripped method is:
```
expr op->dumpPretty()
func.func @main(%arg0: tensor<?x?x?x1xf32>) -> tensor<?x1x?x?xf32> {
...
```
that is, non-stripped methods can successfully be called, despite
compiler flags / build configuration.

Thus, mark MLIR-related dump() methods with the macro so that they are
not stripped away (in Debug or when LLVM_ENABLE_DUMP is defined).

Note: LLVM's documentation suggests to additionally cover methods marked
with LLVM_DUMP_METHOD by an #ifdef so that they are still properly
stripped in the Release builds. However, mlir::Operation::dumpPretty()
is not covered by that. Given that the macro itself resolves into "no
inline" in case of Release, it seems it should already be sufficient. At
least without an additional wrapping the behaviour seems to be
more-or-less exact to the original one when the macro was not used.
---
 mlir/include/mlir/Analysis/CallGraph.h                     | 2 +-
 mlir/include/mlir/Analysis/Liveness.h                      | 2 +-
 mlir/include/mlir/Analysis/Presburger/IntegerRelation.h    | 2 +-
 mlir/include/mlir/Analysis/Presburger/Matrix.h             | 2 +-
 mlir/include/mlir/Analysis/Presburger/PWMAFunction.h       | 4 ++--
 mlir/include/mlir/Analysis/Presburger/PresburgerRelation.h | 2 +-
 mlir/include/mlir/Analysis/Presburger/PresburgerSpace.h    | 4 ++--
 mlir/include/mlir/Analysis/Presburger/Simplex.h            | 2 +-
 mlir/include/mlir/Analysis/Presburger/Utils.h              | 2 +-
 mlir/include/mlir/Debug/ExecutionContext.h                 | 5 +----
 mlir/include/mlir/Dialect/Affine/Analysis/Utils.h          | 4 ++--
 mlir/include/mlir/IR/AffineExpr.h                          | 2 +-
 mlir/include/mlir/IR/AffineMap.h                           | 2 +-
 mlir/include/mlir/IR/Attributes.h                          | 2 +-
 mlir/include/mlir/IR/Block.h                               | 2 +-
 mlir/include/mlir/IR/IntegerSet.h                          | 2 +-
 mlir/include/mlir/IR/Location.h                            | 2 +-
 mlir/include/mlir/IR/OpDefinition.h                        | 2 +-
 mlir/include/mlir/IR/Operation.h                           | 2 +-
 mlir/include/mlir/IR/OperationSupport.h                    | 2 +-
 mlir/include/mlir/IR/Types.h                               | 2 +-
 mlir/include/mlir/IR/Value.h                               | 2 +-
 mlir/include/mlir/Interfaces/InferTypeOpInterface.h        | 2 +-
 mlir/include/mlir/Interfaces/ValueBoundsOpInterface.h      | 2 +-
 mlir/include/mlir/Pass/PassManager.h                       | 2 +-
 mlir/lib/Debug/ExecutionContext.cpp                        | 5 +++++
 mlir/lib/Dialect/SparseTensor/IR/Detail/Var.h              | 2 +-
 27 files changed, 34 insertions(+), 32 deletions(-)

diff --git a/mlir/include/mlir/Analysis/CallGraph.h b/mlir/include/mlir/Analysis/CallGraph.h
index 9808aea1239cf..fc342255c5ca1 100644
--- a/mlir/include/mlir/Analysis/CallGraph.h
+++ b/mlir/include/mlir/Analysis/CallGraph.h
@@ -208,7 +208,7 @@ class CallGraph {
   iterator end() const { return nodes.end(); }
 
   /// Dump the graph in a human readable format.
-  void dump() const;
+  LLVM_DUMP_METHOD void dump() const;
   void print(raw_ostream &os) const;
 
 private:
diff --git a/mlir/include/mlir/Analysis/Liveness.h b/mlir/include/mlir/Analysis/Liveness.h
index ca4d8dfab3c91..23d9543a1af43 100644
--- a/mlir/include/mlir/Analysis/Liveness.h
+++ b/mlir/include/mlir/Analysis/Liveness.h
@@ -78,7 +78,7 @@ class Liveness {
   bool isDeadAfter(Value value, Operation *operation) const;
 
   /// Dumps the liveness information in a human readable format.
-  void dump() const;
+  LLVM_DUMP_METHOD void dump() const;
 
   /// Dumps the liveness information to the given stream.
   void print(raw_ostream &os) const;
diff --git a/mlir/include/mlir/Analysis/Presburger/IntegerRelation.h b/mlir/include/mlir/Analysis/Presburger/IntegerRelation.h
index 4b13085eceddf..ce6e9df154077 100644
--- a/mlir/include/mlir/Analysis/Presburger/IntegerRelation.h
+++ b/mlir/include/mlir/Analysis/Presburger/IntegerRelation.h
@@ -849,7 +849,7 @@ class IntegerRelation {
   bool isFullDim();
 
   void print(raw_ostream &os) const;
-  void dump() const;
+  LLVM_DUMP_METHOD void dump() const;
 
 protected:
   /// Checks all rows of equality/inequality constraints for trivial
diff --git a/mlir/include/mlir/Analysis/Presburger/Matrix.h b/mlir/include/mlir/Analysis/Presburger/Matrix.h
index 96afef1bd3105..3c034043c419d 100644
--- a/mlir/include/mlir/Analysis/Presburger/Matrix.h
+++ b/mlir/include/mlir/Analysis/Presburger/Matrix.h
@@ -210,7 +210,7 @@ class Matrix {
 
   /// Print the matrix.
   void print(raw_ostream &os) const;
-  void dump() const;
+  LLVM_DUMP_METHOD void dump() const;
 
   /// Return whether the Matrix is in a consistent state with all its
   /// invariants satisfied.
diff --git a/mlir/include/mlir/Analysis/Presburger/PWMAFunction.h b/mlir/include/mlir/Analysis/Presburger/PWMAFunction.h
index fcc39bf0e0537..e7a3e271673bf 100644
--- a/mlir/include/mlir/Analysis/Presburger/PWMAFunction.h
+++ b/mlir/include/mlir/Analysis/Presburger/PWMAFunction.h
@@ -110,7 +110,7 @@ class MultiAffineFunction {
   IntegerRelation getAsRelation() const;
 
   void print(raw_ostream &os) const;
-  void dump() const;
+  LLVM_DUMP_METHOD void dump() const;
 
 private:
   /// Assert that the MAF is consistent.
@@ -221,7 +221,7 @@ class PWMAFunction {
   PWMAFunction unionLexMax(const PWMAFunction &func);
 
   void print(raw_ostream &os) const;
-  void dump() const;
+  LLVM_DUMP_METHOD void dump() const;
 
 private:
   /// Return a function defined on the union of the domains of `this` and
diff --git a/mlir/include/mlir/Analysis/Presburger/PresburgerRelation.h b/mlir/include/mlir/Analysis/Presburger/PresburgerRelation.h
index f7e06a6b22a95..778f99d9414ff 100644
--- a/mlir/include/mlir/Analysis/Presburger/PresburgerRelation.h
+++ b/mlir/include/mlir/Analysis/Presburger/PresburgerRelation.h
@@ -223,7 +223,7 @@ class PresburgerRelation {
 
   /// Print the set's internal state.
   void print(raw_ostream &os) const;
-  void dump() const;
+  LLVM_DUMP_METHOD void dump() const;
 
 protected:
   /// Construct an empty PresburgerRelation with the specified number of
diff --git a/mlir/include/mlir/Analysis/Presburger/PresburgerSpace.h b/mlir/include/mlir/Analysis/Presburger/PresburgerSpace.h
index c7808e7201470..ede6f4279fe90 100644
--- a/mlir/include/mlir/Analysis/Presburger/PresburgerSpace.h
+++ b/mlir/include/mlir/Analysis/Presburger/PresburgerSpace.h
@@ -102,7 +102,7 @@ class Identifier {
   bool operator!=(const Identifier &other) const { return !isEqual(other); }
 
   void print(llvm::raw_ostream &os) const;
-  void dump() const;
+  LLVM_DUMP_METHOD void dump() const;
 
 private:
   /// The value of the identifier.
@@ -311,7 +311,7 @@ class PresburgerSpace {
   void mergeAndAlignSymbols(PresburgerSpace &other);
 
   void print(llvm::raw_ostream &os) const;
-  void dump() const;
+  LLVM_DUMP_METHOD void dump() const;
 
 protected:
   PresburgerSpace(unsigned numDomain, unsigned numRange, unsigned numSymbols,
diff --git a/mlir/include/mlir/Analysis/Presburger/Simplex.h b/mlir/include/mlir/Analysis/Presburger/Simplex.h
index d89bbe37a6b3e..163ae24975253 100644
--- a/mlir/include/mlir/Analysis/Presburger/Simplex.h
+++ b/mlir/include/mlir/Analysis/Presburger/Simplex.h
@@ -205,7 +205,7 @@ class SimplexBase {
 
   /// Print the tableau's internal state.
   void print(raw_ostream &os) const;
-  void dump() const;
+  LLVM_DUMP_METHOD void dump() const;
 
 protected:
   /// Construct a SimplexBase with the specified number of variables and fixed
diff --git a/mlir/include/mlir/Analysis/Presburger/Utils.h b/mlir/include/mlir/Analysis/Presburger/Utils.h
index 0e6d18279d67e..a4083a9eb2055 100644
--- a/mlir/include/mlir/Analysis/Presburger/Utils.h
+++ b/mlir/include/mlir/Analysis/Presburger/Utils.h
@@ -182,7 +182,7 @@ class DivisionRepr {
   removeDuplicateDivs(llvm::function_ref<bool(unsigned i, unsigned j)> merge);
 
   void print(raw_ostream &os) const;
-  void dump() const;
+  LLVM_DUMP_METHOD void dump() const;
 
 private:
   /// Each row of the Matrix represents a single division dividend. The
diff --git a/mlir/include/mlir/Debug/ExecutionContext.h b/mlir/include/mlir/Debug/ExecutionContext.h
index 93c26e0ce5f82..e2a5f3d0f3269 100644
--- a/mlir/include/mlir/Debug/ExecutionContext.h
+++ b/mlir/include/mlir/Debug/ExecutionContext.h
@@ -29,10 +29,7 @@ struct ActionActiveStack {
   const Action &getAction() const { return action; }
   int getDepth() const { return depth; }
   void print(raw_ostream &os, bool withContext) const;
-  void dump() const {
-    print(llvm::errs(), /*withContext=*/true);
-    llvm::errs() << "\n";
-  }
+  LLVM_DUMP_METHOD void dump() const;
   Breakpoint *getBreakpoint() const { return breakpoint; }
   void setBreakpoint(Breakpoint *breakpoint) { this->breakpoint = breakpoint; }
 
diff --git a/mlir/include/mlir/Dialect/Affine/Analysis/Utils.h b/mlir/include/mlir/Dialect/Affine/Analysis/Utils.h
index df4145db90a61..5365e381856f7 100644
--- a/mlir/include/mlir/Dialect/Affine/Analysis/Utils.h
+++ b/mlir/include/mlir/Dialect/Affine/Analysis/Utils.h
@@ -264,7 +264,7 @@ struct MemRefDependenceGraph {
 
   void print(raw_ostream &os) const;
 
-  void dump() const { print(llvm::errs()); }
+  LLVM_DUMP_METHOD void dump() const { print(llvm::errs()); }
 
   /// The block for which this graph is created to perform fusion.
   Block █
@@ -372,7 +372,7 @@ struct ComputationSliceState {
   /// If the validity cannot be determined, returns std::nullopt.
   std::optional<bool> isSliceValid() const;
 
-  void dump() const;
+  LLVM_DUMP_METHOD void dump() const;
 
 private:
   /// Fast check to determine if the computation slice is maximal. Returns true
diff --git a/mlir/include/mlir/IR/AffineExpr.h b/mlir/include/mlir/IR/AffineExpr.h
index 51b5e972abd41..3f26afe5e0856 100644
--- a/mlir/include/mlir/IR/AffineExpr.h
+++ b/mlir/include/mlir/IR/AffineExpr.h
@@ -87,7 +87,7 @@ class AffineExpr {
   AffineExprKind getKind() const;
 
   void print(raw_ostream &os) const;
-  void dump() const;
+  LLVM_DUMP_METHOD void dump() const;
 
   /// Returns true if this expression is made out of only symbols and
   /// constants, i.e., it does not involve dimensional identifiers.
diff --git a/mlir/include/mlir/IR/AffineMap.h b/mlir/include/mlir/IR/AffineMap.h
index aa932e7bcda6c..98792775c23cf 100644
--- a/mlir/include/mlir/IR/AffineMap.h
+++ b/mlir/include/mlir/IR/AffineMap.h
@@ -198,7 +198,7 @@ class AffineMap {
 
   // Prints affine map to 'os'.
   void print(raw_ostream &os) const;
-  void dump() const;
+  LLVM_DUMP_METHOD void dump() const;
 
   unsigned getNumDims() const;
   unsigned getNumSymbols() const;
diff --git a/mlir/include/mlir/IR/Attributes.h b/mlir/include/mlir/IR/Attributes.h
index a2f9c5fcda873..389ba95d9be97 100644
--- a/mlir/include/mlir/IR/Attributes.h
+++ b/mlir/include/mlir/IR/Attributes.h
@@ -63,7 +63,7 @@ class Attribute {
   /// without a trailing colon type if it has one.
   void print(raw_ostream &os, bool elideType = false) const;
   void print(raw_ostream &os, AsmState &state, bool elideType = false) const;
-  void dump() const;
+  LLVM_DUMP_METHOD void dump() const;
 
   /// Print the attribute without dialect wrapping.
   void printStripped(raw_ostream &os) const;
diff --git a/mlir/include/mlir/IR/Block.h b/mlir/include/mlir/IR/Block.h
index 3638595358e25..7611f5320c82b 100644
--- a/mlir/include/mlir/IR/Block.h
+++ b/mlir/include/mlir/IR/Block.h
@@ -406,7 +406,7 @@ class alignas(8) Block : public IRObjectWithUseList<BlockOperand>,
 
   void print(raw_ostream &os);
   void print(raw_ostream &os, AsmState &state);
-  void dump();
+  LLVM_DUMP_METHOD void dump();
 
   /// Print out the name of the block without printing its body.
   /// NOTE: The printType argument is ignored.  We keep it for compatibility
diff --git a/mlir/include/mlir/IR/IntegerSet.h b/mlir/include/mlir/IR/IntegerSet.h
index 3c84131e8ecd5..088a4ca42da24 100644
--- a/mlir/include/mlir/IR/IntegerSet.h
+++ b/mlir/include/mlir/IR/IntegerSet.h
@@ -103,7 +103,7 @@ class IntegerSet {
   void walkExprs(function_ref<void(AffineExpr)> callback) const;
 
   void print(raw_ostream &os) const;
-  void dump() const;
+  LLVM_DUMP_METHOD void dump() const;
 
   friend ::llvm::hash_code hash_value(IntegerSet arg);
 
diff --git a/mlir/include/mlir/IR/Location.h b/mlir/include/mlir/IR/Location.h
index abc435b9b08ff..a8f458343b701 100644
--- a/mlir/include/mlir/IR/Location.h
+++ b/mlir/include/mlir/IR/Location.h
@@ -95,7 +95,7 @@ class Location {
 
   /// Print the location.
   void print(raw_ostream &os) const { impl.print(os); }
-  void dump() const { impl.dump(); }
+  LLVM_DUMP_METHOD void dump() const { impl.dump(); }
 
   friend ::llvm::hash_code hash_value(Location arg);
 
diff --git a/mlir/include/mlir/IR/OpDefinition.h b/mlir/include/mlir/IR/OpDefinition.h
index 0ab6679187c8e..eef99974ee188 100644
--- a/mlir/include/mlir/IR/OpDefinition.h
+++ b/mlir/include/mlir/IR/OpDefinition.h
@@ -123,7 +123,7 @@ class OpState {
   }
 
   /// Dump this operation.
-  void dump() { state->dump(); }
+  LLVM_DUMP_METHOD void dump() { state->dump(); }
 
   /// The source location the operation was defined or derived from.
   Location getLoc() { return state->getLoc(); }
diff --git a/mlir/include/mlir/IR/Operation.h b/mlir/include/mlir/IR/Operation.h
index 3ea9ad8ca0cfc..adddd8572f2a3 100644
--- a/mlir/include/mlir/IR/Operation.h
+++ b/mlir/include/mlir/IR/Operation.h
@@ -345,7 +345,7 @@ class alignas(8) Operation final
 
   void print(raw_ostream &os, const OpPrintingFlags &flags = {});
   void print(raw_ostream &os, AsmState &state);
-  void dump();
+  LLVM_DUMP_METHOD void dump();
 
   // Dump pretty printed IR. This method is helpful for better readability if
   // the Operation is not verified because it won't disable custom printers to
diff --git a/mlir/include/mlir/IR/OperationSupport.h b/mlir/include/mlir/IR/OperationSupport.h
index 3b43a1cf07bf9..68be626d7a560 100644
--- a/mlir/include/mlir/IR/OperationSupport.h
+++ b/mlir/include/mlir/IR/OperationSupport.h
@@ -541,7 +541,7 @@ class OperationName {
   StringAttr getIdentifier() const { return getImpl()->getName(); }
 
   void print(raw_ostream &os) const;
-  void dump() const;
+  LLVM_DUMP_METHOD void dump() const;
 
   /// Represent the operation name as an opaque pointer. (Used to support
   /// PointerLikeTypeTraits).
diff --git a/mlir/include/mlir/IR/Types.h b/mlir/include/mlir/IR/Types.h
index 70599b448f76e..89c93cf0687bf 100644
--- a/mlir/include/mlir/IR/Types.h
+++ b/mlir/include/mlir/IR/Types.h
@@ -159,7 +159,7 @@ class Type {
   /// Print the current type.
   void print(raw_ostream &os) const;
   void print(raw_ostream &os, AsmState &state) const;
-  void dump() const;
+  LLVM_DUMP_METHOD void dump() const;
 
   friend ::llvm::hash_code hash_value(Type arg);
 
diff --git a/mlir/include/mlir/IR/Value.h b/mlir/include/mlir/IR/Value.h
index a34837bfcea1a..d5cef1f0c44ba 100644
--- a/mlir/include/mlir/IR/Value.h
+++ b/mlir/include/mlir/IR/Value.h
@@ -223,7 +223,7 @@ class Value {
   void print(raw_ostream &os) const;
   void print(raw_ostream &os, const OpPrintingFlags &flags) const;
   void print(raw_ostream &os, AsmState &state) const;
-  void dump() const;
+  LLVM_DUMP_METHOD void dump() const;
 
   /// Print this value as if it were an operand.
   void printAsOperand(raw_ostream &os, AsmState &state) const;
diff --git a/mlir/include/mlir/Interfaces/InferTypeOpInterface.h b/mlir/include/mlir/Interfaces/InferTypeOpInterface.h
index 1bfb66e681d8d..90ce18aad0cb0 100644
--- a/mlir/include/mlir/Interfaces/InferTypeOpInterface.h
+++ b/mlir/include/mlir/Interfaces/InferTypeOpInterface.h
@@ -92,7 +92,7 @@ class ShapeAdaptor {
   explicit operator bool() const { return !val.isNull(); }
 
   /// Dumps textual repesentation to stderr.
-  void dump() const;
+  LLVM_DUMP_METHOD void dump() const;
 
 private:
   // Union storing either ShapedTypeComponents, ShapedType (stored as Type and
diff --git a/mlir/include/mlir/Interfaces/ValueBoundsOpInterface.h b/mlir/include/mlir/Interfaces/ValueBoundsOpInterface.h
index 50c2dfe64de2b..593d4398a4f7e 100644
--- a/mlir/include/mlir/Interfaces/ValueBoundsOpInterface.h
+++ b/mlir/include/mlir/Interfaces/ValueBoundsOpInterface.h
@@ -353,7 +353,7 @@ class ValueBoundsConstraintSet
 
   /// Debugging only: Dump the constraint set and the column-to-value/dim
   /// mapping to llvm::errs.
-  void dump() const;
+  LLVM_DUMP_METHOD void dump() const;
 
 protected:
   /// Dimension identifier to indicate a value is index-typed. This is used for
diff --git a/mlir/include/mlir/Pass/PassManager.h b/mlir/include/mlir/Pass/PassManager.h
index 0f2a2bd060acd..a3ff667940a32 100644
--- a/mlir/include/mlir/Pass/PassManager.h
+++ b/mlir/include/mlir/Pass/PassManager.h
@@ -148,7 +148,7 @@ class OpPassManager {
   void printAsTextualPipeline(raw_ostream &os, bool pretty = false) const;
 
   /// Raw dump of the pass manager to llvm::errs().
-  void dump();
+  LLVM_DUMP_METHOD void dump();
 
   /// Merge the pass statistics of this class into 'other'.
   void mergeStatisticsInto(OpPassManager &other);
diff --git a/mlir/lib/Debug/ExecutionContext.cpp b/mlir/lib/Debug/ExecutionContext.cpp
index cc72bac549ab0..1fd38349b0f5d 100644
--- a/mlir/lib/Debug/ExecutionContext.cpp
+++ b/mlir/lib/Debug/ExecutionContext.cpp
@@ -42,6 +42,11 @@ void ActionActiveStack::print(raw_ostream &os, bool withContext) const {
   }
 }
 
+void ActionActiveStack::dump() const {
+  print(llvm::errs(), /*withContext=*/true);
+  llvm::errs() << "\n";
+}
+
 //===----------------------------------------------------------------------===//
 // ExecutionContext
 //===----------------------------------------------------------------------===//
diff --git a/mlir/lib/Dialect/SparseTensor/IR/Detail/Var.h b/mlir/lib/Dialect/SparseTensor/IR/Detail/Var.h
index dce8b003b013b..36e4785d5efd9 100644
--- a/mlir/lib/Dialect/SparseTensor/IR/Detail/Var.h
+++ b/mlir/lib/Dialect/SparseTensor/IR/Detail/Var.h
@@ -134,7 +134,7 @@ class Var {
   std::string str() const;
   void print(llvm::raw_ostream &os) const;
   void print(AsmPrinter &printer) const;
-  void dump() const;
+  LLVM_DUMP_METHOD void dump() const;
 };
 static_assert(IsZeroCostAbstraction<Var>);
 



More information about the Mlir-commits mailing list