diff mbox series

[RFC,6/6] ifcvt: Fall through to NCE if getting the CE condition failed

Message ID alpine.LFD.2.21.2012031104450.656242@eddie.linux-mips.org
State Accepted
Headers show
Series Add missing calls to `onlyjump_p' | expand

Commit Message

Maciej W. Rozycki Dec. 3, 2020, 11:35 a.m. UTC
If getting the condition for conditional execution has failed then fall 
through and try the non-conditional execution approach instead rather 
than giving up with dead code elimination altogether, for a better code 
structure if nothing else.

The case may well now be that whenever `cond_exec_get_condition' fails 
`noce_get_condition' will as well, however in that case no change in 
semantics will result.  If they ever diverge, then someone will have to 
chase this place.

	gcc/
	* ifcvt.c (dead_or_predicable) [!IFCVT_MODIFY_TESTS]: Fall 
	through to the non-conditional execution case if getting the 
	condition for conditional execution has failed.
---
 gcc/ifcvt.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

Index: gcc/gcc/ifcvt.c
===================================================================
--- gcc.orig/gcc/ifcvt.c
+++ gcc/gcc/ifcvt.c
@@ -5134,7 +5134,7 @@  dead_or_predicable (basic_block test_bb,
 
       cond = cond_exec_get_condition (jump);
       if (! cond)
-	return FALSE;
+	goto nce;
 
       rtx note = find_reg_note (jump, REG_BR_PROB, NULL_RTX);
       profile_probability prob_val