[all-commits] [llvm/llvm-project] c38b46: [CIR][CMake] Limit MLIR dependencies to used compo...

Mehdi Amini via All-commits all-commits at lists.llvm.org
Mon Sep 7 13:23:10 PDT 2026


  Branch: refs/heads/users/mamini/clang-cir-minimize-mlir-dependencies
  Home:   https://github.com/llvm/llvm-project
  Commit: c38b4632254053426237114ccca5fdbcea6b158b
      https://github.com/llvm/llvm-project/commit/c38b4632254053426237114ccca5fdbcea6b158b
  Author: Mehdi Amini <joker.eph at gmail.com>
  Date:   2026-09-07 (Mon, 07 Sep 2026)

  Changed paths:
    M clang/lib/CIR/CodeGen/CMakeLists.txt
    M clang/lib/CIR/FrontendAction/CMakeLists.txt
    M clang/lib/CIR/Interfaces/CMakeLists.txt
    M clang/lib/CIR/Lowering/CMakeLists.txt
    M clang/lib/CIR/Lowering/DirectToLLVM/CMakeLists.txt
    M clang/tools/cir-lsp-server/CMakeLists.txt
    M clang/tools/cir-lsp-server/cir-lsp-server.cpp
    M clang/tools/cir-opt/CMakeLists.txt
    M clang/tools/cir-translate/CMakeLists.txt
    M clang/tools/cir-translate/cir-translate.cpp

  Log Message:
  -----------
  [CIR][CMake] Limit MLIR dependencies to used components

CIR libraries and tools consume MLIR's global dialect, conversion, and
translation library collections. This makes every library in those collections
reachable from Ninja's all target even when MLIR is configured only as a CIR
dependency.

Replace the collections with target-specific dependencies. Register only the
CIR, LLVM, and MemRef dialects in cir-lsp-server, and replace the all-LLVM
translation registration in cir-translate with the Builtin, LLVM, and OpenMP
interfaces used by CIR lowering.

For a dependency-only MLIR configuration with tests enabled, archives reachable
from Ninja all fall from 511 to 314. The libMLIR*.a subset falls from 333 to
136, and Ninja dry-run edges fall from 6,925 to 6,277.

Validation:
- Configured CIR with dependency-only MLIR, with and without tests.
- Configured Clang and MLIR explicitly with CIR and tests enabled.
- Verified implicit mode omits MLIR unit and lit test targets.
- Verified explicit mode retains MLIR unit and lit test targets.
- Verified Ninja all graphs and dry-run edge counts without rebuilding.

Assisted-by: Codex



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list