Hi David,<div><br></div><div>Might a more performant solution not be to wrap any hoisted instructions that are not safe to expand in a conditional that tests if the loop will be entered at least once?</div><div><br></div><div>
How difficult would this be to implement?</div><div><br></div><div>Cheers,</div><div><br></div><div>James<br><br><div class="gmail_quote">On 4 June 2013 12:22, David Majnemer <span dir="ltr"><<a href="mailto:david.majnemer@gmail.com" target="_blank">david.majnemer@gmail.com</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">IndVarSimplify is willing to move divide instructions outside of their loop bodies if they are invariant of the loop. However, it may not be safe to expand them if we do not know if they can trap.<div>
<br></div>
<div>The attached patch checks to see if it is not safe to expand the instruction and skips doing so if this would be the case.</div><div><br></div><div>This fixes PR16041.</div><div><br></div><div>
Testcase by Rafael Ávila de Espíndola.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>-- </div><div>David Majnemer</div></font></span></div>
<br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div>