[PATCH] D105272: [CMake][MLIR][Linalg] Adding variable to specify tablegen file dependencies.

Tobias Gysi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 1 09:40:10 PDT 2021


gysit updated this revision to Diff 355918.
gysit added a comment.

Address comments by adding comments.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105272/new/

https://reviews.llvm.org/D105272

Files:
  llvm/cmake/modules/TableGen.cmake
  mlir/include/mlir/Dialect/Linalg/IR/CMakeLists.txt


Index: mlir/include/mlir/Dialect/Linalg/IR/CMakeLists.txt
===================================================================
--- mlir/include/mlir/Dialect/Linalg/IR/CMakeLists.txt
+++ mlir/include/mlir/Dialect/Linalg/IR/CMakeLists.txt
@@ -25,6 +25,10 @@
     ${MLIR_LINALG_ODS_GEN_EXE}
     ${MLIR_LINALG_ODS_GEN_TARGET}
     ${GEN_ODS_FILE} ${GEN_CPP_FILE})
+  # Setup the file dependencies needed for the subsequent tablegen step.
+  # TODO: Once there is only one way of generating named ops remove this parent
+  # scope manipulation and implement the tablegen generation in the same scope.
+  set(LLVM_TARGET_DEPENDS ${LLVM_TARGET_DEPENDS} ${GEN_ODS_FILE} PARENT_SCOPE)
 endfunction()
 
 # Declare a function to generate ODS with mlir-linalg-ods-yaml-gen
@@ -52,10 +56,17 @@
     ${MLIR_LINALG_ODS_YAML_GEN_EXE}
     ${MLIR_LINALG_ODS_YAML_GEN_TARGET}
     ${GEN_ODS_FILE} ${GEN_CPP_FILE})
+  # Setup the file dependencies needed for the subsequent tablegen step.
+  # TODO: Once there is only one way of generating named ops remove this parent
+  # scope manipulation and implement the tablegen generation in the same scope.
+  set(LLVM_TARGET_DEPENDS ${LLVM_TARGET_DEPENDS} ${GEN_ODS_FILE} PARENT_SCOPE)
 endfunction()
 
 # TODO: Delete tc generation and replace with the YAML variant once all ops are
-# ported.
+# ported. At the same time, move the YAML and TableGen generation to the same
+# scope to avoid the at a distance dependency manipulation via
+# LLVM_TARGET_DEPENDS.
+set(LLVM_TARGET_DEPENDS "")
 add_linalg_ods_tc_gen(LinalgNamedStructuredOpsSpec.tc LinalgNamedStructuredOps)
 add_linalg_ods_yaml_gen(LinalgNamedStructuredOps.yaml LinalgNamedStructuredOps)
 
Index: llvm/cmake/modules/TableGen.cmake
===================================================================
--- llvm/cmake/modules/TableGen.cmake
+++ llvm/cmake/modules/TableGen.cmake
@@ -1,4 +1,5 @@
-# LLVM_TARGET_DEFINITIONS must contain the name of the .td file to process.
+# LLVM_TARGET_DEFINITIONS must contain the name of the .td file to process,
+# while LLVM_TARGET_DEPENDS may contain additional file dependencies.
 # Extra parameters for `tblgen' may come after `ofn' parameter.
 # Adds the name of the generated file to TABLEGEN_OUTPUT.
 
@@ -104,6 +105,7 @@
     DEPENDS ${${project}_TABLEGEN_TARGET} ${${project}_TABLEGEN_EXE}
       ${local_tds} ${global_tds}
     ${LLVM_TARGET_DEFINITIONS_ABSOLUTE}
+    ${LLVM_TARGET_DEPENDS}
     COMMENT "Building ${ofn}..."
     )
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105272.355918.patch
Type: text/x-patch
Size: 2469 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210701/e4871eb3/attachment.bin>


More information about the llvm-commits mailing list