summaryrefslogtreecommitdiff
path: root/gcc/predict.c
diff options
context:
space:
mode:
authorjle <jle@138bc75d-0d04-0410-961f-82ee72b054a4>2000-01-29 01:41:22 +0000
committerjle <jle@138bc75d-0d04-0410-961f-82ee72b054a4>2000-01-29 01:41:22 +0000
commit7fcadf6226463092f6a36084f6e22b79b83ef1d8 (patch)
treeb7e53416e72be71ecc8ff02e5544a3d4f9199174 /gcc/predict.c
parentdaac33087f0c0e477b902326fcc532899610cb51 (diff)
downloadgcc-7fcadf6226463092f6a36084f6e22b79b83ef1d8.tar.gz
Fri Jan 7 19:48:04 CET 2000 Jan Hubicka <jh@suse.cz>
* sbitmap.c (sbitmap_first_set_bit, sbitmap_last_set_bit): New function. * sbitmap.h (sbitmap_first_set_bit, sbitmap_last_set_bit): Declare. * basic_block.h (FLOW_LOOP_FIRST_BLOCK): New macro. (FLOW_LOOP_LAST_BLOCK): Likewise. 2000-01-21 Michael Hayes <m.hayes@elec.canterbury.ac.nz> * basic-block.h (struct loop): New fields 'first' and 'last'. * flow.c (flow_loops_find): Compute loop->first and loop->last. (flow_loops_dump): Use loop->first to check for NOTE_INSN_LOOP_BEG and loop->last to check for NOTE_INSN_LOOP_END. Fri Jan 28 10:57:58 2000 Jason Eckhardt <jle@cygnus.com> * predict.c (estimate_probability): Use the new FIRST and LAST fields of the loop descriptor rather than HEADER and LATCH. Also added missing break statements as well making some coding style modifications as suggested by Michael Hayes. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31679 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/predict.c')
-rw-r--r--gcc/predict.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/gcc/predict.c b/gcc/predict.c
index 1846b4a8f7c..d8a588f6df0 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -53,7 +53,7 @@
??? In the next revision there will be a number of other predictors added
from the above references. Further, each heuristic will be factored out
into its own function for clarity (and to facilitate the combination of
- predictions). */
+ predictions). */
void
estimate_probability (loops_info)
@@ -61,13 +61,14 @@ estimate_probability (loops_info)
{
int i;
- /* Try to predict out blocks in a loop that are not part of a natural loop */
+ /* Try to predict out blocks in a loop that are not part of a
+ natural loop. */
for (i = 0; i < loops_info->num; i++)
{
int j;
- for (j = loops_info->array[i].header->index;
- j <= loops_info->array[i].latch->index;
+ for (j = loops_info->array[i].first->index;
+ j <= loops_info->array[i].last->index;
++j)
{
edge e;
@@ -83,17 +84,18 @@ estimate_probability (loops_info)
|| ! condjump_p (last_insn) || simplejump_p (last_insn))
continue;
cond = get_condition (last_insn, &earliest);
- if (!cond)
+ if (! cond)
continue;
if (! find_reg_note (last_insn, REG_BR_PROB, 0))
REG_NOTES (last_insn)
- = gen_rtx_EXPR_LIST (REG_BR_PROB, GEN_INT (REG_BR_PROB_BASE),
+ = gen_rtx_EXPR_LIST (REG_BR_PROB,
+ GEN_INT (REG_BR_PROB_BASE),
REG_NOTES (last_insn));
}
}
}
- /* Try to predict condjumps using same algorithm as mostly_true_jump */
+ /* Try to predict condjumps using same algorithm as mostly_true_jump. */
for (i = 0; i < n_basic_blocks - 1; i++)
{
rtx last_insn = BLOCK_END (i);
@@ -114,10 +116,13 @@ estimate_probability (loops_info)
case CONST_INT:
/* Unconditional branch. */
prob = REG_BR_PROB_BASE / 2;
+ break;
case EQ:
prob = REG_BR_PROB_BASE / 10;
+ break;
case NE:
prob = REG_BR_PROB_BASE / 2;
+ break;
case LE:
case LT:
if (XEXP (cond, 1) == const0_rtx)