From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by sourceware.org (Postfix) with ESMTPS id D187C3858432 for ; Fri, 15 Oct 2021 14:17:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D187C3858432 Received: by mail-pg1-x535.google.com with SMTP id e7so8765579pgk.2 for ; Fri, 15 Oct 2021 07:17:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=6AEYzqBLJJwOFL06D2C/Q5cvGaUkDcHHiDtGGCq3UCw=; b=kNDtxZ34UULa531VOnFV13OFooy9HqXOmtrQWva8VqDIAEvA4piVnjjEi+SSOblzD2 Sr1xad/qMwlh9CDpKt/qyXqlD5EtVmmKT99ulsG3+9I1IcV6s+p0fr5GBRpjDWkh500s homwF7fU4dJ/Ip8AkG4mK/iO3CChhwhn3YpO7shRxqjOBe/ez5WVEve6FYpJ+GL/3iQC wBXNCMCzVmZ8VET2KyXWipKt5Bs92vzMeCjoQCXJZkPHmo3V8RKMZbIlAkXmH6rQEjWp NJyfgytIFfq8PFS415oPWfP9h2bkoG+AANOl7oVEDZl6pEx84jv7fZiu1THwvytsZ58i uHsg== X-Gm-Message-State: AOAM530mnvifZbcDcF40t973Md/7UDDrCxjgtbXqLv1joihqGcBRt7ci 8GoAuzcNZmpwu9Xk6WhN8a8= X-Google-Smtp-Source: ABdhPJy4lMxqmaadxwd3wKIrJeDrIqByKomAgIJY7fYMqfrXhgXhcnEV/rnZIbcTAZVOUVuYtr5OmQ== X-Received: by 2002:a63:5453:: with SMTP id e19mr9307354pgm.178.1634307423738; Fri, 15 Oct 2021 07:17:03 -0700 (PDT) Received: from [172.31.0.175] (c-98-202-48-222.hsd1.ut.comcast.net. [98.202.48.222]) by smtp.gmail.com with ESMTPSA id w4sm5195467pfb.3.2021.10.15.07.17.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 15 Oct 2021 07:17:03 -0700 (PDT) Subject: Re: [PATCH] Ranger : Do not process abnormal ssa-names. To: Andrew MacLeod , gcc-patches , Aldy Hernandez , Richard Biener , Jakub Jelinek References: <65efdb72-260a-e5a3-5b28-f536f86bd5e6@redhat.com> From: Jeff Law Message-ID: <86d78306-d33b-4263-824d-5ef1712ebe41@gmail.com> Date: Fri, 15 Oct 2021 08:17:02 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <65efdb72-260a-e5a3-5b28-f536f86bd5e6@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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-List-Received-Date: Fri, 15 Oct 2021 14:17:07 -0000 On 10/15/2021 7:50 AM, Andrew MacLeod via Gcc-patches wrote: > I've been looking at the pathological time issue ranger has with the > testcase from, uuuuuh..  PR 97623 I think.  I've lost the details, but > kept the file since it was showing unpleasant behaviour. > > Most of the time is spent in callbacks from substitute_and_fold to > value_on_edge()  dealing with PHI results and arguments.  Turns out, > its virtually all wasted time dealing with SSA_NAMES with the > OCCURS_IN_ABNORMAL_PHI flag set.. > > This patch tells ranger not to consider any SSA_NAMEs which occur in > abnormal PHIs.  This reduces the memory footprint of all the caches, > and also has a ripple effect with the new threader code which uses the > GORI exports and imports tables, making it faster as well as no > ssa-name with the abnormal flag set will be entered into the tables. > > That alone was not quite enough, as all the sheer volume of call backs > still took time,  so I added checks in the value_of_* class of > routines used by substitute_and_fold to indicate there is no constant > value available for any SSA_NAME with that flag set. > > On my x86_64 box, before this change, that test case looked like: > > tree VRP                           :   7.76 (  4%)   0.23 ( 5%) 8.02 > (  4%)   537k (  0%) > tree VRP threader                  :   7.20 (  4%)   0.08 (  2%) 7.28 > (  4%)   392k (  0%) > tree Early VRP                     :  39.22 ( 22%)   0.07 (  2%) 39.44 > ( 22%)  1142k (  0%) > > And with this patch , the results are: > >  tree VRP                           :   7.57 (  6%)   0.26 ( 5%) 7.85 > (  6%)   537k (  0%) >  tree VRP threader                  :   0.62 (  0%)   0.02 ( 0%) 0.65 > (  0%)   392k (  0%) >  tree Early VRP                     :   4.00 (  3%)   0.01 ( 0%) 4.03 > (  3%)  1142k (  0%) > > Which is a significant improvement, both for EVRP and the threader.. > > The patch adjusts the ranger folder, as well as the hybrid folder. > > bootstrapped on x86_64-pc-linux-gnu with no regressions and no missed > cases that I have been able to find. > > I don't want to push it quite yet as I wanted feedback to make sure we > don't actually do anything I'm not aware of with SSA_NAMES which have > the ABNORMAL_PHI flag set.  Most of the code i can find in VRP and > vr-values appears to punt, so I presume not even considering those > names is fine? > > This also seems like something that might be worth back-porting, > especially the hybrid pass parts... Punting on the abnormals seems perfectly fine to me.  They rarely, if ever, provide information that improves optimization. Jeff