<p dir="ltr">Right, I agree with this in general, but looking to avoid the weird subtarget flags that I mentioned. Perhaps we should revisit Akira's original idea of wrapping pass in a decorator if you want to pull it out of the pass manager machinery?<br>
</p>
<br><div class="gmail_quote">On Wed, Apr 8, 2015, 8:04 PM Chandler Carruth <<a href="mailto:chandlerc@google.com">chandlerc@google.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Actually, even this could be done cleanly.<br><br>You could change the *pass* to accept the generic predicate in this case, and add one unpredicated version to the pipeline and add a predicated form later.<br><div><br></div><div>I'm essentially trying to lift the predicate logic out of the pass management machinery and into the pass itself because that's where the motivation for a predicate comes from.</div></div><br><div class="gmail_quote">On Wed, Apr 8, 2015 at 8:03 PM Chandler Carruth <<a href="mailto:chandlerc@google.com" target="_blank">chandlerc@google.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Is this a real use case or a hypothetical one? Because it seems somewhat contrived to me...<br><br><div>If there really is some predicate that necessitates really radically different pass pipelines, I feel like they should be, well, two separate pass pipelines.</div></div><br><div class="gmail_quote">On Wed, Apr 8, 2015 at 7:54 PM Eric Christopher <<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Optnone, IMO, needs to be replaced by something less terrible. </p>
<p dir="ltr">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().<br>
</p>
<br><div class="gmail_quote">On Wed, Apr 8, 2015, 7:38 PM Sean Silva <<a href="mailto:chisophugis@gmail.com" target="_blank">chisophugis@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Adding Paul as this seems related to optnone.</div><div class="gmail_extra"><br><div class="gmail_quote"></div></div><div class="gmail_extra"><div class="gmail_quote">On Wed, Apr 8, 2015 at 7:31 PM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@gmail.com" target="_blank">chandlerc@gmail.com</a>></span> wrote:<br></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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.<br>
<br>
If we think that's likely to be the case, here is an alternative suggestion:<br>
<br>
- Add bool-returning predicates for each pass to the subtarget base class (eg, "isIfConversionProfitable()") with the expected default ("true").<br>
- Override these for the subtargets that want to opt out.<br>
- Change the pass to directly get the subtarget, query it, and bail without doing anything if it gets "false".<br>
<br>
>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.<br>
<br>
This also matches how an optimization pass should query the function for the 'noopt' attribute and bail.<br>
<br>
Thoughts?<br>
</blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><br>
<br>
<a href="http://reviews.llvm.org/D8717" target="_blank">http://reviews.llvm.org/D8717</a><br>
<br>
EMAIL PREFERENCES<br>
  <a href="http://reviews.llvm.org/settings/panel/emailpreferences/" target="_blank">http://reviews.llvm.org/<u></u>settings/panel/<u></u>emailpreferences/</a><br>
<br>
<br>
<br></div></div></blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>
______________________________<u></u>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div></div></blockquote></div>
______________________________<u></u><u></u>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailm<u></u>an/listinfo/llvm-commits</a><br>
</blockquote></div></blockquote></div>
</blockquote></div>