aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgloopmanip.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2004-04-22 23:46:48 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2004-04-22 21:46:48 +0000
commitbade3a0018d65df8c449ccec6f6472965d3e3b24 (patch)
treeff2786de6067078df56240e0b8d6d340cb186aac /gcc/cfgloopmanip.c
parenteddc836e8a4466e25bb52c6b1eef2824ee896009 (diff)
downloadgcc-bade3a0018d65df8c449ccec6f6472965d3e3b24.zip
gcc-bade3a0018d65df8c449ccec6f6472965d3e3b24.tar.gz
gcc-bade3a0018d65df8c449ccec6f6472965d3e3b24.tar.bz2
cfgloopmanip.c (scale_bbs_frequencies): Use RDIV macro
* cfgloopmanip.c (scale_bbs_frequencies): Use RDIV macro * cfgloopanal.c (expected_loop_iterations): Change the return value From-SVN: r81058
Diffstat (limited to 'gcc/cfgloopmanip.c')
-rw-r--r--gcc/cfgloopmanip.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/cfgloopmanip.c b/gcc/cfgloopmanip.c
index 2dc4643..59ae4a1 100644
--- a/gcc/cfgloopmanip.c
+++ b/gcc/cfgloopmanip.c
@@ -50,6 +50,8 @@ static void scale_bbs_frequencies (basic_block *, int, int, int);
static basic_block create_preheader (struct loop *, int);
static void fix_irreducible_loops (basic_block);
+#define RDIV(X,Y) (((X) + (Y) / 2) / (Y))
+
/* Splits basic block BB after INSN, returns created edge. Updates loops
and dominators. */
edge
@@ -458,7 +460,7 @@ scale_bbs_frequencies (basic_block *bbs, int nbbs, int num, int den)
for (i = 0; i < nbbs; i++)
{
bbs[i]->frequency = (bbs[i]->frequency * num) / den;
- bbs[i]->count = (bbs[i]->count * num) / den;
+ bbs[i]->count = RDIV (bbs[i]->count * num, den);
for (e = bbs[i]->succ; e; e = e->succ_next)
e->count = (e->count * num) /den;
}
@@ -812,7 +814,6 @@ can_duplicate_loop_p (struct loop *loop)
return ret;
}
-#define RDIV(X,Y) (((X) + (Y) / 2) / (Y))
/* Duplicates body of LOOP to given edge E NDUPL times. Takes care of updating
LOOPS structure and dominators. E's destination must be LOOP header for