From 650a202b472b02639e1ddaf424d69dd1ffaacd02 Mon Sep 17 00:00:00 2001 From: Aditya Kumar Date: Wed, 27 May 2015 15:06:25 +0000 Subject: [PATCH] auto-profile.c (afdo_calculate_branch_prob): Break once has_sample is true. * auto-profile.c (afdo_calculate_branch_prob): Break once has_sample is true. From-SVN: r223762 --- gcc/ChangeLog | 3 +++ gcc/auto-profile.c | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5b12b4a3d89..c6bd18b50ee 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,8 @@ 2015-05-22 Aditya Kumar + * auto-profile.c (afdo_calculate_branch_prob): Break once has_sample + is true. + * statistics.c (statistics_fini_pass): Print pass name. 2015-05-27 Richard Biener diff --git a/gcc/auto-profile.c b/gcc/auto-profile.c index 55dd8d18483..1936487242f 100644 --- a/gcc/auto-profile.c +++ b/gcc/auto-profile.c @@ -1365,8 +1365,13 @@ afdo_calculate_branch_prob (bb_set *annotated_bb, edge_set *annotated_edge) bool has_sample = false; FOR_EACH_BB_FN (bb, cfun) - if (bb->count > 0) - has_sample = true; + { + if (bb->count > 0) + { + has_sample = true; + break; + } + } if (!has_sample) return; -- 2.30.2