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] DCE with control dependence again (with numbers, for a change)


On Tuesday 20 January 2004 20:22, law@redhat.com 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
for tree-flow).

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
> datastructure.

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,
> etc.

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.

Gr.
Steven


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