[tree-ssa] some manual store sinking for tree-dfa

Steven Bosscher s.bosscher@student.tudelft.nl
Tue Dec 9 00:05:00 GMT 2003


Hi,

Honza noted that, surprisingly, tree-dfa.c:add_vdef is a bottleneck.
This patch help a bit, but not enough.  Walking over two potentially
big varrays, bah...

BTW Without this patch we could sink the store to source, but I've
verified that we don't do that.  Is store sinking implemented?

Bootstrapped & tested on i686-pc-linux-gnu.  OK, or is this going
away when Andrew is done with his new voperands data structs?

Gr.
Steven

2003-12-08  Steven Bosscher  <stevenb@suse.de>

	* tree-dfa.c (add_vdef): Only store `source' if we've found it.

Index: tree-dfa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-dfa.c,v
retrieving revision 1.1.4.199
diff -c -3 -p -r1.1.4.199 tree-dfa.c
*** tree-dfa.c	8 Dec 2003 12:58:22 -0000	1.1.4.199
--- tree-dfa.c	8 Dec 2003 23:59:24 -0000
*************** add_vdef (tree var, tree stmt, voperands
*** 744,750 ****
  {
    stmt_ann_t ann;
    size_t i;
-   bool found;
    tree result, source;
  
    ann = stmt_ann (stmt);
--- 744,749 ----
*************** add_vdef (tree var, tree stmt, voperands
*** 763,787 ****
    /* If the statement already had virtual definitions, see if any of the
       existing VDEFs matches VAR.  If so, re-use it, otherwise add a new
       VDEF for VAR.  */
-   found = false;
    result = NULL_TREE;
    source = NULL_TREE;
    if (prev_vops && prev_vops->vdef_ops)
      for (i = 0; i < NUM_VDEFS (prev_vops->vdef_ops); i++)
        {
  	result = VDEF_RESULT (prev_vops->vdef_ops, i);
- 	source = VDEF_OP (prev_vops->vdef_ops, i);
  	if (result == var
  	    || (TREE_CODE (result) == SSA_NAME
  		&& SSA_NAME_VAR (result) == var))
  	  {
! 	    found = true;
  	    break;
  	  }
        }
  
    /* If no previous VDEF operand was found for VAR, create one now.  */
!   if (!found)
      {
        result = var;
        source = var;
--- 762,784 ----
    /* If the statement already had virtual definitions, see if any of the
       existing VDEFs matches VAR.  If so, re-use it, otherwise add a new
       VDEF for VAR.  */
    result = NULL_TREE;
    source = NULL_TREE;
    if (prev_vops && prev_vops->vdef_ops)
      for (i = 0; i < NUM_VDEFS (prev_vops->vdef_ops); i++)
        {
  	result = VDEF_RESULT (prev_vops->vdef_ops, i);
  	if (result == var
  	    || (TREE_CODE (result) == SSA_NAME
  		&& SSA_NAME_VAR (result) == var))
  	  {
! 	    source = VDEF_OP (prev_vops->vdef_ops, i);
  	    break;
  	  }
        }
  
    /* If no previous VDEF operand was found for VAR, create one now.  */
!   if (source == NULL_TREE)
      {
        result = var;
        source = var;



More information about the Gcc-patches mailing list