Re: [PATCH] Implement ‘optnone’ attribute semantics

Chandler Carruth chandlerc at google.com
Mon Nov 18 00:16:58 PST 2013


On Wed, Nov 13, 2013 at 4:09 PM, Robinson, Paul <
Paul_Robinson at playstation.sony.com> wrote:

> Patch #2 deals with skipping optimization passes for 'optnone'
> functions.  This is probably the piece that has caused the most angst.
> We tried to minimize the fiddling with the dreaded Pass Manager, and
> made as straightforward and simple a change as we could come up with
> that got the job done.  That is:
>
> We introduce a 'bool mustAlwaysRun()' method on passes, and say that
> an 'optnone' function doesn't run any function IR, loop, or basic
> block pass, unless that pass is marked 'mustAlwaysRun.'  The default
> for 'mustAlwaysRun' is true, so we explicitly turn it off for all the
> Transform passes that we do not want to run on an 'optnone' function.
> This is kind of tedious but is a mostly mechanical change.
>
> Note that module-level passes will still consider 'optnone' functions.
>

I don't really like this approach.

In re-working the pass manager stuff it is really desirable that the pass
interface narrow. And if you're going to have to update each transform pass
to handle this attribute anyways, it would seem better to just go into each
pass's run method and add an early exit if the attribute is set. Did folks
see any problems with doing that?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131118/a208b3ec/attachment.html>


More information about the llvm-commits mailing list