This is the mail archive of the gcc-patches@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: [tree-ssa] More aggressive dead code elimination


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


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