This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcse pass: expression hash table
On Thu, 2005-02-24 at 15:59 -0500, Andrew Pinski wrote:
> On Feb 24, 2005, at 3:55 PM, Tarun Kawatra wrote:
>
> > Actually I am trying to extend PRE implementation so that it performs
> > strength reduction as well. it requires multiplication expressions to
> > get into hash table.
>
> Why do you want to do that?
> Strength reduction is done already in loop.c.
>
Generally, PRE based strength reduction also includes straight line code
strength reduction.
Non-ssa based ones don't do much better in terms of redundancy
elimination, but the SSA based ones can eliminate many more redundnacies
when you integrate strength reduction into them.
IE given something like:
b = a * b;
<use b>
if (argc)
{
a = a + 1;
}
else
{
a = a + 2;
}
c = a * b;
<use c>
It will remove the second multiply in favor of additions at the site of
the changes of a.
--Dan