While trying to fix PR 123308, I found a few cleanups/fixes that should be done
to noce_try_cond_zero_arith. The first one is a small cleanup and removes some
questionable code of swapping a shared structure. The second one is the fix
for PR123308 (which I had submitted before but was broken due to not realizing 
cond
was not the correct thing to use, that has been fixed and improved with the 
previous
patch).
The last patch is remove the check against 0 since the code already removed the 
check
against comparisons this one remove the check against 0 which allows for `a > 
10 ? b + c : b`
to be optimized.


Andrew Pinski (3):
  ifcvt: cleanup if_info->cond usage in noce_try_cond_zero_arith
  ifcvt: Handle lowpart subregs if noce_emit_cmove fails in
    noce_try_cond_zero_arith [PR123308]
  ifcvt: Allow non-comparisons against 0 in noce_try_cond_zero_arith

 gcc/ifcvt.cc | 42 ++++++++++++++++++++++++++++++++----------
 1 file changed, 32 insertions(+), 10 deletions(-)

-- 
2.43.0

Reply via email to