[Mlir-commits] [mlir] [MLIR][linalg] Share external interface implementations to reduce build time (NFC) (PR #221814)

Mehdi Amini llvmlistbot at llvm.org
Mon Sep 7 12:50:36 PDT 2026


joker-eph wrote:

Some stats:

The baseline was captured during a clean all build of 5,525 Ninja steps. That build took 7m17.17s wall time, 11,387.70s user time, and 694.49s system time at 2,763% effective CPU, with 3,007,068 KiB peak RSS and zero swaps. It produced 1,377 MLIR C++ TU traces totaling 9,710.73s of ExecuteCompiler time.

Before this change, TilingInterfaceImpl.cpp took 86.197s ExecuteCompiler, 31.278s frontend, 54.444s backend, 41.046s optimizer, 13.363s code generation, 21.486s function instantiation, 20.940s pending instantiations, 11.571s class instantiation, 5.283s source processing, and 4.865s class parsing. The single registerAll instantiation for 90 generated operation types took 19.205s.

The final source took 7.286s ExecuteCompiler, 3.811s frontend, 3.413s backend, 2.211s optimizer, 1.199s code generation, 1.480s function instantiation, 1.226s pending instantiations, 1.174s class instantiation, 2.141s source processing, and 2.030s class parsing. The registerAll instantiation fell to 0.503s.

That is a 91.5% reduction in ExecuteCompiler time, 87.8% in frontend time, 93.7% in backend time, 94.6% in optimizer time, 91.0% in code generation, and 97.4% in registerAll instantiation time. The baseline came from a contended full build while the final trace came from an isolated compile, so wall time is not a controlled A/B; the phase and object-size reductions independently confirm the improvement.

The final one-object compile took 7.33s wall time, 6.90s user time, and 0.30s system time at 98% CPU, with 638,176 KiB peak RSS and zero swaps. The trace shrank from 35,940,437 to 2,094,717 bytes, a 94.2% reduction.

Object text shrank from 2,605,544 to 572,391 bytes, a 78.0% reduction, and the object file shrank from 5,870,360 to 2,137,088 bytes, a 63.6% reduction. Text symbols belonging to the tiling and partial-reduction model families shrank from 2,201,961 to 279,183 bytes, an 87.3% reduction. The straight-line registerAll function remained 78,059 bytes.



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


More information about the Mlir-commits mailing list