[cfe-dev] [RFC] add Function Attribute to disable optimization

Chandler Carruth chandlerc at google.com
Mon Jun 17 11:35:30 PDT 2013


On Mon, Jun 17, 2013 at 10:59 AM, jahanian <fjahanian at apple.com> wrote:

> Wouldn’t implementing this proposal be a red herring? By this I mean, it
> is possible that
> throughout the optimization phases, there is an implied assumption that
> all functions
> are similarly optimized.
>

There is no such intrinsic assumption.

The optimizer is already perfectly capable of handling these scenarios, and
they already come up. Imagine LTO of a two translation units with different
optimization levels. Also see the optsize attribute.


> An example would be under certain optimization flag, compiler changes
> calling convention of static functions.
>

This is always (and must always) done by a pass that looks at all of the
callers together. Thus, it will be able to (and must be taught) respect any
attribute on a function which is designed to turn off optimizations.

The only real challenge to this proposal is going through and teaching as
much of the optimizer as possible to respect this function attribute. I
don't see any really fundamentally problematic aspects to it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130617/10bc1ef2/attachment.html>


More information about the cfe-dev mailing list