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]

[bitmaps] Some more renaming


This patch depends on my 'Early terminating equal_p and intersection_p'
patch.

It renames bitmap_union_of_diff to bitmap_ior_and_compl so that it is
consistent with bitmap_ior_and_compl_into.  I also change the bitmap
operations so that they do not return a 'changed' flag, as (apart from
bitmap_ior_and_compl{,_into}) it is no longer necessary with the intersect_p
operator patch.

This patch has no functional changes.  It'll allow a simpler implementation
of the bitmap operators.

booted & tested on i686-pc-linux-gnu, ok?

nathan
--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk

2004-11-01  Nathan Sidwell  <nathan@codesourcery.com>

	* bitmap.h (bitmap_and, bitmap_and_into, bitmap_and_compl,
	bitmap_and_compl_into, bitmap_ior, bitmap_iot_into,
	bitmap_ior_compl, bitmap_xor, bitmap_xor_into): Produce void.
	(bitmap_ior_and_compl_into): Produce bool.
	(bitmap_union_of_diff): Rename to ...
	(bitmap_ior_and_compl): ... here. Produce bool.
	* bitmap.c (bitmap_ior_and_compl_into): Return bool. Use
	bitmap_operation directly.
	(bitmap_union_of_diff): Rename to ...
	(bitmap_ior_and_compl): ... here. Return bool, use
	bitmap_operation directly.
	* df.c (df_rd_transfer_function): Use bitmap_ior_and_compl.
	(df_ru_transfer_function, df_lr_transfer_function): Likewise.
	* global.c (modify_bb_reg_pav): Likewise.

Index: bitmap.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/bitmap.c,v
retrieving revision 1.54
diff -c -3 -p -r1.54 bitmap.c
*** bitmap.c	29 Oct 2004 08:40:53 -0000	1.54
--- bitmap.c	1 Nov 2004 15:09:36 -0000
*************** bitmap_equal_p (bitmap a, bitmap b)
*** 678,687 ****
    return ret;
  }
  
! /* Or into bitmap TO bitmap FROM1 and'ed with the complement of
!    bitmap FROM2.  */
  
! int
  bitmap_ior_and_compl_into (bitmap to, bitmap from1, bitmap from2)
  {
    bitmap_head tmp;
--- 713,721 ----
    return ret;
  }
  
! /* Produce TO |= FROM1 & ~FROM2.  Return true, if TO changed.  */
  
