From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id AFEE33858D20 for ; Mon, 22 Jan 2024 13:27:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AFEE33858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AFEE33858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705930043; cv=none; b=H56kiYW5tDDsEr416xV3Yyr+DOUsCJV0TKmuVN7ZRfY3QTaJHOvQfmIgqZ9IRuKCpiLaTJZ0WHBEAIyxciKJNmDuZaewnQrVDlCSOPTI172U5DZSeIrg+JOJWBy11XM9AVmTcCr3HrCoexnOgeij5pRmwdQOM3LNZPPRyyAum0k= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705930043; c=relaxed/simple; bh=s8tuHQ5OZhl8XebtfCoUeRf5tpq04NEJoFdiCLNKDxQ=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=n4gRipVffO7N5ILmt2Z3CzPcioqKsBF7gzGsZjBzoqfUsSPuSNzwIuuNpFYQWzLXopci5uBTpYXadTugp7pUDMDzWYfN6jwQV2wH6Kw+fLgpdrQNsDEkX+OSk3C7JdLNaEaur9m6D4abPz8litf4NmDfDFD4hSg88WCFZRzWH1w= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 57A491FB; Mon, 22 Jan 2024 05:28:05 -0800 (PST) Received: from localhost (e121540-lin.manchester.arm.com [10.32.110.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 96D833F73F; Mon, 22 Jan 2024 05:27:18 -0800 (PST) From: Richard Sandiford To: Alex Coplan Mail-Followup-To: Alex Coplan ,gcc-patches@gcc.gnu.org, Kyrylo Tkachov , Richard Earnshaw , richard.sandiford@arm.com Cc: gcc-patches@gcc.gnu.org, Kyrylo Tkachov , Richard Earnshaw Subject: Re: [PATCH 1/4] rtl-ssa: Run finalize_new_accesses forwards [PR113070] References: Date: Mon, 22 Jan 2024 13:27:17 +0000 In-Reply-To: (Alex Coplan's message of "Sat, 13 Jan 2024 15:43:18 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-21.4 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_NONE,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Alex Coplan writes: > The next patch in this series exposes an interface for creating new uses > in RTL-SSA. The intent is that new user-created uses can consume new > user-created defs in the same change group. This is so that we can > correctly update uses of memory when inserting a new store pair insn in > the aarch64 load/store pair fusion pass (the affected uses need to > consume the new store pair insn). > > As it stands, finalize_new_accesses is called as part of the backwards > insn placement loop within change_insns, but if we want new uses to be > able to depend on new defs in the same change group, we need > finalize_new_accesses to be called on earlier insns first. This is so > that when we process temporary uses and turn them into permanent uses, > we can follow the last_def link on the temporary def to ensure we end up > with a permanent use consuming a permanent def. > > Bootstrapped/regtested on aarch64-linux-gnu, OK for trunk? > > Thanks, > Alex > > gcc/ChangeLog: > > PR target/113070 > * rtl-ssa/changes.cc (function_info::change_insns): Split out the call > to finalize_new_accesses from the backwards placement loop, run it > forwards in a separate loop. OK, thanks. Richard > --- > gcc/rtl-ssa/changes.cc | 21 ++++++++++++++++----- > 1 file changed, 16 insertions(+), 5 deletions(-) > > diff --git a/gcc/rtl-ssa/changes.cc b/gcc/rtl-ssa/changes.cc > index 2fac45ae885..e538b637848 100644 > --- a/gcc/rtl-ssa/changes.cc > +++ b/gcc/rtl-ssa/changes.cc > @@ -775,15 +775,26 @@ function_info::change_insns (array_slice changes) > placeholder = add_placeholder_after (after); > following_insn = placeholder; > } > - > - // Finalize the new list of accesses for the change. Don't install > - // them yet, so that we still have access to the old lists below. > - finalize_new_accesses (change, > - placeholder ? placeholder : insn); > } > placeholders[i] = placeholder; > } > > + // Finalize the new list of accesses for each change. Don't install them yet, > + // so that we still have access to the old lists below. > + // > + // Note that we do this forwards instead of in the backwards loop above so > + // that any new defs being inserted are processed before new uses of those > + // defs, so that the (initially) temporary uses referring to temporary defs > + // can be easily updated to become permanent uses referring to permanent defs. > + for (unsigned i = 0; i < changes.size (); i++) > + { > + insn_change &change = *changes[i]; > + insn_info *placeholder = placeholders[i]; > + if (!change.is_deletion ()) > + finalize_new_accesses (change, > + placeholder ? placeholder : change.insn ()); > + } > + > // Remove all definitions that are no longer needed. After the above, > // the only uses of such definitions should be dead phis and now-redundant > // live-out uses.