> On May 23, 2018, at 5:46 AM, Richard Biener <richard.guent...@gmail.com> 
> wrote:
> 
> ...
> 
>> 2. The reported costs for the various insns are
>>         r22:HI=['x']            6
>>         cmp(r22:HI,r23:HI)      4
>>         cmp(['x'],['y'])        16
>>    so the added cost for the memory argument in the cmp is 6 -- the same
>> as the whole cost for the mov.  That certainly explains the behavior.  It
>> isn't what I want it to be.  Which target hook(s) are involved in these
>> numbers?  I don't see them in my rtx_costs hook.
> 
> The rtx_cost hook.   I think the costs above make sense.  There's also a
> new insn_cost hook but you have to dig whether combine uses that.
> Otherwise address_cost might be involved.

Thanks.  For a pdp11, those costs aren't right because mov and cmp and 
a memory reference each have about the same cost.  So 8, 4, 12 would be 
closer.  But the real question for me at this point is where to find
the knobs that adjust these choices.

The various cost hooks have me confused, and the GCCINT manual is not
really enlightening.  There is rtx_costs, insn_cost, and addr_cost.
It sort of feels like insn_cost and addr_cost together would provide 
roughly the same information that rtx_costs gives.  In the existing 
platforms, I see rtx_costs everywhere, addr_cost in a fair number of
targets, and insn_cost in just one (rs6000).  Can someone explain the
interaction of these various cost hooks, and what happens if you define
various combinations of the three?

        paul


Reply via email to