<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><br></div></div></div></div>