From d02fce2d149eaad90fd5bcc0579de868fa86526d Mon Sep 17 00:00:00 2001 From: Stephen Neuendorffer Date: Wed, 13 May 2020 08:57:25 -0700 Subject: [PATCH] [MLIR] Discourage people from copying the toy examples The CMake structure of the toy example is non-standard. encourage people to copy the standalone example instead. Differential Revision: https://reviews.llvm.org/D79889 --- mlir/examples/toy/Ch1/CMakeLists.txt | 1 + mlir/examples/toy/Ch2/CMakeLists.txt | 1 + mlir/examples/toy/Ch3/CMakeLists.txt | 1 + mlir/examples/toy/Ch4/CMakeLists.txt | 1 + mlir/examples/toy/Ch4/include/toy/CMakeLists.txt | 2 ++ mlir/examples/toy/Ch5/CMakeLists.txt | 1 + mlir/examples/toy/Ch5/include/toy/CMakeLists.txt | 2 ++ mlir/examples/toy/Ch6/CMakeLists.txt | 1 + mlir/examples/toy/Ch6/include/toy/CMakeLists.txt | 2 ++ mlir/examples/toy/Ch7/CMakeLists.txt | 1 + mlir/examples/toy/Ch7/include/toy/CMakeLists.txt | 2 ++ 11 files changed, 15 insertions(+) diff --git a/mlir/examples/toy/Ch1/CMakeLists.txt b/mlir/examples/toy/Ch1/CMakeLists.txt index f4e855561301..fd71e1fbd119 100644 --- a/mlir/examples/toy/Ch1/CMakeLists.txt +++ b/mlir/examples/toy/Ch1/CMakeLists.txt @@ -1,3 +1,4 @@ +# For a better template to copy, see examples/standalone set(LLVM_LINK_COMPONENTS Support ) diff --git a/mlir/examples/toy/Ch2/CMakeLists.txt b/mlir/examples/toy/Ch2/CMakeLists.txt index 818491748e3f..6553e18bf2f3 100644 --- a/mlir/examples/toy/Ch2/CMakeLists.txt +++ b/mlir/examples/toy/Ch2/CMakeLists.txt @@ -1,3 +1,4 @@ +# For a better template to copy, see examples/standalone add_subdirectory(include) set(LLVM_LINK_COMPONENTS diff --git a/mlir/examples/toy/Ch3/CMakeLists.txt b/mlir/examples/toy/Ch3/CMakeLists.txt index ef70dcbac309..603d468cd572 100644 --- a/mlir/examples/toy/Ch3/CMakeLists.txt +++ b/mlir/examples/toy/Ch3/CMakeLists.txt @@ -1,3 +1,4 @@ +# For a better template to copy, see examples/standalone include_directories(include) add_subdirectory(include) diff --git a/mlir/examples/toy/Ch4/CMakeLists.txt b/mlir/examples/toy/Ch4/CMakeLists.txt index ae30a691894e..24a9502d044c 100644 --- a/mlir/examples/toy/Ch4/CMakeLists.txt +++ b/mlir/examples/toy/Ch4/CMakeLists.txt @@ -1,3 +1,4 @@ +# For a better template to copy, see examples/standalone include_directories(include) add_subdirectory(include) diff --git a/mlir/examples/toy/Ch4/include/toy/CMakeLists.txt b/mlir/examples/toy/Ch4/include/toy/CMakeLists.txt index 7f60477fc272..f293ff63fc64 100644 --- a/mlir/examples/toy/Ch4/include/toy/CMakeLists.txt +++ b/mlir/examples/toy/Ch4/include/toy/CMakeLists.txt @@ -1,8 +1,10 @@ +# Most dialects should use add_mlir_dialect(). See examples/standalone. set(LLVM_TARGET_DEFINITIONS Ops.td) mlir_tablegen(Ops.h.inc -gen-op-decls) mlir_tablegen(Ops.cpp.inc -gen-op-defs) add_public_tablegen_target(ToyCh4OpsIncGen) +# Most dialects should use add_mlir_interfaces(). set(LLVM_TARGET_DEFINITIONS ShapeInferenceInterface.td) mlir_tablegen(ShapeInferenceOpInterfaces.h.inc -gen-op-interface-decls) mlir_tablegen(ShapeInferenceOpInterfaces.cpp.inc -gen-op-interface-defs) diff --git a/mlir/examples/toy/Ch5/CMakeLists.txt b/mlir/examples/toy/Ch5/CMakeLists.txt index ba3a88e03c0b..dd032bf99d3b 100644 --- a/mlir/examples/toy/Ch5/CMakeLists.txt +++ b/mlir/examples/toy/Ch5/CMakeLists.txt @@ -1,3 +1,4 @@ +# For a better template to copy, see examples/standalone include_directories(include) add_subdirectory(include) diff --git a/mlir/examples/toy/Ch5/include/toy/CMakeLists.txt b/mlir/examples/toy/Ch5/include/toy/CMakeLists.txt index e8bd1fc0bc2e..66ceb13f6655 100644 --- a/mlir/examples/toy/Ch5/include/toy/CMakeLists.txt +++ b/mlir/examples/toy/Ch5/include/toy/CMakeLists.txt @@ -1,8 +1,10 @@ +# Most dialects should use add_mlir_dialect(). See examples/standalone. set(LLVM_TARGET_DEFINITIONS Ops.td) mlir_tablegen(Ops.h.inc -gen-op-decls) mlir_tablegen(Ops.cpp.inc -gen-op-defs) add_public_tablegen_target(ToyCh5OpsIncGen) +# Most dialects should use add_mlir_interfaces(). set(LLVM_TARGET_DEFINITIONS ShapeInferenceInterface.td) mlir_tablegen(ShapeInferenceOpInterfaces.h.inc -gen-op-interface-decls) mlir_tablegen(ShapeInferenceOpInterfaces.cpp.inc -gen-op-interface-defs) diff --git a/mlir/examples/toy/Ch6/CMakeLists.txt b/mlir/examples/toy/Ch6/CMakeLists.txt index c821c77f461c..9e3d7383c6db 100644 --- a/mlir/examples/toy/Ch6/CMakeLists.txt +++ b/mlir/examples/toy/Ch6/CMakeLists.txt @@ -1,3 +1,4 @@ +# For a better template to copy, see examples/standalone include_directories(include) add_subdirectory(include) diff --git a/mlir/examples/toy/Ch6/include/toy/CMakeLists.txt b/mlir/examples/toy/Ch6/include/toy/CMakeLists.txt index c6adf5a15a73..cc5b7469e7e1 100644 --- a/mlir/examples/toy/Ch6/include/toy/CMakeLists.txt +++ b/mlir/examples/toy/Ch6/include/toy/CMakeLists.txt @@ -1,8 +1,10 @@ +# Most dialects should use add_mlir_dialect(). See examples/standalone. set(LLVM_TARGET_DEFINITIONS Ops.td) mlir_tablegen(Ops.h.inc -gen-op-decls) mlir_tablegen(Ops.cpp.inc -gen-op-defs) add_public_tablegen_target(ToyCh6OpsIncGen) +# Most dialects should use add_mlir_interfaces(). set(LLVM_TARGET_DEFINITIONS ShapeInferenceInterface.td) mlir_tablegen(ShapeInferenceOpInterfaces.h.inc -gen-op-interface-decls) mlir_tablegen(ShapeInferenceOpInterfaces.cpp.inc -gen-op-interface-defs) diff --git a/mlir/examples/toy/Ch7/CMakeLists.txt b/mlir/examples/toy/Ch7/CMakeLists.txt index f622bf5ac527..66bfab67d6c7 100644 --- a/mlir/examples/toy/Ch7/CMakeLists.txt +++ b/mlir/examples/toy/Ch7/CMakeLists.txt @@ -1,3 +1,4 @@ +# For a better template to copy, see examples/standalone include_directories(include) add_subdirectory(include) diff --git a/mlir/examples/toy/Ch7/include/toy/CMakeLists.txt b/mlir/examples/toy/Ch7/include/toy/CMakeLists.txt index 43eb23bf93b8..977ebb68e97e 100644 --- a/mlir/examples/toy/Ch7/include/toy/CMakeLists.txt +++ b/mlir/examples/toy/Ch7/include/toy/CMakeLists.txt @@ -1,8 +1,10 @@ +# Most dialects should use add_mlir_dialect(). See examples/standalone. set(LLVM_TARGET_DEFINITIONS Ops.td) mlir_tablegen(Ops.h.inc -gen-op-decls) mlir_tablegen(Ops.cpp.inc -gen-op-defs) add_public_tablegen_target(ToyCh7OpsIncGen) +# Most dialects should use add_mlir_interfaces(). set(LLVM_TARGET_DEFINITIONS ShapeInferenceInterface.td) mlir_tablegen(ShapeInferenceOpInterfaces.h.inc -gen-op-interface-decls) mlir_tablegen(ShapeInferenceOpInterfaces.cpp.inc -gen-op-interface-defs)