[PATCH] Little improvement in IndVarSimplify

Andrew Trick atrick at apple.com
Wed Jul 10 21:46:51 PDT 2013


On Jun 24, 2013, at 9:12 AM, Michele Scandale <michele.scandale at gmail.com> wrote:

> Hi everybody,
> 
> I would like to propose a little improvement to IndVarSimplify pass. The
> attached patch adds a special handling of the case where, during the loop exit
> condition rewriting, the exit value is a constant of bitwidth lower than the
> type of the induction variable: instead of introducing a trunc operation in
> order to match correctly the operand types, it allows to convert the constant
> value to an equivalent constant, depending on the initial value of the induction
> variable and the trip count, in order have an equivalent comparison between the
> induction variable and the new constant.

Sorry I missed this. It looks fine to me, thanks.

+    } else CmpIndVar = Builder.CreateTrunc(CmpIndVar, ExitCnt->getType(),
+                                           "lftr.wideiv");

I would be happier with an extra set of braces here.

-Andy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130710/dd4ea80c/attachment.html>


More information about the llvm-commits mailing list