[mlir] Move Conversion/StandardToStandard to Dialect/StandardOps/Transforms/FuncConve...
authorAlex Zinenko <zinenko@google.com>
Tue, 12 May 2020 22:30:54 +0000 (00:30 +0200)
committerAlex Zinenko <zinenko@google.com>
Tue, 12 May 2020 22:33:25 +0000 (00:33 +0200)
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

mlir/include/mlir/Dialect/StandardOps/Transforms/FuncConversions.h [moved from mlir/include/mlir/Conversion/StandardToStandard/StandardToStandard.h with 72% similarity]
mlir/lib/Conversion/CMakeLists.txt
mlir/lib/Conversion/StandardToStandard/CMakeLists.txt [deleted file]
mlir/lib/Dialect/StandardOps/Transforms/CMakeLists.txt
mlir/lib/Dialect/StandardOps/Transforms/FuncConversions.cpp [moved from mlir/lib/Conversion/StandardToStandard/StandardToStandard.cpp with 93% similarity]
mlir/test/lib/Dialect/Test/CMakeLists.txt
mlir/test/lib/Dialect/Test/TestPatterns.cpp
mlir/test/lib/Transforms/CMakeLists.txt

@@ -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_
index fbf3e12..85869f3 100644 (file)
@@ -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 (file)
index 2d1a0be..0000000
+++ /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
-  )
index 5db3c37..614f30f 100644 (file)
@@ -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
   )
@@ -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"
 
index 542be7b..81bd888 100644 (file)
@@ -33,7 +33,7 @@ add_mlir_library(MLIRTestDialect
   MLIRLinalgTransforms
   MLIRPass
   MLIRStandardOps
-  MLIRStandardToStandard
+  MLIRStandardOpsTransforms
   MLIRTransformUtils
   MLIRTransforms
 )
index 87b1a69..f578780 100644 (file)
@@ -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"
index a749d81..4d89f06 100644 (file)
@@ -42,7 +42,7 @@ add_mlir_library(MLIRTestTransforms
   MLIRSCF
   MLIRGPU
   MLIRPass
-  MLIRStandardToStandard
+  MLIRStandardOpsTransforms
   MLIRTestDialect
   MLIRTransformUtils
   MLIRVectorToLoops