2014-01-07 Jakub Jelinek <jakub@redhat.com>
+ PR rtl-optimization/58668
+ * cfgcleanup.c (flow_find_cross_jump): Don't count
+ any jumps if dir_p is NULL. Remove p1 variable, use active_insn_p
+ to determine what is counted.
+ (flow_find_head_matching_sequence): Use active_insn_p to determine
+ what is counted.
+ (try_head_merge_bb): Adjust for the flow_find_head_matching_sequence
+ counting change.
+ * ifcvt.c (count_bb_insns): Use active_insn_p && !JUMP_P to
+ determine what is counted.
+
PR tree-optimization/59643
* tree-predcom.c (split_data_refs_to_components): If one dr is
read and one write, determine_offset fails and the write isn't
{
rtx i1, i2, last1, last2, afterlast1, afterlast2;
int ninsns = 0;
- rtx p1;
enum replace_direction dir, last_dir, afterlast_dir;
bool follow_fallthru, did_fallthru;
|| (returnjump_p (i2) && !side_effects_p (PATTERN (i2))))
{
last2 = i2;
- /* Count everything except for unconditional jump as insn. */
- if (!simplejump_p (i2) && !returnjump_p (i2) && last1)
+ /* Count everything except for unconditional jump as insn.
+ Don't count any jumps if dir_p is NULL. */
+ if (!simplejump_p (i2) && !returnjump_p (i2) && last1 && dir_p)
ninsns++;
i2 = PREV_INSN (i2);
}
last1 = i1, last2 = i2;
afterlast_dir = last_dir;
last_dir = dir;
- p1 = PATTERN (i1);
- if (!(GET_CODE (p1) == USE || GET_CODE (p1) == CLOBBER))
+ if (active_insn_p (i1))
ninsns++;
}
beforelast1 = last1, beforelast2 = last2;
last1 = i1, last2 = i2;
- ninsns++;
+ if (active_insn_p (i1))
+ ninsns++;
}
if (i1 == BB_END (bb1) || i2 == BB_END (bb2)
max_match--;
if (max_match == 0)
return false;
- do
- e0_last_head = prev_real_insn (e0_last_head);
- while (DEBUG_INSN_P (e0_last_head));
+ e0_last_head = prev_active_insn (e0_last_head);
}
if (max_match == 0)
basic_block merge_bb = EDGE_SUCC (bb, ix)->dest;
rtx head = BB_HEAD (merge_bb);
- while (!NONDEBUG_INSN_P (head))
- head = NEXT_INSN (head);
+ if (!active_insn_p (head))
+ head = next_active_insn (head);
headptr[ix] = head;
currptr[ix] = head;
/* Compute the end point and live information */
for (j = 1; j < max_match; j++)
- do
- head = NEXT_INSN (head);
- while (!NONDEBUG_INSN_P (head));
+ head = next_active_insn (head);
simulate_backwards_to_point (merge_bb, live, head);
IOR_REG_SET (live_union, live);
}