This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: optimization/5738: GCSE missed optimization
- From: Daniel Berlin <dan at dberlin dot org>
- To: rth at gcc dot gnu dot org, <dann at godzilla dot ics dot uci dot edu>, <gcc-bugs at gcc dot gnu dot org>, <gcc-prs at gcc dot gnu dot org>, <nobody at gcc dot gnu dot org>, <gcc-gnats at gcc dot gnu dot org>
- Date: Wed, 3 Apr 2002 07:58:55 -0500 (EST)
- Subject: Re: optimization/5738: GCSE missed optimization
On 3 Apr 2002 rth@gcc.gnu.org wrote:
> Synopsis: GCSE missed optimization
>
> State-Changed-From-To: open->closed
> State-Changed-By: rth
> State-Changed-When: Wed Apr 3 02:25:09 2002
> State-Changed-Why:
> That's not how partial redundancy elimination (PRE) works.
> The object with PRE is to minimize the number of evaluations
> of an expression *along a path*.
No, the main object of PRE (besides performing GCSE) is to suppress
partial redundancies.
IE expressions that are available along one or more paths, but missing from some path.
It does so by making it fully redundant, copying it to a block (or
blocks) such that it reaches all of the paths. It then eliminates the
other copies.
> There is already one
> evaluation along each path, thus PRE considers things
> optimal.
No it won't.
The expression is not in the earliest place possible, and is fully
redundant.
It *should* copy it to the predecessor, and eliminate the other two
copies.
>
> You want global value numbering or something, which we
> don't implement.
GVN wouldn't help here, actually.
GVN doesn't insert new copies, it only eliminates values that are really
still available from some other block.
Please don't close this PR, it's correct.
--Dan