[clang] [llvm] Introduce -defer-thinlto-prelink-coro-split that skips Coro passes in ThinLTO pre-link pipeline (PR #107153)

Adrian Vogelsgesang via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 13 03:01:25 PDT 2024


vogelsgesang wrote:

My 2cts:

I think it would be best for clang-users, if HALO / coroutine optimizations work out-of-the-box in as many cases as possible.

Unfortunately, it seems we have an "either-or" decision here. Either, the "thin-lto + HALO" work out-of-the-box or the llc-code-generation works out-of-the-box. Afaict, thin-lto is the more common use case compared to calling llc directly. At least there seems to be documentation for [thin-lto](https://clang.llvm.org/docs/ThinLTO.html) but not for the llc use case?

As a normal C++ programmer and clang user, I doubt that I would ever find the `-defer-thinlto-prelink-coro-split` setting, in particular given that this commit does not add any documentation for it. As such, I would be stuck without cross-TU link-time HALO optimizations. At the same time, I would expect people which use custom llc-based compilation to be more experienced with setting up an LLVM toolchain, and more enabled to figure out about the existince of the flag.

All of this is to say: I think the default should be flipped. **By default, coro-split should be deferred to post-link** (such that the more common thin-lto setup can apply HALO out-of-the-box). More advanced users, who call llc directly, can still use a flag to defer coro-split.

In addition, some documentation would be great (e.g. mentioning the newly introduced flag in https://clang.llvm.org/docs/ThinLTO.html and https://llvm.org/docs/Coroutines.html

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


More information about the cfe-commits mailing list