[PATCH 3/7] ifcvt: Improve costs handling for noce_convert_multiple.
Robin Dapp
rdapp@linux.ibm.com
Thu Jul 22 12:07:04 GMT 2021
> It looks like this is an existing (potential) problem,
> but default_noce_conversion_profitable_p uses seq_cost, which in turn
> uses insn_cost. And insn_cost has an optional target hook behind it,
> which allows for costing based on insn attributes etc. For a true
> apples-with-apples comparison we should use insn_cost here too.
Good point, fixed that.
> I think the detail that COSTS_N_INSNS (2) is the default is useful here.
> (In other words, I'd forgotten by the time I'd poked around other bits of
> ifcvt and was about to ask why we didn't cost the condition “properly”.)
> So how about something like:
>
> The original costs already include a base cost of COSTS_N_INSNS (2):
> one instruction for the compare (which we will be needing either way)
> and one instruction for the branch.
Yes, this is much clearer. I went with that wording in the attached v2.
Regards
Robin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v2-0003-ifcvt-Improve-costs-handling-for-noce_convert_mul.patch
Type: text/x-patch
Size: 3851 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210722/b3ed04c4/attachment.bin>
More information about the Gcc-patches
mailing list