This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] More aggressive dead code elimination
- From: Steven Bosscher <s dot bosscher at student dot tudelft dot nl>
- To: law at redhat dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 7 Jan 2004 23:56:14 +0100
- Subject: Re: [tree-ssa] More aggressive dead code elimination
- References: <200401072228.i07MSndW031324@speedy.slc.redhat.com>
On Wednesday 07 January 2004 23:28, law@redhat.com wrote:
> >This patch re-introduces the classic SSA DCE algorithm as described
> >in Morgan's book. The current implementation takes the conservative
> >approach and marks all conditional branches inherently necessary.
> >This prevents us from removing some of them at the tree level. With
> >this patch we do eliminate unnecessary branches, e.g. stuff like,
>
> We decided a few months ago against using this approach to DCE due to
> performance issues.
Yes. We had slow iterators, and dominance info was slow. Both are
now a lot faster.
> The code we have now misses two cases that the approach cited in Morgan
> and other sources handles:
>
> 1. Useless loop removal. Frankly, I don't care about this.
We never kill useless loops, not even on RTL. And they appear to be
not very uncommon especially with C++ code, and with the tree loop
optimizers we're planning, they may become more common.
> 2. If the last DCE pass kills a conditional it does not arrange to
> kill the statements which feed the conditional. This can be
> easily solved by re-running the DCE pass in that case. These are
> extremely rare.
Running the existing DCE twice is just as expensive as running the more
aggressive version just once, so this argument doesn't make sense to me.
Gr.
Steven