[all-commits] [llvm/llvm-project] cdf702: [mlir] Reuse a precompiled header for MLIRIR (NFC)

Mehdi Amini via All-commits all-commits at lists.llvm.org
Thu Sep 10 13:09:11 PDT 2026


  Branch: refs/heads/users/mamini/mlir-arith-linalg-pch-combined
  Home:   https://github.com/llvm/llvm-project
  Commit: cdf702dcad4ec051a0fbb22215ddd8bf579ccba0
      https://github.com/llvm/llvm-project/commit/cdf702dcad4ec051a0fbb22215ddd8bf579ccba0
  Author: Mehdi Amini <joker.eph at gmail.com>
  Date:   2026-09-09 (Wed, 09 Sep 2026)

  Changed paths:
    A mlir/include/mlir/IR/pch.h
    M mlir/lib/CMakeLists.txt
    M mlir/lib/IR/CMakeLists.txt
    M mlir/lib/Tools/mlir-lsp-server/LSPServer.cpp

  Log Message:
  -----------
  [mlir] Reuse a precompiled header for MLIRIR (NFC)

Build a private precompiled header from the common MLIR IR headers and use it
for MLIRIR. Build Support and IR first so the PCH is available early, and
qualify the LLVM LSP Location name that the broader header surface exposes.

On current main, clean Release builds of LLVM and MLIR with Ninja -j16 pinned
to CPUs 16-31 improved as follows:

  wall:   535.99s -> 420.41s (-21.56%)
  user:  7550.29s -> 6125.97s (-18.86%)
  system: 569.85s -> 481.88s (-15.44%)

Assisted-by: Codex


  Commit: 81b343fb9c047c130744e77e7c04885b715a5031
      https://github.com/llvm/llvm-project/commit/81b343fb9c047c130744e77e7c04885b715a5031
  Author: Mehdi Amini <joker.eph at gmail.com>
  Date:   2026-09-09 (Wed, 09 Sep 2026)

  Changed paths:
    A mlir/include/mlir/Dialect/LLVMIR/pch.h
    M mlir/lib/CMakeLists.txt
    M mlir/lib/Dialect/LLVMIR/CMakeLists.txt

  Log Message:
  -----------
  [mlir][LLVM] Reuse a PCH for MLIRLLVMDialect (NFC)

Build a private precompiled header from the LLVM dialect and LLVM IR headers
and use it for MLIRLLVMDialect. Build dialect libraries before conversions so
the PCH is available early and repeated parsing is avoided.

Relative to the MLIRIR PCH parent, clean Release builds of LLVM and MLIR with
Ninja -j16 pinned to CPUs 16-31 improved as follows:

  wall:   420.41s -> 398.79s (-5.14%)
  user:  6125.97s -> 5789.14s (-5.50%)
  system: 481.88s -> 455.05s (-5.57%)

Assisted-by: Codex


  Commit: a53bc4fa61c0ee92f4fd378f7ec9295e05f9ee85
      https://github.com/llvm/llvm-project/commit/a53bc4fa61c0ee92f4fd378f7ec9295e05f9ee85
  Author: Mehdi Amini <joker.eph at gmail.com>
  Date:   2026-09-09 (Wed, 09 Sep 2026)

  Changed paths:
    M llvm/cmake/modules/AddLLVM.cmake
    M mlir/cmake/modules/AddMLIR.cmake
    A mlir/test/lib/CMake/CMakeLists.txt
    A mlir/test/lib/CMake/Inputs/PCHOptOut.c
    A mlir/test/lib/CMake/Inputs/PCHOptOut.cpp
    M mlir/test/lib/CMakeLists.txt

  Log Message:
  -----------
  [mlir] Reuse the MLIRIR PCH through dependencies (NFC)

Track whether an MLIR library's link closure reaches MLIRIR and reuse the
MLIRIR PCH for those libraries. Preserve higher-priority local PCHs and add an
explicit opt-out for targets whose sources are incompatible with reuse.

Relative to the core and LLVM dialect PCH parent, clean Release builds of LLVM
and MLIR with Ninja -j16 pinned to CPUs 16-31 improved as follows:

  wall:   398.79s -> 386.47s (-3.09%)
  user:  5789.14s -> 5624.02s (-2.85%)
  system: 455.05s -> 438.45s (-3.65%)

Assisted-by: Codex


  Commit: 302f34967928b3fc93b264df7a552db4aa7422db
      https://github.com/llvm/llvm-project/commit/302f34967928b3fc93b264df7a552db4aa7422db
  Author: Mehdi Amini <joker.eph at gmail.com>
  Date:   2026-09-10 (Thu, 10 Sep 2026)

  Changed paths:
    A mlir/include/mlir/Dialect/Arith/IR/pch.h
    A mlir/include/mlir/Dialect/Linalg/IR/pch.h
    M mlir/lib/Dialect/Arith/IR/CMakeLists.txt
    M mlir/lib/Dialect/LLVMIR/CMakeLists.txt
    M mlir/lib/Dialect/Linalg/IR/CMakeLists.txt

  Log Message:
  -----------
  [mlir] Reuse PCHs for Arith and Linalg dialects (NFC)

Add dialect-local PCHs for Arith and Linalg, while preferring the more
expensive LLVM dialect PCH when both are available.

Clean LLVM and MLIR builds with -j16 improve from 378.98s to 368.70s
on average (-2.71%).

Assisted-by: Codex


Compare: https://github.com/llvm/llvm-project/compare/cdf702dcad4e%5E...302f34967928

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