ifcvt: Improve costs handling for noce_convert_multiple.
authorRobin Dapp <rdapp@linux.ibm.com>
Wed, 27 Nov 2019 12:46:17 +0000 (13:46 +0100)
committerRobin Dapp <rdapp@linux.ibm.com>
Wed, 19 Jan 2022 17:34:10 +0000 (18:34 +0100)
commit46346d8d76c24bd07a30cb2c367e34601efabfef
tree46c1ed9744d972dde2ea4dfcbf04ed8f7c71b556
parent9b8eaa282250ad260e01d164093b597579db00d9
ifcvt: Improve costs handling for noce_convert_multiple.

When noce_convert_multiple is called the original costs are not yet
initialized.  Therefore, up to now, costs were only ever unfairly
compared against COSTS_N_INSNS (2).  This would lead to
default_noce_conversion_profitable_p () rejecting all but the most
contrived of sequences.

This patch temporarily initializes the original costs by counting
adding costs for all sets inside the then_bb.

gcc/ChangeLog:

* ifcvt.cc (bb_ok_for_noce_convert_multiple_sets): Estimate insns costs.
(noce_process_if_block): Use potential costs.
gcc/ifcvt.cc