------- Comment #11 from dberlin at gcc dot gnu dot org  2006-04-08 23:20 
-------
Subject: Re:  IVs with the same evolution not
        eliminated

> ------- Comment #10 from stevenb dot gcc at gmail dot com  2006-04-08 21:13 
> -------
> Subject: Re:  IVs with the same evolution not eliminated
> 
> > The new SCC value numberer for PRE i'm working on gets this case right (and
> > this is in fact, one of the advantages of SCC based value numbering).
> 
> Is the SCC-VN patch I posted long ago still of some use to you, or are
> you writing something new from scratch?
I ended up rewriting it from scratch, for other reasons.

In particular
1. I keep separate hash tables for unary, binary, references, and phi
expressions, each with their own structure
This is because you really want valuized structures in the hash table.
Your implementation will get the wrong answers during optimistic lookup
at times, because the value representative for a phi argument can change
and will get hashed to the wrong value.
2. I keep track of what expressions simplified to, and whether they have
constants in the simplified expression.   This enables much more
simplification that simply storing the value number name.

In particular, in something like
int main(int argc)
{
  int a;
  int b;
  int c;
  int d;
  a = argc + 4;
  b = argc + 8;
  c = a & b;
  d = a + 4;
  return c + d;
}

We will prove that d and b have the same value.

BTW, you missed the part of the thesis where he explains that phi nodes
in different blocks can't be congruent to each other (this isn't quite
true, but it's a much harder property to prove).

3. I needed the structures i made so i could directly transform the
results into value handles.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19590

Reply via email to