<div dir="ltr">On Wed, Sep 26, 2018 at 3:36 PM Kevin Neal <<a href="mailto:Kevin.Neal@sas.com">Kevin.Neal@sas.com</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div class="m_-27177400973007496WordSection1">
<p class="MsoNormal"><span style="font-family:"Courier New";color:#44546a">I have no example side effects in hand. But LLVM targets a bunch of architectures, and who knows what the future holds. So it may be prudent to not promise too much so as to leave ourselves
 an escape hatch.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#44546a"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#44546a">Doesn’t LLVM target some chips that have floating point instruction sets that are not IEEE compliant? Can we be certain that no new LLVM target will ever have to jump through hoops to
 avoid side effects simply because we promised that fneg would never, ever have any side effects?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#44546a"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#44546a">Assuming we do promise no side effects from fneg, ever and forever, then the documentation should say that clearly.</span></p></div></div></blockquote><div><br></div><div>Maybe I'm misunderstanding the LangRef copy, but the promise of 'no side effects' is really saying that trapping behavior is not guaranteed to be preserved under optimizations. FNEG(X) never has side effects (it never traps). It is a bitwise operation. </div><div><br></div><div>Now changing FNEG(X) into FSUB(-0.0, X) is a different conversation. Those two operations do not give bitwise identical results for all inputs. So, it's really not safe to replace one with the other [well, arguably only FNEG(X) --> FSUB(-0.0, X) isn't safe]. So, as long as we don't make an unsafe transformation, which can set incorrect bits if we do make it, then I don't foresee a problem with side-effects on FNEG. </div></div></div>