[tree-ssa] DCE with control dependence again (with numbers, for a change)

law@redhat.com law@redhat.com
Tue Jan 20 19:24:00 GMT 2004


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.


I know that the existing tree-ssa-dce.c already uses necessary_p and
clear_necessary, but I don't see the value in even bothering having
them as inlined functions -- just access them through their macros
directly instead of indirectly through a function.

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

Can't DEF_STMT point to an empty statement node  (say for a parameter).  It
seems to me that you never need to mark those as necessary or put them on
the worklist.  Again, I think the old code had that behavior as well, so it
may not be a big deal.


  /* 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.
cleanup_cfg, delete_unreachable_blocks, etc are active nouns -- they do
something such as delete unreachable blocks, straighten the flow graph, etc.


It seems to me that you need to clear the statistics in tree_dce_init.  A
simple

memset ((void *) &stats, 0, sizeof (stats));

Ought to do the trick.


Probably the only critical things are to remove the explicit bitmap.h
inclusion, fixing the "the flow graph will remove" comment and making
sure the stats structure gets cleared.   The other issues would be nice
to address, but I wouldn't consider them blockers for inclusion.

jeff




More information about the Gcc-patches mailing list