On Thu, May 19, 2011 at 09:21, Basile Starynkevitch
<bas...@starynkevitch.net> wrote:
> I am coding a pass in MELT which should ideally transform some OpenCL things
> into Gimple

I think you mean Gimple to OpenCL.

> (yes, I do know that this has been done by Andrey Belevantset et
> al in their http://www.gccsummit.org/2010/view_abstract.php?content_key=15
> paperat GCC Summit 2010).
>
> That meltopengpu_detect pass is in the MELT branch file
> gcc/melt/xtramelt-opengpu.melt
>
> It is currently installed before the ivcanon pass.
>
> How should I find the induction variable?

What is your definition of induction variable?
My definitions are:
- every variable defined in a loop is an induction variable,
- an induction variable has a phi node with one of the
  arguments defined in the loop.

If you take one of these definitions your pattern matching is easy.

> I could loop at the internal name
> of the variable, and check if it starts with graphite_IV.

I think this is a *very* bad idea, and unfortunately the graphite-opencl
code uses this strcmp technique to detect reductions, and that's why
the graphite-opencl code is broken right now.

Sebastian

Reply via email to