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]

[tree-ssa] More cleanups, this time for tree-cfg


This patch eliminates all direct uses of the dom_children field in the
tree bb annotation.  Bootstrapped on i686-pc-linux-gnu, testing in
progress.  OK?

Gr.
Steven


Attachment: ChangeLog.entry
Description: Text document

Index: tree-cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-cfg.c,v
retrieving revision 1.1.4.133
diff -c -3 -p -r1.1.4.133 tree-cfg.c
*** tree-cfg.c	22 Jul 2003 18:51:43 -0000	1.1.4.133
--- tree-cfg.c	23 Jul 2003 15:05:24 -0000
*************** bsi_insert_on_edge_immediate (edge e, tr
*** 4206,4214 ****
    /* Otherwise, create a new basic block, and split this edge.  */
    new_bb = split_edge (e);
    ann = bb_ann (new_bb);
-   ann->phi_nodes = NULL_TREE;
-   ann->ephi_nodes = NULL_TREE;
-   ann->dom_children = (bitmap) NULL;
  
    if (created_block)
      *created_block = new_bb;
--- 4206,4211 ----
*************** replace_stmt (tree *tp1, tree *tp2)
*** 4453,4459 ****
  static void
  move_outgoing_edges (basic_block bb1, basic_block bb2)
  {
-   bb_ann_t ann1, ann2;
  
    while (bb2->succ)
      {
--- 4450,4455 ----
*************** move_outgoing_edges (basic_block bb1, ba
*** 4480,4493 ****
  
    /* BB2's dominator children are now BB1's.  Also, remove BB2 as a
       dominator child of BB1.  */
!   ann1 = bb_ann (bb1);
!   ann2 = bb_ann (bb2);
!   if (ann1->dom_children)
!     {
!       bitmap_clear_bit (ann1->dom_children, bb2->index);
!       if (ann2->dom_children)
! 	bitmap_a_or_b (ann1->dom_children, ann1->dom_children,
! 		       ann2->dom_children);
      }
  }
  
--- 4476,4488 ----
  
    /* BB2's dominator children are now BB1's.  Also, remove BB2 as a
       dominator child of BB1.  */
!   if (dom_children (bb1))
!     {
!       bitmap dom1 = dom_children (bb1);
!       bitmap dom2 = dom_children (bb2);
!       bitmap_clear_bit (dom1, bb2->index);
!       if (dom2)
! 	bitmap_a_or_b (dom1, dom1, dom2);
      }
  }
  
Index: tree-flow-inline.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-flow-inline.h,v
retrieving revision 1.1.2.43
diff -c -3 -p -r1.1.2.43 tree-flow-inline.h
*** tree-flow-inline.h	22 Jul 2003 02:50:15 -0000	1.1.2.43
--- tree-flow-inline.h	23 Jul 2003 15:05:24 -0000
*************** add_dom_child (basic_block bb, basic_blo
*** 315,320 ****
--- 315,339 ----
    bitmap_set_bit (ann->dom_children, child_bb->index);
  }
  
+ static inline void
+ remove_dom_child (basic_block bb, basic_block child_bb)
+ {
+   bb_ann_t ann = bb_ann (bb);
+ 
+ #if defined ENABLE_CHECKING
+   if (ann->dom_children == NULL)
+     abort ();
+ #endif
+ 
+   bitmap_clear_bit (ann->dom_children, child_bb->index);
+ }
+ 
+ static inline void
+ clear_dom_children (basic_block bb)
+ {
+   bb_ann (bb)->dom_children = NULL;
+ }
+ 
  static inline bitmap
  dom_children (basic_block bb)
  {
Index: tree-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa.c,v
retrieving revision 1.1.4.108
diff -c -3 -p -r1.1.4.108 tree-ssa.c
*** tree-ssa.c	22 Jul 2003 18:36:38 -0000	1.1.4.108
--- tree-ssa.c	23 Jul 2003 15:05:26 -0000
*************** rewrite_into_ssa (tree fndecl, sbitmap v
*** 314,320 ****
    for (i = 0; i < n_basic_blocks; i++)
      {
        dfs[i] = BITMAP_XMALLOC ();
!       bb_ann (BASIC_BLOCK (i))->dom_children = NULL;
      }
  
    /* Compute immediate dominators.  */
--- 314,320 ----
    for (i = 0; i < n_basic_blocks; i++)
      {
        dfs[i] = BITMAP_XMALLOC ();
!       clear_dom_children (BASIC_BLOCK (i));
      }
  
    /* Compute immediate dominators.  */

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