[gcc(refs/vendors/riscv/heads/gcc-15-with-riscv-opts)] ifcvt: Move noce_try_cond_zero_arith last
Jeff Law
law@gcc.gnu.org
Thu Jan 29 19:51:15 GMT 2026
https://gcc.gnu.org/g:1c46218ac75fd1f8b5af1f0f376b199ace9c431d
commit 1c46218ac75fd1f8b5af1f0f376b199ace9c431d
Author: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
Date: Tue Dec 23 13:30:00 2025 -0800
ifcvt: Move noce_try_cond_zero_arith last
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>
(cherry picked from commit ce55e48fc4ae41064b01e3241b17e6434fbaf07a)
Diff:
---
gcc/ifcvt.cc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/gcc/ifcvt.cc b/gcc/ifcvt.cc
index e305e3b4c575..2a8ccd0263ee 100644
--- a/gcc/ifcvt.cc
+++ b/gcc/ifcvt.cc
@@ -4407,14 +4407,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)
More information about the Gcc-cvs
mailing list