aboutsummaryrefslogtreecommitdiff
path: root/gcc/ifcvt.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ifcvt.c')
-rw-r--r--gcc/ifcvt.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index ca5221a5821..c8a07e23b40 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -2783,6 +2783,20 @@ find_if_case_1 (basic_block test_bb, edge then_edge, edge else_edge)
edge then_succ = then_bb->succ;
int then_bb_index;
+ /* APPLE LOCAL begin hot/cold partitioning */
+ /* If we are partitioning hot/cold basic blocks, we don't want to
+ mess up unconditional or indirect jumps that cross between hot
+ and cold sections. */
+
+ if (flag_reorder_blocks_and_partition
+ && ((BB_END (then_bb)
+ && find_reg_note (BB_END (then_bb), REG_CROSSING_JUMP, NULL_RTX))
+ || (BB_END (else_bb)
+ && find_reg_note (BB_END (else_bb), REG_CROSSING_JUMP,
+ NULL_RTX))))
+ return FALSE;
+ /* APPLE LOCAL end hot/cold partitioning */
+
/* THEN has one successor. */
if (!then_succ || then_succ->succ_next != NULL)
return FALSE;
@@ -2851,6 +2865,20 @@ find_if_case_2 (basic_block test_bb, edge then_edge, edge else_edge)
edge else_succ = else_bb->succ;
rtx note;
+ /* APPLE LOCAL begin hot/cold partitioning */
+ /* If we are partitioning hot/cold basic blocks, we don't want to
+ mess up unconditional or indirect jumps that cross between hot
+ and cold sections. */
+
+ if (flag_reorder_blocks_and_partition
+ && ((BB_END (then_bb)
+ && find_reg_note (BB_END (then_bb), REG_CROSSING_JUMP, NULL_RTX))
+ || (BB_END (else_bb)
+ && find_reg_note (BB_END (else_bb), REG_CROSSING_JUMP,
+ NULL_RTX))))
+ return FALSE;
+ /* APPLE LOCAL end hot/cold partitioning */
+
/* ELSE has one successor. */
if (!else_succ || else_succ->succ_next != NULL)
return FALSE;
@@ -3195,8 +3223,12 @@ if_convert (int x_life_data_ok)
num_true_changes = 0;
life_data_ok = (x_life_data_ok != 0);
- if (! (* targetm.cannot_modify_jumps_p) ())
+ /* APPLE LOCAL begin hot/cold partitioning */
+ if ((! (* targetm.cannot_modify_jumps_p) ())
+ && (!flag_reorder_blocks_and_partition || !no_new_pseudos
+ || !targetm.have_named_sections))
mark_loop_exit_edges ();
+ /* APPLE LOCAL end hot/cold partitioning */
/* Free up basic_block_for_insn so that we don't have to keep it
up to date, either here or in merge_blocks. */