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]

more gcse.c work



compute_local_properties is now a common routine shared by cprop and gcse/pre.  
It can also be shared by other optimizers like code hoisting.

It's existance makes compute_pre_local_properties redundant.

        * gcse.c (compute_pre_local_properties): Delete.
        (compute_pre_data): Use compute_local_properties instead of 
        compute_pre_local_properties.

Index: gcse.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/gcse.c,v
retrieving revision 1.32
diff -c -3 -p -r1.32 gcse.c
*** gcse.c	1999/03/10 21:29:44	1.32
--- gcse.c	1999/03/11 05:34:06
*************** static int one_cprop_pass	     PROTO ((i
*** 577,583 ****
  
  static void alloc_pre_mem	     PROTO ((int, int));
  static void free_pre_mem	      PROTO ((void));
- static void compute_pre_local_properties PROTO ((void));
  static void compute_pre_avinout       PROTO ((void));
  static void compute_pre_antinout      PROTO ((void));
  static void compute_pre_pavinout      PROTO ((void));
--- 577,582 ----
*************** free_pre_mem ()
*** 4000,4077 ****
    free (pre_transpout);
  }
  
- /* Compute the local properties of each recorded expression.
-    Local properties are those that are defined by the block, irrespective
-    of other blocks.
- 
-    An expression is transparent in a block if its operands are not modified
-    in the block.
- 
-    An expression is computed (locally available) in a block if it is computed
-    at least once and expression would contain the same value if the
-    computation was moved to the end of the block.
- 
-    An expression is locally anticipatable in a block if it is computed at
-    least once and expression would contain the same value if the computation
-    was moved to the beginning of the block.  */
- 
- static void
- compute_pre_local_properties ()
- {
-   int i;
- 
-   sbitmap_vector_ones (pre_transp, n_basic_blocks);
-   sbitmap_vector_zero (pre_comp, n_basic_blocks);
-   sbitmap_vector_zero (pre_antloc, n_basic_blocks);
- 
-   for (i = 0; i < expr_hash_table_size; i++)
-     {
-       struct expr *expr;
- 
-       for (expr = expr_hash_table[i]; expr != NULL; expr = expr->next_same_hash)
- 	{
- 	  struct occr *occr;
- 	  int indx = expr->bitmap_index;
- 
- 	  /* The expression is transparent in this block if it is not killed.
- 	     We start by assuming all are transparent [none are killed], and then
- 	     reset the bits for those that are.  */
- 
- 	  compute_transp (expr->expr, indx, pre_transp, 0);
- 
- 	  /* The occurrences recorded in antic_occr are exactly those that
- 	     we want to set to non-zero in ANTLOC.  */
- 
- 	  for (occr = expr->antic_occr; occr != NULL; occr = occr->next)
- 	    {
- 	      int bb = BLOCK_NUM (occr->insn);
- 	      SET_BIT (pre_antloc[bb], indx);
- 
- 	      /* While we're scanning the table, this is a good place to
- 		 initialize this.  */
- 	      occr->deleted_p = 0;
- 	    }
- 
- 	  /* The occurrences recorded in avail_occr are exactly those that
- 	     we want to set to non-zero in COMP.  */
- 
- 	  for (occr = expr->avail_occr; occr != NULL; occr = occr->next)
- 	    {
- 	      int bb = BLOCK_NUM (occr->insn);
- 	      SET_BIT (pre_comp[bb], indx);
- 
- 	      /* While we're scanning the table, this is a good place to
- 		 initialize this.  */
- 	      occr->copied_p = 0;
- 	    }
- 
- 	  /* While we're scanning the table, this is a good place to
- 	     initialize this.  */
- 	  expr->reaching_reg = 0;
- 	}
-     }
- }
- 
  /* Compute expression availability at entrance and exit of each block.  */
  
  static void
--- 3999,4004 ----
*************** compute_pre_ppinout ()
*** 4337,4343 ****
  static void
  compute_pre_data ()
  {
!   compute_pre_local_properties ();
    compute_pre_avinout ();
    compute_pre_antinout ();
    compute_pre_pavinout ();
--- 4264,4270 ----
  static void
  compute_pre_data ()
  {
!   compute_local_properties (pre_transp, pre_comp, pre_antloc, 0);
    compute_pre_avinout ();
    compute_pre_antinout ();
    compute_pre_pavinout ();


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