<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Jun 24, 2013, at 9:12 AM, Michele Scandale <<a href="mailto:michele.scandale@gmail.com">michele.scandale@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Hi everybody,<br><br>I would like to propose a little improvement to IndVarSimplify pass. The<br>attached patch adds a special handling of the case where, during the loop exit<br>condition rewriting, the exit value is a constant of bitwidth lower than the<br>type of the induction variable: instead of introducing a trunc operation in<br>order to match correctly the operand types, it allows to convert the constant<br>value to an equivalent constant, depending on the initial value of the induction<br>variable and the trip count, in order have an equivalent comparison between the<br>induction variable and the new constant.<br></div></blockquote></div><br><div>Sorry I missed this. It looks fine to me, thanks.</div><div><br></div><div><div>+    } else CmpIndVar = Builder.CreateTrunc(CmpIndVar, ExitCnt->getType(),</div><div>+                                           "lftr.wideiv");</div></div><div><br></div><div>I would be happier with an extra set of braces here.</div><div><br></div><div>-Andy</div></body></html>