<div dir="ltr">(though it's still illegal to remove it in this particular case).<div><br></div><div>I'm just saying, just because you don't make a function read-only or read-none, doesn't mean clang/llvm won't infer the attribute.</div><div><br></div><div>Here, it's illegal because you don't have the definition.</div><div><br></div><div>The function is also may-throw.</div><div>So even if it was readnone/readonly, we could not remove the call.</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 24, 2016 at 8:57 AM, Daniel Berlin <span dir="ltr"><<a href="mailto:dberlin@dberlin.org" target="_blank">dberlin@dberlin.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Actually, this is false.<div>It will infer the attribute :)</div><div><br></div><div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 24, 2016 at 5:47 AM, Renato Golin 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"><span>On 24 August 2016 at 11:45, Alexandre Isoard <<a href="mailto:alexandre.isoard@gmail.com" target="_blank">alexandre.isoard@gmail.com</a>> wrote:<br>
> However, he also stated that in the case the functions returns void it is<br>
> not removed, which suggest there is something fishier going on.<br>
<br>
</span>Looking back at the example (and LangRef, for function attributes),<br>
looks like it's not legal to remove because the function does *not*<br>
have "readnone" or "readonly", so LLVM can't prove it side-effect<br>
free.<br>
<br>
Sanjoy's fix is probably on the right track.<br>
<div><div><br>
--renato<br>
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>