Skip to content

Conversation

linuxlonelyeagle
Copy link
Member

Removed redundant IRMapping variables from outlineSingleBlockRegion.

@llvmbot
Copy link
Member

llvmbot commented Sep 15, 2025

@llvm/pr-subscribers-mlir

@llvm/pr-subscribers-mlir-scf

Author: lonely eagle (linuxlonelyeagle)

Changes

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 --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) {

@linuxlonelyeagle linuxlonelyeagle changed the title [mlir][scf] Remove unnecessary IRMapping in outlineSingleBlockRegion(nfc) [mlir][scf] Remove unnecessary IRMapping in outlineSingleBlockRegion (NFC) Sep 15, 2025
@linuxlonelyeagle linuxlonelyeagle requested review from joker-eph, krzysz00 and mfrancio and removed request for joker-eph September 15, 2025 16:28
Copy link
Contributor

@krzysz00 krzysz00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this is NFC (and probably should marked as such), approved

@linuxlonelyeagle linuxlonelyeagle merged commit 3e74e53 into llvm:main Sep 15, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants