This is the mail archive of the
mailing list for the GCC project.
Re: Array prefetch patch take 3
On Tue, Dec 11, 2001 at 07:19:46PM +0100, Jan Hubicka wrote:
> + /* We don't want to return 1 if X is a MEM that contains a register
> + within REG_SET_REG. */
> + if ((GET_CODE (x) == MEM) && rtx_equal_p (d->mem_address, XEXP (x, 0)))
> + d->mem_write = 1;
The comment doesn't match the code. Cut and paste-o?
> + /* Like rtx_equal_p, but attempts to swap commutative operands. This is
> + important to get some addresses combined. Later more sophisticated
> + transformations can be added when necesary.
Is this _really_ needed? I'd hope that commutative operands were
canonicalized. If the problem case is merely reg+reg, perhaps we
can instead extend swap_commutative_operands_p to look at REGNO
> + static int
> + remove_constant_addition (x)
Must be HOST_WIDE_INT to avoid truncating the value.
> + "Prefetch: ignoring loop - not enought iterations.\n");
> + /* Attempt to calculate the number of bytes fetched by the loop. */
> + if (LOOP_INFO (loop)->n_iterations
> + && LOOP_INFO (loop)->n_iterations < 200)
> + info[i].total_bytes = info[i].stride * LOOP_INFO (loop)->n_iterations;
Why the 200? Yes, I can see that you'd like to not overflow, but
if (LOOP_INFO (loop)->n_iterations
&& (0xffffffff / info[i].stride) >= LOOP_INFO (loop)->n_iterations)