diff --git a/mlir/include/mlir/Dialect/Arith/Transforms/Passes.h b/mlir/include/mlir/Dialect/Arith/Transforms/Passes.h index cbc6147cb81e22..9dc262cc72ed00 100644 --- a/mlir/include/mlir/Dialect/Arith/Transforms/Passes.h +++ b/mlir/include/mlir/Dialect/Arith/Transforms/Passes.h @@ -24,9 +24,6 @@ namespace arith { class WideIntEmulationConverter; class NarrowTypeEmulationConverter; -/// Create a pass to bufferize arith.constant ops. -std::unique_ptr createConstantBufferizePass(uint64_t alignment = 0); - /// Adds patterns to emulate wide Arith and Function ops over integer /// types into supported ones. This is done by splitting original power-of-two /// i2N integer types into two iN halves. diff --git a/mlir/include/mlir/Dialect/Arith/Transforms/Passes.td b/mlir/include/mlir/Dialect/Arith/Transforms/Passes.td index 4096e309199e98..550c5c0cf4f60f 100644 --- a/mlir/include/mlir/Dialect/Arith/Transforms/Passes.td +++ b/mlir/include/mlir/Dialect/Arith/Transforms/Passes.td @@ -11,22 +11,6 @@ include "mlir/Pass/PassBase.td" -def ArithBufferizePass : Pass<"arith-bufferize", "ModuleOp"> { - let summary = "Bufferize Arith dialect ops."; - let description = [{ - This pass bufferizes arith dialect ops. - - This pass needs to be a module pass because it inserts memref.global - ops into the module, which cannot be done safely from a function pass due to - multi-threading. Most other bufferization passes can run in parallel at - function granularity. - }]; - let options = [ - Option<"alignment", "alignment", "unsigned", /*default=*/"0", - "Create global memrefs with a specified alignment">, - ]; -} - def ArithExpandOpsPass : Pass<"arith-expand"> { let summary = "Legalize Arith ops to be convertible to LLVM."; let dependentDialects = ["vector::VectorDialect"]; diff --git a/mlir/include/mlir/Dialect/Bufferization/Transforms/Passes.h b/mlir/include/mlir/Dialect/Bufferization/Transforms/Passes.h index 459c252b707121..e053e6c97e1430 100644 --- a/mlir/include/mlir/Dialect/Bufferization/Transforms/Passes.h +++ b/mlir/include/mlir/Dialect/Bufferization/Transforms/Passes.h @@ -221,9 +221,6 @@ createPromoteBuffersToStackPass(std::function isSmallAlloc); /// insert_slice ops. std::unique_ptr createEmptyTensorEliminationPass(); -/// Create a pass that bufferizes ops from the bufferization dialect. -std::unique_ptr createBufferizationBufferizePass(); - //===----------------------------------------------------------------------===// // Registration //===----------------------------------------------------------------------===// diff --git a/mlir/include/mlir/Dialect/Bufferization/Transforms/Passes.td b/mlir/include/mlir/Dialect/Bufferization/Transforms/Passes.td index 7cb10b2ca03f97..970571b4dde53c 100644 --- a/mlir/include/mlir/Dialect/Bufferization/Transforms/Passes.td +++ b/mlir/include/mlir/Dialect/Bufferization/Transforms/Passes.td @@ -350,11 +350,6 @@ def FinalizingBufferize : Pass<"finalizing-bufferize", "func::FuncOp"> { let constructor = "mlir::bufferization::createFinalizingBufferizePass()"; } -def BufferizationBufferize : Pass<"bufferization-bufferize", "func::FuncOp"> { - let summary = "Bufferize the `bufferization` dialect"; - let constructor = "mlir::bufferization::createBufferizationBufferizePass()"; -} - def DropEquivalentBufferResults : Pass<"drop-equivalent-buffer-results", "ModuleOp"> { let summary = "Remove MemRef return values that are equivalent to a bbArg"; let description = [{ diff --git a/mlir/include/mlir/Dialect/Linalg/Passes.h b/mlir/include/mlir/Dialect/Linalg/Passes.h index d36d1e70f0b14d..f2955d55e59eca 100644 --- a/mlir/include/mlir/Dialect/Linalg/Passes.h +++ b/mlir/include/mlir/Dialect/Linalg/Passes.h @@ -22,10 +22,6 @@ namespace func { class FuncOp; } // namespace func -namespace bufferization { -struct OneShotBufferizationOptions; -} // namespace bufferization - #define GEN_PASS_DECL #include "mlir/Dialect/Linalg/Passes.h.inc" // IWYU pragma: keep diff --git a/mlir/include/mlir/Dialect/Linalg/Passes.td b/mlir/include/mlir/Dialect/Linalg/Passes.td index 0a4ce8953136dd..0621a9f33ba1e8 100644 --- a/mlir/include/mlir/Dialect/Linalg/Passes.td +++ b/mlir/include/mlir/Dialect/Linalg/Passes.td @@ -89,16 +89,6 @@ def LinalgInlineScalarOperandsPass : Pass<"linalg-inline-scalar-operands"> { ]; } -def LinalgBufferizePass : Pass<"linalg-bufferize"> { - let summary = "Bufferize the linalg dialect"; - let dependentDialects = [ - "affine::AffineDialect", - "bufferization::BufferizationDialect", - "linalg::LinalgDialect", - "memref::MemRefDialect", - ]; -} - def LinalgGeneralizeNamedOpsPass : Pass<"linalg-generalize-named-ops"> { let summary = "Convert named ops into generic ops"; let dependentDialects = ["linalg::LinalgDialect"]; diff --git a/mlir/include/mlir/Dialect/Shape/Transforms/Passes.h b/mlir/include/mlir/Dialect/Shape/Transforms/Passes.h index cfb637f133f54c..28e17459ff9625 100644 --- a/mlir/include/mlir/Dialect/Shape/Transforms/Passes.h +++ b/mlir/include/mlir/Dialect/Shape/Transforms/Passes.h @@ -47,13 +47,6 @@ void populateShapeRewritePatterns(RewritePatternSet &patterns); void populateRemoveShapeConstraintsPatterns(RewritePatternSet &patterns); std::unique_ptr> createRemoveShapeConstraintsPass(); -// Bufferizes shape dialect ops. -// -// Note that most shape dialect ops must be converted to std before -// bufferization happens, as they are intended to be bufferized at the std -// level. -std::unique_ptr> createShapeBufferizePass(); - /// Outline the shape computation part by adding shape.func and populate /// conrresponding mapping infomation into ShapeMappingAnalysis. std::unique_ptr> createOutlineShapeComputationPass(); diff --git a/mlir/include/mlir/Dialect/Shape/Transforms/Passes.td b/mlir/include/mlir/Dialect/Shape/Transforms/Passes.td index 9dfda9ea336153..83834509b4a35a 100644 --- a/mlir/include/mlir/Dialect/Shape/Transforms/Passes.td +++ b/mlir/include/mlir/Dialect/Shape/Transforms/Passes.td @@ -103,11 +103,4 @@ def ShapeToShapeLowering : Pass<"shape-to-shape-lowering", "func::FuncOp"> { let constructor = "mlir::createShapeToShapeLowering()"; } -// TODO: Generalize this to allow any type conversions desired. -def ShapeBufferize : Pass<"shape-bufferize", "func::FuncOp"> { - let summary = "Bufferize the shape dialect."; - let constructor = "mlir::createShapeBufferizePass()"; - let dependentDialects = ["bufferization::BufferizationDialect", - "memref::MemRefDialect"]; -} #endif // MLIR_DIALECT_SHAPE_TRANSFORMS_PASSES diff --git a/mlir/include/mlir/Dialect/Tensor/Transforms/Passes.h b/mlir/include/mlir/Dialect/Tensor/Transforms/Passes.h index 48f9066934a25e..964c35b3f15b80 100644 --- a/mlir/include/mlir/Dialect/Tensor/Transforms/Passes.h +++ b/mlir/include/mlir/Dialect/Tensor/Transforms/Passes.h @@ -21,9 +21,6 @@ namespace tensor { /// Creates an instance of the `tensor` subset folding pass. std::unique_ptr createFoldTensorSubsetOpsPass(); -/// Creates an instance of the `tensor` dialect bufferization pass. -std::unique_ptr createTensorBufferizePass(); - //===----------------------------------------------------------------------===// // Registration //===----------------------------------------------------------------------===// diff --git a/mlir/include/mlir/Dialect/Tensor/Transforms/Passes.td b/mlir/include/mlir/Dialect/Tensor/Transforms/Passes.td index 4cc3844f29120b..be4c333836ec07 100644 --- a/mlir/include/mlir/Dialect/Tensor/Transforms/Passes.td +++ b/mlir/include/mlir/Dialect/Tensor/Transforms/Passes.td @@ -27,9 +27,4 @@ def FoldTensorSubsetOps : Pass<"fold-tensor-subset-ops"> { ]; } -def TensorBufferize : Pass<"tensor-bufferize", "func::FuncOp"> { - let summary = "Bufferize the `tensor` dialect"; - let constructor = "mlir::tensor::createTensorBufferizePass()"; -} - #endif // MLIR_DIALECT_TENSOR_TRANSFORMS_PASSES diff --git a/mlir/include/mlir/Dialect/Vector/Transforms/Passes.h b/mlir/include/mlir/Dialect/Vector/Transforms/Passes.h index 911402551e14d4..5667f4fa95ace4 100644 --- a/mlir/include/mlir/Dialect/Vector/Transforms/Passes.h +++ b/mlir/include/mlir/Dialect/Vector/Transforms/Passes.h @@ -17,9 +17,6 @@ namespace vector { #define GEN_PASS_DECL #include "mlir/Dialect/Vector/Transforms/Passes.h.inc" -/// Creates an instance of the `vector` dialect bufferization pass. -std::unique_ptr createVectorBufferizePass(); - /// Creates an instance of the `vector.mask` lowering pass. std::unique_ptr createLowerVectorMaskPass(); diff --git a/mlir/include/mlir/Dialect/Vector/Transforms/Passes.td b/mlir/include/mlir/Dialect/Vector/Transforms/Passes.td index 31a0b3b2f0c53d..74369987497910 100644 --- a/mlir/include/mlir/Dialect/Vector/Transforms/Passes.td +++ b/mlir/include/mlir/Dialect/Vector/Transforms/Passes.td @@ -11,11 +11,6 @@ include "mlir/Pass/PassBase.td" -def VectorBufferize : Pass<"vector-bufferize", "func::FuncOp"> { - let summary = "Bufferize Vector dialect ops"; - let constructor = "mlir::vector::createVectorBufferizePass()"; -} - def LowerVectorMaskPass : Pass<"lower-vector-mask", "func::FuncOp"> { let summary = "Lower 'vector.mask' operations"; let constructor = "mlir::vector::createLowerVectorMaskPass()"; diff --git a/mlir/lib/Dialect/Arith/Transforms/Bufferize.cpp b/mlir/lib/Dialect/Arith/Transforms/Bufferize.cpp deleted file mode 100644 index 9a066756f429ca..00000000000000 --- a/mlir/lib/Dialect/Arith/Transforms/Bufferize.cpp +++ /dev/null @@ -1,67 +0,0 @@ -//===- Bufferize.cpp - Bufferization for Arith ops ---------*- C++ -*-===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include "mlir/Dialect/Arith/Transforms/Passes.h" - -#include "mlir/Dialect/Arith/IR/Arith.h" -#include "mlir/Dialect/Arith/Transforms/BufferizableOpInterfaceImpl.h" -#include "mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h" -#include "mlir/Dialect/Bufferization/IR/Bufferization.h" -#include "mlir/Dialect/Bufferization/Transforms/Bufferize.h" -#include "mlir/Dialect/MemRef/IR/MemRef.h" - -namespace mlir { -namespace arith { -#define GEN_PASS_DEF_ARITHBUFFERIZEPASS -#include "mlir/Dialect/Arith/Transforms/Passes.h.inc" -} // namespace arith -} // namespace mlir - -using namespace mlir; -using namespace bufferization; - -namespace { -/// Pass to bufferize Arith ops. -struct ArithBufferizePass - : public arith::impl::ArithBufferizePassBase { - using ArithBufferizePassBase::ArithBufferizePassBase; - - ArithBufferizePass(uint64_t alignment = 0, bool constantOpOnly = false) - : constantOpOnly(constantOpOnly) { - this->alignment = alignment; - } - - void runOnOperation() override { - BufferizationOptions options = getPartialBufferizationOptions(); - if (constantOpOnly) { - options.opFilter.allowOperation(); - } else { - options.opFilter.allowDialect(); - } - options.bufferAlignment = alignment; - - if (failed(bufferizeOp(getOperation(), options))) - signalPassFailure(); - } - - void getDependentDialects(DialectRegistry ®istry) const override { - registry.insert(); - arith::registerBufferizableOpInterfaceExternalModels(registry); - } - -private: - bool constantOpOnly; -}; -} // namespace - -std::unique_ptr -mlir::arith::createConstantBufferizePass(uint64_t alignment) { - return std::make_unique(alignment, - /*constantOpOnly=*/true); -} diff --git a/mlir/lib/Dialect/Arith/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Arith/Transforms/CMakeLists.txt index 12659eaba1fa5e..6b8bde8dc2aaf3 100644 --- a/mlir/lib/Dialect/Arith/Transforms/CMakeLists.txt +++ b/mlir/lib/Dialect/Arith/Transforms/CMakeLists.txt @@ -1,7 +1,6 @@ add_mlir_dialect_library(MLIRArithTransforms BufferDeallocationOpInterfaceImpl.cpp BufferizableOpInterfaceImpl.cpp - Bufferize.cpp BufferViewFlowOpInterfaceImpl.cpp EmulateUnsupportedFloats.cpp EmulateWideInt.cpp diff --git a/mlir/lib/Dialect/Bufferization/Transforms/Bufferize.cpp b/mlir/lib/Dialect/Bufferization/Transforms/Bufferize.cpp index e553ddd77975f8..9dfa53d0d93126 100644 --- a/mlir/lib/Dialect/Bufferization/Transforms/Bufferize.cpp +++ b/mlir/lib/Dialect/Bufferization/Transforms/Bufferize.cpp @@ -321,29 +321,6 @@ struct OneShotBufferizePass }; } // namespace -namespace { -struct BufferizationBufferizePass - : public bufferization::impl::BufferizationBufferizeBase< - BufferizationBufferizePass> { - void runOnOperation() override { - BufferizationOptions options = getPartialBufferizationOptions(); - options.opFilter.allowDialect(); - - if (failed(bufferizeOp(getOperation(), options))) - signalPassFailure(); - } - - void getDependentDialects(DialectRegistry ®istry) const override { - registry - .insert(); - } -}; -} // namespace - -std::unique_ptr mlir::bufferization::createBufferizationBufferizePass() { - return std::make_unique(); -} - std::unique_ptr mlir::bufferization::createOneShotBufferizePass() { return std::make_unique(); } diff --git a/mlir/lib/Dialect/Linalg/Transforms/Bufferize.cpp b/mlir/lib/Dialect/Linalg/Transforms/Bufferize.cpp deleted file mode 100644 index 8812ca14ba6109..00000000000000 --- a/mlir/lib/Dialect/Linalg/Transforms/Bufferize.cpp +++ /dev/null @@ -1,52 +0,0 @@ -//===- Bufferize.cpp - Bufferization of linalg ops ------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include "mlir/Dialect/Linalg/Passes.h" - -#include "mlir/Dialect/Affine/IR/AffineOps.h" -#include "mlir/Dialect/Bufferization/IR/Bufferization.h" -#include "mlir/Dialect/Bufferization/Transforms/Bufferize.h" -#include "mlir/Dialect/Func/IR/FuncOps.h" -#include "mlir/Dialect/Linalg/IR/Linalg.h" -#include "mlir/Dialect/Linalg/Transforms/BufferizableOpInterfaceImpl.h" -#include "mlir/Dialect/Linalg/Transforms/Transforms.h" -#include "mlir/Dialect/Tensor/IR/Tensor.h" -#include "mlir/IR/BuiltinDialect.h" -#include "mlir/IR/Operation.h" -#include "mlir/Pass/Pass.h" - -namespace mlir { -#define GEN_PASS_DEF_LINALGBUFFERIZEPASS -#include "mlir/Dialect/Linalg/Passes.h.inc" -} // namespace mlir - -using namespace mlir; -using namespace bufferization; - -namespace { -/// Converts Linalg operations that work on tensor-type operands or results to -/// work on buffers. -struct LinalgBufferizePass - : public impl::LinalgBufferizePassBase { - using impl::LinalgBufferizePassBase< - LinalgBufferizePass>::LinalgBufferizePassBase; - void runOnOperation() override { - BufferizationOptions options = getPartialBufferizationOptions(); - options.opFilter.allowDialect(); - - if (failed(bufferizeOp(getOperation(), options))) - signalPassFailure(); - } - - void getDependentDialects(DialectRegistry ®istry) const override { - registry.insert(); - linalg::registerBufferizableOpInterfaceExternalModels(registry); - } -}; -} // namespace diff --git a/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt index ed9f40089282a6..7e3dc56e0acdc9 100644 --- a/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt +++ b/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt @@ -2,7 +2,6 @@ add_mlir_dialect_library(MLIRLinalgTransforms AllInterfaces.cpp BubbleUpExtractSlice.cpp BufferizableOpInterfaceImpl.cpp - Bufferize.cpp ConstantFold.cpp ConvertToDestinationStyle.cpp ConvertConv2DToImg2Col.cpp diff --git a/mlir/lib/Dialect/Shape/Transforms/Bufferize.cpp b/mlir/lib/Dialect/Shape/Transforms/Bufferize.cpp deleted file mode 100644 index 9dadbdbc91eca9..00000000000000 --- a/mlir/lib/Dialect/Shape/Transforms/Bufferize.cpp +++ /dev/null @@ -1,49 +0,0 @@ -//====----- Bufferize.cpp - Bufferization of shape ops ---------*- C++-*--===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include "mlir/Dialect/Shape/Transforms/Passes.h" - -#include "mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h" -#include "mlir/Dialect/Bufferization/IR/Bufferization.h" -#include "mlir/Dialect/Bufferization/Transforms/Bufferize.h" -#include "mlir/Dialect/Func/IR/FuncOps.h" -#include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/Shape/IR/Shape.h" -#include "mlir/Dialect/Shape/Transforms/BufferizableOpInterfaceImpl.h" -#include "mlir/Pass/Pass.h" - -namespace mlir { -#define GEN_PASS_DEF_SHAPEBUFFERIZE -#include "mlir/Dialect/Shape/Transforms/Passes.h.inc" -} // namespace mlir - -using namespace mlir; -using namespace bufferization; - -namespace { -struct ShapeBufferizePass - : public impl::ShapeBufferizeBase { - void runOnOperation() override { - BufferizationOptions options = getPartialBufferizationOptions(); - options.opFilter.allowDialect(); - - if (failed(bufferizeOp(getOperation(), options))) - signalPassFailure(); - } - - void getDependentDialects(DialectRegistry ®istry) const override { - registry.insert(); - shape::registerBufferizableOpInterfaceExternalModels(registry); - } -}; -} // namespace - -std::unique_ptr> mlir::createShapeBufferizePass() { - return std::make_unique(); -} diff --git a/mlir/lib/Dialect/Shape/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Shape/Transforms/CMakeLists.txt index 7c9b0d2e5e3a8e..a51c6780c28665 100644 --- a/mlir/lib/Dialect/Shape/Transforms/CMakeLists.txt +++ b/mlir/lib/Dialect/Shape/Transforms/CMakeLists.txt @@ -1,6 +1,5 @@ add_mlir_dialect_library(MLIRShapeOpsTransforms BufferizableOpInterfaceImpl.cpp - Bufferize.cpp OutlineShapeComputation.cpp RemoveShapeConstraints.cpp ShapeToShapeLowering.cpp diff --git a/mlir/lib/Dialect/Tensor/Transforms/Bufferize.cpp b/mlir/lib/Dialect/Tensor/Transforms/Bufferize.cpp deleted file mode 100644 index d27c4576a8b7a9..00000000000000 --- a/mlir/lib/Dialect/Tensor/Transforms/Bufferize.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//===- Bufferize.cpp - Bufferization for `tensor` dialect ops -------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -// -// This file implements bufferization of `tensor` dialect ops -// -//===----------------------------------------------------------------------===// - -#include "mlir/Dialect/Bufferization/Transforms/Bufferize.h" -#include "mlir/Dialect/Arith/IR/Arith.h" -#include "mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h" -#include "mlir/Dialect/Bufferization/IR/Bufferization.h" -#include "mlir/Dialect/Func/IR/FuncOps.h" -#include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/SCF/IR/SCF.h" -#include "mlir/Dialect/Tensor/IR/Tensor.h" -#include "mlir/Dialect/Tensor/Transforms/BufferizableOpInterfaceImpl.h" -#include "mlir/Dialect/Tensor/Transforms/Passes.h" -#include "mlir/IR/ImplicitLocOpBuilder.h" -#include "mlir/Transforms/DialectConversion.h" - -namespace mlir { -namespace tensor { -#define GEN_PASS_DEF_TENSORBUFFERIZE -#include "mlir/Dialect/Tensor/Transforms/Passes.h.inc" -} // namespace tensor -} // namespace mlir - -using namespace mlir; -using namespace bufferization; - -namespace { -struct TensorBufferizePass - : public tensor::impl::TensorBufferizeBase { - void runOnOperation() override { - BufferizationOptions options = getPartialBufferizationOptions(); - options.opFilter.allowDialect(); - - if (failed(bufferizeOp(getOperation(), options))) - signalPassFailure(); - } - - void getDependentDialects(DialectRegistry ®istry) const override { - registry - .insert(); - tensor::registerBufferizableOpInterfaceExternalModels(registry); - } -}; -} // namespace - -std::unique_ptr mlir::tensor::createTensorBufferizePass() { - return std::make_unique(); -} diff --git a/mlir/lib/Dialect/Tensor/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Tensor/Transforms/CMakeLists.txt index 0aabdaf667b9d8..ce32dea09bb0b5 100644 --- a/mlir/lib/Dialect/Tensor/Transforms/CMakeLists.txt +++ b/mlir/lib/Dialect/Tensor/Transforms/CMakeLists.txt @@ -1,6 +1,5 @@ add_mlir_dialect_library(MLIRTensorTransforms BufferizableOpInterfaceImpl.cpp - Bufferize.cpp ConcatOpPatterns.cpp EmptyOpPatterns.cpp ExtractSliceFromReshapeUtils.cpp diff --git a/mlir/lib/Dialect/Vector/Transforms/Bufferize.cpp b/mlir/lib/Dialect/Vector/Transforms/Bufferize.cpp deleted file mode 100644 index ee99a99b561090..00000000000000 --- a/mlir/lib/Dialect/Vector/Transforms/Bufferize.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//===- Bufferize.cpp - Bufferization for `vector` dialect ops -------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -// -// This file implements bufferization of `vector` dialect ops -// -//===----------------------------------------------------------------------===// - -#include "mlir/Dialect/Bufferization/Transforms/Bufferize.h" - -#include "mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h" -#include "mlir/Dialect/Bufferization/IR/Bufferization.h" -#include "mlir/Dialect/Func/IR/FuncOps.h" -#include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/Tensor/IR/Tensor.h" -#include "mlir/Dialect/Vector/IR/VectorOps.h" -#include "mlir/Dialect/Vector/Transforms/BufferizableOpInterfaceImpl.h" -#include "mlir/Dialect/Vector/Transforms/Passes.h" - -namespace mlir { -namespace vector { -#define GEN_PASS_DEF_VECTORBUFFERIZE -#include "mlir/Dialect/Vector/Transforms/Passes.h.inc" -} // namespace vector -} // namespace mlir - -using namespace mlir; -using namespace bufferization; - -namespace { -struct VectorBufferizePass - : public vector::impl::VectorBufferizeBase { - void runOnOperation() override { - BufferizationOptions options = getPartialBufferizationOptions(); - options.opFilter.allowDialect(); - - if (failed(bufferizeOp(getOperation(), options))) - signalPassFailure(); - } - - void getDependentDialects(DialectRegistry ®istry) const override { - registry.insert(); - vector::registerBufferizableOpInterfaceExternalModels(registry); - } -}; -} // namespace - -std::unique_ptr mlir::vector::createVectorBufferizePass() { - return std::make_unique(); -} diff --git a/mlir/lib/Dialect/Vector/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Vector/Transforms/CMakeLists.txt index c4b6abd3e23615..4dbefdd376a8b9 100644 --- a/mlir/lib/Dialect/Vector/Transforms/CMakeLists.txt +++ b/mlir/lib/Dialect/Vector/Transforms/CMakeLists.txt @@ -1,6 +1,5 @@ add_mlir_dialect_library(MLIRVectorTransforms BufferizableOpInterfaceImpl.cpp - Bufferize.cpp LowerVectorBroadcast.cpp LowerVectorContract.cpp LowerVectorGather.cpp diff --git a/mlir/test/Dialect/Arith/bufferize.mlir b/mlir/test/Dialect/Arith/bufferize.mlir index 944954e9e4edd8..a3b1454fb68f66 100644 --- a/mlir/test/Dialect/Arith/bufferize.mlir +++ b/mlir/test/Dialect/Arith/bufferize.mlir @@ -1,5 +1,4 @@ -// RUN: mlir-opt %s -arith-bufferize -split-input-file -verify-diagnostics | FileCheck %s -// RUN: mlir-opt %s -arith-bufferize=alignment=64 -split-input-file -verify-diagnostics | FileCheck --check-prefix=ALIGNED %s +// RUN: mlir-opt %s --one-shot-bufferize="dialect-filter=arith,bufferization copy-before-write unknown-type-conversion=identity-layout-map" -split-input-file -verify-diagnostics | FileCheck %s // CHECK-LABEL: func @index_cast( // CHECK-SAME: %[[TENSOR:.*]]: tensor, %[[SCALAR:.*]]: i32 @@ -22,10 +21,7 @@ func.func @index_cast(%tensor: tensor, %scalar: i32) -> (tensor, ind // The name isn't load-bearing though. // CHECK: memref.global "private" constant @__constant_3x4xf32 : memref<3x4xf32> = dense<7.000000e+00> -// CHECK-NOT: alignment - -// ALIGNED: memref.global "private" constant @__constant_3x4xf32 : memref<3x4xf32> = dense<7.000000e+00> -// ALIGNED-SAME: {alignment = 64 : i64} +// CHECK-SAME: {alignment = 64 : i64} // CHECK: @basic func.func @basic() -> tensor<3x4xf32> { diff --git a/mlir/test/Dialect/Linalg/bufferize.mlir b/mlir/test/Dialect/Linalg/bufferize.mlir index 29f27e6838e661..e8ab1184b1fd26 100644 --- a/mlir/test/Dialect/Linalg/bufferize.mlir +++ b/mlir/test/Dialect/Linalg/bufferize.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-opt -linalg-bufferize -canonicalize -cse -split-input-file %s | FileCheck %s +// RUN: mlir-opt --one-shot-bufferize="dialect-filter=linalg,bufferization copy-before-write unknown-type-conversion=identity-layout-map" -canonicalize -cse -split-input-file %s | FileCheck %s #map0 = affine_map<(d0) -> (d0)> @@ -189,31 +189,3 @@ func.func @bufferize_dot(%in: tensor<4xf32>, %out: tensor) -> tensor { // CHECK: %[[OUT_TENSOR:.*]] = bufferization.to_tensor %[[ALLOC]] : memref // CHECK: return %[[OUT_TENSOR]] } - -// ----- - -// This is a regression test. The linalg-bufferize pass should ignore all func -// dialect ops. - -// CHECK-LABEL: func private @csum(tensor<6xi64>) -> tensor<6xi64> -func.func private @csum(%arg0: tensor<6xi64>) -> tensor<6xi64> - -// CHECK: func public @main(%[[arg0:.*]]: tensor<2x3xi1>) -// CHECK: %[[collapse:.*]] = tensor.collapse_shape %[[arg0]] -// CHECK: %[[collapse_m:.*]] = bufferization.to_memref %[[collapse]] -// CHECK: %[[alloc:.*]] = memref.alloc() -// CHECK: linalg.generic {{.*}} ins(%[[collapse_m]] : memref<6xi1>) outs(%[[alloc]] : memref<6xi64>) -// CHECK: %[[generic_t:.*]] = bufferization.to_tensor %[[alloc]] -// CHECK: %[[call:.*]] = call @csum(%[[generic_t]]) -// CHECK: return %[[call]] -func.func public @main(%arg0: tensor<2x3xi1>) -> tensor<6xi64> { - %0 = tensor.collapse_shape %arg0 [[0, 1]] : tensor<2x3xi1> into tensor<6xi1> - %1 = tensor.empty() : tensor<6xi64> - %2 = linalg.generic {indexing_maps = [affine_map<(d0) -> (d0)>, affine_map<(d0) -> (d0)>], iterator_types = ["parallel"]} ins(%0 : tensor<6xi1>) outs(%1 : tensor<6xi64>) { - ^bb0(%arg1: i1, %arg2: i64): - %4 = arith.extui %arg1 : i1 to i64 - linalg.yield %4 : i64 - } -> tensor<6xi64> - %3 = func.call @csum(%2) : (tensor<6xi64>) -> tensor<6xi64> - return %3 : tensor<6xi64> -} diff --git a/mlir/test/Dialect/Shape/bufferize.mlir b/mlir/test/Dialect/Shape/bufferize.mlir index 963a5e8bcf5787..9f30a052208f0b 100644 --- a/mlir/test/Dialect/Shape/bufferize.mlir +++ b/mlir/test/Dialect/Shape/bufferize.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-opt -split-input-file -shape-bufferize <%s | FileCheck %s +// RUN: mlir-opt -split-input-file --one-shot-bufferize="dialect-filter=shape,bufferization copy-before-write unknown-type-conversion=identity-layout-map allow-unknown-ops" <%s | FileCheck %s // ----- diff --git a/mlir/test/Dialect/SparseTensor/sparse_lower.mlir b/mlir/test/Dialect/SparseTensor/sparse_lower.mlir index 6112856fbf2931..c27df00785522a 100644 --- a/mlir/test/Dialect/SparseTensor/sparse_lower.mlir +++ b/mlir/test/Dialect/SparseTensor/sparse_lower.mlir @@ -4,8 +4,7 @@ // RUN: FileCheck %s --check-prefix=CHECK-MIR // // RUN: mlir-opt %s --sparse-reinterpret-map -sparsification --sparse-tensor-conversion --cse \ -// RUN: --func-bufferize --arith-bufferize \ -// RUN: --tensor-bufferize --finalizing-bufferize | \ +// RUN: --one-shot-bufferize="copy-before-write bufferize-function-boundaries function-boundary-type-conversion=identity-layout-map" | \ // RUN: FileCheck %s --check-prefix=CHECK-LIR #CSR = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : dense, d1 : compressed)}> diff --git a/mlir/test/Dialect/SparseTensor/sparse_lower_col.mlir b/mlir/test/Dialect/SparseTensor/sparse_lower_col.mlir index 401da152a8bdb8..9fbb9dd0a26d17 100644 --- a/mlir/test/Dialect/SparseTensor/sparse_lower_col.mlir +++ b/mlir/test/Dialect/SparseTensor/sparse_lower_col.mlir @@ -4,8 +4,7 @@ // RUN: FileCheck %s --check-prefix=CHECK-MIR // // RUN: mlir-opt %s --sparse-reinterpret-map -sparsification --sparse-tensor-conversion --cse \ -// RUN: --func-bufferize --arith-bufferize \ -// RUN: --tensor-bufferize --finalizing-bufferize | \ +// RUN: --one-shot-bufferize="copy-before-write bufferize-function-boundaries function-boundary-type-conversion=identity-layout-map" | \ // RUN: FileCheck %s --check-prefix=CHECK-LIR #CSC = #sparse_tensor.encoding<{ diff --git a/mlir/test/Dialect/SparseTensor/sparse_lower_inplace.mlir b/mlir/test/Dialect/SparseTensor/sparse_lower_inplace.mlir index d769876d8ee8e3..a827360abb4267 100644 --- a/mlir/test/Dialect/SparseTensor/sparse_lower_inplace.mlir +++ b/mlir/test/Dialect/SparseTensor/sparse_lower_inplace.mlir @@ -4,8 +4,7 @@ // RUN: FileCheck %s --check-prefix=CHECK-MIR // // RUN: mlir-opt %s --sparse-reinterpret-map -sparsification --sparse-tensor-conversion --cse \ -// RUN: --func-bufferize --arith-bufferize \ -// RUN: --tensor-bufferize --finalizing-bufferize | \ +// RUN: --one-shot-bufferize="copy-before-write bufferize-function-boundaries function-boundary-type-conversion=identity-layout-map" | \ // RUN: FileCheck %s --check-prefix=CHECK-LIR #CSR = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : dense, d1 : compressed)}> diff --git a/mlir/test/Dialect/Tensor/bufferize.mlir b/mlir/test/Dialect/Tensor/bufferize.mlir index 4f553adcc500fb..e85d9e740adf4e 100644 --- a/mlir/test/Dialect/Tensor/bufferize.mlir +++ b/mlir/test/Dialect/Tensor/bufferize.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-opt %s -tensor-bufferize -cse -split-input-file | FileCheck %s +// RUN: mlir-opt %s --one-shot-bufferize="dialect-filter=tensor,bufferization copy-before-write unknown-type-conversion=identity-layout-map" -cse -split-input-file | FileCheck %s // CHECK-LABEL: func @dim( // CHECK-SAME: %[[TENSOR:.*]]: tensor<*xf32>, diff --git a/mlir/test/Dialect/Vector/bufferize-invalid.mlir b/mlir/test/Dialect/Vector/bufferize-invalid.mlir index 1ae3e312c868f7..bcca50a0fe79a6 100644 --- a/mlir/test/Dialect/Vector/bufferize-invalid.mlir +++ b/mlir/test/Dialect/Vector/bufferize-invalid.mlir @@ -1,5 +1,4 @@ -// RUN: mlir-opt %s -vector-bufferize -split-input-file -verify-diagnostics -// | FileCheck %s +// RUN: mlir-opt %s --one-shot-bufferize="dialect-filter=vector,bufferization copy-before-write unknown-type-conversion=identity-layout-map allow-unknown-ops" -split-input-file -verify-diagnostics // CHECK-LABEL: func @mask( func.func @mask(%t0: tensor, %val: vector<16xf32>, %idx: index, %m0: vector<16xi1>) -> tensor { diff --git a/mlir/test/Dialect/Vector/bufferize.mlir b/mlir/test/Dialect/Vector/bufferize.mlir index 6a6a8fa8938bc2..3399f60a2c3bf3 100644 --- a/mlir/test/Dialect/Vector/bufferize.mlir +++ b/mlir/test/Dialect/Vector/bufferize.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-opt %s -vector-bufferize -split-input-file | FileCheck %s +// RUN: mlir-opt %s --one-shot-bufferize="dialect-filter=vector,bufferization copy-before-write unknown-type-conversion=identity-layout-map" -split-input-file | FileCheck %s // CHECK-LABEL: func @transfer_read( // CHECK-SAME: %[[t:.*]]: tensor, %[[o1:.*]]: index, %[[o2:.*]]: index, %[[pad:.*]]: f32) diff --git a/mlir/test/Integration/Dialect/Complex/CPU/correctness.mlir b/mlir/test/Integration/Dialect/Complex/CPU/correctness.mlir index b0e414d157268b..5d27c3e290d50c 100644 --- a/mlir/test/Integration/Dialect/Complex/CPU/correctness.mlir +++ b/mlir/test/Integration/Dialect/Complex/CPU/correctness.mlir @@ -1,5 +1,5 @@ // RUN: mlir-opt %s \ -// RUN: -func-bufferize -tensor-bufferize -arith-bufferize --canonicalize \ +// RUN: -one-shot-bufferize="bufferize-function-boundaries" --canonicalize \ // RUN: -convert-scf-to-cf --convert-complex-to-standard \ // RUN: -finalize-memref-to-llvm -convert-math-to-llvm -convert-math-to-libm \ // RUN: -convert-vector-to-llvm -convert-complex-to-llvm \ diff --git a/mlir/test/Integration/Dialect/Linalg/CPU/test-collapse-tensor.mlir b/mlir/test/Integration/Dialect/Linalg/CPU/test-collapse-tensor.mlir index 43e423d4c3e8e1..734e09b7ed103d 100644 --- a/mlir/test/Integration/Dialect/Linalg/CPU/test-collapse-tensor.mlir +++ b/mlir/test/Integration/Dialect/Linalg/CPU/test-collapse-tensor.mlir @@ -1,10 +1,10 @@ -// RUN: mlir-opt %s -linalg-bufferize \ -// RUN: -arith-bufferize -tensor-bufferize -func-bufferize \ +// RUN: mlir-opt %s \ +// RUN: -one-shot-bufferize="bufferize-function-boundaries" \ // RUN: -finalizing-bufferize -buffer-deallocation-pipeline -convert-bufferization-to-memref \ // RUN: -convert-scf-to-cf -expand-strided-metadata -lower-affine -convert-cf-to-llvm -convert-arith-to-llvm \ // RUN: -finalize-memref-to-llvm -convert-func-to-llvm -reconcile-unrealized-casts | \ // RUN: mlir-cpu-runner -e main -entry-point-result=void \ -// RUN: -shared-libs=%mlir_runner_utils \ +// RUN: -shared-libs=%mlir_runner_utils,%mlir_c_runner_utils \ // RUN: | FileCheck %s diff --git a/mlir/test/Integration/Dialect/Linalg/CPU/test-elementwise.mlir b/mlir/test/Integration/Dialect/Linalg/CPU/test-elementwise.mlir index 84dad567ced3ff..a323b0d9f876cf 100644 --- a/mlir/test/Integration/Dialect/Linalg/CPU/test-elementwise.mlir +++ b/mlir/test/Integration/Dialect/Linalg/CPU/test-elementwise.mlir @@ -1,5 +1,5 @@ // RUN: mlir-opt %s -convert-elementwise-to-linalg \ -// RUN: -arith-bufferize -linalg-bufferize -tensor-bufferize -func-bufferize \ +// RUN: -one-shot-bufferize="bufferize-function-boundaries" \ // RUN: -canonicalize -buffer-deallocation-pipeline -convert-bufferization-to-memref -convert-linalg-to-loops \ // RUN: -convert-scf-to-cf -convert-arith-to-llvm -convert-cf-to-llvm --finalize-memref-to-llvm \ // RUN: -convert-func-to-llvm -reconcile-unrealized-casts | \ diff --git a/mlir/test/Integration/Dialect/Linalg/CPU/test-expand-tensor.mlir b/mlir/test/Integration/Dialect/Linalg/CPU/test-expand-tensor.mlir index db882f7a54d392..45283e173c9f02 100644 --- a/mlir/test/Integration/Dialect/Linalg/CPU/test-expand-tensor.mlir +++ b/mlir/test/Integration/Dialect/Linalg/CPU/test-expand-tensor.mlir @@ -1,10 +1,10 @@ -// RUN: mlir-opt %s -linalg-bufferize \ -// RUN: -arith-bufferize -tensor-bufferize -func-bufferize \ +// RUN: mlir-opt %s \ +// RUN: -one-shot-bufferize="bufferize-function-boundaries" \ // RUN: -finalizing-bufferize -buffer-deallocation-pipeline -convert-bufferization-to-memref \ // RUN: -convert-scf-to-cf -expand-strided-metadata -lower-affine -convert-cf-to-llvm -convert-arith-to-llvm \ // RUN: -finalize-memref-to-llvm -convert-func-to-llvm -reconcile-unrealized-casts | \ // RUN: mlir-cpu-runner -e main -entry-point-result=void \ -// RUN: -shared-libs=%mlir_runner_utils \ +// RUN: -shared-libs=%mlir_runner_utils,%mlir_c_runner_utils \ // RUN: | FileCheck %s diff --git a/mlir/test/Integration/Dialect/Linalg/CPU/test-padtensor.mlir b/mlir/test/Integration/Dialect/Linalg/CPU/test-padtensor.mlir index 54a2bbf8d46809..23a07464bb5be9 100644 --- a/mlir/test/Integration/Dialect/Linalg/CPU/test-padtensor.mlir +++ b/mlir/test/Integration/Dialect/Linalg/CPU/test-padtensor.mlir @@ -1,6 +1,5 @@ // RUN: mlir-opt %s -test-linalg-transform-patterns=test-linalg-to-vector-patterns \ -// RUN: -empty-tensor-to-alloc-tensor -linalg-bufferize -arith-bufferize \ -// RUN: -bufferization-bufferize -tensor-bufferize -func-bufferize \ +// RUN: -one-shot-bufferize="bufferize-function-boundaries" \ // RUN: -finalizing-bufferize -buffer-deallocation-pipeline -convert-bufferization-to-memref \ // RUN: -convert-linalg-to-loops -convert-scf-to-cf -expand-strided-metadata \ // RUN: -lower-affine -convert-arith-to-llvm -finalize-memref-to-llvm -convert-func-to-llvm -reconcile-unrealized-casts | \ diff --git a/mlir/test/Integration/Dialect/Linalg/CPU/test-subtensor-insert-multiple-uses.mlir b/mlir/test/Integration/Dialect/Linalg/CPU/test-subtensor-insert-multiple-uses.mlir index 98fce6c020c03d..01a0ba26fd7cda 100644 --- a/mlir/test/Integration/Dialect/Linalg/CPU/test-subtensor-insert-multiple-uses.mlir +++ b/mlir/test/Integration/Dialect/Linalg/CPU/test-subtensor-insert-multiple-uses.mlir @@ -1,5 +1,5 @@ -// RUN: mlir-opt %s -linalg-bufferize \ -// RUN: -arith-bufferize -tensor-bufferize -func-bufferize \ +// RUN: mlir-opt %s \ +// RUN: -one-shot-bufferize="bufferize-function-boundaries" \ // RUN: -finalizing-bufferize -buffer-deallocation-pipeline -convert-bufferization-to-memref \ // RUN: -convert-linalg-to-loops -convert-scf-to-cf -expand-strided-metadata \ // RUN: -lower-affine -convert-arith-to-llvm --finalize-memref-to-llvm \ diff --git a/mlir/test/Integration/Dialect/Linalg/CPU/test-subtensor-insert.mlir b/mlir/test/Integration/Dialect/Linalg/CPU/test-subtensor-insert.mlir index cf7d0c762ea36f..73d4aff73fb7a4 100644 --- a/mlir/test/Integration/Dialect/Linalg/CPU/test-subtensor-insert.mlir +++ b/mlir/test/Integration/Dialect/Linalg/CPU/test-subtensor-insert.mlir @@ -1,5 +1,5 @@ -// RUN: mlir-opt %s -linalg-bufferize \ -// RUN: -arith-bufferize -tensor-bufferize -func-bufferize \ +// RUN: mlir-opt %s \ +// RUN: -one-shot-bufferize="bufferize-function-boundaries" \ // RUN: -finalizing-bufferize -buffer-deallocation-pipeline -convert-bufferization-to-memref \ // RUN: -convert-linalg-to-loops -convert-scf-to-cf -expand-strided-metadata \ // RUN: -lower-affine -convert-arith-to-llvm --finalize-memref-to-llvm \ diff --git a/mlir/test/Integration/Dialect/Linalg/CPU/test-tensor-e2e.mlir b/mlir/test/Integration/Dialect/Linalg/CPU/test-tensor-e2e.mlir index 38b49cd444df3c..ff9ddedf91e177 100644 --- a/mlir/test/Integration/Dialect/Linalg/CPU/test-tensor-e2e.mlir +++ b/mlir/test/Integration/Dialect/Linalg/CPU/test-tensor-e2e.mlir @@ -1,5 +1,6 @@ -// RUN: mlir-opt %s -arith-bufferize -linalg-bufferize \ -// RUN: -tensor-bufferize -func-bufferize -finalizing-bufferize -buffer-deallocation-pipeline -convert-bufferization-to-memref -convert-linalg-to-loops \ +// RUN: mlir-opt %s \ +// RUN: -one-shot-bufferize="bufferize-function-boundaries" \ +// RUN: -finalizing-bufferize -buffer-deallocation-pipeline -convert-bufferization-to-memref -convert-linalg-to-loops \ // RUN: -convert-arith-to-llvm -convert-scf-to-cf -convert-cf-to-llvm --finalize-memref-to-llvm -convert-func-to-llvm -reconcile-unrealized-casts | \ // RUN: mlir-cpu-runner -e main -entry-point-result=void \ // RUN: -shared-libs=%mlir_runner_utils \ diff --git a/mlir/test/Integration/Dialect/Linalg/CPU/test-tensor-matmul.mlir b/mlir/test/Integration/Dialect/Linalg/CPU/test-tensor-matmul.mlir index 41296cdfcb2d5a..698191577efe31 100644 --- a/mlir/test/Integration/Dialect/Linalg/CPU/test-tensor-matmul.mlir +++ b/mlir/test/Integration/Dialect/Linalg/CPU/test-tensor-matmul.mlir @@ -1,14 +1,14 @@ // UNSUPPORTED: asan -// RUN: mlir-opt %s -test-transform-dialect-erase-schedule -linalg-bufferize -arith-bufferize \ -// RUN: -tensor-bufferize -func-bufferize -finalizing-bufferize -buffer-deallocation-pipeline -convert-bufferization-to-memref -convert-linalg-to-loops -convert-scf-to-cf \ +// RUN: mlir-opt %s -test-transform-dialect-erase-schedule \ +// RUN: -one-shot-bufferize="bufferize-function-boundaries" \ +// RUN: -finalizing-bufferize -buffer-deallocation-pipeline -convert-bufferization-to-memref -convert-linalg-to-loops -convert-scf-to-cf \ // RUN: -expand-strided-metadata -lower-affine -convert-arith-to-llvm -convert-scf-to-cf --finalize-memref-to-llvm -convert-func-to-llvm -reconcile-unrealized-casts | \ // RUN: mlir-cpu-runner -e main -entry-point-result=void \ // RUN: -shared-libs=%mlir_c_runner_utils,%mlir_runner_utils \ // RUN: | FileCheck %s -// RUN: mlir-opt %s -transform-interpreter -test-transform-dialect-erase-schedule -linalg-bufferize \ -// RUN: -scf-bufferize -arith-bufferize -tensor-bufferize \ -// RUN: -func-bufferize \ +// RUN: mlir-opt %s -transform-interpreter -test-transform-dialect-erase-schedule \ +// RUN: -one-shot-bufferize="bufferize-function-boundaries" \ // RUN: -finalizing-bufferize -convert-linalg-to-loops -convert-scf-to-cf -convert-scf-to-cf \ // RUN: -expand-strided-metadata -lower-affine -convert-arith-to-llvm -convert-scf-to-cf --finalize-memref-to-llvm -convert-func-to-llvm -reconcile-unrealized-casts | \ // RUN: mlir-cpu-runner -e main -entry-point-result=void \ diff --git a/mlir/test/Integration/Dialect/Memref/print-memref.mlir b/mlir/test/Integration/Dialect/Memref/print-memref.mlir index b83f3919efd83e..f59e220d7461e6 100644 --- a/mlir/test/Integration/Dialect/Memref/print-memref.mlir +++ b/mlir/test/Integration/Dialect/Memref/print-memref.mlir @@ -1,5 +1,5 @@ // RUN: mlir-opt %s \ -// RUN: -func-bufferize -arith-bufferize --canonicalize \ +// RUN: -one-shot-bufferize="bufferize-function-boundaries" --canonicalize \ // RUN: -finalize-memref-to-llvm\ // RUN: -convert-func-to-llvm -reconcile-unrealized-casts |\ // RUN: mlir-cpu-runner \ diff --git a/mlir/test/Integration/Dialect/Memref/verify-memref.mlir b/mlir/test/Integration/Dialect/Memref/verify-memref.mlir index b7e2a46688f475..431ae0a89d20c3 100644 --- a/mlir/test/Integration/Dialect/Memref/verify-memref.mlir +++ b/mlir/test/Integration/Dialect/Memref/verify-memref.mlir @@ -1,5 +1,5 @@ // RUN: mlir-opt %s \ -// RUN: -func-bufferize -arith-bufferize --canonicalize \ +// RUN: -func-bufferize -one-shot-bufferize="bufferize-function-boundaries" --canonicalize \ // RUN: -convert-vector-to-scf -convert-scf-to-cf -convert-vector-to-llvm -finalize-memref-to-llvm\ // RUN: -convert-func-to-llvm -reconcile-unrealized-casts |\ // RUN: mlir-cpu-runner \ diff --git a/mlir/test/Integration/Dialect/Vector/CPU/AMX/test-mulf-full.mlir b/mlir/test/Integration/Dialect/Vector/CPU/AMX/test-mulf-full.mlir index faa129efa63a91..a7c5b91273423b 100644 --- a/mlir/test/Integration/Dialect/Vector/CPU/AMX/test-mulf-full.mlir +++ b/mlir/test/Integration/Dialect/Vector/CPU/AMX/test-mulf-full.mlir @@ -1,5 +1,6 @@ -// RUN: mlir-opt %s -convert-vector-to-scf -lower-affine -convert-scf-to-cf \ -// RUN: -arith-bufferize -convert-vector-to-llvm="enable-amx" \ +// RUN: mlir-opt %s -convert-vector-to-scf -lower-affine \ +// RUN: -one-shot-bufferize="bufferize-function-boundaries" \ +// RUN: -convert-scf-to-cf -convert-vector-to-llvm="enable-amx" \ // RUN: -finalize-memref-to-llvm -convert-func-to-llvm -reconcile-unrealized-casts | \ // RUN: mlir-translate -mlir-to-llvmir | \ // RUN: %lli --entry-function=entry --mattr="+amx-tile,+amx-int8,+amx-bf16" \ diff --git a/mlir/test/Integration/Dialect/Vector/CPU/AMX/test-muli-full.mlir b/mlir/test/Integration/Dialect/Vector/CPU/AMX/test-muli-full.mlir index 3ed28fc68acb8f..7b7ee54db8c348 100644 --- a/mlir/test/Integration/Dialect/Vector/CPU/AMX/test-muli-full.mlir +++ b/mlir/test/Integration/Dialect/Vector/CPU/AMX/test-muli-full.mlir @@ -1,5 +1,7 @@ -// RUN: mlir-opt %s -convert-vector-to-scf -lower-affine -convert-scf-to-cf \ -// RUN: -arith-bufferize -convert-vector-to-llvm="enable-amx" \ +// RUN: mlir-opt %s -convert-vector-to-scf -lower-affine \ +// RUN: -one-shot-bufferize="bufferize-function-boundaries" \ +// RUN: -convert-scf-to-cf \ +// RUN: -convert-vector-to-llvm="enable-amx" \ // RUN: -finalize-memref-to-llvm -convert-func-to-llvm -reconcile-unrealized-casts | \ // RUN: mlir-translate -mlir-to-llvmir | \ // RUN: %lli --entry-function=entry --mattr="+amx-tile,+amx-int8,+amx-bf16" \