[qt/clang/llvm]: Summary of bulk changes made

KDE Git Services - Bulk Change <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git repository change summary for qt/clang/llvm
Pushed by mirror-service into branch 'upstream/users/makslevental/mlir-ir-pch'.
Changed from 0000000000000000000000000000000000000000 to 9947b7f554dd5b6f53c4c2020111082e35a38ea8
Acknowledgement was received that this change introduces only existing code that has been pushed to another public open source repository.

This change contains the following new commits:

Git commit c72e559157248b271439ac1ebca6187634922328 by makslevental on 01/08/2026 at 05:56..
[MLIR][CMake] Add PCH for MLIRIR

Add a precompiled header for MLIRIR, following the infrastructure added in
llvm#176420 and the per-component PCHs for llvm/IR (llvm#183303),
llvm/CodeGen (llvm#183346) and clang/AST (llvm#183358).

The header list was selected with the same methodology: compile all 1173
CUs under mlir/lib with -ftime-trace, rank mlir headers by the time spent
parsing them (including transitively included headers), then greedily pick
the header with the largest marginal coverage until the marginal gain
falls off. Candidates were restricted to headers already reachable from
MLIRIR's own sources, so the PCH does not invert the library layering.

Over the mlir/lib CUs, the selected set covers 1227s of 3674s total
frontend time (33%). On a Release+assertions build of mlir-opt
(Apple M-series, -j16), clean build wall time goes from 468.3s to 440.8s
(-5.9%); 715 of 1536 MLIR objects reuse the PCH.

mlir/lib/CMakeLists.txt gains an explicit add_subdirectory(IR) before the
other directories: CMake can only reuse a PCH from a target that is
already defined, so MLIRIR must exist before its dependants.

As with the earlier PCHs, the wider header visibility exposes a name
collision: mlir-lsp-server/LSPServer.cpp does `using namespace mlir` and
`using llvm::lsp::Location`, which becomes ambiguous once mlir::Location
is declared. Qualify the llvm::lsp::Location uses in that file.
https://invent.kde.org/qt/clang/llvm/-/commit/c72e559157248b271439ac1ebca6187634922328

Git commit 9947b7f554dd5b6f53c4c2020111082e35a38ea8 by makslevental on 01/08/2026 at 08:20..
[MLIR][CMake] Extend MLIRIR PCH reuse to transitive dependants

llvm_update_pch() only offers a PCH to targets that name the defining
library as a *direct* dependency, because across LLVM subprojects a
transitively reused PCH drags in unrelated headers and causes name
collisions. Within MLIR that concern is much weaker: mlir/IR/pch.h holds
MLIR core headers that essentially every MLIR library includes anyway.

Add mlir_reuse_ir_pch(), which offers MLIRIR's PCH to any target that
actually reaches MLIRIR through its link graph. The reachability check
matters: a PCH containing MLIR IR headers emits out-of-line symbols that
only libMLIRIR provides, so handing it to a Support-only target such as
tblgen-lsp-server breaks the link.

The helper is called from add_mlir_library() and add_mlir_tool(), and
again from mlir_target_link_libraries(), where most tests, unittests and
libMLIR.so-avoiding libraries actually attach their MLIR dependencies. It
is idempotent and skips targets that define their own PCH, that opt out
with DISABLE_PCH_REUSE, that override RTTI/EH, or that contain C/ObjC
sources. MLIRSupport is excluded because MLIRIR links it, and PCH reuse
creates a real target dependency that would form a cycle.

add_mlir_library() now parses DISABLE_PCH_REUSE itself, so the opt-out is
visible here; previously it was consumed by llvm_add_library and left no
queryable property, which silently defeated the C API opt-out from
llvm#182862.

mlir/lib/CMakeLists.txt processes Interfaces, Pass and Rewrite right after
IR, so that the libraries carrying the dependency edge to MLIRIR exist
before their dependants are configured.

PDLL opts out: mlir::pdll::ast::Type/TupleType/InFlightDiagnostic and
mlir::pdll::ods::Dialect/Operation collide with the mlir:: names in the
PCH. Those libraries only link MLIRSupport, so the PCH is of no use there.

Together this takes PCH reuse from 715 to 1122 of 1536 MLIR objects.
check-mlir passes with 0 unexpected failures.
https://invent.kde.org/qt/clang/llvm/-/commit/9947b7f554dd5b6f53c4c2020111082e35a38ea8
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.