diff options
author | aj <aj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-07-30 18:04:33 +0000 |
---|---|---|
committer | aj <aj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-07-30 18:04:33 +0000 |
commit | e725f8989692f8a2f09e4ca2c34df373f1f3b430 (patch) | |
tree | 6f14be388d2d55c84523eb6739cdd6963a3f8f37 /gcc/predict.c | |
parent | 0d93d5085f406eea698993c990817e415dd20acc (diff) | |
download | gcc-e725f8989692f8a2f09e4ca2c34df373f1f3b430.tar.gz |
* jump.c: Add prototype for mark_modified_reg.
* cse.c (set_live_p): Add unused attribute.
* gcov.c (calculate_branch_probs): Use gcov_type to avoid
overflow.
(scan_for_source_files): Use long for count to avoid overflow.
(output_data): Likewise.
(output_data): Don't use string concatatenation to silence gcc
-traditional.
* predict.c: Fix typos and grammar.
* gcse.c (insert_insn_end_bb): Remove unused variables.
For cp:
* decl2.c: Remove unused var global_temp_name_counter.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44479 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/predict.c')
-rw-r--r-- | gcc/predict.c | 66 |
1 files changed, 35 insertions, 31 deletions
diff --git a/gcc/predict.c b/gcc/predict.c index 38b9a5b6928..36f59e0c0ae 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -228,7 +228,7 @@ combine_predictions_for_insn (insn, bb) bb->index); /* We implement "first match" heuristics and use probability guessed - by predictor with smallest index. In future we will use better + by predictor with smallest index. In the future we will use better probability combination techniques. */ while (*pnote) { @@ -304,8 +304,8 @@ estimate_probability (loops_info) { int header_found = 0; edge e; - - /* Loop branch heruistics - predict as taken an edge back to + + /* Loop branch heuristics - predict as taken an edge back to a loop's head. */ for (e = BASIC_BLOCK(j)->succ; e; e = e->succ_next) if (e->dest == loops_info->array[i].header @@ -314,8 +314,9 @@ estimate_probability (loops_info) header_found = 1; predict_edge_def (e, PRED_LOOP_BRANCH, TAKEN); } - /* Loop exit heruistics - predict as not taken an edge exiting - the loop if the conditinal has no loop header successors */ + /* Loop exit heuristics - predict as not taken an edge + exiting the loop if the conditinal has no loop header + successors. */ if (!header_found) for (e = BASIC_BLOCK(j)->succ; e; e = e->succ_next) if (e->dest->index <= 0 @@ -408,7 +409,7 @@ estimate_probability (loops_info) && (XEXP (cond, 1) == const0_rtx || (GET_CODE (XEXP (cond, 1)) == REG && REG_POINTER (XEXP (cond, 1))))) - + predict_insn_def (last_insn, PRED_POINTER, NOT_TAKEN); break; case NE: @@ -487,7 +488,7 @@ estimate_probability (loops_info) } /* __builtin_expect dropped tokens into the insn stream describing - expected values of registers. Generate branch probabilities + expected values of registers. Generate branch probabilities based off these values. */ void @@ -535,7 +536,7 @@ expected_value_to_br_prob () (set r71 -1) (set r80 (lt r70 r71)) (set pc (if_then_else (ne r80 0) ...)) - as canonicalize_condition will render this to us as + as canonicalize_condition will render this to us as (lt r70, r71) Could use cselib to try and reduce this further. */ cond = XEXP (SET_SRC (PATTERN (insn)), 0); @@ -545,7 +546,7 @@ expected_value_to_br_prob () || GET_CODE (XEXP (cond, 1)) != CONST_INT) continue; - /* Substitute and simplify. Given that the expression we're + /* Substitute and simplify. Given that the expression we're building involves two constants, we should wind up with either true or false. */ cond = gen_rtx_fmt_ee (GET_CODE (cond), VOIDmode, @@ -560,7 +561,7 @@ expected_value_to_br_prob () } } -/* This is used to carry information about basic blocks. It is +/* This is used to carry information about basic blocks. It is attached to the AUX field of the standard CFG block. */ typedef struct block_info_def @@ -620,19 +621,22 @@ propagate_freq (head) if (!BLOCK_INFO (e->src)->visited && !EDGE_INFO (e)->back_edge) break; - /* We didn't proceeded all predecesors of edge e yet. These may - be waiting in the queue or we may hit irreducible region. - - To avoid infinite looping on irrecudible regions, count number - of block proceeded at the time basic block has been queued. In the - case number didn't changed, we've hit irreducible region and we - forget the backward edge. This can increase time complexity - by the number of irreducible blocks, but in same way standard the - loop does, so it should not result in noticeable slowodwn. - - Alternativly we may distinquish backward and cross edges in the - DFS tree by preprocesing pass and ignore existence of non-loop - backward edges. */ + /* We haven't proceeded all predecessors of edge e yet. + These may be waiting in the queue or we may hit an + irreducible region. + + To avoid infinite looping on irrecudible regions, count + the number of blocks proceeded at the time the basic + block has been queued. In the case the number doesn't + change, we've hit an irreducible region and we can forget + the backward edge. This can increase the time complexity + by the number of irreducible blocks, but in the same way + the standard the loop does, so it should not result in a + noticeable slowdown. + + Alternatively we may distinguish backward and cross edges + in the DFS tree by the preprocessing pass and ignore the + existence of non-loop backward edges. */ if (e && BLOCK_INFO (bb)->nvisited != nvisited) { if (!nextbb) @@ -670,7 +674,7 @@ propagate_freq (head) * BLOCK_INFO (bb)->frequency / REG_BR_PROB_BASE); - /* Propagate to succesor blocks. */ + /* Propagate to successor blocks. */ for (e = bb->succ; e; e = e->succ_next) if (!EDGE_INFO (e)->back_edge && !BLOCK_INFO (e->dest)->visited @@ -687,7 +691,7 @@ propagate_freq (head) } } -/* Estimate probabilities of the loopback edges in loops at same nest level. */ +/* Estimate probabilities of loopback edges in loops at same nest level. */ static void estimate_loops_at_level (first_loop) struct loop *first_loop; @@ -701,13 +705,13 @@ estimate_loops_at_level (first_loop) estimate_loops_at_level (loop->inner); - /* find current loop back edge and mark it. */ + /* Find current loop back edge and mark it. */ for (e = loop->latch->succ; e->dest != loop->header; e = e->succ_next); EDGE_INFO (e)->back_edge = 1; - /* In case loop header is shared, ensure that it is the last one sharing - same header, so we avoid redundant work. */ + /* In case the loop header is shared, ensure that it is the last + one sharing the same header, so we avoid redundant work. */ if (loop->shared) { for (l = loop->next; l; l = l->next) @@ -778,12 +782,12 @@ estimate_bb_frequencies (loops) edge fallthru, branch; if (GET_CODE (last_insn) != JUMP_INSN || !any_condjump_p (last_insn) - /* Avoid handling of conditionals jump jumping to fallthru edge. */ + /* Avoid handling of conditional jumps jumping to fallthru edge. */ || BASIC_BLOCK (i)->succ->succ_next == NULL) { /* We can predict only conditional jumps at the moment. - Expect each edge to be equall probable. - ?? In future we want to make abnormal edges improbable. */ + Expect each edge to be equally probable. + ?? In the future we want to make abnormal edges improbable. */ int nedges = 0; edge e; |