[Mlir-commits] [mlir] [MLIR] Default PDL off for dependency-only builds (PR #233108)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sat Oct 17 09:03:58 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir

Author: Mehdi Amini (joker-eph)

<details>
<summary>Changes</summary>

Default PDL support in PatternMatch to off whenever MLIR is configured only as a dependency. Keep the existing default for explicitly enabled MLIR builds and preserve user-provided PDL settings. This speeds up clang build with CIR enabled.

Assisted-by: Codex

---
Full diff: https://github.com/llvm/llvm-project/pull/233108.diff


1 Files Affected:

- (modified) mlir/CMakeLists.txt (+9-1) 


``````````diff
diff --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt
index 68df5aed001e2..f2c9d29af17e4 100644
--- a/mlir/CMakeLists.txt
+++ b/mlir/CMakeLists.txt
@@ -151,7 +151,15 @@ 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")
+# Avoid pulling PDL into builds that only use MLIR as a dependency.
+if("mlir" IN_LIST LLVM_DEPENDENCY_ONLY_PROJECTS)
+  set(MLIR_ENABLE_PDL_IN_PATTERNMATCH_default 0)
+else()
+  set(MLIR_ENABLE_PDL_IN_PATTERNMATCH_default 1)
+endif()
+set(MLIR_ENABLE_PDL_IN_PATTERNMATCH
+    ${MLIR_ENABLE_PDL_IN_PATTERNMATCH_default} CACHE BOOL
+    "Enable PDL in PatternMatch")
 
 option(MLIR_INCLUDE_TESTS
        "Generate build targets for the MLIR unit tests."

``````````

</details>


https://github.com/llvm/llvm-project/pull/233108


More information about the Mlir-commits mailing list