aboutsummaryrefslogtreecommitdiff
path: root/gcc/dojump.c
diff options
context:
space:
mode:
authorEaswaran Raman <eraman@google.com>2012-10-16 05:28:08 +0000
committerEaswaran Raman <eraman@google.com>2012-10-16 05:28:08 +0000
commit301498c17365c8497e19652764b94f65171c340c (patch)
tree73e706f18d0cfa88bafa5eb814ff70dbc3d9885c /gcc/dojump.c
parent5885dfeabdf7f96c268f3b2ba464f2a857b044bf (diff)
2012-10-15 Easwaran Raman <eraman@google.com>
* optabs.c (emit_cmp_and_jump_insn_1): Add a new parameter to specificy the probability of taking the jump. (emit_cmp_and_jump_insns): Likewise. (expand_compare_and_swap_loop): Make the jump predicted not taken. * dojump.c (do_compare_rtx_and_jump): Remove the code attaching REG_BR_PROB note and pass probability to emit_cmp_and_jump_insns. * cfgbuild.c (compute_outgoing_frequencies): Do not guess outgoing probabilities for branches with more than two successors. * expr.c (emit_block_move_via_loop): Predict the loop backedge loop to be highly taken. (try_casesi): Pass the probability of jumping to the default label. (try_tablejump): Likewise. (do_tablejump): Likewise. * expr.h (try_tablejump): Add a new parameter. (try_casesi): Likewise. (emit_cmp_and_jump_insns): Add probability as default parameter with a default value of -1. * except.c (sjlj_emit_function_enter): Pass probability to emit_cmp_and_jump_insns. * stmt.c (case_node): Add new fields PROB and SUBTREE_PROB. (do_jump_if_equal): Pass probability for REG_BR_PROB note. (add_case_node): Pass estimated probability of jumping to the case label. (emit_case_decision_tree): Pass default_prob to emit_case_nodes. (get_outgoing_edge_probs): New function. (conditional_probability): Likewise. (reset_out_edges_aux): Likewise. (compute_cases_per_edge): Likewise. (emit_case_dispatch_table): Update probabilities of edges coming out of the switch statement. (expand_case): Compute and propagate default edge probability to emit_case_dispatch_table. (expand_sjlj_dispatch_table): Update calls to add_case_node and emit_case_dispatch_table. (balance_case_nodes): Update subtree_prob values. (emit_case_nodes): Compute edge probabilities and add pass them to emit_cmp_and_jump_insns. testsuite/ChangeLog: 2012-10-15 Easwaran Raman <eraman@google.com> * gcc.dg/tree-prof/switch-case-1.c: New test case. * gcc.dg/tree-prof/switch-case-2.c: New test case. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@192488 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dojump.c')
-rw-r--r--gcc/dojump.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/gcc/dojump.c b/gcc/dojump.c
index 66d3b04bd03..35cb2cf62eb 100644
--- a/gcc/dojump.c
+++ b/gcc/dojump.c
@@ -886,7 +886,6 @@ do_compare_rtx_and_jump (rtx op0, rtx op1, enum rtx_code code, int unsignedp,
{
rtx tem;
rtx dummy_label = NULL_RTX;
- rtx last;
/* Reverse the comparison if that is safe and we want to jump if it is
false. Also convert to the reverse comparison if the target can
@@ -1069,25 +1068,8 @@ do_compare_rtx_and_jump (rtx op0, rtx op1, enum rtx_code code, int unsignedp,
}
}
- last = get_last_insn ();
emit_cmp_and_jump_insns (op0, op1, code, size, mode, unsignedp,
- if_true_label);
- if (prob != -1 && profile_status != PROFILE_ABSENT)
- {
- for (last = NEXT_INSN (last);
- last && NEXT_INSN (last);
- last = NEXT_INSN (last))
- if (JUMP_P (last))
- break;
- if (last
- && JUMP_P (last)
- && ! NEXT_INSN (last)
- && any_condjump_p (last))
- {
- gcc_assert (!find_reg_note (last, REG_BR_PROB, 0));
- add_reg_note (last, REG_BR_PROB, GEN_INT (prob));
- }
- }
+ if_true_label, prob);
}
if (if_false_label)