This is the mail archive of the
mailing list for the GCC project.
Re: [tree-ssa] DCE with control dependence again (with numbers, for a change)
- 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: Tue, 20 Jan 2004 21:16:37 +0100
- Subject: Re: [tree-ssa] DCE with control dependence again (with numbers, for a change)
- References: <200401201922.i0KJMYMX005901@speedy.slc.redhat.com>
On Tuesday 20 January 2004 20:22, firstname.lastname@example.org wrote:
> As I mentioned, a few minor nits in the code:
> #include "bitmap.h"
> bitmap.h is already included by tree-flow.h a few lines later.
Hmm I didn't want to rely on that. IMO every file should pull in its
own dependencies, or suddenly your code will fail to compile when you
try something smart in one of the include files (like testing ebitmaps
But tree-flow will probably always inlcude bitmap.h anyway. I'll rip
this line out.
> It appears that you mark all GOTO_EXPRs as being inherently necessary -- I
> would think that the only ones you need to mark as inherently necessary
> would be those which create abnormal edges. ie, you don't want a block to
> be marked as necessary just because it ends with a goto statement. Right?
> Or am I missing something? [ I see the old code also had that behavior.
> Odd. ]
Hmmm, in my first post (somewhere in the archives) I did not mark simple
gotos inherently necessary... Later I decided that they were, though
the original patch did work. I suppose was misguided by all the
discussions about the CFG and control statements, but I think the first
choice was right after all. I'll fix this up.
> /* If we have determined that a conditional branch statement contributes
> nothing to the program, then we not only remove it, but change the
> flowgraph so that the block points directly to the immediate
> post-dominator. The flow graph will remove the blocks we are
> circumventing, and this block will then simply fall-thru to the
> post-dominator. This prevents us from having to add any branch
> instuctions to replace the conditional statement. */
> "The flow graph will remove ..." -> "The blocks we are circumventing will
> be removed by cleanup_cfg as they will have become unreachable." or
> something like that. Think of "the flow graph" as a passive noun -- it's a
Ah yes, the comment is a literal copy of the old RTL ssa-dce code. That's
the deficiency that you mentioned in Morgan's algorithm. I told you how
I found out about that bug... :-)
> cleanup_cfg, delete_unreachable_blocks, etc are active nouns -- they do
> something such as delete unreachable blocks, straighten the flow graph,
I had a hard time understanding the comment. I blaimed it on my own bad
english. Will fix.
> It seems to me that you need to clear the statistics in tree_dce_init.
Yup, that is a bug.