From 994a57cd287e37aaaf909fc1ae671e54b1b360c4 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Mon, 17 Apr 2000 09:49:00 -0700 Subject: builtins.c (expand_builtin_expect): New. * builtins.c (expand_builtin_expect): New. (expand_builtin): Call it. * builtins.def (BUILT_IN_EXPECT): New. * c-common.c (c_common_nodes_and_builtins): Declare __builtin_expect. * extend.texi: Document it. * predict.c (expected_value_to_br_prob): New. (find_expected_value): New. * basic-block.h (expected_value_to_br_prob): Declare. * toplev.c (rest_of_compilation): Invoke it. * rtl.h (NOTE_EXPECTED_VALUE): New. (NOTE_INSN_EXPECTED_VALUE): New. * rtl.c (note_insn_name): Update. * print-rtl.c (print_rtx): Reorg NOTE_LINE_NUMBER special cases; handle NOTE_INSN_EXPECTED_VALUE. From-SVN: r33211 --- gcc/toplev.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gcc/toplev.c') diff --git a/gcc/toplev.c b/gcc/toplev.c index 6d8336d..4f9a385 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -2893,9 +2893,10 @@ rest_of_compilation (decl) goto exit_rest_of_compilation; } + init_EXPR_INSN_LIST_cache (); + /* We may have potential sibling or tail recursion sites. Select one (of possibly multiple) methods of performing the call. */ - init_EXPR_INSN_LIST_cache (); if (flag_optimize_sibling_calls) optimize_sibling_and_tail_recursive_calls (); @@ -2962,6 +2963,10 @@ rest_of_compilation (decl) of the function. */ TIMEVAR (jump_time, { + /* Turn NOTE_INSN_EXPECTED_VALUE into REG_BR_PROB. Do this + before jump optimization switches branch directions. */ + expected_value_to_br_prob (); + reg_scan (insns, max_reg_num (), 0); jump_optimize (insns, !JUMP_CROSS_JUMP, !JUMP_NOOP_MOVES, JUMP_AFTER_REGSCAN); -- cgit v1.1