From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by sourceware.org (Postfix) with ESMTPS id 15B8D3858404 for ; Sat, 16 Oct 2021 16:22:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 15B8D3858404 Received: by mail-wr1-x434.google.com with SMTP id g25so31909858wrb.2 for ; Sat, 16 Oct 2021 09:22:11 -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:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=XJiFlU+aeNlPsXIzX66eRfyYwsN15WJuQUuewSLtQoU=; b=0RVGtUtGfMfrExX9q5cgQXNTr2LeXz5SNzkwRB2OYIwxUZaktuLskDrkH/IkqcnIzO VSt5FoUewVMdQojyYxL7ImUlqiorPly0w7ohUeAtZYF98MSaSbioyOFTvD9amcQ4We6N xFPgKWkmP4fj+keLsGHu0tRPhy02QGRTi/VEEDCEP2deLgcwbBEbezU6nCzG57ElZh7z Ra2SL2IUJJTQKNL60i048D1ChypuDe5OiXEq7xhRnJ0V4SHsY3q4qGsNSYQnLD0XWAgB TSk+kzG7jPOKXXKYf2xpEtqtMkkfGg89PzGskikVz3ziX6vmSDjmzRYS+g2yzdC3nhR4 9Iww== X-Gm-Message-State: AOAM531WwCyYEJ6PNVRaMEweA5mpGNKOjCLo6CRnvhuj8+nr7CaVjniR DQp9wPgsLy+tRazU6WbQbyU= X-Google-Smtp-Source: ABdhPJxUFqxJvGq1InHQe1b8nQuBnxeXs23gdn/+iRxgx+J58XgI12Ue38PjL5poNYG+TVnkvMOoRQ== X-Received: by 2002:adf:d1c5:: with SMTP id b5mr22488903wrd.419.1634401329745; Sat, 16 Oct 2021 09:22:09 -0700 (PDT) Received: from [192.168.1.214] (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.googlemail.com with ESMTPSA id o6sm10044695wri.49.2021.10.16.09.22.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Oct 2021 09:22:09 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\)) Subject: Re: [PATCH] Ranger : Do not process abnormal ssa-names. From: Iain Sandoe In-Reply-To: Date: Sat, 16 Oct 2021 17:22:01 +0100 Cc: gcc-patches Content-Transfer-Encoding: quoted-printable Message-Id: <31D3C8B5-9356-4B92-ADD0-3AF9A6133D78@googlemail.com> References: <65efdb72-260a-e5a3-5b28-f536f86bd5e6@redhat.com> To: Andrew MacLeod X-Mailer: Apple Mail (2.3445.104.21) X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_SHORT, 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: Sat, 16 Oct 2021 16:22:12 -0000 > On 16 Oct 2021, at 10:27, Andrew Pinski via Gcc-patches = wrote: >=20 > On Fri, Oct 15, 2021 at 6:53 AM Andrew MacLeod via Gcc-patches > wrote: >>=20 >> 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. >>=20 >> 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.. >>=20 >> 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. >>=20 >> 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. >>=20 >> On my x86_64 box, before this change, that test case looked like: >>=20 >> 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%) >>=20 >> And with this patch , the results are: >>=20 >> 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%) >>=20 >> Which is a significant improvement, both for EVRP and the threader.. >>=20 >> The patch adjusts the ranger folder, as well as the hybrid folder. >>=20 >> bootstrapped on x86_64-pc-linux-gnu with no regressions and no missed >> cases that I have been able to find. >=20 > Did you test it with go enabled? > Because others and myself are now running into a bootstrap failure > most likely due to this patch. > The number of SSA_NAME_OCCURS_IN_ABNORMAL_PHI in go is increased due > to -fnon-call-exceptions being true there. and, presumably for similar reasons, there are around 25 Ada regressions = on several platforms. the acats output is probably not as helpful as Andrew=E2=80=99s ICE. Iain (possibly, there are some D / libphobos regressions too - but I didn=E2=80= =99t bisect those) >=20 > Thanks, > Andrew Pinski > PS here is the ICE for me: > libtool: compile: > /home/apinski/src/upstream-gcc/gcc/objdir/./gcc/gccgo > -B/home/apinski/src/upstream-gcc/gcc/objdir/./gcc/ > -B/home/apinski/upstream-gcc/x86_64-pc-linux-gnu/bin/ > -B/home/apinski/upstream-gcc/x86_64-pc-linux-gnu/lib/ -isystem > /home/apinski/upstream-gcc/x86_64-pc-linux-gnu/include -isystem > /home/apinski/upstream-gcc/x86_64-pc-linux-gnu/sys-include > -fchecking=3D1 -minline-all-stringops -O2 -g -m32 -I . -c > -fgo-pkgpath=3Dcmd/go/internal/modget > = /home/apinski/src/upstream-gcc/gcc/libgo/go/cmd/go/internal/modget/get.go > = /home/apinski/src/upstream-gcc/gcc/libgo/go/cmd/go/internal/modget/query.g= o > -o cmd/go/internal/modget.o > during GIMPLE pass: evrp > In function =E2=80=98cmd/go/internal/modget.resolver.resolveQueries=E2=80= =99: > go1: internal compiler error: tree check: expected class =E2=80=98type=E2= =80=99, have > =E2=80=98exceptional=E2=80=99 (error_mark) in = useless_type_conversion_p, at > gimple-expr.c:87 > 0x862719 tree_class_check_failed(tree_node const*, tree_code_class, > char const*, int, char const*) > /home/apinski/src/upstream-gcc/gcc/gcc/tree.c:8739 > 0x7910ed tree_class_check(tree_node*, tree_code_class, char const*, > int, char const*) > /home/apinski/src/upstream-gcc/gcc/gcc/tree.h:3556 > 0x7910ed useless_type_conversion_p(tree_node*, tree_node*) > /home/apinski/src/upstream-gcc/gcc/gcc/gimple-expr.c:87 > 0xf81a58 verify_gimple_phi > /home/apinski/src/upstream-gcc/gcc/gcc/tree-cfg.c:5128 > 0xf81a58 verify_gimple_in_cfg(function*, bool) > /home/apinski/src/upstream-gcc/gcc/gcc/tree-cfg.c:5457 > 0xe54a57 execute_function_todo > /home/apinski/src/upstream-gcc/gcc/gcc/passes.c:2042 > 0xe5546e execute_todo > /home/apinski/src/upstream-gcc/gcc/gcc/passes.c:2096 > Please submit a full bug report, > with preprocessed source if appropriate. > Please include the complete backtrace with any bug report. > See for instructions. >=20 >=20 >>=20 >> 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? >>=20 >> This also seems like something that might be worth back-porting, >> especially the hybrid pass parts... >>=20 >> Andrew