# RFC? Moving \`InitAll\*\*\*\` implementation into static library

**URL:** <https://discourse.llvm.org/t/rfc-moving-initall-implementation-into-static-library/87559>\
**Category:** MLIR\
**Created:** [July 26, 2025, 11:11pm UTC](https://discourse.llvm.org/t/rfc-moving-initall-implementation-into-static-library/87559 "2025-07-26T23:11:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hardcode84](https://sea1.discourse-cdn.com/flex021/user_avatar/discourse.llvm.org/hardcode84/32/793_2.png) [@Hardcode84](https://discourse.llvm.org/u/Hardcode84)\
**Post date:** [July 26, 2025, 11:11pm UTC](https://discourse.llvm.org/t/rfc-moving-initall-implementation-into-static-library/87559/1 "2025-07-26T23:11:18Z")

</div>

`InitAll***` functions are used by `opt`-style tools to init all MLIR dialects/passes/extensions. Currently they are implemeted as inline functions and include essentially the entire MLIR header tree. Each file which includes this header (~10 currently) can take 10+ sec and multiple GB of ram to compile (tested with clang-19), which limits amount of parallel compiler jobs which can be run. Also, flang just includes this file into one of its headers.

I propose to move actual implementation into static library, so it’s compiled only once.

Draft PR [[mlir][core] Move `InitAll***` implementation into static library. by Hardcode84 · Pull Request #150805 · llvm/llvm-project · GitHub](https://github.com/llvm/llvm-project/pull/150805)

---

<div class="post-metadata">

**Author:** ![mehdi\_amini](https://sea1.discourse-cdn.com/flex021/user_avatar/discourse.llvm.org/mehdi_amini/32/25595_2.png) [@mehdi\_amini](https://discourse.llvm.org/u/mehdi_amini)\
**Post date:** [July 27, 2025, 7:34pm UTC](https://discourse.llvm.org/t/rfc-moving-initall-implementation-into-static-library/87559/2 "2025-07-27T19:34:23Z")

</div>

This is a really good finding! Thanks 🙂
