summaryrefslogtreecommitdiff
path: root/mlir/CMakeLists.txt
diff options
context:
space:
mode:
authorJacques Pienaar <jpienaar@google.com>2024-01-03 09:43:22 -0800
committerGitHub <noreply@github.com>2024-01-03 09:43:22 -0800
commit5930725c891b60f5fb94058c6c08a55a2e03d83e (patch)
tree7a1f887f1aff8c1d9de8673edd74035e6b9ccccf /mlir/CMakeLists.txt
parentfc0fdd1ae20062e4d77c1b7ffc5b06773c752815 (diff)
[mlir] Add config for PDL (#69927)
Make it so that PDL in pattern rewrites can be optionally disabled. PDL is still enabled by default and not optional bazel. So this should be a NOP for most folks, while enabling other to disable. This is piped through mlir-tblgen invocation and that could be changed/avoided by splitting up the passes file instead. This only works with tests disabled. With tests enabled this still compiles but tests fail as there is no lit config to disable tests that depend on PDL rewrites yet.
Diffstat (limited to 'mlir/CMakeLists.txt')
-rw-r--r--mlir/CMakeLists.txt5
1 files changed, 3 insertions, 2 deletions
diff --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt
index dcc068e4097c..3de8677aefe9 100644
--- a/mlir/CMakeLists.txt
+++ b/mlir/CMakeLists.txt
@@ -133,6 +133,8 @@ set(MLIR_ENABLE_NVPTXCOMPILER 0 CACHE BOOL
"Statically link the nvptxlibrary instead of calling ptxas as a subprocess \
for compiling PTX to cubin")
+set(MLIR_ENABLE_PDL_IN_PATTERNMATCH 1 CACHE BOOL "Enable PDL in PatternMatch")
+
option(MLIR_INCLUDE_TESTS
"Generate build targets for the MLIR unit tests."
${LLVM_INCLUDE_TESTS})
@@ -178,10 +180,9 @@ include_directories( ${MLIR_INCLUDE_DIR})
# Adding tools/mlir-tblgen here as calling add_tablegen sets some variables like
# MLIR_TABLEGEN_EXE in PARENT_SCOPE which gets lost if that folder is included
# from another directory like tools
-add_subdirectory(tools/mlir-tblgen)
add_subdirectory(tools/mlir-linalg-ods-gen)
add_subdirectory(tools/mlir-pdll)
-
+add_subdirectory(tools/mlir-tblgen)
set(MLIR_TABLEGEN_EXE "${MLIR_TABLEGEN_EXE}" CACHE INTERNAL "")
set(MLIR_TABLEGEN_TARGET "${MLIR_TABLEGEN_TARGET}" CACHE INTERNAL "")
set(MLIR_LINALG_ODS_YAML_GEN_TABLEGEN_EXE "${MLIR_LINALG_ODS_YAML_GEN_TABLEGEN_EXE}" CACHE INTERNAL "")