[rtlanal] Do a better job of costing parallel sets containing flag-setting operations.

Richard Earnshaw (lists) Richard.Earnshaw@arm.com
Mon Jun 19 16:01:00 GMT 2017


On 19/06/17 16:09, Segher Boessenkool wrote:
> On Mon, Jun 19, 2017 at 03:45:23PM +0100, Richard Earnshaw (lists) wrote:
>>>> At present all such insns are treated as having unknown cost (ie 0) and
>>>> combine assumes that such insns are infinitely more expensive than any
>>>> other insn sequence with a non-zero cost.
>>>
>>> That's not what combine does: it optimistically assumes any combination
>>> with unknown costs is an improvement.
>>
>> Actually the logic is
>>
>>   int reject = old_cost > 0 && new_cost > old_cost;
>>
>> So reject will never be true if old cost is zero.
> 
> Yes, exactly; and neither if new_cost is zero.  If any cost is unknown
> combine just hopes for the best.
> 
> 
> Segher
> 

Yeah, and I'm not suggesting we change the logic there (sorry if the
description was misleading).  Instead I'm proposing that we handle more
cases for parallels to not return zero.

R.



More information about the Gcc-patches mailing list