Commit c4f81e4a by Jan Hubicka Committed by Jan Hubicka

predict.c (estimate_probability): Avoid duplicated predictions.

	* predict.c (estimate_probability): Avoid duplicated predictions.

	* loop.c (find_and_verify_loops): Grok multiple barriers.

From-SVN: r44369
parent 472385a2
Thu Jul 26 00:19:30 CEST 2001 Jan Hubicka <jh@suse.cz>
* predict.c (estimate_probability): Avoid duplicated predictions.
* loop.c (find_and_verify_loops): Grok multiple barriers.
Wed Jul 25 18:00:05 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> Wed Jul 25 18:00:05 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* config/alpha/alpha.c (print_operand, case '/'): Don't write '/'. * config/alpha/alpha.c (print_operand, case '/'): Don't write '/'.
......
...@@ -2676,6 +2676,14 @@ find_and_verify_loops (f, loops) ...@@ -2676,6 +2676,14 @@ find_and_verify_loops (f, loops)
= JUMP_LABEL (insn) ? JUMP_LABEL (insn) : get_last_insn (); = JUMP_LABEL (insn) ? JUMP_LABEL (insn) : get_last_insn ();
struct loop *target_loop = uid_loop[INSN_UID (target)]; struct loop *target_loop = uid_loop[INSN_UID (target)];
rtx loc, loc2; rtx loc, loc2;
rtx tmp;
/* Search for possible garbage past the conditional jumps
and look for latest barrier. */
for (tmp = last_insn_to_move;
tmp && GET_CODE (tmp) != CODE_LABEL; tmp = NEXT_INSN (tmp))
if (GET_CODE (tmp) == BARRIER)
last_insn_to_move = tmp;
for (loc = target; loc; loc = PREV_INSN (loc)) for (loc = target; loc; loc = PREV_INSN (loc))
if (GET_CODE (loc) == BARRIER if (GET_CODE (loc) == BARRIER
......
...@@ -255,6 +255,7 @@ estimate_probability (loops_info) ...@@ -255,6 +255,7 @@ estimate_probability (loops_info)
{ {
sbitmap *dominators, *post_dominators; sbitmap *dominators, *post_dominators;
int i; int i;
int found_noreturn = 0;
dominators = sbitmap_vector_alloc (n_basic_blocks, n_basic_blocks); dominators = sbitmap_vector_alloc (n_basic_blocks, n_basic_blocks);
post_dominators = sbitmap_vector_alloc (n_basic_blocks, n_basic_blocks); post_dominators = sbitmap_vector_alloc (n_basic_blocks, n_basic_blocks);
...@@ -309,9 +310,15 @@ estimate_probability (loops_info) ...@@ -309,9 +310,15 @@ estimate_probability (loops_info)
/* If block has no sucessor, predict all possible paths to /* If block has no sucessor, predict all possible paths to
it as improbable, as the block contains a call to a noreturn it as improbable, as the block contains a call to a noreturn
function and thus can be executed only once. */ function and thus can be executed only once. */
if (bb->succ == NULL) if (bb->succ == NULL && !found_noreturn)
{ {
int y; int y;
/* ??? Postdominator claims each noreturn block to be postdominated
by each, so we need to run only once. This needs to be changed
once postdominace algorithm is updated to say something more sane.
*/
found_noreturn = 1;
for (y = 0; y < n_basic_blocks; y++) for (y = 0; y < n_basic_blocks; y++)
if (!TEST_BIT (post_dominators[y], i)) if (!TEST_BIT (post_dominators[y], i))
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment