cfgloopmanip.c (scale_loop_profile): Avoid use of REG_BR_PROB_BASE fixpoint arithmetics.
authorJan Hubicka <hubicka@ucw.cz>
Sun, 16 Jul 2017 16:35:00 +0000 (18:35 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sun, 16 Jul 2017 16:35:00 +0000 (16:35 +0000)
* cfgloopmanip.c (scale_loop_profile): Avoid use of REG_BR_PROB_BASE
fixpoint arithmetics.

From-SVN: r250242

gcc/ChangeLog
gcc/cfgloopmanip.c

index 849de45f2c8ca937cc55e887db6bfb3d52bbd1aa..ccceea51091054ff27f1b8e1c20752dddece107e 100644 (file)
@@ -1,3 +1,8 @@
+2017-07-16  Jan Hubicka  <hubicka@ucw.cz>
+
+       * cfgloopmanip.c (scale_loop_profile): Avoid use of REG_BR_PROB_BASE
+       fixpoint arithmetics.
+
 2017-07-16  Jan Hubicka  <hubicka@ucw.cz>
 
        * tree-ssa-loop-unswitch.c (hoist_guard): Avoid use of REG_BR_PROB_BASE
index 3f4ff988c7400decf9099a131d6c35c3a3bd73b5..f62c829bd5fe3816190f84416534d97d2550c21f 100644 (file)
@@ -546,8 +546,8 @@ scale_loop_profile (struct loop *loop, profile_probability p,
 
          /* Probability of exit must be 1/iterations.  */
          freq_delta = EDGE_FREQUENCY (e);
-         e->probability = profile_probability::from_reg_br_prob_base
-                               (REG_BR_PROB_BASE / iteration_bound);
+         e->probability = profile_probability::always ()
+                               .apply_scale (1, iteration_bound);
          other_e->probability = e->probability.invert ();
          freq_delta -= EDGE_FREQUENCY (e);