[clang] [Offload] Always consider `flto` on for AMDGPU (PR #129118)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 7 04:50:41 PST 2025


jhuber6 wrote:

> > I think people are just confusing what `-flto` means when put on a link job.
> 
> Including me. :)
> 
> Apologies for my ignorance, what does this do and why do we want it? It allows for some (LTO-related?) flags to be forwarded/handled correctly?

The clang driver is very conservative with forwarding flags to the linker because it doesn't always know that the linker supports. `-flto` is a promise that your linker supports LTO and it should accept some flags. It could honestly be improved if we know the linker is `ld.lld` (like in the AMDGPU case) but that's just how it works right now.

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


More information about the cfe-commits mailing list