[Mlir-commits] [mlir] [mlir][scf] Remove unnecessary IRMapping in outlineSingleBlockRegion (NFC) (PR #158675)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Sep 15 09:28:24 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir-scf

Author: lonely eagle (linuxlonelyeagle)

<details>
<summary>Changes</summary>

Removed redundant IRMapping variables from outlineSingleBlockRegion.

---
Full diff: https://github.com/llvm/llvm-project/pull/158675.diff


1 Files Affected:

- (modified) mlir/lib/Dialect/SCF/Utils/Utils.cpp (+1-2) 


``````````diff
diff --git a/mlir/lib/Dialect/SCF/Utils/Utils.cpp b/mlir/lib/Dialect/SCF/Utils/Utils.cpp
index 684dff8121de6..fc93cf35a5242 100644
--- a/mlir/lib/Dialect/SCF/Utils/Utils.cpp
+++ b/mlir/lib/Dialect/SCF/Utils/Utils.cpp
@@ -202,8 +202,7 @@ FailureOr<func::FuncOp> mlir::outlineSingleBlockRegion(RewriterBase &rewriter,
       OpBuilder::InsertionGuard g(rewriter);
       rewriter.setInsertionPointToStart(outlinedFuncBody);
       if (Operation *cst = orig.getDefiningOp<arith::ConstantIndexOp>()) {
-        IRMapping bvm;
-        repl = rewriter.clone(*cst, bvm)->getResult(0);
+        repl = rewriter.clone(*cst)->getResult(0);
       }
     }
     orig.replaceUsesWithIf(repl, [&](OpOperand &opOperand) {

``````````

</details>


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


More information about the Mlir-commits mailing list