[PATCH] D28404: IRGen: Add optnone attribute on function during O0

Mehdi AMINI via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 9 10:19:44 PST 2017

mehdi_amini added a comment.

In https://reviews.llvm.org/D28404#639874, @probinson wrote:

> Over the weekend I had a thought:  Why is -O0 so special here?  That is, after going to all this trouble to propagate -O0 to LTO, how does this generalize to propagating -O1 or any other specific -O option?  (Maybe this question would be better dealt with on the dev list...)

O0 is "special" like Os and Oz because we have an attribute for it and passes "know" how to handle this attribute.
I guess no-one cares enough about https://reviews.llvm.org/owners/package/1//https://reviews.llvm.org/owners/package/2//O3 to find a solution for these (in the context of LTO, I don't really care about https://reviews.llvm.org/owners/package/1//https://reviews.llvm.org/owners/package/2/).
It is likely that Og would need a special treatment at some point, maybe with a new attribute as well, to inhibit optimization that can't preserve debug info properly.


More information about the cfe-commits mailing list