diff --git a/mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp b/mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp --- a/mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp +++ b/mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp @@ -1089,7 +1089,7 @@ forallOp.getMixedUpperBound(), forallOp.getMixedStep(), /*outputs=*/ValueRange(), forallOp.getMapping()); - newForallOp.getBody()->getTerminator()->erase(); + rewriter.eraseOp(newForallOp.getBody()->getTerminator()); // Move over block contents of the old op. SmallVector replacementBbArgs;