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

Reply via email to