This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 1/2] Add support for IVOPT
Richard Sandiford <richard.sandiford@arm.com> writes:
> kugan.vivekanandarajah@linaro.org writes:
>> + parts.step = wide_int_to_tree (sizetype, fact);
>> + /* Addressing mode "base + index << scale". */
>> + addr = addr_for_mem_ref (&parts, as, false);
>> + unsigned new_cost = address_cost (addr, mem_mode, as, speed);
>> + if (new_cost < cost)
>
> I think it'd be worth splitting the guts of this check out into a helper,
> since it's something that could be reusable. Maybe:
>
> unsigned int preferred_mem_scalar_factor (machine_mode);
>
> with the only supported values for now being 1 and GET_MODE_INNER_SIZE.
> (Could be extended later if a target needs it.)
Er, I did of course mean "scale_factor" :-)