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]

Minor combine.c change




This is in preparation for another change I'm working on.

Right now we do not have any toplevel routine we can call to simplify an
arbitrary rtx expression.

Yes, you read that correctly.

Instead we have simplify_binary_operation, simplify_unary_operation, etc etc.

What I want (and need) is a generic simplify_rtx that can be called on an
arbitrary rtx expression at an arbitrary time in the compiler -- ie it must
not depend pass specific state.   cse.c::fold_rtx & combine.c::simplify_rtx
exist, but are not useable because of pass specific state dependencies.

The natural name for this routine is simplify_rtx, but that's already taken
as a file static function in combine.c.

The easiest thing to do is rename the combine.c function so that we can have
a sanely named generic routine for simplifying rtx expressions.

	* combine.c (combine_simplify_rtx): Renamed from simplify_rtx.  All
	references/callers changed.

Index: combine.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/combine.c,v
retrieving revision 1.87
diff -c -3 -p -r1.87 combine.c
*** combine.c	1999/10/27 19:27:40	1.87
--- combine.c	1999/10/31 17:34:57
*************** static rtx try_combine		PROTO((rtx, rtx,
*** 362,368 ****
  static void undo_all		PROTO((void));
  static rtx *find_split_point	PROTO((rtx *, rtx));
  static rtx subst		PROTO((rtx, rtx, rtx, int, int));
! static rtx simplify_rtx		PROTO((rtx, enum machine_mode, int, int));
  static rtx simplify_if_then_else  PROTO((rtx));
  static rtx simplify_set		PROTO((rtx));
  static rtx simplify_logical	PROTO((rtx, int));
--- 362,368 ----
  static void undo_all		PROTO((void));
  static rtx *find_split_point	PROTO((rtx *, rtx));
  static rtx subst		PROTO((rtx, rtx, rtx, int, int));
! static rtx combine_simplify_rtx	PROTO((rtx, enum machine_mode, int, int));
  static rtx simplify_if_then_else  PROTO((rtx));
  static rtx simplify_set		PROTO((rtx));
  static rtx simplify_logical	PROTO((rtx, int));
*************** subst (x, from, to, in_dest, unique_copy
*** 3248,3254 ****
        /* If X is sufficiently simple, don't bother trying to do anything
  	 with it.  */
        if (code != CONST_INT && code != REG && code != CLOBBER)
! 	x = simplify_rtx (x, op0_mode, i == 3, in_dest);
  
        if (GET_CODE (x) == code)
  	break;
--- 3248,3254 ----
        /* If X is sufficiently simple, don't bother trying to do anything
  	 with it.  */
        if (code != CONST_INT && code != REG && code != CLOBBER)
! 	x = combine_simplify_rtx (x, op0_mode, i == 3, in_dest);
  
        if (GET_CODE (x) == code)
  	break;
*************** subst (x, from, to, in_dest, unique_copy
*** 3272,3278 ****
     X is returned; IN_DEST is nonzero if we are inside a SET_DEST.  */
  
  static rtx
! simplify_rtx (x, op0_mode, last, in_dest)
       rtx x;
       enum machine_mode op0_mode;
       int last;
--- 3272,3278 ----
     X is returned; IN_DEST is nonzero if we are inside a SET_DEST.  */
  
  static rtx
! combine_simplify_rtx (x, op0_mode, last, in_dest)
       rtx x;
       enum machine_mode op0_mode;
       int last;



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