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 859BE3860C33 for ; Tue, 11 Aug 2020 06:59:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 859BE3860C33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=richard.sandiford@arm.com 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 1C18FD6E; Mon, 10 Aug 2020 23:59:47 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.98.126]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6484C3F575; Mon, 10 Aug 2020 23:59:46 -0700 (PDT) From: Richard Sandiford To: Segher Boessenkool Mail-Followup-To: Segher Boessenkool , Senthil Kumar via Gcc-patches , Senthil Kumar , ebotcazou@adacore.com, richard.sandiford@arm.com Cc: Senthil Kumar via Gcc-patches , Senthil Kumar , ebotcazou@adacore.com Subject: Re: [PATCH] emit-rtl.c: Allow splitting of RTX_FRAME_RELATED_P insns? References: <20200810225327.GG6753@gate.crashing.org> Date: Tue, 11 Aug 2020 07:59:44 +0100 In-Reply-To: <20200810225327.GG6753@gate.crashing.org> (Segher Boessenkool's message of "Mon, 10 Aug 2020 17:53:27 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, 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: Tue, 11 Aug 2020 06:59:48 -0000 Segher Boessenkool writes: > On Mon, Aug 10, 2020 at 05:16:15PM +0100, Richard Sandiford wrote: >> Senthil Kumar via Gcc-patches writes: >> > The wiki suggests using post-reload splitters, so that's the >> > direction I took, but I ran into an issue where split_insn >> > bails out early if RTX_FRAME_RELATED_P is true - this means >> > that splits for REG_CC clobbering insns with >> > RTX_FRAME_RELATED_P will never execute, resulting in a >> > could-not-split insn ICE in the final stage. >> > >> > I see that the recog.c:peep2_attempt allows splitting of a >> > RTX_FRAME_RELATED_P insn, provided the result of the split is a >> > single insn. Would it be ok to modify try_split also to >> > allow those kinds of insns (tentative patch attached, code >> > copied over from peep2_attempt, only setting old and new_insn)? Or i= s there >> > a different approach to fix this? >>=20 >> I agree there's no obvious reason why splitting to a single insn >> should be rejected but a peephole2 to a single instruction should be OK. >> And reusing the existing, tried-and-tested code is the way to go. > > The only obvious difference is that the splitters run many times, while > peep2 runs only once, very late. If you make this only do stuff for > reload_completed splitters, that difference is gone as well. Yeah, but I was talking specifically about RTX_FRAME_RELATED_P stuff, rather than in general, and RTX_FRAME_RELATED_P insns shouldn't exist until prologue/epilogue generation. The reference to =E2=80=9Csingle insn= =E2=80=9D was because both passes would still reject splitting/peepholing an RTX_FRAME_RELATED_P insn to multiple insns. Thanks, Richard