This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PRE (sometimes) confuses ivopts/scev?


On Tue, 25 Jan 2005, Daniel Berlin wrote:

>
>
> On Tue, 25 Jan 2005, Richard Guenther wrote:
>
> > On Tue, 25 Jan 2005, Daniel Berlin wrote:
> >
> >>> I created PR tree-optimization/19624 with my testcase (took a day to
> >>> reduce...).
> >>>
> >>
> >> Okay, i think i've got it going now.
> >> Can you two test a patch for me if i send it to you?
> >
> > Yes, of course.
> >
> > Richard.
>
>
> Give this a spin.
>
> It should avoid insertion of the partial redundancy temporary phi node,
> but not avoid lifting invariant code.
>
> (Note that it may insert dead code in the predecessors in this case,
> there's not much i can do about this, at least right now.  The easiest fix
> is to just run DCE after PRE, which we were planning to do anyway because
> casts sometimes cause dead code insertion).

It helps my testcase the same as -fno-tree-pre, but still does some
(useful) work.  Before the patch we have
Insertions:12
New PHIs:12
Eliminated:12

afterwards there is
Insertions:46
New PHIs:0
Eliminated:12
Constified:0

with early loop unrolling on we find 3 loops instead of 12 and do
Insertions:34
New PHIs:0
Eliminated:33
Constified:0

and the code produced is even better than before with -fno-tree-pre!

For a runtime test of the tramp3d testcase we gain about 2% in
runtime compared to -fno-tree-pre and about 5% compared to -ftree-pre
without your patch.

Nice ;)

Richard.

--
Richard Guenther <richard dot guenther at uni-tuebingen dot de>
WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]