]> git.feebdaed.xyz Git - 0xmirror/gcc.git/commitdiff
ifcvt: Move noce_try_cond_zero_arith last
authorAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Tue, 23 Dec 2025 21:30:00 +0000 (13:30 -0800)
committerAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Wed, 24 Dec 2025 01:45:27 +0000 (17:45 -0800)
I noticed that on x86_64 and aarch64, noce_try_cond_zero_arith
would produce worse code than noce_try_cmove_arith.
So we should do noce_try_cond_zero_arith last instead
of before noce_try_cmove_arith.

Pushed as obvious after bootstrap/test on x86_64-linux-gnu.
Also checked to make sure riscv testcases still work.

gcc/ChangeLog:

* ifcvt.cc (noce_process_if_block): Move noce_try_cond_zero_arith
last.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
gcc/ifcvt.cc

index 75d959f652c58ef85d00958123d9e48203f66e90..97033aad482c09994fc537f445613507f2fb1627 100644 (file)
@@ -4404,14 +4404,14 @@ noce_process_if_block (struct noce_if_info *if_info)
        goto success;
       if (noce_try_store_flag_mask (if_info))
        goto success;
-      if (HAVE_conditional_move
-          && noce_try_cond_zero_arith (if_info))
-       goto success;
       if (HAVE_conditional_move
          && noce_try_cmove_arith (if_info))
        goto success;
       if (noce_try_sign_mask (if_info))
        goto success;
+      if (HAVE_conditional_move
+          && noce_try_cond_zero_arith (if_info))
+       goto success;
     }
 
   if (!else_bb && set_b)