[Mlir-commits] [mlir] 703ef17 - [mlir] Make linalg-bufferize run on FuncOp

Sean Silva llvmlistbot at llvm.org
Fri Nov 13 15:45:11 PST 2020


Author: Sean Silva
Date: 2020-11-13T15:43:24-08:00
New Revision: 703ef17e7a0a0f51e1d000bb1f71ad437a9933e4

URL: https://github.com/llvm/llvm-project/commit/703ef17e7a0a0f51e1d000bb1f71ad437a9933e4
DIFF: https://github.com/llvm/llvm-project/commit/703ef17e7a0a0f51e1d000bb1f71ad437a9933e4.diff

LOG: [mlir] Make linalg-bufferize run on FuncOp

That way, it runs in parallel across functions.

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/Linalg/Passes.h
    mlir/include/mlir/Dialect/Linalg/Passes.td
    mlir/lib/Dialect/Linalg/Transforms/Bufferize.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/Linalg/Passes.h b/mlir/include/mlir/Dialect/Linalg/Passes.h
index 50aec73366a8..620abd96636d 100644
--- a/mlir/include/mlir/Dialect/Linalg/Passes.h
+++ b/mlir/include/mlir/Dialect/Linalg/Passes.h
@@ -48,7 +48,7 @@ std::unique_ptr<OperationPass<FuncOp>> createConvertLinalgToAffineLoopsPass();
 
 /// Create a pass to convert Linalg operations which work on tensors to use
 /// buffers instead.
-std::unique_ptr<OperationPass<ModuleOp>> createLinalgBufferizePass();
+std::unique_ptr<OperationPass<FuncOp>> createLinalgBufferizePass();
 
 /// Populate patterns that convert `ElementwiseMappable` ops to linalg
 /// parallel loops.

diff  --git a/mlir/include/mlir/Dialect/Linalg/Passes.td b/mlir/include/mlir/Dialect/Linalg/Passes.td
index b9f6c617de50..07bf93a70f5e 100644
--- a/mlir/include/mlir/Dialect/Linalg/Passes.td
+++ b/mlir/include/mlir/Dialect/Linalg/Passes.td
@@ -61,7 +61,7 @@ def LinalgLowerToLoops : FunctionPass<"convert-linalg-to-loops"> {
   let dependentDialects = ["linalg::LinalgDialect", "scf::SCFDialect", "AffineDialect"];
 }
 
-def LinalgBufferize : Pass<"linalg-bufferize", "ModuleOp"> {
+def LinalgBufferize : Pass<"linalg-bufferize", "FuncOp"> {
   let summary = "Bufferize the linalg dialect";
   let constructor = "mlir::createLinalgBufferizePass()";
   let dependentDialects = ["linalg::LinalgDialect"];

diff  --git a/mlir/lib/Dialect/Linalg/Transforms/Bufferize.cpp b/mlir/lib/Dialect/Linalg/Transforms/Bufferize.cpp
index 255a0d4cff90..ec2d1d9de5c8 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Bufferize.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Bufferize.cpp
@@ -356,7 +356,7 @@ struct LinalgBufferizePass : public LinalgBufferizeBase<LinalgBufferizePass> {
 };
 } // end anonymous namespace
 
-std::unique_ptr<OperationPass<ModuleOp>> mlir::createLinalgBufferizePass() {
+std::unique_ptr<OperationPass<FuncOp>> mlir::createLinalgBufferizePass() {
   return std::make_unique<LinalgBufferizePass>();
 }
 


        


More information about the Mlir-commits mailing list