<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 style>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 style><br></div><div style>This fixes PR16041.</div><div style><br></div><div style>
Testcase by Rafael Ávila de Espíndola.</div><div style><br></div><div style>-- </div><div style>David Majnemer</div></div>