Commit 57cb6d52 by Andreas Jaeger Committed by Andreas Jaeger

jump.c: Add prototype for mark_modified_reg.

        * 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.

From-SVN: r44479
parent d76cbbc8
2001-07-30 Andreas Jaeger <aj@suse.de>
* decl2.c: Remove unused var global_temp_name_counter.
2001-07-28 Richard Henderson <rth@redhat.com> 2001-07-28 Richard Henderson <rth@redhat.com>
* method.c (pending_inlines): Remove. * method.c (pending_inlines): Remove.
...@@ -46,7 +50,7 @@ ...@@ -46,7 +50,7 @@
declaring a function, and create last_function_parms correctly. declaring a function, and create last_function_parms correctly.
2001-07-25 Jason Merrill <jason_merrill@redhat.com> 2001-07-25 Jason Merrill <jason_merrill@redhat.com>
* call.c (joust): Only prefer a non-builtin candidate to a builtin * call.c (joust): Only prefer a non-builtin candidate to a builtin
one if they have the same signature. one if they have the same signature.
...@@ -232,7 +236,7 @@ ...@@ -232,7 +236,7 @@
* pt.c (instantiate_class_template): Don't set * pt.c (instantiate_class_template): Don't set
TYPE_VEC_DELETE_TAKES_SIZE. TYPE_VEC_DELETE_TAKES_SIZE.
* NEWS: Document ABI changes from GCC 3.0. * NEWS: Document ABI changes from GCC 3.0.
2001-07-18 Xavier Delacour <xavier@fmaudio.net>, 2001-07-18 Xavier Delacour <xavier@fmaudio.net>,
Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
......
...@@ -104,10 +104,6 @@ static varray_type deferred_fns; ...@@ -104,10 +104,6 @@ static varray_type deferred_fns;
#define deferred_fns_used \ #define deferred_fns_used \
(deferred_fns ? deferred_fns->elements_used : 0) (deferred_fns ? deferred_fns->elements_used : 0)
/* Same, but not reset. Local temp variables and global temp variables
can have the same name. */
static int global_temp_name_counter;
/* Flag used when debugging spew.c */ /* Flag used when debugging spew.c */
extern int spew_debug; extern int spew_debug;
......
...@@ -7489,7 +7489,7 @@ count_reg_usage (x, counts, dest, incr) ...@@ -7489,7 +7489,7 @@ count_reg_usage (x, counts, dest, incr)
static bool static bool
set_live_p (set, insn, counts) set_live_p (set, insn, counts)
rtx set; rtx set;
rtx insn; rtx insn ATTRIBUTE_UNUSED; /* Only used with HAVE_cc0. */
int *counts; int *counts;
{ {
#ifdef HAVE_cc0 #ifdef HAVE_cc0
......
...@@ -788,7 +788,7 @@ scan_for_source_files () ...@@ -788,7 +788,7 @@ scan_for_source_files ()
{ {
struct sourcefile *s_ptr = NULL; struct sourcefile *s_ptr = NULL;
char *ptr; char *ptr;
int count; long count;
long line_num; long line_num;
/* Search the bb_data to find: /* Search the bb_data to find:
...@@ -878,7 +878,7 @@ calculate_branch_probs (current_graph, block_num, branch_probs, last_line_num) ...@@ -878,7 +878,7 @@ calculate_branch_probs (current_graph, block_num, branch_probs, last_line_num)
struct arcdata **branch_probs; struct arcdata **branch_probs;
int last_line_num; int last_line_num;
{ {
int total; gcov_type total;
struct adj_list *arcptr; struct adj_list *arcptr;
struct arcdata *end_ptr, *a_ptr; struct arcdata *end_ptr, *a_ptr;
...@@ -990,7 +990,7 @@ output_data () ...@@ -990,7 +990,7 @@ output_data ()
char *source_file_name; char *source_file_name;
FILE *source_file; FILE *source_file;
struct bb_info_list *current_graph; struct bb_info_list *current_graph;
int count; long count;
char *cptr; char *cptr;
long block_num; long block_num;
long line_num; long line_num;
...@@ -1360,16 +1360,23 @@ output_data () ...@@ -1360,16 +1360,23 @@ output_data ()
else else
{ {
if (output_branch_counts) if (output_branch_counts)
fnotice (gcov_file, {
"call %d returns = " char c[20];
HOST_WIDEST_INT_PRINT_DEC "\n", sprintf (c, HOST_WIDEST_INT_PRINT_DEC,
i, a_ptr->total - a_ptr->hits); a_ptr->total - a_ptr->hits);
fnotice (gcov_file,
"call %d returns = %s\n", i, c);
}
else else
fnotice (gcov_file, {
"call %d returns = " char c[20];
HOST_WIDEST_INT_PRINT_DEC "%%\n", sprintf (c, HOST_WIDEST_INT_PRINT_DEC,
i, 100 - ((a_ptr->hits * 100) + 100 - ((a_ptr->hits * 100)
(a_ptr->total >> 1))/a_ptr->total); + (a_ptr->total >> 1))
/ a_ptr->total);
fnotice (gcov_file,
"call %d returns = %s%%\n", i, c);
}
} }
} }
else else
...@@ -1380,18 +1387,23 @@ output_data () ...@@ -1380,18 +1387,23 @@ output_data ()
else else
{ {
if (output_branch_counts) if (output_branch_counts)
fnotice (gcov_file, {
"branch %d taken = " char c[20];
HOST_WIDEST_INT_PRINT_DEC "\n", sprintf (c, HOST_WIDEST_INT_PRINT_DEC,
i, a_ptr->hits); a_ptr->hits);
fnotice (gcov_file,
"branch %d taken = %s\n", i, c);
}
else else
{
char c[20];
sprintf (c, HOST_WIDEST_INT_PRINT_DEC,
((a_ptr->hits * 100)
+ (a_ptr->total >> 1))
/ a_ptr->total);
fnotice (gcov_file, fnotice (gcov_file,
"branch %d taken = " "branch %d taken = %s%%\n", i, c);
HOST_WIDEST_INT_PRINT_DEC "%%\n", i, }
((a_ptr->hits * 100) +
(a_ptr->total >> 1))/
a_ptr->total);
} }
} }
} }
......
...@@ -4628,10 +4628,6 @@ insert_insn_end_bb (expr, bb, pre) ...@@ -4628,10 +4628,6 @@ insert_insn_end_bb (expr, bb, pre)
of exception handling. */ of exception handling. */
else if (GET_CODE (insn) == CALL_INSN) else if (GET_CODE (insn) == CALL_INSN)
{ {
HARD_REG_SET parm_regs;
int nparm_regs;
rtx p;
/* Keeping in mind SMALL_REGISTER_CLASSES and parameters in registers, /* Keeping in mind SMALL_REGISTER_CLASSES and parameters in registers,
we search backward and place the instructions before the first we search backward and place the instructions before the first
parameter is loaded. Do this for everyone for consistency and a parameter is loaded. Do this for everyone for consistency and a
......
...@@ -69,6 +69,7 @@ static void invert_exp_1 PARAMS ((rtx)); ...@@ -69,6 +69,7 @@ static void invert_exp_1 PARAMS ((rtx));
static int invert_exp PARAMS ((rtx)); static int invert_exp PARAMS ((rtx));
static int returnjump_p_1 PARAMS ((rtx *, void *)); static int returnjump_p_1 PARAMS ((rtx *, void *));
static void delete_prior_computation PARAMS ((rtx, rtx)); static void delete_prior_computation PARAMS ((rtx, rtx));
static void mark_modified_reg PARAMS ((rtx, rtx, void *));
/* Alternate entry into the jump optimizer. This entry point only rebuilds /* Alternate entry into the jump optimizer. This entry point only rebuilds
the JUMP_LABEL field in jumping insns and REG_LABEL notes in non-jumping the JUMP_LABEL field in jumping insns and REG_LABEL notes in non-jumping
......
...@@ -228,7 +228,7 @@ combine_predictions_for_insn (insn, bb) ...@@ -228,7 +228,7 @@ combine_predictions_for_insn (insn, bb)
bb->index); bb->index);
/* We implement "first match" heuristics and use probability guessed /* 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. */ probability combination techniques. */
while (*pnote) while (*pnote)
{ {
...@@ -304,8 +304,8 @@ estimate_probability (loops_info) ...@@ -304,8 +304,8 @@ estimate_probability (loops_info)
{ {
int header_found = 0; int header_found = 0;
edge e; 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. */ a loop's head. */
for (e = BASIC_BLOCK(j)->succ; e; e = e->succ_next) for (e = BASIC_BLOCK(j)->succ; e; e = e->succ_next)
if (e->dest == loops_info->array[i].header if (e->dest == loops_info->array[i].header
...@@ -314,8 +314,9 @@ estimate_probability (loops_info) ...@@ -314,8 +314,9 @@ estimate_probability (loops_info)
header_found = 1; header_found = 1;
predict_edge_def (e, PRED_LOOP_BRANCH, TAKEN); predict_edge_def (e, PRED_LOOP_BRANCH, TAKEN);
} }
/* Loop exit heruistics - predict as not taken an edge exiting /* Loop exit heuristics - predict as not taken an edge
the loop if the conditinal has no loop header successors */ exiting the loop if the conditinal has no loop header
successors. */
if (!header_found) if (!header_found)
for (e = BASIC_BLOCK(j)->succ; e; e = e->succ_next) for (e = BASIC_BLOCK(j)->succ; e; e = e->succ_next)
if (e->dest->index <= 0 if (e->dest->index <= 0
...@@ -408,7 +409,7 @@ estimate_probability (loops_info) ...@@ -408,7 +409,7 @@ estimate_probability (loops_info)
&& (XEXP (cond, 1) == const0_rtx && (XEXP (cond, 1) == const0_rtx
|| (GET_CODE (XEXP (cond, 1)) == REG || (GET_CODE (XEXP (cond, 1)) == REG
&& REG_POINTER (XEXP (cond, 1))))) && REG_POINTER (XEXP (cond, 1)))))
predict_insn_def (last_insn, PRED_POINTER, NOT_TAKEN); predict_insn_def (last_insn, PRED_POINTER, NOT_TAKEN);
break; break;
case NE: case NE:
...@@ -487,7 +488,7 @@ estimate_probability (loops_info) ...@@ -487,7 +488,7 @@ estimate_probability (loops_info)
} }
/* __builtin_expect dropped tokens into the insn stream describing /* __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. */ based off these values. */
void void
...@@ -535,7 +536,7 @@ expected_value_to_br_prob () ...@@ -535,7 +536,7 @@ expected_value_to_br_prob ()
(set r71 -1) (set r71 -1)
(set r80 (lt r70 r71)) (set r80 (lt r70 r71))
(set pc (if_then_else (ne r80 0) ...)) (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) (lt r70, r71)
Could use cselib to try and reduce this further. */ Could use cselib to try and reduce this further. */
cond = XEXP (SET_SRC (PATTERN (insn)), 0); cond = XEXP (SET_SRC (PATTERN (insn)), 0);
...@@ -545,7 +546,7 @@ expected_value_to_br_prob () ...@@ -545,7 +546,7 @@ expected_value_to_br_prob ()
|| GET_CODE (XEXP (cond, 1)) != CONST_INT) || GET_CODE (XEXP (cond, 1)) != CONST_INT)
continue; 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 building involves two constants, we should wind up with either
true or false. */ true or false. */
cond = gen_rtx_fmt_ee (GET_CODE (cond), VOIDmode, cond = gen_rtx_fmt_ee (GET_CODE (cond), VOIDmode,
...@@ -560,7 +561,7 @@ expected_value_to_br_prob () ...@@ -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. */ attached to the AUX field of the standard CFG block. */
typedef struct block_info_def typedef struct block_info_def
...@@ -620,19 +621,22 @@ propagate_freq (head) ...@@ -620,19 +621,22 @@ propagate_freq (head)
if (!BLOCK_INFO (e->src)->visited && !EDGE_INFO (e)->back_edge) if (!BLOCK_INFO (e->src)->visited && !EDGE_INFO (e)->back_edge)
break; break;
/* We didn't proceeded all predecesors of edge e yet. These may /* We haven't proceeded all predecessors of edge e yet.
be waiting in the queue or we may hit irreducible region. These may be waiting in the queue or we may hit an
irreducible region.
To avoid infinite looping on irrecudible regions, count number
of block proceeded at the time basic block has been queued. In the To avoid infinite looping on irrecudible regions, count
case number didn't changed, we've hit irreducible region and we the number of blocks proceeded at the time the basic
forget the backward edge. This can increase time complexity block has been queued. In the case the number doesn't
by the number of irreducible blocks, but in same way standard the change, we've hit an irreducible region and we can forget
loop does, so it should not result in noticeable slowodwn. the backward edge. This can increase the time complexity
by the number of irreducible blocks, but in the same way
Alternativly we may distinquish backward and cross edges in the the standard the loop does, so it should not result in a
DFS tree by preprocesing pass and ignore existence of non-loop noticeable slowdown.
backward edges. */
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 (e && BLOCK_INFO (bb)->nvisited != nvisited)
{ {
if (!nextbb) if (!nextbb)
...@@ -670,7 +674,7 @@ propagate_freq (head) ...@@ -670,7 +674,7 @@ propagate_freq (head)
* BLOCK_INFO (bb)->frequency * BLOCK_INFO (bb)->frequency
/ REG_BR_PROB_BASE); / REG_BR_PROB_BASE);
/* Propagate to succesor blocks. */ /* Propagate to successor blocks. */
for (e = bb->succ; e; e = e->succ_next) for (e = bb->succ; e; e = e->succ_next)
if (!EDGE_INFO (e)->back_edge if (!EDGE_INFO (e)->back_edge
&& !BLOCK_INFO (e->dest)->visited && !BLOCK_INFO (e->dest)->visited
...@@ -687,7 +691,7 @@ propagate_freq (head) ...@@ -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 static void
estimate_loops_at_level (first_loop) estimate_loops_at_level (first_loop)
struct loop *first_loop; struct loop *first_loop;
...@@ -701,13 +705,13 @@ estimate_loops_at_level (first_loop) ...@@ -701,13 +705,13 @@ estimate_loops_at_level (first_loop)
estimate_loops_at_level (loop->inner); 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); for (e = loop->latch->succ; e->dest != loop->header; e = e->succ_next);
EDGE_INFO (e)->back_edge = 1; EDGE_INFO (e)->back_edge = 1;
/* In case loop header is shared, ensure that it is the last one sharing /* In case the loop header is shared, ensure that it is the last
same header, so we avoid redundant work. */ one sharing the same header, so we avoid redundant work. */
if (loop->shared) if (loop->shared)
{ {
for (l = loop->next; l; l = l->next) for (l = loop->next; l; l = l->next)
...@@ -778,12 +782,12 @@ estimate_bb_frequencies (loops) ...@@ -778,12 +782,12 @@ estimate_bb_frequencies (loops)
edge fallthru, branch; edge fallthru, branch;
if (GET_CODE (last_insn) != JUMP_INSN || !any_condjump_p (last_insn) 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) || BASIC_BLOCK (i)->succ->succ_next == NULL)
{ {
/* We can predict only conditional jumps at the moment. /* We can predict only conditional jumps at the moment.
Expect each edge to be equall probable. Expect each edge to be equally probable.
?? In future we want to make abnormal edges improbable. */ ?? In the future we want to make abnormal edges improbable. */
int nedges = 0; int nedges = 0;
edge e; edge e;
......
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