From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 47097 invoked by alias); 6 Jun 2017 09:05:11 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 47062 invoked by uid 89); 6 Jun 2017 09:05:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-6.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,SPF_PASS autolearn=ham version=3.3.2 spammy=COVERAGE X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 06 Jun 2017 09:05:08 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 775D1AD45 for ; Tue, 6 Jun 2017 09:05:10 +0000 (UTC) Resent-From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Resent-To: GCC Patches Resent-Date: Tue, 6 Jun 2017 11:05:06 +0200 Resent-Message-ID: <90a253cb-577a-c82f-a228-9e197bfc8369@suse.cz> Resent-User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 Message-Id: From: marxin Date: Tue, 06 Jun 2017 09:05:00 -0000 Subject: [PATCH 0/3] Rework early return and hot/cold label predictors To: gcc-patches@gcc.gnu.org Cc: hubicka@ucw.cz X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg00276.txt.bz2 Hello. As mentioned in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79489#c1 early-return predictors is currenty not much precise. I decided to come up with GIMPLE_PREDICT statement that I put early and thus more precise numbers can be seen. For SPEC 2017 we can improve the predictor from: HEURISTICS BRANCHES (REL) BR. HITRATE HITRATE COVERAGE COVERAGE (REL) predict.def (REL) early return (on trees) 17804 11.7% 63.54% 55.14% / 85.46% 38154989508 38.15G 5.4% 54% 1.1% to: early return (on trees) 3692 4.1% 79.55% 66.22% / 76.14% 15778842701 15.78G 2.4% 66% 0.2% For tests I had to change couple of tailrecursion tests, where recursion happens in tailr2 pass. It's not done in tailr1 due to GIMPLE_PREDICT statement. Apart from that I would like to add a sanity unit tests for values of predictors. And finally, I was asked by Honza to transform cold/hot label predictors to GIMPLE_PREDICT as well. Patch can bootstrap on ppc64le-redhat-linux and survives regression tests. Ready to be installed? Martin marxin (3): Come up with selftests for predict.c. Make early return predictor more precise. Rework cold and hot label attributes in predict.c. gcc/gimple-low.c | 3 + gcc/gimple-predict.h | 8 ++ gcc/gimplify.c | 26 +++++- gcc/predict.c | 103 +++++++++--------------- gcc/predict.def | 15 +--- gcc/selftest-run-tests.c | 1 + gcc/selftest.h | 1 + gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c | 4 +- gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-1.c | 4 +- gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-2.c | 4 +- gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-6.c | 4 +- gcc/tree-inline.c | 7 ++ 12 files changed, 95 insertions(+), 85 deletions(-) -- 2.13.0