<div><div dir="auto">Maybe because when n is 0, it trap? And you simplification get rid of the trap?</div></div><div><br><div class="gmail_quote"><div dir="ltr">On Thu, Aug 2, 2018 at 10:03 AM Alexandre Isoard via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>I noticed that our SCEVUDiv does not simplify anything when the RHS is not a constant.</div><div>Is that because there is a potential issue with division by zero being simplified?</div><div><br></div><div>For instance, would it be okay to simplify:</div><div><br></div><div>((%i * %n)<nuw> /u %n)</div><div><br></div><div>into: %i</div><div><br></div><div>The way I see it, if %n is 0, then that division is undefined and we can "define it", at will, as being %i.</div><div><br></div><div>Would that make sense in SCEV world?</div></div><div dir="ltr"><div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="m_-5036747400986434173gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><b>Alexandre Isoard</b><br></div></div></div></div>
_______________________________________________<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/mailman/listinfo/llvm-dev</a><br>
</blockquote></div></div>