[LLVMdev] regarding opt -indvars

Andrew Trick atrick at apple.com
Wed Jul 25 12:44:45 PDT 2012


-indvars runs the "Induction Variable Simplification" pass. It determines whether any induction variable users can be simplified. If not, then it doesn't rewrite the loop. We used to have an option for rewriting induction variables, but that was removed in 3.1 because it was untested.

Loop::getCanonicalInductionVariable() is also untested and should be removed. There is still some SCEVExpander code that uses it because of projects and out-of-tree work. I'd like to figure out a graceful way to remove all of this so that external users can migrate.

The way to "fix" it depends on what you really want. If you want induction variable analysis, then use SCEV. If you want the loop's induction variables transformed into a more optimal form, that is highly target specific and done in LoopStrengthReduce. If you have some other reason you want to rewrite induction variables, then you and anyone else who's interested need to maintain your own pass to do that.

Sorry for the confusion.

-Andy

On Jul 24, 2012, at 6:20 PM, Edvard Ghazaryan <edvard_gh at yahoo.com> wrote:

> 
> Hello .
> 
> 
> opt -indvars pass does not generate canonical induction variable. 
> 
> (NULL == loop->getCanonicalInductionVariable();)
> 
> PLEASE explain why? and how can I fix it?
> 
> Thanks in advance,
> Edvard 
> 
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120725/cc3b9aa6/attachment.html>


More information about the llvm-dev mailing list