Question on multiplied address cost computation in ivopt
Richard Biener
richard.guenther@gmail.com
Mon Feb 25 09:39:00 GMT 2013
On Fri, Feb 22, 2013 at 9:42 AM, Bin.Cheng <amker.cheng@gmail.com> wrote:
> Hi,
> Function get_address_cost in ivopt computes multiplied address cost
> with below code:
>
> First:
> rat = 1;
> for (i = 2; i <= MAX_RATIO; i++)
> if (multiplier_allowed_in_address_p (i, mem_mode, as))
> {
> rat = i;
> break;
> }
>
> Then:
> if (rat_p)
> addr = gen_rtx_fmt_ee (MULT, address_mode, addr,
> gen_int_mode (rat, address_mode));
>
> What's the purpose of first iteration? It just finds the first allowed
> ratio in address, causing the generated ADDR always has the minimal
> allowed ratio. Is it right?
Looks like so.
> For target doesn't support multiplied address, the generated ADDR is:
> (MULT reg, 1). The cost generally is equal to address with pure
> register. What's the meaning of this cost?
Look at its uses.
Richard.
> Thanks very much.
>
>
> --
> Best Regards.
More information about the Gcc
mailing list