! bool
  bitmap_ior_and_compl_into (bitmap to, bitmap from1, bitmap from2)
  {
    bitmap_head tmp;
*************** bitmap_ior_and_compl_into (bitmap to, bi
*** 691,703 ****
    tmp.using_obstack = 0;
  
    bitmap_and_compl (&tmp, from1, from2);
!   changed = bitmap_ior_into (to, &tmp);
    bitmap_clear (&tmp);
    return changed;
  }
  
! int
! bitmap_union_of_diff (bitmap dst, bitmap a, bitmap b, bitmap c)
  {
    bitmap_head tmp;
    int changed;
--- 725,739 ----
    tmp.using_obstack = 0;
  
    bitmap_and_compl (&tmp, from1, from2);
!   changed = bitmap_operation (to, to, &tmp, BITMAP_IOR);
    bitmap_clear (&tmp);
    return changed;
  }
  
! /* Produce DST = A | (B & ~C).  Return true if DST != A.  */
! 
! bool
! bitmap_ior_and_compl (bitmap dst, bitmap a, bitmap b, bitmap c)
  {
    bitmap_head tmp;
    int changed;
*************** bitmap_union_of_diff (bitmap dst, bitmap
*** 706,712 ****
    tmp.using_obstack = 0;
  
    bitmap_and_compl (&tmp, b, c);
!   changed = bitmap_ior (dst, &tmp, a);
    bitmap_clear (&tmp);
  
    return changed;
--- 742,748 ----
    tmp.using_obstack = 0;
  
    bitmap_and_compl (&tmp, b, c);
!   changed = bitmap_operation (dst, a, &tmp, BITMAP_IOR);
    bitmap_clear (&tmp);
  
    return changed;
Index: bitmap.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/bitmap.h,v
retrieving revision 1.39
diff -c -3 -p -r1.39 bitmap.h
*** bitmap.h	29 Oct 2004 08:40:53 -0000	1.39
--- bitmap.h	1 Nov 2004 15:09:38 -0000
*************** extern int bitmap_equal_p (bitmap, bitma
*** 92,110 ****
  /* Perform an operation on two bitmaps, yielding a third.  */
  extern int bitmap_operation (bitmap, bitmap, bitmap, enum bitmap_bits);
  
! #define bitmap_and(DST,A,B) bitmap_operation (DST,A,B,BITMAP_AND)
! #define bitmap_and_into(DST_SRC,B) bitmap_operation (DST_SRC,DST_SRC,B,BITMAP_AND)
! #define bitmap_and_compl(DST,A,B) bitmap_operation (DST,A,B,BITMAP_AND_COMPL)
! #define bitmap_and_compl_into(DST_SRC,B) bitmap_operation (DST_SRC,DST_SRC,B,BITMAP_AND_COMPL)
! #define bitmap_ior(DST,A,B) bitmap_operation (DST,A,B,BITMAP_IOR)
! #define bitmap_ior_into(DST_SRC,B) bitmap_operation (DST_SRC,DST_SRC,B,BITMAP_IOR)
! #define bitmap_ior_compl(DST,A,B) bitmap_operation (DST,A,B,BITMAP_IOR_COMPL)
! #define bitmap_xor(DST,A,B) bitmap_operation (DST,A,B,BITMAP_XOR)
! #define bitmap_xor_into(DST_SRC,B) bitmap_operation (DST_SRC,DST_SRC,B,BITMAP_XOR)
  
  /* `or' into one bitmap the `and' of a second bitmap witih the complement
     of a third. Return nonzero if the bitmap changes. */
! extern int bitmap_ior_and_compl_into (bitmap, bitmap, bitmap);
  
  /* Clear a single register in a register set.  */
  extern void bitmap_clear_bit (bitmap, int);
--- 92,111 ----
  /* Perform an operation on two bitmaps, yielding a third.  */
  extern int bitmap_operation (bitmap, bitmap, bitmap, enum bitmap_bits);
  
! #define bitmap_and(DST,A,B) (void)bitmap_operation (DST,A,B,BITMAP_AND)
! #define bitmap_and_into(DST_SRC,B) (void)bitmap_operation (DST_SRC,DST_SRC,B,BITMAP_AND)
! #define bitmap_and_compl(DST,A,B) (void)bitmap_operation (DST,A,B,BITMAP_AND_COMPL)
! #define bitmap_and_compl_into(DST_SRC,B) (void)bitmap_operation (DST_SRC,DST_SRC,B,BITMAP_AND_COMPL)
! #define bitmap_ior(DST,A,B) (void)bitmap_operation (DST,A,B,BITMAP_IOR)
! #define bitmap_ior_into(DST_SRC,B) (void)bitmap_operation (DST_SRC,DST_SRC,B,BITMAP_IOR)
! #define bitmap_ior_compl(DST,A,B) (void)bitmap_operation (DST,A,Br,BITMAP_IOR_COMPL)
! #define bitmap_xor(DST,A,B) (void)bitmap_operation (DST,A,B,BITMAP_XOR)
! #define bitmap_xor_into(DST_SRC,B) (void)bitmap_operation (DST_SRC,DST_SRC,B,BITMAP_XOR)
  
  /* `or' into one bitmap the `and' of a second bitmap witih the complement
     of a third. Return nonzero if the bitmap changes. */
! extern bool bitmap_ior_and_compl_into (bitmap, bitmap, bitmap);
! extern bool bitmap_ior_and_compl (bitmap, bitmap, bitmap, bitmap);
  
  /* Clear a single register in a register set.  */
  extern void bitmap_clear_bit (bitmap, int);
*************** extern void bitmap_release_memory (void)
*** 134,140 ****
  #define bitmap_zero(a) bitmap_clear (a)
  #define bitmap_a_or_b(a,b,c) bitmap_operation (a, b, c, BITMAP_IOR)
  #define bitmap_a_and_b(a,b,c) bitmap_operation (a, b, c, BITMAP_AND)
- extern int bitmap_union_of_diff (bitmap, bitmap, bitmap, bitmap);
  extern int bitmap_first_set_bit (bitmap);
  extern int bitmap_last_set_bit (bitmap);
  
--- 135,140 ----
Index: df.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/df.c,v
retrieving revision 1.74
diff -c -3 -p -r1.74 df.c
*** df.c	29 Oct 2004 08:40:54 -0000	1.74
--- df.c	1 Nov 2004 15:10:06 -0000
*************** df_rd_transfer_function (int bb ATTRIBUT
*** 1588,1594 ****
  			 void *out, void *gen, void *kill,
  			 void *data ATTRIBUTE_UNUSED)
  {
!   *changed = bitmap_union_of_diff (out, gen, in, kill);
  }
  
  
--- 1588,1594 ----
  			 void *out, void *gen, void *kill,
  			 void *data ATTRIBUTE_UNUSED)
  {
!   *changed = bitmap_ior_and_compl (out, gen, in, kill);
  }
  
  
*************** df_ru_transfer_function (int bb ATTRIBUT
*** 1597,1603 ****
  			 void *out, void *gen, void *kill,
  			 void *data ATTRIBUTE_UNUSED)
  {
!   *changed = bitmap_union_of_diff (in, gen, out, kill);
  }
  
  
--- 1597,1603 ----
  			 void *out, void *gen, void *kill,
  			 void *data ATTRIBUTE_UNUSED)
  {
!   *changed = bitmap_ior_and_compl (in, gen, out, kill);
  }
  
  
*************** df_lr_transfer_function (int bb ATTRIBUT
*** 1606,1612 ****
  			 void *out, void *use, void *def,
  			 void *data ATTRIBUTE_UNUSED)
  {
!   *changed = bitmap_union_of_diff (in, use, out, def);
  }
  
  
--- 1606,1612 ----
  			 void *out, void *use, void *def,
  			 void *data ATTRIBUTE_UNUSED)
  {
!   *changed = bitmap_ior_and_compl (in, use, out, def);
  }
  
  
Index: global.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/global.c,v
retrieving revision 1.112
diff -c -3 -p -r1.112 global.c
*** global.c	18 Oct 2004 15:11:28 -0000	1.112
--- global.c	1 Nov 2004 15:10:42 -0000
*************** modify_bb_reg_pav (basic_block bb, basic
*** 2307,2313 ****
    bb_pavout = bb_info->pavout;
    if (pred->index != ENTRY_BLOCK)
      bitmap_a_or_b (bb_pavin, bb_pavin, BB_INFO (pred)->pavout);
!   changed_p |= bitmap_union_of_diff (bb_pavout, bb_info->avloc,
  				     bb_pavin, bb_info->killed);
    return changed_p;
  }
--- 2307,2313 ----
    bb_pavout = bb_info->pavout;
    if (pred->index != ENTRY_BLOCK)
      bitmap_a_or_b (bb_pavin, bb_pavin, BB_INFO (pred)->pavout);
!   changed_p |= bitmap_ior_and_compl (bb_pavout, bb_info->avloc,
  				     bb_pavin, bb_info->killed);
    return changed_p;
  }

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