Sebastian Pop wrote:
On Wed, Apr 29, 2009 at 17:15, Richard Guenther
<richard.guent...@gmail.com> wrote:
I don't see how SSA form makes anything more complicated ;)


One of the difficulties was regenerating the phi nodes after code
hoisting: CLooG optimizes

for (i)
  if (invariant of i)
    s += A[i];

into

if (invariant of i)
  for (i)
    s += A[i];

In the transformed code you have no place to put the phi nodes that
you had after the condition.

Add to this the problem of code duplication that CLooG does sometimes:

if (invariant of i)
  for (i in domain1)
    s += A[i];
  for (i in domain2)
    s += A[i];
  ...

Maintaining the SSA form for s is difficult after such transforms.  If
you figure out a good way to maintain the SSA form, I'm very
interested to hear about.

I believe the short-cut proposed by Sebastian makes sense. We never go out of SSA, just the hard-to-maintain-in-SSA induction variables are converted temporarily into single-element arrays. This of course is only a quick fix, and it does handle all cases. It will not complicate a future rewrite of this into a nice in-SSA induction variable reconstruction (an unexpected problem, worth investigating indeed, and maybe a future deeper research result is hiding).

Albert


Reply via email to