[PATCH] D28053: Cleanup the handling of noinline function attributes, -fno-inline, -fno-inline-functions, -O0, and optnone.

Mehdi AMINI via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 22 10:07:00 PST 2016


mehdi_amini added a comment.

In https://reviews.llvm.org/D28053#629768, @rnk wrote:

> The big change here is that `clang -O0` now applies the noinline attribute everywhere. I can see why someone might expect things to work that way, but it seems surprising to me at first glance.
>
> Before this change I can imagine someone distributing a static archive of bitcode which could be used to produce debug binaries and release binaries. There are some issues with that (lack of lifetime markers), but it should mostly work.


Note that LTO runs a bunch of optimizations during the compile phase that you wouldn't get with that.

Steven had issues in the past when mixing O0 and https://reviews.llvm.org/owners/package/2/ in LTO, I don't remember the details unfortunately (and Steven is OOO).
Right now we don't add the `optnone` attribute when building with O0, maybe we should as well if we go this route.


https://reviews.llvm.org/D28053





More information about the cfe-commits mailing list