[PATCH] Add a callback to FunctionPass to enable skipping execution on a per-function basis

Sean Silva chisophugis at gmail.com
Wed Apr 8 19:38:42 PDT 2015


Adding Paul as this seems related to optnone.

On Wed, Apr 8, 2015 at 7:31 PM, Chandler Carruth <chandlerc at gmail.com>
wrote:

> I feel like we could do something much simpler than this. This feeling is
> predicated on one primary theory: most passes will run for most subtargets.
> Put another way, there will only be a small number of passes that we
> actually want to opt out of on a per-subtarget basis.
>
> If we think that's likely to be the case, here is an alternative
> suggestion:
>
> - Add bool-returning predicates for each pass to the subtarget base class
> (eg, "isIfConversionProfitable()") with the expected default ("true").
> - Override these for the subtargets that want to opt out.
> - Change the pass to directly get the subtarget, query it, and bail
> without doing anything if it gets "false".
>
> From looking at and thinking about if-conversion at least, this seems
> nicer to me. It makes someone working on the pass aware that there are
> subtarget profitability concerns, and it makes it very clear that we are
> *running* all of the passes, just that some have no effect on certain
> subtargets.
>
> This also matches how an optimization pass should query the function for
> the 'noopt' attribute and bail.
>
> Thoughts?
>
>
> http://reviews.llvm.org/D8717
>
> EMAIL PREFERENCES
>   http://reviews.llvm.org/settings/panel/emailpreferences/
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150408/dce2da0d/attachment.html>


More information about the llvm-commits mailing list