From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id 831703857C47 for ; Mon, 10 Aug 2020 22:53:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 831703857C47 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=segher@kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 07AMrSIR024434; Mon, 10 Aug 2020 17:53:28 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 07AMrRqC024433; Mon, 10 Aug 2020 17:53:27 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Mon, 10 Aug 2020 17:53:27 -0500 From: Segher Boessenkool To: Senthil Kumar via Gcc-patches , Senthil Kumar , ebotcazou@adacore.com, richard.sandiford@arm.com Subject: Re: [PATCH] emit-rtl.c: Allow splitting of RTX_FRAME_RELATED_P insns? Message-ID: <20200810225327.GG6753@gate.crashing.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-9.0 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, TXREP, T_SPF_HELO_PERMERROR, T_SPF_PERMERROR autolearn=no 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: Mon, 10 Aug 2020 22:53:36 -0000 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 is there > > a different approach to fix this? > > 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. > But could you split the code out of peep2_attempt into a subroutine > (probably still in recog.c) and reuse it in try_split? Yes please :-) Segher