[Mlir-commits] [mlir] [mlir][NFC] Add RewriterBase operand/block-arg mutation helpers (PR #187992)
Hocky Yudhiono
llvmlistbot at llvm.org
Mon Mar 23 07:03:24 PDT 2026
================
@@ -244,6 +244,37 @@ void RewriterBase::eraseBlock(Block *block) {
block->erase();
}
+void RewriterBase::eraseBlockArgument(Block *block, unsigned index) {
+ eraseBlockArguments(block, index, /*num=*/1);
+}
+
+void RewriterBase::eraseBlockArguments(Block *block, unsigned start,
+ unsigned num) {
+ if (Operation *parentOp = block->getParentOp()) {
+ modifyOpInPlace(parentOp, [&]() { block->eraseArguments(start, num); });
+ return;
+ }
+ block->eraseArguments(start, num);
----------------
hockyy wrote:
> That fallback is surprising to me and seems like a new behavior?
sorry mustve been accident line duplicate while i was copying the signatures
https://github.com/llvm/llvm-project/pull/187992
More information about the Mlir-commits
mailing list