This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question re: SSA Aggressive Dead Code Elimination
- To: <law at redhat dot com>
- Subject: Re: Question re: SSA Aggressive Dead Code Elimination
- From: Daniel Berlin <dan at www dot cgsoftware dot com>
- Date: Wed, 27 Jun 2001 13:24:25 -0400 (EDT)
- cc: Michael Matz <matzmich at cs dot tu-berlin dot de>, <gcc at gcc dot gnu dot org>
On Wed, 27 Jun 2001 law@redhat.com wrote:
> In message <87k81yovxn.fsf@cgsoftware.com>you write:
> > The initial removing of the edge isn't strictly wrong, as long as you
> > update the phi nodes accordingly.
> I disagree. Even if the PHI nodes are updated, the resulting code is
> still wrong. Follow the original RTL through the two paths through the
> CFG and you'll see there are two values that we can put into r0 at the
> end of the CFG. Either r24 + r27 or just r24.
>
> If we remove either outgoing edge from block #0, then we change the semantics
> of the program. ie, removing the edge is strictly wrong. The only question
> in my mind was which optimization algorithm was incorrect.
Yeah yeah. I need to think more before writing emails so i don't look
stupid. It usually hits me about 2 minutes later that I was completely
wrong.
As to which optimization is wrong, all the dominator optimization did
was eliminate a useless computation, and reuse a register (in effect,
copy propping a=b+c into b=b+c to get b=a), which should not change the
importance of the jump node. It seems to have only because it
copy-propped into a phi node.
The only way this could happen that i can think of is if you weren't
following the control dependences in phi nodes in the dead code
elimination.
--Dan