[Mlir-commits] [mlir] [mlir][reducer] make opt-reduction pass clone topOp after check (NFC) (PR #189356)

lonely eagle llvmlistbot at llvm.org
Mon Mar 30 04:06:35 PDT 2026


https://github.com/linuxlonelyeagle updated https://github.com/llvm/llvm-project/pull/189356

>From 41bf2a968c566a3a06eadc9ce334ccd69af42b12 Mon Sep 17 00:00:00 2001
From: linuxlonelyeagle <2020382038 at qq.com>
Date: Mon, 30 Mar 2026 10:59:23 +0000
Subject: [PATCH] make opt-reduction pass clone topOp after check.

---
 mlir/lib/Reducer/OptReductionPass.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/mlir/lib/Reducer/OptReductionPass.cpp b/mlir/lib/Reducer/OptReductionPass.cpp
index 4bdc7b17567d9..24e4d9173de39 100644
--- a/mlir/lib/Reducer/OptReductionPass.cpp
+++ b/mlir/lib/Reducer/OptReductionPass.cpp
@@ -47,8 +47,6 @@ void OptReductionPass::runOnOperation() {
   Tester test(testerName, testerArgs);
 
   ModuleOp module = this->getOperation();
-  ModuleOp moduleVariant = module.clone();
-
   OpPassManager passManager("builtin.module");
   if (failed(parsePassPipeline(optPass, passManager))) {
     module.emitError() << "\nfailed to parse pass pipeline";
@@ -60,6 +58,7 @@ void OptReductionPass::runOnOperation() {
     module.emitError() << "\nthe original input is not interested";
     return signalPassFailure();
   }
+  ModuleOp moduleVariant = module.clone();
 
   // Temporarily push the variant under the main module and execute the pipeline
   // on it.



More information about the Mlir-commits mailing list