summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Zinenko <zinenko@google.com>2019-11-14 10:34:46 -0800
committerA. Unique TensorFlower <gardener@tensorflow.org>2019-11-14 10:35:21 -0800
commit971b8dd4d881cdc21b6aa73a3797bf9a6d48ca14 (patch)
tree09a30489967cbb9d63a7d7dd6fbaa40a0cec8228
parentb34a861d5a50fa380ddd578290baf9b819d3b5df (diff)
downloadbcm5719-llvm-971b8dd4d881cdc21b6aa73a3797bf9a6d48ca14.tar.gz
bcm5719-llvm-971b8dd4d881cdc21b6aa73a3797bf9a6d48ca14.zip
Move Affine to Standard conversion to lib/Conversion
This is essentially a dialect conversion and conceptually belongs to conversions. PiperOrigin-RevId: 280460034
-rw-r--r--mlir/examples/toy/Ch6/CMakeLists.txt2
-rw-r--r--mlir/examples/toy/Ch6/mlir/LowerToLLVM.cpp2
-rw-r--r--mlir/examples/toy/Ch7/CMakeLists.txt2
-rw-r--r--mlir/examples/toy/Ch7/mlir/LowerToLLVM.cpp2
-rw-r--r--mlir/include/mlir/Conversion/AffineToStandard/AffineToStandard.h (renamed from mlir/include/mlir/Transforms/LowerAffine.h)9
-rw-r--r--mlir/lib/Conversion/AffineToStandard/AffineToStandard.cpp (renamed from mlir/lib/Transforms/LowerAffine.cpp)5
-rw-r--r--mlir/lib/Conversion/CMakeLists.txt1
-rw-r--r--mlir/lib/Conversion/LoopsToGPU/LoopsToGPU.cpp2
-rw-r--r--mlir/lib/Dialect/Linalg/Transforms/LowerToLLVMDialect.cpp2
-rw-r--r--mlir/lib/Transforms/CMakeLists.txt1
-rw-r--r--mlir/tools/mlir-opt/CMakeLists.txt1
11 files changed, 17 insertions, 12 deletions
diff --git a/mlir/examples/toy/Ch6/CMakeLists.txt b/mlir/examples/toy/Ch6/CMakeLists.txt
index d66c921b15e..c342ed1d4a0 100644
--- a/mlir/examples/toy/Ch6/CMakeLists.txt
+++ b/mlir/examples/toy/Ch6/CMakeLists.txt
@@ -31,6 +31,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/)
target_link_libraries(toyc-ch6
PRIVATE
MLIRAffineOps
+ MLIRAffineToStandard
MLIRAnalysis
MLIRExecutionEngine
MLIRIR
@@ -45,6 +46,7 @@ target_link_libraries(toyc-ch6
)
whole_archive_link(toyc-ch6
+ MLIRAffineToStandard
MLIRAffineOps
MLIRLLVMIR
MLIRStandardOps
diff --git a/mlir/examples/toy/Ch6/mlir/LowerToLLVM.cpp b/mlir/examples/toy/Ch6/mlir/LowerToLLVM.cpp
index 091eada5ac3..ba79c348894 100644
--- a/mlir/examples/toy/Ch6/mlir/LowerToLLVM.cpp
+++ b/mlir/examples/toy/Ch6/mlir/LowerToLLVM.cpp
@@ -24,6 +24,7 @@
#include "toy/Dialect.h"
#include "toy/Passes.h"
+#include "mlir/Conversion/AffineToStandard/AffineToStandard.h"
#include "mlir/Conversion/LoopToStandard/ConvertLoopToStandard.h"
#include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h"
#include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h"
@@ -33,7 +34,6 @@
#include "mlir/Dialect/StandardOps/Ops.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Transforms/DialectConversion.h"
-#include "mlir/Transforms/LowerAffine.h"
#include "llvm/ADT/Sequence.h"
using namespace mlir;
diff --git a/mlir/examples/toy/Ch7/CMakeLists.txt b/mlir/examples/toy/Ch7/CMakeLists.txt
index fc26425f038..5956d7f4d9b 100644
--- a/mlir/examples/toy/Ch7/CMakeLists.txt
+++ b/mlir/examples/toy/Ch7/CMakeLists.txt
@@ -31,6 +31,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/)
target_link_libraries(toyc-ch7
PRIVATE
MLIRAffineOps
+ MLIRAffineToStandard
MLIRAnalysis
MLIRExecutionEngine
MLIRIR
@@ -45,6 +46,7 @@ target_link_libraries(toyc-ch7
)
whole_archive_link(toyc-ch7
+ MLIRAffineToStandard
MLIRAffineOps
MLIRLLVMIR
MLIRStandardOps
diff --git a/mlir/examples/toy/Ch7/mlir/LowerToLLVM.cpp b/mlir/examples/toy/Ch7/mlir/LowerToLLVM.cpp
index 091eada5ac3..ba79c348894 100644
--- a/mlir/examples/toy/Ch7/mlir/LowerToLLVM.cpp
+++ b/mlir/examples/toy/Ch7/mlir/LowerToLLVM.cpp
@@ -24,6 +24,7 @@
#include "toy/Dialect.h"
#include "toy/Passes.h"
+#include "mlir/Conversion/AffineToStandard/AffineToStandard.h"
#include "mlir/Conversion/LoopToStandard/ConvertLoopToStandard.h"
#include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h"
#include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h"
@@ -33,7 +34,6 @@
#include "mlir/Dialect/StandardOps/Ops.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Transforms/DialectConversion.h"
-#include "mlir/Transforms/LowerAffine.h"
#include "llvm/ADT/Sequence.h"
using namespace mlir;
diff --git a/mlir/include/mlir/Transforms/LowerAffine.h b/mlir/include/mlir/Conversion/AffineToStandard/AffineToStandard.h
index 5fae4763bf7..b5c51ad4b4c 100644
--- a/mlir/include/mlir/Transforms/LowerAffine.h
+++ b/mlir/include/mlir/Conversion/AffineToStandard/AffineToStandard.h
@@ -1,4 +1,4 @@
-//===- LowerAffine.h - Convert Affine to Standard dialect -------*- C++ -*-===//
+//===- AffineToStandard.h - Convert Affine to Standard dialect --*- C++ -*-===//
//
// Copyright 2019 The MLIR Authors.
//
@@ -15,11 +15,10 @@
// limitations under the License.
// =============================================================================
-#ifndef MLIR_TRANSFORMS_LOWERAFFINE_H
-#define MLIR_TRANSFORMS_LOWERAFFINE_H
+#ifndef MLIR_CONVERSION_AFFINETOSTANDARD_AFFINETOSTANDARD_H
+#define MLIR_CONVERSION_AFFINETOSTANDARD_AFFINETOSTANDARD_H
#include "mlir/Support/LLVM.h"
-#include <vector>
namespace mlir {
class AffineExpr;
@@ -55,4 +54,4 @@ Value *lowerAffineLowerBound(AffineForOp op, OpBuilder &builder);
Value *lowerAffineUpperBound(AffineForOp op, OpBuilder &builder);
} // namespace mlir
-#endif // MLIR_TRANSFORMS_LOWERAFFINE_H
+#endif // MLIR_CONVERSION_AFFINETOSTANDARD_AFFINETOSTANDARD_H
diff --git a/mlir/lib/Transforms/LowerAffine.cpp b/mlir/lib/Conversion/AffineToStandard/AffineToStandard.cpp
index d50c5e0e8c7..98d80ede238 100644
--- a/mlir/lib/Transforms/LowerAffine.cpp
+++ b/mlir/lib/Conversion/AffineToStandard/AffineToStandard.cpp
@@ -1,4 +1,4 @@
-//===- LowerAffine.cpp - Lower affine constructs to primitives ------------===//
+//===- AffineToStandard.cpp - Lower affine constructs to primitives -------===//
//
// Copyright 2019 The MLIR Authors.
//
@@ -20,7 +20,8 @@
//
//===----------------------------------------------------------------------===//
-#include "mlir/Transforms/LowerAffine.h"
+#include "mlir/Conversion/AffineToStandard/AffineToStandard.h"
+
#include "mlir/Dialect/AffineOps/AffineOps.h"
#include "mlir/Dialect/LoopOps/LoopOps.h"
#include "mlir/Dialect/StandardOps/Ops.h"
diff --git a/mlir/lib/Conversion/CMakeLists.txt b/mlir/lib/Conversion/CMakeLists.txt
index c0fd6b83fd9..1639a301205 100644
--- a/mlir/lib/Conversion/CMakeLists.txt
+++ b/mlir/lib/Conversion/CMakeLists.txt
@@ -1,3 +1,4 @@
+add_subdirectory(AffineToStandard)
add_subdirectory(GPUToCUDA)
add_subdirectory(GPUToNVVM)
add_subdirectory(GPUToROCDL)
diff --git a/mlir/lib/Conversion/LoopsToGPU/LoopsToGPU.cpp b/mlir/lib/Conversion/LoopsToGPU/LoopsToGPU.cpp
index e33b8401c74..eb0b0d5931a 100644
--- a/mlir/lib/Conversion/LoopsToGPU/LoopsToGPU.cpp
+++ b/mlir/lib/Conversion/LoopsToGPU/LoopsToGPU.cpp
@@ -23,6 +23,7 @@
#include "mlir/Conversion/LoopsToGPU/LoopsToGPU.h"
+#include "mlir/Conversion/AffineToStandard/AffineToStandard.h"
#include "mlir/Dialect/AffineOps/AffineOps.h"
#include "mlir/Dialect/GPU/GPUDialect.h"
#include "mlir/Dialect/LoopOps/LoopOps.h"
@@ -30,7 +31,6 @@
#include "mlir/IR/AffineExpr.h"
#include "mlir/IR/Builders.h"
#include "mlir/Transforms/LoopUtils.h"
-#include "mlir/Transforms/LowerAffine.h"
#include "mlir/Transforms/RegionUtils.h"
#include "llvm/ADT/Sequence.h"
#include "llvm/Support/Debug.h"
diff --git a/mlir/lib/Dialect/Linalg/Transforms/LowerToLLVMDialect.cpp b/mlir/lib/Dialect/Linalg/Transforms/LowerToLLVMDialect.cpp
index 61614aaf417..c0ed70291cd 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/LowerToLLVMDialect.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/LowerToLLVMDialect.cpp
@@ -15,6 +15,7 @@
// limitations under the License.
// =============================================================================
+#include "mlir/Conversion/AffineToStandard/AffineToStandard.h"
#include "mlir/Conversion/LoopToStandard/ConvertLoopToStandard.h"
#include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h"
#include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h"
@@ -40,7 +41,6 @@
#include "mlir/Pass/PassManager.h"
#include "mlir/Support/LogicalResult.h"
#include "mlir/Transforms/DialectConversion.h"
-#include "mlir/Transforms/LowerAffine.h"
#include "mlir/Transforms/Passes.h"
#include "llvm/ADT/SetVector.h"
diff --git a/mlir/lib/Transforms/CMakeLists.txt b/mlir/lib/Transforms/CMakeLists.txt
index 10daf85da9e..de7801bf215 100644
--- a/mlir/lib/Transforms/CMakeLists.txt
+++ b/mlir/lib/Transforms/CMakeLists.txt
@@ -13,7 +13,6 @@ add_llvm_library(MLIRTransforms
LoopTiling.cpp
LoopUnrollAndJam.cpp
LoopUnroll.cpp
- LowerAffine.cpp
LowerVectorTransfers.cpp
MaterializeVectors.cpp
MemRefDataFlowOpt.cpp
diff --git a/mlir/tools/mlir-opt/CMakeLists.txt b/mlir/tools/mlir-opt/CMakeLists.txt
index a279b0f4afc..23515b47453 100644
--- a/mlir/tools/mlir-opt/CMakeLists.txt
+++ b/mlir/tools/mlir-opt/CMakeLists.txt
@@ -17,6 +17,7 @@ target_link_libraries(MLIRMlirOptLib ${LIB_LIBS})
set(LIBS
MLIRAffineOps
+ MLIRAffineToStandard
MLIRLoopsToGPU
MLIRAnalysis
MLIRLoopToStandard
OpenPOWER on IntegriCloud