[PATCH, PR target/65103, 2/3] Propagate address constants into loops for i386

Ilya Enkovich enkovich.gnu@gmail.com
Wed Apr 15 11:07:00 GMT 2015


2015-04-14 8:22 GMT+03:00 Jeff Law <law@redhat.com>:
> On 03/15/2015 02:30 PM, Richard Sandiford wrote:
>>
>> Ilya Enkovich <enkovich.gnu@gmail.com> writes:
>>>
>>> This patch allows propagation of loop invariants for i386 if propagated
>>> value is a constant to be used in address operand.  Bootstrapped and
>>> tested on x86_64-unknown-linux-gnu.  OK for trunk or stage 1?
>>
>>
>> Is it necessary for this to be a target hook?  The concept doesn't seem
>> particularly target-specific.  We should only propagate into the address
>> if the new cost is no greater than the old cost, but if the address
>> meets that condition and if propagating at this point in the pipeline is
>> a win on x86, then wouldn't it be a win for other targets too?
>
> I agree with Richard here.  I can't see a strong reason why this should be a
> target hook.
>
> Perhaps part of the issue here is the address costing metrics may not have
> enough context to make good decisions.  In which case what context do they
> need?

At this point I don't insist on a target hook.  The main reasoning was
to not affect other targets. If we extend propagation for non constant
values different aspects may appear. E.g. possible register pressure
changes may significantly affect ia32. I just wanted to have an
instrument to play with a propagation on x86 not affecting other
targets. I don't have an opportunity to test possible performance
implications on non-x86 targets. Don't expect (significant)
regressions there but who knows...

I'll remove the hook from this patch. Will probably introduce it later
if some target specific cases are found.

Thanks,
Ilya

>
> Jeff



More information about the Gcc-patches mailing list