[mlir] Rename BufferPlacement.h to Bufferize.h
authorSean Silva <silvasean@google.com>
Sat, 10 Oct 2020 00:31:42 +0000 (17:31 -0700)
committerSean Silva <silvasean@google.com>
Sat, 10 Oct 2020 00:48:20 +0000 (17:48 -0700)
Context: https://llvm.discourse.group/t/what-is-the-strategy-for-tensor-memref-conversion-bufferization/1938/14

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

mlir/include/mlir/Transforms/Bufferize.h [moved from mlir/include/mlir/Transforms/BufferPlacement.h with 95% similarity]
mlir/lib/Dialect/Linalg/Transforms/TensorsToBuffers.cpp
mlir/lib/Dialect/Shape/Transforms/ShapeTypeConversion.cpp
mlir/lib/Transforms/BufferPlacement.cpp
mlir/test/lib/Transforms/TestBufferPlacement.cpp

similarity index 95%
rename from mlir/include/mlir/Transforms/BufferPlacement.h
rename to mlir/include/mlir/Transforms/Bufferize.h
index 8d3e476..e8fffcf 100644 (file)
@@ -1,4 +1,4 @@
-//===- BufferPlacement.h - Buffer Assignment Utilities ---------*- C++ -*-===//
+//===- Bufferize.h - Bufferization utilities --------------------*- C++ -*-===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -6,13 +6,17 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// This header file defines buffer assignment helper methods to compute correct
-// and valid positions for placing Alloc and Dealloc operations.
+// We use the term "bufferize" to mean conversion from tensor types to
+// memref types.
+//
+// Generally speaking, for each op that operates on tensor types, a conversion
+// pattern needs to be written. The infrastructure in this file assists in
+// defining these conversion patterns in a composable way.
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef MLIR_TRANSFORMS_BUFFERPLACEMENT_H
-#define MLIR_TRANSFORMS_BUFFERPLACEMENT_H
+#ifndef MLIR_TRANSFORMS_BUFFERIZE_H
+#define MLIR_TRANSFORMS_BUFFERIZE_H
 
 #include "mlir/Analysis/Liveness.h"
 #include "mlir/Dialect/StandardOps/IR/Ops.h"
@@ -256,4 +260,4 @@ static void populateWithBufferAssignmentOpConversionPatterns(
 }
 } // end namespace mlir
 
-#endif // MLIR_TRANSFORMS_BUFFERPLACEMENT_H
+#endif // MLIR_TRANSFORMS_BUFFERIZE_H
index a9ec621..bb37a2e 100644 (file)
@@ -20,7 +20,7 @@
 #include "mlir/IR/Function.h"
 #include "mlir/IR/Operation.h"
 #include "mlir/Pass/Pass.h"
-#include "mlir/Transforms/BufferPlacement.h"
+#include "mlir/Transforms/Bufferize.h"
 
 namespace {
 
index 6f4c96b..e281cea 100644 (file)
@@ -18,7 +18,7 @@
 #include "mlir/IR/Operation.h"
 #include "mlir/IR/StandardTypes.h"
 #include "mlir/Pass/Pass.h"
-#include "mlir/Transforms/BufferPlacement.h"
+#include "mlir/Transforms/Bufferize.h"
 
 using namespace mlir;
 using namespace mlir::shape;
index 4f97fb8..380c720 100644 (file)
 //
 //===----------------------------------------------------------------------===//
 
-#include "mlir/Transforms/BufferPlacement.h"
 #include "PassDetail.h"
 #include "mlir/Dialect/Linalg/IR/LinalgOps.h"
 #include "mlir/IR/Operation.h"
 #include "mlir/Pass/Pass.h"
+#include "mlir/Transforms/Bufferize.h"
 #include "mlir/Transforms/Passes.h"
 #include "llvm/ADT/SetOperations.h"
 
index 3b31ac0..aecf99f 100644 (file)
@@ -18,7 +18,7 @@
 #include "mlir/IR/Operation.h"
 #include "mlir/Pass/Pass.h"
 #include "mlir/Pass/PassManager.h"
-#include "mlir/Transforms/BufferPlacement.h"
+#include "mlir/Transforms/Bufferize.h"
 
 using namespace mlir;