[Mlir-commits] [mlir] [MLIR] Preserve operand segment sizes when removing dead inputs (PR #223154)

Matthias Springer llvmlistbot at llvm.org
Sat Sep 12 18:40:47 PDT 2026


================
@@ -1150,6 +1150,16 @@ struct OperationState {
   MLIRContext *getContext() const { return location->getContext(); }
 };
 
+//===----------------------------------------------------------------------===//
+// Operand mutation
+//===----------------------------------------------------------------------===//
+
+/// Erase the operands selected by `eraseIndices` and update operandSegmentSizes
+/// if the operation has AttrSizedOperandSegments. The bit vector must have one
+/// entry for each original operand. The caller must select operands that the
+/// operation permits removing and update any other dependent metadata.
+void eraseOperands(Operation *op, const BitVector &eraseIndices);
----------------
matthias-springer wrote:

Can you move this function `RewriterBase`? We already have `RewriterBase::eraseOpResults` there.

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


More information about the Mlir-commits mailing list