This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH to hoist loads/stores out of loops
On Tue, Jul 21, 1998 at 07:29:15AM -0700, Mark Mitchell wrote:
> I don't quite understand your patch, though. You set num_times_set to
> zero, but the new reg (the contents of the MEM) could be set more than
> once.
You are right. It must have been late...
> Also, now that you're loading MEMs so late, we won't see biv/givs
> involving the contents of MEMs?
Sure we will -- strength_reduce is still run after loop_mems.
> I would have expected that after the call to load_mems, my code would
> have recalculated n_times_set, and that it would be 0 for the base reg.
> Why isn't it?
Well mostly cause I didn't copy the n_times_set recalc to the end of
the function. And there was some distinct lack of thought that decided
to init it to 0.
It seems like replace_loop_mem ought to be able to come up with a
number for our one register, rather than having to do a general
recalculation, but we need context info from the containing rtx.
Perhaps for_each_rtx ought to also pass in the containing rtx?
r~