[Mlir-commits] [mlir] 1d448e1 - [mlir][bufferization] Use rewriter to erase ops in scf.forall bufferization.

Thomas Raoux llvmlistbot at llvm.org
Tue Mar 28 17:09:53 PDT 2023


Author: Thomas Raoux
Date: 2023-03-28T23:59:45Z
New Revision: 1d448e1f24a8a44f9ab95c42945ef15cc63b48e7

URL: https://github.com/llvm/llvm-project/commit/1d448e1f24a8a44f9ab95c42945ef15cc63b48e7
DIFF: https://github.com/llvm/llvm-project/commit/1d448e1f24a8a44f9ab95c42945ef15cc63b48e7.diff

LOG: [mlir][bufferization] Use rewriter to erase ops in scf.forall bufferization.

Without this bufferization cannot track operations removed during bufferization.
Unfortunately there is currently no way to enforce that ops need to be erased through
the rewriter and this causes sporadic errors when tracking pointers in Bufferization pass.
Therefore there is no easy way to test that the pattern is doing the right thing.

Reviewed By: mravishankar

Differential Revision: https://reviews.llvm.org/D147095

Added: 
    

Modified: 
    mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp b/mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp
index 91a7bb42e402d..13f0d769ef4cc 100644
--- a/mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp
+++ b/mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp
@@ -1089,7 +1089,7 @@ struct ForallOpInterface
         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<Value> replacementBbArgs;


        


More information about the Mlir-commits mailing list