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

Chandler Carruth chandlerc at google.com
Wed Apr 8 20:09:28 PDT 2015


Ow. Anyways, I'd rather have a predicated and unpredicted form of
cfgcleanup rather than litter predicates in the machine function pass layer
itself.

On Wed, Apr 8, 2015 at 8:07 PM Eric Christopher <echristo at gmail.com> wrote:

>
> It's a real case, check out the ARM port for it.
>
> On Wed, Apr 8, 2015, 8:02 PM Chandler Carruth <chandlerc at google.com>
> wrote:
>
> Is this a real use case or a hypothetical one? Because it seems somewhat
> contrived to me...
>
> If there really is some predicate that necessitates really radically
> different pass pipelines, I feel like they should be, well, two separate
> pass pipelines.
>
>
>  On Wed, Apr 8, 2015 at 7:54 PM Eric Christopher <echristo at gmail.com>
> wrote:
>
> Optnone, IMO, needs to be replaced by something less terrible.
>
> I'm not sure how this is going to work with the "I want to run the first
> cfgcleanup unconditionally, but not the second" without tying the
> subtargets to things like shouldRunCfgCleanup2().
>
> On Wed, Apr 8, 2015, 7:38 PM Sean Silva <chisophugis at gmail.com> wrote:
>
>  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
>
>
> _______________________________________________
> 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/20150409/1680b5b3/attachment.html>


More information about the llvm-commits mailing list