[Mlir-commits] [mlir] [mlir][Transforms] Fix compile time regression in dialect conversion (PR #83023)

Matthias Springer llvmlistbot at llvm.org
Tue Feb 27 00:35:20 PST 2024


================
@@ -1229,9 +1229,8 @@ LogicalResult ConversionPatternRewriterImpl::remapValues(
 }
 
 bool ConversionPatternRewriterImpl::isOpIgnored(Operation *op) const {
-  // Check to see if this operation was replaced or its parent ignored.
-  return ignoredOps.count(op->getParentOp()) ||
-         hasRewrite<ReplaceOperationRewrite>(rewrites, op);
+  // Check to see if this operation or the parent operation is ignored.
+  return ignoredOps.count(op->getParentOp()) || ignoredOps.count(op);
----------------
matthias-springer wrote:

I had to partially undo this change (#83051) because of downstream code that uses the rewriter API incorrectly: accessing nested regions of an op after replacing the op; the dialect conversion does not crash when doing that because ops are not really erased the very end. But this change caused those nested ops to be ignored. I'm going to fix that code, then I should be able to change this to simply `ignoredOps.count(op)`.


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


More information about the Mlir-commits mailing list