<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; ">-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.<div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>Sorry for the confusion.</div><div><br></div><div>-Andy<br><div><br><div><div>On Jul 24, 2012, at 6:20 PM, Edvard Ghazaryan <<a href="mailto:edvard_gh@yahoo.com">edvard_gh@yahoo.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><div style="background-color: rgb(255, 255, 255); font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><br></div><div style="font-family: 'times new roman', 'new york', times, serif; "><div style="font-family: 'times new roman', 'new york', times, serif; "><div id="yiv415300124"><div style="background-color: rgb(255, 255, 255); font-family: 'times new roman', 'new york', times, serif; "><div style="font-family: times, serif; "><div style="font-family: times, serif; "><div id="yiv415300124"><div style="background-color: rgb(255, 255, 255); font-family: times, serif; "><div style="font-family: times, serif; "><div style="font-family: times, serif; "><div id="yiv415300124"><div style="background-color: rgb(255, 255, 255); font-family: times, serif; "><div style="font-family: times, serif; "><div style="font-family: times, serif; ">
<div id="yiv415300124"><div style="background-color: rgb(255, 255, 255); font-family: times, serif; "><div style="font-family: times, serif; font-size: 12pt; ">Hello .</div><div style="font-family: times, serif; font-size: 12pt; "><div class="yiv415300124yui_3_2_0_20_134301829836475"><br></div><div class="yiv415300124yui_3_2_0_20_134301829836475"><br></div></div><div class="yiv415300124yui_3_2_0_20_134301829836475" style="font-family: times, serif; font-size: 12pt; ">opt -indvars pass does not generate canonical induction variable. </div><div class="yiv415300124yui_3_2_0_20_134301829836475 yui_3_2_0_19_1343178987934107" style="font-family: times, serif; font-size: 12pt; "><br></div><div class="yiv415300124yui_3_2_0_20_134301829836475 yui_3_2_0_19_1343178987934107">(NULL == loop->getCanonicalInductionVariable();)<br></div><div class="yiv415300124yui_3_2_0_20_134301829836475 yui_3_2_0_19_1343178987934107"><br></div><div class="yiv415300124yui_3_2_0_20_134301829836475 yiv415300124yui_3_2_0_19_134308788264589" style="font-family: times, serif; font-size: 12pt; "><span style="font-weight: bold;"><span style="font-size:12pt;">PLEASE </span>explain <span style="font-size:12pt;">why? and how can I fix it?</span></span></div><div style="font-family: times, serif; font-size: 12pt; " class="yiv415300124yui_3_2_0_20_134301829836475 yiv415300124yui_3_2_0_19_134308788264589 yiv415300124yui_3_2_0_19_1343169411891101"><br></div><div style="font-family: times, serif; font-size: 12pt; "><span><font face="times new roman, new york, times, serif" size="3">Thanks in advance,</font></span></div><div style="font-family: times, serif; font-size: 12pt; "><span><font face="times new roman, new york, times, serif" size="3">Edvard </font></span></div></div></div><br><br> </div> </div>  </div></div><br><br> </div> </div>  </div></div><br><br> </div> </div>  </div></div><br><br> </div> </div>  </div></div>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></blockquote></div><br></div></div></body></html>