From patchwork Sat Dec 11 19:54:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 48834 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B7CCF3857C7A for ; Sat, 11 Dec 2021 19:55:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B7CCF3857C7A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1639252522; bh=WVwj/anTV7UECdfrY/4fmfuGn22IbLJl2piIz9ATrzo=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=DB9ZF5wkc/HkGh6USilsVCCB1aFt4uqePJ/qZBFYYXMCTRYNw05oovRkHfUSnvv2g tsk68H8YmcVLanjJZu0piPj8mu00Z3GMTUimjozrEuVISE7zjTuuhM9AvkmV5PMNRK 0z+1ZIxzxY88P7kNpAvNxDeWqLl5BE7MakcHcZWM= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from nikam.ms.mff.cuni.cz (nikam.ms.mff.cuni.cz [195.113.20.16]) by sourceware.org (Postfix) with ESMTPS id 65EA93858D39 for ; Sat, 11 Dec 2021 19:54:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 65EA93858D39 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id E70D8280B1D; Sat, 11 Dec 2021 20:54:50 +0100 (CET) Date: Sat, 11 Dec 2021 20:54:50 +0100 To: gcc-patches@gcc.gnu.org Subject: Fix handling of histogram in ipa-profile Message-ID: <20211211195450.GB50931@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jan Hubicka via Gcc-patches From: Jan Hubicka Reply-To: Jan Hubicka Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Hi, this patch removes apparently forgotten debugging hack (which got in during the speculative call patchset) which reduces hot bb threshold. This does not make sense since it is set and reset randomly as the summaries are processed. One problem is that we set the BB threshold to make certain BBs hot and hten unrolling or vectorization may reduce it to some fraction of the count that makes it cold. We may want to add some buffer and divide the value by, say 32, but that shoulid be done independently of speculative calls. gcc/ChangeLog: 2021-12-11 Jan Hubicka * ipa-profile.c (ipa_profile): Do not update hot bb threshold. diff --git a/gcc/ipa-profile.c b/gcc/ipa-profile.c index ce32b538976..02f42d9b0f7 100644 --- a/gcc/ipa-profile.c +++ b/gcc/ipa-profile.c @@ -854,18 +854,6 @@ ipa_profile (void) node_map_initialized = true; ncommon++; - if (in_lto_p) - { - if (dump_file) - { - fprintf (dump_file, - "Updating hotness threshold in LTO mode.\n"); - fprintf (dump_file, "Updated min count: %" PRId64 "\n", - (int64_t) threshold / spec_count); - } - set_hot_bb_threshold (threshold / spec_count); - } - unsigned speculative_id = 0; profile_count orig = e->count; for (unsigned i = 0; i < spec_count; i++)