[PATCH] D29376: LTO: align the Monolithic LTO optimization pipeline on the ThinLTO and O2/O3 one

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 1 13:16:24 PST 2017

pcc added a comment.

In https://reviews.llvm.org/D29376#663795, @mehdi_amini wrote:

> > It is not necessarily just Chromium, it is any user who just wants CFI/devirt without it being tied to the rest of the LTO pipeline.
> That's very legitimate, and "not being tied to the rest of the LTO pipeline" is exactly the reason why I oppose blocking the LTO pipeline on such use case. If such use-case needs to be "untied", a separate flag/flow can be provided to them.

I agree that in the long term we should think about this more carefully. In fact right now in ThinLTO we have no way of untying these features from the rest of the pipeline. I think the long term plan should be:

- figure out the right way to expose the "act like a regular linker with --gc-sections" feature
- expose it to regular and thin LTO
- remove the hardcoded regular LTO path you mention below

>> LTO opt level 1 already allows users to do that; it roughly means "act like a regular linker with --gc-sections".
> I'd be fine with having `LTO O1` being hardcoded to a special path that would be CFI+DCE,

Works for me, thanks.

> but then what is O0?

I think O0 should have basically the same meaning as in the compiler: the minimal pass pipeline required for correctness.


More information about the llvm-commits mailing list