From a4da41e1279cf8bf84fc0a0d4e3af5c5e297c011 Mon Sep 17 00:00:00 2001 From: Easwaran Raman Date: Tue, 16 Oct 2012 05:28:08 +0000 Subject: [multiple changes] 2012-10-15 Easwaran Raman * 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 * gcc.dg/tree-prof/switch-case-1.c: New test case. * gcc.dg/tree-prof/switch-case-2.c: New test case. From-SVN: r192488 --- gcc/except.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'gcc/except.c') diff --git a/gcc/except.c b/gcc/except.c index 88cac85..adafe8c 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -1161,13 +1161,7 @@ sjlj_emit_function_enter (rtx dispatch_label) emit_cmp_and_jump_insns (x, const0_rtx, NE, 0, TYPE_MODE (integer_type_node), 0, - dispatch_label); - last = get_last_insn (); - if (JUMP_P (last) && any_condjump_p (last)) - { - gcc_assert (!find_reg_note (last, REG_BR_PROB, 0)); - add_reg_note (last, REG_BR_PROB, GEN_INT (REG_BR_PROB_BASE / 100)); - } + dispatch_label, REG_BR_PROB_BASE / 100); #else expand_builtin_setjmp_setup (plus_constant (Pmode, XEXP (fc, 0), sjlj_fc_jbuf_ofs), -- cgit v1.1