<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 25, 2017 at 8:04 PM, Hal Finkel <span dir="ltr"><<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"><div><div class="h5">
<p><br>
</p>
<div class="m_-6744161108479083392moz-cite-prefix">On 10/20/2017 12:36 AM, Daniel Berlin
via llvm-dev wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr"><br>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Thu, Oct 19, 2017 at 10:23 PM,
Mikael Holmén via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
Also, I think there is a bigger problem lurking than just
with norecurse.</blockquote>
<div>Yes</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> I think
that in general, functionattrs is not very good with
attributes when intrinsics are present.<br>
</blockquote>
<div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
E.g.<br>
<a href="https://bugs.llvm.org/show_bug.cgi?id=34696" rel="noreferrer" target="_blank">https://bugs.llvm.org/show_bug<wbr>.cgi?id=34696</a><br>
<br>
Here dbg.value prevents both norecurse and readnone from
being deduced.<br>
</blockquote>
<div><br>
</div>
<div>A lot of these are the more general issue of intrinsics
not being marked with proper memory attributes as a form
of attempted control dependence/optimization blocking/etc</div>
<div><br>
</div>
<div>Intrinsics.td even says this.</div>
<div><br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
So, it would be nice to fix this for norecurse, but it
would be even nicer to fix it for intrinsics and
attributes in general.<br>
</blockquote>
<div><br>
</div>
<div>Nobody as of yet has signed up to fix this, because it
often requires significant thinking about each intrinsic
and what really should be happening to it, modeling that,
and teaching optimizers to deal with it.</div>
<div><br>
</div>
<div>Instead the large hammer is chosen.</div>
<div><br>
</div>
<div>Eventually it'll matter enough to performance for
someone to do the work :)</div>
</div>
</div>
</div>
</blockquote>
<br></div></div>
I agree with this, but I also agree with Sanjoy: We should add a
NoRecurse property and mark intrinsics with it. This fits our
general scheme for intrinsics (i.e., "if we say nothing, we assume
the worst").<br>
<br>
The fact that we model all sorts of dependencies as memory
dependencies is also a problem, but a somewhat independent one.<span class="HOEnZb"><font color="#888888"><br>
</font></span></div><div bgcolor="#FFFFFF" text="#000000"><br></div></blockquote><div>I'm with you 100%, I was just responding to the "we should fix everything" part.</div><div><br></div><div>We *should* fix everything.</div><div>But we don't have to do that here, we can start with just adding NoRecurse.</div><div>We lose nothing, and gain something.</div><div><br></div></div></div></div>