<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Sep 27, 2013 at 3:03 PM, Nick Lewycky <span dir="ltr"><<a href="mailto:nicholas@mxc.ca" target="_blank">nicholas@mxc.ca</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">
<br>
  Some of us were chatting about this stuff yesterday and thought<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
that while the PassManager manipulation idea would work for clang it<br>
wouldn't generalize to other tools.  This suggests that optnone really<br>
does need to be an IR attribute.  (I could easily be wrong, I don't<br>
really understand this PassManager stuff.)<br>
</blockquote></blockquote>
<br></div>
Opt offers control of the passmanager all the way out to the command-line. It currently doesn't offer per-function control, but you can do the same things with the existing command-line tools if you really wanted. Use llvm-extract to pull out the functions, then opt, then llvm-link to merge them back in.<br>
</blockquote><div><br></div><div>I think a derivative of this idea may be sufficient for the use case at hand. Clang could effectively extract all functions marked as "optnone" (or in the scope of #pragma optimize, or whatever) into a separate module and link them in only after the rest of the module has been optimized (or maybe even later, such as at link time). That seems completely generic.</div>
<div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I don't understand why you think it would need to be an IR attribute just because the other tools wouldn't "support" it. There are plenty language attributes in clang which aren't represented in the IR (and hence not supported there).<br>

<br>
It's also difficult to describe what goes wrong with having an optnone attribute. There are some questions that are hard to answer, like "what about module passes?" which I claim is a symptom of this having the wrong design. It's very clear what happens with module passes when you use the API directly.<br>

<br>
Mostly I just don't like the idea of replicating "mechanism to control passmanager" in the IR. We already have a mechanism to control the passmanager, and this new one doesn't fit. If the passmanager currently took the list of passes to run as a module attribute, I wouldn't be so bothered.<span class="HOEnZb"><font color="#888888"><br>

<br>
Nick</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
--paulr<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
The backend however, doesn't offer this sort of control, nor could it<br>
with its current design. Its pass list is fixed, each pass has<br>
</blockquote>
semantic<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
requirements that other passes ran before it. Hence, having function<br>
attributes for "make the backend codegen this at -O0" (there's an enum<br>
in codegen with four settings in it) would be fantastic.<br>
<br>
Nick<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thanks for bearing with us whilst we stumble around trying to<br>
</blockquote>
integrate<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
into the community properly!<br>
<br>
Greg Bedwell<br>
SN Systems - Sony Computer Entertainment Group<br>
<br>
<br>
<br>
</blockquote></blockquote>
******************************<u></u>******************************<u></u>**********<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This email and any files transmitted with it are confidential and<br>
</blockquote>
intended<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
solely for the use of the individual or entity to whom they are<br>
</blockquote>
addressed.<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
If you have received this email in error please notify<br>
</blockquote>
<a href="mailto:postmaster@scee.net" target="_blank">postmaster@scee.net</a><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This footnote also confirms that this email message has been checked<br>
</blockquote>
for<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
all known viruses.<br>
Sony Computer Entertainment Europe Limited<br>
Registered Office: 10 Great Marlborough Street, London W1F 7LP,<br>
</blockquote></blockquote>
United<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Kingdom<br>
Registered in England: 3277793<br>
<br>
</blockquote></blockquote>
******************************<u></u>******************************<u></u>**********<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
P Please consider the environment before printing this e-mail<br>
______________________________<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>
<br>
</blockquote>
<br>
______________________________<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>
</blockquote>
<br>
<br>
______________________________<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>
</blockquote>
<br>
<br>
</blockquote>
<br>
______________________________<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><br></div></div>