[LLVMdev] A question about induction variables

Chris Lattner sabre at nondot.org
Thu Apr 1 13:15:02 PST 2004


On Thu, 1 Apr 2004, Vladimir Prus wrote:
> The code I get is somewhat different:
> but still there's a loop.

Yeah that should be fine.

> > > I compile it and then run:
> > >    analyze -indvars x.bc
> > > which prints:
> > >    Printing analysis 'Induction Variable Analysis' for function 'main':
> >
> > When I did this, I got the following:
> >
> > $ analyze -indvars t.ll
> > Printing analysis 'Induction Variable Analysis' for function 'main':
> > Canonical Induction Variable: int %i.0.0:
> >         %i.0.0 = phi int [ 0, %entry ], [ %inc, %no_exit ]              ;
> > <int> [#uses=2] Start = int 0  Step = int 1
> >
> > ... so it seems to work.  Are you sure that your x.bc file contains the
> > correct LLVM code?
>
> Yes, I've just tried again, with the same results.

Okay, I think this is due to some code that I have had in my tree for a
long time that I forgot about.  I'll get it into CVS and then let you
know.

-Chris

-- 
http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/




More information about the llvm-dev mailing list