diff --git a/mlir/include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h b/mlir/include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h index ea7af3018bda8..ada9539e87121 100644 --- a/mlir/include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h +++ b/mlir/include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h @@ -315,16 +315,6 @@ struct BufferizationOptions { // outside of the parallel region will be given a new buffer. bool checkParallelRegions = true; - /// Certain ops have aliasing OpOperand/OpResult invariants (e.g., scf.for). - /// If this flag is set to `false`, those invariants are no longer enforced - /// with buffer copies. - /// - /// Note: Deactivating this flag can lead to incorrect bufferization results - /// when used incorrectly. This flag is useful with - /// `AlwaysCopyAnalysisState` which bufferizes all writing tensor - /// OpOperands out-of-place. - bool enforceAliasingInvariants = true; - /// This function controls buffer types on function signatures. Sets /// `functionArgTypeConverterFn` and `inferFunctionResultLayout` accordingly. /// diff --git a/mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp b/mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp index e9d7dc1b847c6..74e36796d498e 100644 --- a/mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp +++ b/mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp @@ -652,8 +652,7 @@ struct ForOpInterface if (failed(bufferizableOp.resolveTensorOpOperandConflicts(rewriter, state))) return failure(); - if (!state.getOptions().enforceAliasingInvariants || - state.getOptions().copyBeforeWrite) + if (state.getOptions().copyBeforeWrite) return success(); // According to the `getAliasing...` implementations, a bufferized OpResult @@ -894,8 +893,7 @@ struct WhileOpInterface if (failed(bufferizableOp.resolveTensorOpOperandConflicts(rewriter, state))) return failure(); - if (!state.getOptions().enforceAliasingInvariants || - state.getOptions().copyBeforeWrite) + if (state.getOptions().copyBeforeWrite) return success(); // According to the `getAliasing...` implementations, a bufferized OpResult