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]

Re: Patch to make get_condition more flexible.



  In message <200002140554.AAA11553@jwlab.FEITH.COM>you write:
  > This patch allows get_condition to be used to canonize conditions
  > for conditional moves and store conditions.  This is used by value
  > range propagation.
  > 
  > ChangeLog:
  > 
  > Sun Feb 13 11:55:34 EST 2000  John Wehle  (john@feith.com)
  > 
  > 	* loop.c (get_condition): New argument COND.
  > 	(check_dbra_loop, get_condition_for_loop): Update
  > 	for new argument to get_condition.
  > 	* gcse.c (delete_null_pointers_check_1,
  > 	delete_null_pointers_check): Likewise.
  > 	* jump.c (jump_optimize_1): Likewise.
  > 	* predict.c (estimate_probability): Likewise.
  > 	* expr.h (get_condition): Update prototype.
Instead I would break out the canonicalization code into its own function,
then have get_condition and the value range propagation call the
canonicalization code.

It just seems conceptually cleaner.

This comment also seems rather odd:

! /* Given an INSN and condition, return a canonical description of the
!    test being made.  NULL_RTX may be used as the condition in the case
!    of a JUMP_INSN.  */
! extern rtx get_condition PARAMS ((rtx, rtx, rtx *));
  

On some targets the condition is in the jump insn itself.


The comment before get_condition seems strange now too:

!    COND can be NULL_RTX if INSN is a jump insn in which case the condition
!    that will cause INSN to branch to its JUMP_LABEL will be returned.
!    If the condition cannot be understood, or is an inequality floating-point
!    comparison which needs to be reversed, 0 will be returned.

It really seems like you're trying to overload additional functionality
in get_condition when instead we should be providing a new function which
shares common subroutines with get_condition.

jeff


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