From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by sourceware.org (Postfix) with ESMTP id ADAFF3857832 for ; Wed, 16 Dec 2020 03:52:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org ADAFF3857832 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-482-toNZgtOuMWq1is4UlHsoPQ-1; Tue, 15 Dec 2020 22:52:17 -0500 X-MC-Unique: toNZgtOuMWq1is4UlHsoPQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D6249180A092; Wed, 16 Dec 2020 03:52:16 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-161.phx2.redhat.com [10.3.112.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8B32A27C41; Wed, 16 Dec 2020 03:52:16 +0000 (UTC) Subject: Re: [PATCH 23/23] fwprop: Rewrite to use RTL SSA To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com References: From: Jeff Law Message-ID: <85ed5e60-b4a1-a531-de5a-1088196a0580@redhat.com> Date: Tue, 15 Dec 2020 20:52:16 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Wed, 16 Dec 2020 03:52:22 -0000 On 11/13/20 1:24 AM, Richard Sandiford via Gcc-patches wrote: > This patch rewrites fwprop.c to use the RTL SSA framework. It tries > as far as possible to mimic the old behaviour, even in caes where > that doesn't fit naturally with the new framework. I've added ??? > comments to mark those places, but I think “fixing” them should > be done separately to make bisection easier. > > In particular: > > * The old implementation iterated over uses, and after a successful > substitution, the new insn's uses were added to the end of the list. > The pass still processed those uses, but because it processed them at > the end, it didn't fully optimise one instruction before propagating > it into the next. > > The new version follows the same approach for comparison purposes, > but I'd like to drop that as a follow-on patch. > > * The old implementation operated on single use sites (DF_REF_LOCs). > This doesn't work well for instructions with match_dups, where it's > necessary to update both an operand and its dups at the same time. > For example, attempting to substitute into a divmod instruction would > fail because only the div or the mod side would be updated. > > The new version again follows this to some extent for comparison > purposes (although not exactly). Again I'd like to drop it as a > follow-on patch. > > One difference is that if a register occurs in multiple MEM addresses > in a set, the new version will try to update them all at once. This is > what causes the SVE ACLE st4* output to improve. > > Also, the old version didn't naturally guarantee termination (PR79405), > whereas the new one does. > > gcc/ > * fwprop.c: Rewrite to use the RTL SSA framework. > > gcc/testsuite/ > * gcc.dg/rtl/x86_64/test-return-const.c.before-fwprop.c: Don't > expect insn updates to be deferred. > * gcc.target/aarch64/sve/acle/asm/st4_s8.c: Expect the addition > to be folded into the address. > * gcc.target/aarch64/sve/acle/asm/st4_s8.c: Likewise. Consider killing the ADD_NOTES bits. s/eqaul/equal/ to fix a typo. Naturally I'm happy at how much by-hand RTL analysis code just disappears with this change :-) Ideally you'll drop this in tomorrow and we can get a fresh run of all the targets in my tester before the weekend.  I won't be stressed if we see some fallout, but I don't expect much.  I'll help track them down if they occur. Thanks for your patience. Jeff