[Mlir-commits] [mlir] 473bdaf - [mlir] Move Conversion/StandardToStandard to Dialect/StandardOps/Transforms/FuncConversions
Alex Zinenko
llvmlistbot at llvm.org
Tue May 12 15:33:32 PDT 2020
Author: Alex Zinenko
Date: 2020-05-13T00:33:25+02:00
New Revision: 473bdaf2e81aef06514586e82e5e697ceabb7aa6
URL: https://github.com/llvm/llvm-project/commit/473bdaf2e81aef06514586e82e5e697ceabb7aa6
DIFF: https://github.com/llvm/llvm-project/commit/473bdaf2e81aef06514586e82e5e697ceabb7aa6.diff
LOG: [mlir] Move Conversion/StandardToStandard to Dialect/StandardOps/Transforms/FuncConversions
Conversion/ folders were originally intended to store patterns for
DialectA->DialectB conversions that depend on both dialects and do not
conceptually belong to either of the dialects. As such, DialectA->DialectA
conversion does not make sense under Conversion/ and should rather live with
the dialect it operates on.
Differential Revision: https://reviews.llvm.org/D79569
Added:
mlir/include/mlir/Dialect/StandardOps/Transforms/FuncConversions.h
mlir/lib/Dialect/StandardOps/Transforms/FuncConversions.cpp
Modified:
mlir/lib/Conversion/CMakeLists.txt
mlir/lib/Dialect/StandardOps/Transforms/CMakeLists.txt
mlir/test/lib/Dialect/Test/CMakeLists.txt
mlir/test/lib/Dialect/Test/TestPatterns.cpp
mlir/test/lib/Transforms/CMakeLists.txt
Removed:
mlir/include/mlir/Conversion/StandardToStandard/StandardToStandard.h
mlir/lib/Conversion/StandardToStandard/CMakeLists.txt
mlir/lib/Conversion/StandardToStandard/StandardToStandard.cpp
################################################################################
diff --git a/mlir/include/mlir/Conversion/StandardToStandard/StandardToStandard.h b/mlir/include/mlir/Dialect/StandardOps/Transforms/FuncConversions.h
similarity index 72%
rename from mlir/include/mlir/Conversion/StandardToStandard/StandardToStandard.h
rename to mlir/include/mlir/Dialect/StandardOps/Transforms/FuncConversions.h
index a384d7c22166..5a1bc7b9716e 100644
--- a/mlir/include/mlir/Conversion/StandardToStandard/StandardToStandard.h
+++ b/mlir/include/mlir/Dialect/StandardOps/Transforms/FuncConversions.h
@@ -1,4 +1,4 @@
-//===- StandardToStandard.h - Std intra-dialect conversion -----*- C++ -*-===//
+//===- FuncConversions.h - Patterns for converting std.funcs ----*- 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,12 +6,12 @@
//
//===----------------------------------------------------------------------===//
//
-// This files contains patterns for lowering within the Standard dialect.
+// This files contains patterns for converting standard functions.
//
//===----------------------------------------------------------------------===//
-#ifndef MLIR_CONVERSION_STANDARDTOSTANDARD_STANDARDTOSTANDARD_H_
-#define MLIR_CONVERSION_STANDARDTOSTANDARD_STANDARDTOSTANDARD_H_
+#ifndef MLIR_DIALECT_STANDARDOPS_TRANSFORMS_FUNCCONVERSIONS_H_
+#define MLIR_DIALECT_STANDARDOPS_TRANSFORMS_FUNCCONVERSIONS_H_
namespace mlir {
@@ -28,4 +28,4 @@ void populateCallOpTypeConversionPattern(OwningRewritePatternList &patterns,
} // end namespace mlir
-#endif // MLIR_CONVERSION_STANDARDTOSTANDARD_STANDARDTOSTANDARD_H_
+#endif // MLIR_DIALECT_STANDARDOPS_TRANSFORMS_FUNCCONVERSIONS_H_
diff --git a/mlir/lib/Conversion/CMakeLists.txt b/mlir/lib/Conversion/CMakeLists.txt
index fbf3e1259493..85869f3c6629 100644
--- a/mlir/lib/Conversion/CMakeLists.txt
+++ b/mlir/lib/Conversion/CMakeLists.txt
@@ -11,6 +11,5 @@ add_subdirectory(LoopsToGPU)
add_subdirectory(LoopToStandard)
add_subdirectory(StandardToLLVM)
add_subdirectory(StandardToSPIRV)
-add_subdirectory(StandardToStandard)
add_subdirectory(VectorToLLVM)
add_subdirectory(VectorToLoops)
diff --git a/mlir/lib/Conversion/StandardToStandard/CMakeLists.txt b/mlir/lib/Conversion/StandardToStandard/CMakeLists.txt
deleted file mode 100644
index 2d1a0be0ab7a..000000000000
--- a/mlir/lib/Conversion/StandardToStandard/CMakeLists.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-add_mlir_conversion_library(MLIRStandardToStandard
- StandardToStandard.cpp
-
- ADDITIONAL_HEADER_DIRS
- ${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/StandardToStandard
-
- LINK_LIBS PUBLIC
- MLIRIR
- MLIRPass
- MLIRStandardOps
- MLIRTransforms
- )
diff --git a/mlir/lib/Dialect/StandardOps/Transforms/CMakeLists.txt b/mlir/lib/Dialect/StandardOps/Transforms/CMakeLists.txt
index 5db3c370954c..614f30f22abf 100644
--- a/mlir/lib/Dialect/StandardOps/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/StandardOps/Transforms/CMakeLists.txt
@@ -1,5 +1,6 @@
add_mlir_dialect_library(MLIRStandardOpsTransforms
ExpandAtomic.cpp
+ FuncConversions.cpp
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/StandardOps/Transforms
@@ -13,6 +14,6 @@ target_link_libraries(MLIRStandardOpsTransforms
MLIRPass
MLIRStandardOps
MLIRSupport
- MLIRTransforms
+ MLIRTransforms
LLVMSupport
)
diff --git a/mlir/lib/Conversion/StandardToStandard/StandardToStandard.cpp b/mlir/lib/Dialect/StandardOps/Transforms/FuncConversions.cpp
similarity index 93%
rename from mlir/lib/Conversion/StandardToStandard/StandardToStandard.cpp
rename to mlir/lib/Dialect/StandardOps/Transforms/FuncConversions.cpp
index e4734f31fd63..9d8fceb16db3 100644
--- a/mlir/lib/Conversion/StandardToStandard/StandardToStandard.cpp
+++ b/mlir/lib/Dialect/StandardOps/Transforms/FuncConversions.cpp
@@ -1,4 +1,4 @@
-//===- StandardToStandard.cpp - Std intra-dialect lowering ----------------===//
+//===- FuncConversions.cpp - Standard Function conversions ----------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "mlir/Conversion/StandardToStandard/StandardToStandard.h"
+#include "mlir/Dialect/StandardOps/Transforms/FuncConversions.h"
#include "mlir/Dialect/StandardOps/IR/Ops.h"
#include "mlir/Transforms/DialectConversion.h"
diff --git a/mlir/test/lib/Dialect/Test/CMakeLists.txt b/mlir/test/lib/Dialect/Test/CMakeLists.txt
index 542be7b6ac9c..81bd88823960 100644
--- a/mlir/test/lib/Dialect/Test/CMakeLists.txt
+++ b/mlir/test/lib/Dialect/Test/CMakeLists.txt
@@ -33,7 +33,7 @@ add_mlir_library(MLIRTestDialect
MLIRLinalgTransforms
MLIRPass
MLIRStandardOps
- MLIRStandardToStandard
+ MLIRStandardOpsTransforms
MLIRTransformUtils
MLIRTransforms
)
diff --git a/mlir/test/lib/Dialect/Test/TestPatterns.cpp b/mlir/test/lib/Dialect/Test/TestPatterns.cpp
index 87b1a697f8c9..f57878013936 100644
--- a/mlir/test/lib/Dialect/Test/TestPatterns.cpp
+++ b/mlir/test/lib/Dialect/Test/TestPatterns.cpp
@@ -7,8 +7,8 @@
//===----------------------------------------------------------------------===//
#include "TestDialect.h"
-#include "mlir/Conversion/StandardToStandard/StandardToStandard.h"
#include "mlir/Dialect/StandardOps/IR/Ops.h"
+#include "mlir/Dialect/StandardOps/Transforms/FuncConversions.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Transforms/DialectConversion.h"
diff --git a/mlir/test/lib/Transforms/CMakeLists.txt b/mlir/test/lib/Transforms/CMakeLists.txt
index a749d81d4f6a..4d89f06cace7 100644
--- a/mlir/test/lib/Transforms/CMakeLists.txt
+++ b/mlir/test/lib/Transforms/CMakeLists.txt
@@ -42,7 +42,7 @@ add_mlir_library(MLIRTestTransforms
MLIRSCF
MLIRGPU
MLIRPass
- MLIRStandardToStandard
+ MLIRStandardOpsTransforms
MLIRTestDialect
MLIRTransformUtils
MLIRVectorToLoops
More information about the Mlir-commits
mailing list