diff options
author | Richard Earnshaw <rearnsha@arm.com> | 2003-03-01 12:51:01 +0000 |
---|---|---|
committer | Richard Earnshaw <rearnsha@gcc.gnu.org> | 2003-03-01 12:51:01 +0000 |
commit | c4f6b78e43edb37bfd77018770d9cb820633f9f0 (patch) | |
tree | 5f997896577c333ecdf8df2c2ebdda9acdcfc2b0 | |
parent | 2bcbe1b74a08bffddd9a459d12b952932eafd1ff (diff) | |
download | gcc-c4f6b78e43edb37bfd77018770d9cb820633f9f0.zip gcc-c4f6b78e43edb37bfd77018770d9cb820633f9f0.tar.gz gcc-c4f6b78e43edb37bfd77018770d9cb820633f9f0.tar.bz2 |
predict.c (estimate_bb_frequencies): Initialize the sreal constants once per compilation.
* predict.c (estimate_bb_frequencies): Initialize the sreal
constants once per compilation.
From-SVN: r63607
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/predict.c | 19 |
2 files changed, 17 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 63db809..b76dec5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2003-03-01 Richard Earnshaw <rearnsha@arm.com> + + * predict.c (estimate_bb_frequencies): Initialize the sreal + constants once per compilation. + 2003-02-28 Richard Henderson <rth@redhat.com> * toplev.c (flag_eliminate_unused_debug_types): Enable by default. diff --git a/gcc/predict.c b/gcc/predict.c index 704f269..29d7c46 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -1173,13 +1173,18 @@ estimate_bb_frequencies (loops) counts_to_freqs (); else { - sreal_init (&real_zero, 0, 0); - sreal_init (&real_one, 1, 0); - sreal_init (&real_br_prob_base, REG_BR_PROB_BASE, 0); - sreal_init (&real_bb_freq_max, BB_FREQ_MAX, 0); - sreal_init (&real_one_half, 1, -1); - sreal_div (&real_inv_br_prob_base, &real_one, &real_br_prob_base); - sreal_sub (&real_almost_one, &real_one, &real_inv_br_prob_base); + static int real_values_initialized = 0; + + if (!real_values_initialized) + { + sreal_init (&real_zero, 0, 0); + sreal_init (&real_one, 1, 0); + sreal_init (&real_br_prob_base, REG_BR_PROB_BASE, 0); + sreal_init (&real_bb_freq_max, BB_FREQ_MAX, 0); + sreal_init (&real_one_half, 1, -1); + sreal_div (&real_inv_br_prob_base, &real_one, &real_br_prob_base); + sreal_sub (&real_almost_one, &real_one, &real_inv_br_prob_base); + } mark_dfs_back_edges (); /* Fill in the probability values in flowgraph based on the REG_BR_PROB |