This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Improve cost computation in ivopts
- From: Roger Sayle <roger at eyesopen dot com>
- To: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- Cc: gcc-patches at gcc dot gnu dot org, David Edelsohn <dje at watson dot ibm dot com>
- Date: Wed, 10 Nov 2004 06:51:37 -0700 (MST)
- Subject: Re: [patch] Improve cost computation in ivopts
On Tue, 9 Nov 2004, Zdenek Dvorak wrote:
>
> * fold-const.c (fold): Attempt to use ptr_difference_const whenever
> one of the arguments of MINUS_EXPR is an address.
> (get_core): New function.
> (ptr_difference_const): Handle case when one of the operands is a
> pointer.
> * tree-ssa-loop-ivopts.c (determine_base_object): Fold &*addr.
> (ptr_difference_cost): Pass addresses instead of objects to
> ptr_difference_const.
This is OK for mainline. The fold-const.c parts are correct and the
tree-ssa-loop-ivopts.c changes look obvious once the first bits are
approved. My one suggestion is that "get_core" is a rather cryptic
function name (and it has nothing to do with memory allocation :),
perhaps get_inner_reference_2 would be an improvement?
Thanks.
Roger
--