From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by sourceware.org (Postfix) with ESMTPS id ECA6D3856942 for ; Thu, 14 Jul 2022 14:21:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org ECA6D3856942 Received: by mail-pl1-f178.google.com with SMTP id r1so544980plo.10 for ; Thu, 14 Jul 2022 07:21:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=r5Lngrat0T6Jp9Z13n28FvrbEARFGeM5Md4t+iXmbbw=; b=ImRpce67MSyAqzV1f1spT2rBKxIf8mkZGIPd4NancYFMfqqp/Nl4g+wg7xvyJG4jSX o7L4DG8rB9zTPLVmhYIU6CcDQkaNWSBK3o+a9XFvAcePj8vgKMGXQQCuI5w8Lh+f3PyI mJHtsdI6wq2y4iq1AOyNXRt7RQCT8v6WriYETM/E1pSKoAQZ1yDBFShYItDBejId+1uE ctCQ43ZuMho47u5qBUNU4nscf+/j1y+tYtd6e2jg/erlGa4V9FjMRWG2roJ/DT4DfvFI O3uF7kpTwTllz2AJcfRZO9G5oENeVLAIrF4HJ5I7GMSgefSkESlwvMUXN4WX22ZGgY2w klWQ== X-Gm-Message-State: AJIora/iHSSqmg4L0dmia2S9z+Sg6Db+z9MXmW+BoiMW8l55/zJ1kbZD kzGUK9K5e5ePA4sU+0ORMY37s+sWxFmrnQ== X-Google-Smtp-Source: AGRyM1vufWBoKnlrDVaRKhyjBnwvipVh97cCFlIp6rxbCUOswY3egke5W7Y1klkyNnwaLQcsvNQpdQ== X-Received: by 2002:a17:90a:7e84:b0:1f0:f3de:ffb3 with SMTP id j4-20020a17090a7e8400b001f0f3deffb3mr743647pjl.75.1657808472590; Thu, 14 Jul 2022 07:21:12 -0700 (PDT) Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com. [209.85.214.180]) by smtp.gmail.com with ESMTPSA id 1-20020a170902c10100b0015e8d4eb2cdsm1510000pli.279.2022.07.14.07.21.12 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 Jul 2022 07:21:12 -0700 (PDT) Received: by mail-pl1-f180.google.com with SMTP id 5so544033plk.9 for ; Thu, 14 Jul 2022 07:21:12 -0700 (PDT) X-Received: by 2002:a17:90b:3d85:b0:1f0:7355:734 with SMTP id pq5-20020a17090b3d8500b001f073550734mr11925730pjb.24.1657808471776; Thu, 14 Jul 2022 07:21:11 -0700 (PDT) MIME-Version: 1.0 References: <90b22551-734c-72e4-ad33-864385162f9f@suse.cz> In-Reply-To: <90b22551-734c-72e4-ad33-864385162f9f@suse.cz> From: Erick Ochoa Date: Thu, 14 Jul 2022 16:25:13 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Creating a wrapper around a function at compile time To: =?UTF-8?Q?Martin_Li=C5=A1ka?= Cc: Richard Biener , GCC Development X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jul 2022 14:21:17 -0000 On Thu, 14 Jul 2022 at 16:10, Martin Li=C5=A1ka wrote: > On 7/14/22 16:08, Erick Ochoa via Gcc wrote: > > Last time I checked, value profiling can only track a single value per > > statement. > > Hi. > > Take a look at HIST_TYPE_INDIR_CALL which we use for tracking at maximum = 32 > (#define GCOV_TOPN_MAXIMUM_TRACKED_VALUES 32) and we use for indirect cal= l > speculative calls which you can see for instance here: > > ./gcc/testsuite/g++.dg/tree-prof/indir-call-prof.C > Thanks Martin, I'll give it a read. However, I have mis-spoken. If my understanding is correct: multiple values are tracked, but only the values of a single variable/expression per statement are tracked. That means that for a gcall (which is a single statement and) which has n argument expressions, I believe that the naive way to track all argument expressions is not possible without extending how histograms are associated to statements. Perhaps canonicalizing how callsites work (i.e., only variables are allowed as arguments in call sites and then associating a histogram to the definition of the variables being used in call sites) would be enough, but I haven't given it much thought for the consequences that might follow from this. > > Cheers, > Martin >