[Mlir-commits] [mlir] [mlir] [core]: in -mlir-print-ir-*, dump the pass options as well (PR #195198)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Thu Apr 30 16:47:32 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- mlir/lib/Pass/IRPrinting.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/mlir/lib/Pass/IRPrinting.cpp b/mlir/lib/Pass/IRPrinting.cpp
index 6eab72104..41c50625f 100644
--- a/mlir/lib/Pass/IRPrinting.cpp
+++ b/mlir/lib/Pass/IRPrinting.cpp
@@ -46,7 +46,7 @@ private:
};
} // namespace
-static void printIR(Operation* op, bool printModuleScope, raw_ostream& out,
+static void printIR(Operation *op, bool printModuleScope, raw_ostream &out,
OpPrintingFlags flags, Pass *pass = nullptr) {
// Otherwise, check to see if we are not printing at module scope.
if (!printModuleScope) {
@@ -72,8 +72,9 @@ static void printIR(Operation* op, bool printModuleScope, raw_ostream& out,
}
// Find the top-level operation.
- auto* topLevelOp = op;
- while (auto* parentOp = topLevelOp->getParentOp()) topLevelOp = parentOp;
+ auto *topLevelOp = op;
+ while (auto *parentOp = topLevelOp->getParentOp())
+ topLevelOp = parentOp;
topLevelOp->print(out, flags);
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/195198
More information about the Mlir-commits
mailing list