Re: [PATCH v3 1/7] ifcvt: Check if cmovs are needed.

2022-01-10 Thread Robin Dapp via Gcc-patches
Hi,

I included the outstanding minor remarks and believe everything is OK'ed
now.  Still posting the ChangeLogs that I omitted before continuing.
I'd expect some fallout on other targets (hopefully nothing major) since
rtx costs are handled differently now for this code path.

Regards
 Robin

--

gcc/ChangeLog:

* ifcvt.c (need_cmov_or_rewire): New function.
(noce_convert_multiple_sets): Call it.


Re: [PATCH v3 1/7] ifcvt: Check if cmovs are needed.

2021-12-08 Thread Jeff Law via Gcc-patches




On 12/6/2021 11:43 AM, Robin Dapp via Gcc-patches wrote:

When if-converting multiple SETs and we encounter a swap-style idiom

   if (a > b)
 {
   tmp = c;   // [1]
   c = d;
   d = tmp;
 }

ifcvt should not generate a conditional move for the instruction at
[1].

In order to achieve that, this patch goes through all relevant SETs
and marks the relevant instructions.  This helps to evaluate costs.

On top, only generate temporaries if the current cmov is going to
overwrite one of the comparands of the initial compare.
---
  gcc/ifcvt.c | 174 
  1 file changed, 150 insertions(+), 24 deletions(-)

OK.  Needs a ChangeLog entry though.

Jeff