diff mbox

Break when has_sample is true

Message ID 1432649242-32105-1-git-send-email-hiraditya@msn.com
State New
Headers show

Commit Message

Aditya K May 26, 2015, 2:07 p.m. UTC
gcc/ChangeLog:

2015-05-26  Aditya Kumar  <hiraditya@msn.com>

        * auto-profile.c (afdo_calculate_branch_prob): Break once has_sample is true.


---
 gcc/auto-profile.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

Jeff Law May 26, 2015, 2:14 p.m. UTC | #1
On 05/26/2015 08:07 AM, Aditya Kumar wrote:
> gcc/ChangeLog:
>
> 2015-05-26  Aditya Kumar  <hiraditya@msn.com>
>
>          * auto-profile.c (afdo_calculate_branch_prob): Break once has_sample is true.
OK.  Please install onto the trunk.

Thanks,
jeff
Aditya K May 26, 2015, 2:32 p.m. UTC | #2
I don't have commit access. I would appreciate if someone does that for me.

Thanks,
-Aditya

----------------------------------------
> Date: Tue, 26 May 2015 08:14:41 -0600
> From: law@redhat.com
> To: hiraditya@msn.com; gcc-patches@gcc.gnu.org
> Subject: Re: [PATCH] Break when has_sample is true
>
> On 05/26/2015 08:07 AM, Aditya Kumar wrote:
>> gcc/ChangeLog:
>>
>> 2015-05-26 Aditya Kumar <hiraditya@msn.com>
>>
>> * auto-profile.c (afdo_calculate_branch_prob): Break once has_sample is true.
> OK. Please install onto the trunk.
>
> Thanks,
> jeff
>
Jeff Law May 27, 2015, 3:07 p.m. UTC | #3
On 05/26/2015 08:32 AM, Aditya K wrote:
>
> I don't have commit access. I would appreciate if someone does that for me.
>
> Thanks,
> -Aditya
>
> ----------------------------------------
>> Date: Tue, 26 May 2015 08:14:41 -0600
>> From: law@redhat.com
>> To: hiraditya@msn.com; gcc-patches@gcc.gnu.org
>> Subject: Re: [PATCH] Break when has_sample is true
>>
>> On 05/26/2015 08:07 AM, Aditya Kumar wrote:
>>> gcc/ChangeLog:
>>>
>>> 2015-05-26 Aditya Kumar <hiraditya@msn.com>
>>>
>>> * auto-profile.c (afdo_calculate_branch_prob): Break once has_sample is true.
>> OK. Please install onto the trunk.
Installed on the trunk after a bootstrap and regression test run on 
x86-linux-gnu.



jeff
diff mbox

Patch

diff --git a/gcc/auto-profile.c b/gcc/auto-profile.c
index 55dd8d1..1936487 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;