<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Yes, there is no way for any pass to find out by itself whether that function has side effects, and I didn't tell it that it doesn't have any, so that seems overly aggressive.</div><div class=""><br class=""></div><div class="">As far as finding and fixing the problem goes: I used to build LLVM and Clang from source, but I stopped because a full build takes around 3 hours on this machine and I don't get a lot out of it. I use LLVM on my spare time and I'm about as casual as a compiler back-end user can be. Sanjoy, I'd be happy if you looked into it.<br class=""><div class="">
<br class="Apple-interchange-newline"><span style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none;" class="">Félix</span>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">Le 24 août 2016 à 05:47:46, Renato Golin <<a href="mailto:renato.golin@linaro.org" class="">renato.golin@linaro.org</a>> a écrit :</div><br class="Apple-interchange-newline"><div class=""><div class="">On 24 August 2016 at 11:45, Alexandre Isoard <<a href="mailto:alexandre.isoard@gmail.com" class="">alexandre.isoard@gmail.com</a>> wrote:<br class=""><blockquote type="cite" class="">However, he also stated that in the case the functions returns void it is<br class="">not removed, which suggest there is something fishier going on.<br class=""></blockquote><br class="">Looking back at the example (and LangRef, for function attributes),<br class="">looks like it's not legal to remove because the function does *not*<br class="">have "readnone" or "readonly", so LLVM can't prove it side-effect<br class="">free.<br class=""><br class="">Sanjoy's fix is probably on the right track.<br class=""><br class="">--renato<br class=""></div></div></blockquote></div><br class=""></div></body></html>