From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7880) id D78CC385AC29; Thu, 23 Feb 2023 23:22:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D78CC385AC29 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677194552; bh=rQlOtOrNZVANJDt3D+cCUpZvE8mqYjq+78jUzdNJ5d8=; h=From:To:Subject:Date:From; b=TjR1EaVlWnE2pNijr8P4+yk9DdW+zqf3F4cCY3SiFskL4EQEr25+XXcxGmZRtzj3E zUVNiHqvMUESVZ8omuVqcORPv7iGd+TnhYr9NTc/GF0S+/WH8lHB6QlXoNSN7YYMtK RQtZKjvnik8jwutqwKVG0LWvAUun4CEegbLDQu5M= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Ondrej Kubanek To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/kubaneko/heads/histogram)] vector for histogram_counters not working yet X-Act-Checkin: gcc X-Git-Author: kubaneko X-Git-Refname: refs/users/kubaneko/heads/histogram X-Git-Oldrev: ecf3c41ca0dd4b6cf8319b2a444e8b6e71d5c25f X-Git-Newrev: 680d2bf08fa12f99cfcdfd946b95465061cd13a8 Message-Id: <20230223232232.D78CC385AC29@sourceware.org> Date: Thu, 23 Feb 2023 23:22:32 +0000 (GMT) List-Id: https://gcc.gnu.org/g:680d2bf08fa12f99cfcdfd946b95465061cd13a8 commit 680d2bf08fa12f99cfcdfd946b95465061cd13a8 Author: kubaneko Date: Mon Jan 2 14:54:29 2023 +0000 vector for histogram_counters not working yet Diff: --- gcc/cfgloop.h | 2 +- gcc/profile.cc | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/cfgloop.h b/gcc/cfgloop.h index 8ec6bb03ad1..c0604ff2ffc 100644 --- a/gcc/cfgloop.h +++ b/gcc/cfgloop.h @@ -97,7 +97,7 @@ struct loop_exit_hasher : ggc_ptr_hash struct GTY(()) histogram_counters{ gcov_type sum; int histogram_size; - gcov_type hist[69]; + vec *hist=NULL; }; // quantil function for the distribution diff --git a/gcc/profile.cc b/gcc/profile.cc index 5a6cedfaaec..f4dfe575c61 100644 --- a/gcc/profile.cc +++ b/gcc/profile.cc @@ -931,10 +931,12 @@ compute_value_histograms (histogram_values values, unsigned cfg_checksum, lp->counters=ggc_alloc(); gcov_type sum=0; for (int i=0;icounters->hist[i]=act_count[t][i]; + auto hst=lp->counters->hist; + (*hst)[i]=act_count[t][i]; sum+=act_count[t][i]; } lp->counters->sum=sum; + vec_safe_grow_cleared(lp->counters->hist,param_profile_histogram_size); } continue; }