[Mlir-commits] [mlir] [mlir][execution engine] turn on ENABLE_AGGREGATION for runtimes (PR #71860)

Stella Laurenzo llvmlistbot at llvm.org
Fri Nov 10 21:58:00 PST 2023


stellaraccident wrote:

> > What is the effect of this? I am not familiar with this option
> 
> It turns on shipping the object files for those targets (in addition to the shlibs):
> 
> ![image](https://user-images.githubusercontent.com/5657668/281949895-a824dc70-0ff1-404d-ba43-ff0ee73465f2.png)
> 
> The AGGREGATION part of `ENABLE_AGGREGATION` is about building the MLIR aggregate (i.e., `libMLIR-C`). So these targets the I turned this on for shouldn't be lumped into `libMLIR-C` and so they currently don't carry `ENABLE_AGGREGATION` and instead carry `EXCLUDE_FROM_LIBMLIR`. The combination of the two gives you (I thought) as safe combination: build the objects _and_ don't include them in the aggregate. But windows seems to disagree 🤷 (will have to debug).
> 
> The use case is as I mentioned in the description: right now you can't reuse any of that code (except as a shlib).

If the LLVM build system were being created today, it would probably be generating object libraries for everything by default. That is what newer projects do when they get to the point that they need it. But there was a long time where CMake version and platform limitations kept that from being feasible.

What we have is a bit commingled with different flags influencing whether object libraries get generated on a per library basis, and then there is some debt on the depending side that needs working around. It's been years since I looked at any of this, but the last time I did, I recall it being a rat's nest. In the present day, I would not pay attention to the ENABLE_AGGREGATION and EXCLUDE_FROM_MLIR flags first and just see if I could globally make `add_mlir_library` always generate object libraries for everything. And then things like ENABLE_AGGREGATION and bundling into libMLIR are merely features that require that to be true for what they include.

It's a mess... and even moreso if you look at LLVM broadly.

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


More information about the Mlir-commits mailing list