[PATCH] D57422: [LTO] Set CGOptLevel in LTO config.

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 30 14:19:30 PST 2019


mehdi_amini added a comment.

In D57422#1376600 <https://reviews.llvm.org/D57422#1376600>, @pcc wrote:

> In D57422#1376550 <https://reviews.llvm.org/D57422#1376550>, @sbc100 wrote:
>
> > Can I ask why you don't want --lto-O0 to set CGOptLevel to None?
>
>
> The brief answer is: `--lto-O0` means no cross-module optimizations,


This is a poor convention IMO, because it conflict with the clang user exposed O0 which is for no optimizations.

> and just because you don't want cross-module optimizations doesn't mean that you also want poor code quality.

In such case you shouldn't request something that is "O0"?

> For example, control flow integrity requires LTO, and users of CFI who don't want cross-module optimizations (whether for code size, link performance or other reasons) should not expect the code quality to get worse just because they enabled LTO by necessity.

Why not exposing another option than "O0"? Coupling CFI to optimization even when O0 is requested does not seem in line with the usual practice: CFI is about behavior first.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57422/new/

https://reviews.llvm.org/D57422





More information about the llvm-commits mailing list