ifcvt: Try re-using CC for conditional moves.
authorRobin Dapp <rdapp@linux.ibm.com>
Wed, 19 Jan 2022 16:36:36 +0000 (17:36 +0100)
committerRobin Dapp <rdapp@linux.ibm.com>
Wed, 19 Jan 2022 17:37:46 +0000 (18:37 +0100)
commitaa8cfe785953a0e87d2472311e1260cd98c605c0
treeba5b2184bed0346bce310990806697d55d8eb380
parente9ebb86799fd77cdd5351078230c114a90e66066
ifcvt: Try re-using CC for conditional moves.

Following up on the previous patch, this patch makes
noce_convert_multiple emit two cmov sequences:  The same one as before
and a second one that tries to re-use the existing CC.  Then their costs
are compared and the cheaper one is selected.

gcc/ChangeLog:

* ifcvt.cc (cond_exec_get_condition): New parameter to allow getting the
reversed comparison.
(try_emit_cmove_seq): New function to facilitate creating a cmov
sequence.
(noce_convert_multiple_sets): Create two sequences and use the less
expensive one.
gcc/ifcvt.cc