[llvm-dev] loop canonical variables
Anastasiya Ruzhanskaya via llvm-dev
llvm-dev at lists.llvm.org
Wed Jul 26 00:24:27 PDT 2017
Great, thanks a lot!
2017-07-25 23:48 GMT+02:00 Sanjoy Das <sanjoy at google.com>:
> Hi Anastasiya,
> If it fits you use case, you can consider walking the loop header and
> calling getSCEV() on all of the PHI nodes in the header. This will
> give you a SCEV* which should be easier to analyze than manually
> inspecting PHI cycles.
> -- Sanjoy
> On Tue, Jul 25, 2017 at 11:42 AM, Michael Kruse via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
> > 2017-07-25 19:32 GMT+02:00 Anastasiya Ruzhanskaya
> > <anastasiya.ruzhanskaya at frtk.ru>:
> >> I call this function and it returns only "i" in my example. Are there
> >> ways to return "j" also?
> > That would contradict it being the /canonical/ induction variable,
> wouldn't it?
> > If you look into the imlplementation of
> > getCanonicalInductionVariable(), it just walks the IR instructions and
> > checks some conditions. You can have your own implementation that,
> > instead of returning the first matching PHI, return all matching PHIs.
> > SimplifyIndVar won't try to canonicalize, though.
> > Michael
> > _______________________________________________
> > LLVM Developers mailing list
> > llvm-dev at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev