[LLVMdev] getCanonicalInductionVariable

Michael Ilseman michael at lunarg.com
Mon May 23 08:42:01 PDT 2011


Are you running IndVarSimplify prior to when you're asking for the
inductive variable? The comment for that method (and for other
inductive-like queries in LoopInfo), hints that you should run
IndVarSimplify (-indvars).

On Sat, May 21, 2011 at 4:52 PM, Malveeka Tewari <mtewari at eng.ucsd.edu> wrote:
> Hi
> I have the followed code for which I am writing a loop pass.
> int main() {
>   int i = 0;
>   for (i=0; i<20; i++) {
>     printf ("hello world %d\n", i);
>   }
>   return 0;
> }
> In the function runOnLoop, I have the following instruction
> PHINode *indv = NULL;
> indv = L->getCanonicalInductionVariable();
> However, when I check indv is always set to NULL.
> Since the code has a canonical induction variable, I was expecting the endv
> to start pointing to the induction var phi node.
> Please let me what I'm missing here
> Thanks
> Malveeka
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>




More information about the llvm-dev mailing list