This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: loop.c: n_times_set, n_times_used
- To: law at cygnus dot com
- Subject: Re: loop.c: n_times_set, n_times_used
- From: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Date: Tue, 15 Dec 1998 04:19:15 +0000 (GMT)
- Cc: amylaar at cygnus dot co dot uk, egcs-patches at cygnus dot com
>
> In message <199812111715.RAA06423@phal.cygnus.co.uk>you write:
> > This leaves only combine_givs_used_once as a prospective user of the
> > usage counts.
> Correct.
>
> > And the usage count check there is just overly conservative.
> Why did the original code restrict combination of givs to cases when the
> derived giv was only used once? Is it possible that the code doesn't
> handle cases where the derived giv is used more than once? Is is possible
> that in the case of a DEST_ADDR giv that the derived giv is cheaper to compute
> than the giv it is derived from?
I actually wrote the original check in 1996, as a part of combine_givs.
This was under the reign of Kenner, so I made the check - so I thought then -
fairly conservatives, while still doing what I wanted it to do.
Since n_times_used really holds the number of times the register is set
inside the loop, the check never worked correctly. Most giv registers
are set exactly once in the loop. The only exception are givs recognized
by consec_sets_giv, i.e. where you have stuff like
giv = biv * M
giv = giv + A