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 49F683858296 for ; Sat, 11 Nov 2023 17:29:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 49F683858296 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 49F683858296 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=1699723793; cv=none; b=eEs6Z0m9yuSBPl5d/PABDupeuhLhH2YUpvpigzBElXNdolyjEv1wMV+YIza7pQ3Vk7dFmLyDDK9avAjDOfaD4VkPwVUeaT3dOtr0te+yA4xqzBbvTKCqjSlQygng9FBXYG9cFhSAnqeqKlthnvv+Ski+wuJ7XPlBu214sIJeQSw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699723793; c=relaxed/simple; bh=fxQKcIN5AgvOFQy/DYziQ56seBuQ0D3mqW5mnF5MU+A=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=ITsgXOw/InkwNqAxm75oMcJarFaoE9LgMytTnMusUcnDLY3BzDNhHEPdtPoy+Mg3kYmqQa7BTbCl+zG8i5Og0vxfpx2In5kIzhwruPGSCJYJUyzKxCoofh3E+RvfyI8svVoAE7Efd90szVPCFwDSc0TqgarpeCgooRCsa7UVinU= 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 6E3D312FC; Sat, 11 Nov 2023 09:30:36 -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 02FA73F64C; Sat, 11 Nov 2023 09:29:50 -0800 (PST) From: Richard Sandiford To: Jeff Law Mail-Followup-To: Jeff Law ,gcc-patches@gcc.gnu.org, jlaw@ventanamicro.com, richard.sandiford@arm.com Cc: gcc-patches@gcc.gnu.org, jlaw@ventanamicro.com Subject: Re: [PATCH 11/12] mode-switching: Add a target-configurable confluence operator References: <37798df6-5ffd-41c2-bb27-9e4ce54b83e8@gmail.com> <800942b9-c507-438f-9962-cc1d4cdca845@gmail.com> Date: Sat, 11 Nov 2023 17:29:49 +0000 In-Reply-To: <800942b9-c507-438f-9962-cc1d4cdca845@gmail.com> (Jeff Law's message of "Sat, 11 Nov 2023 09:19:56 -0700") 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=-17.1 required=5.0 tests=BAYES_00,KAM_DMARC_NONE,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Jeff Law writes: > On 11/11/23 08:54, Richard Sandiford wrote: >> Jeff Law writes: >>> On 11/5/23 11:50, Richard Sandiford wrote: >>>> The mode-switching pass assumed that all of an entity's modes >>>> were mutually exclusive. However, the upcoming SME changes >>>> have an entity with some overlapping modes, so that there is >>>> sometimes a "superunion" mode that contains two given modes. >>>> We can use this relationship to pass something more helpful than >>>> "don't know" to the emit hook. >>>> >>>> This patch adds a new hook that targets can use to specify >>>> a mode confluence operator. >>>> >>>> With mutually exclusive modes, it's possible to compute a block's >>>> incoming and outgoing modes by looking at its availability sets. >>>> With the confluence operator, we instead need to solve a full >>>> dataflow problem. >>>> >>>> However, when emitting a mode transition, the upcoming SME use of >>>> mode-switching benefits from having as much information as possible >>>> about the starting mode. Calculating this information is definitely >>>> worth the compile time. >>>> >>>> The dataflow problem is written to work before and after the LCM >>>> problem has been solved. A later patch makes use of this. >>>> >>>> While there (since git blame would ping me for the reindented code), >>>> I used a lambda to avoid the cut-&-pasted loops. >>>> >>>> gcc/ >>>> * target.def (mode_switching.confluence): New hook. >>>> * doc/tm.texi (TARGET_MODE_CONFLUENCE): New @hook. >>>> * doc/tm.texi.in: Regenerate. >>>> * mode-switching.cc (confluence_info): New variable. >>>> (mode_confluence, forward_confluence_n, forward_transfer): New >>>> functions. >>>> (optimize_mode_switching): Use them to calculate mode_in when >>>> TARGET_MODE_CONFLUENCE is defined. >>> OK. There's certain similarities between this and the compatible states >>> we can use to reduce vsetvl instructions in RV-V. I wonder if Juzhe or >>> Lehua could utilize this and do less custom optimization code in the RV >>> backend. >> >> Here's an update based on what you pointed out in 10/12. The change >> from last time is to add: >> >> if (targetm.mode_switching.backprop) >> clear_aux_for_edges (); >> >> before the main loop. Tested as before. >> >> Thanks, >> Richard >> >> >> gcc/ >> * target.def (mode_switching.confluence): New hook. >> * doc/tm.texi (TARGET_MODE_CONFLUENCE): New @hook. >> * doc/tm.texi.in: Regenerate. >> * mode-switching.cc (confluence_info): New variable. >> (mode_confluence, forward_confluence_n, forward_transfer): New >> functions. >> (optimize_mode_switching): Use them to calculate mode_in when >> TARGET_MODE_CONFLUENCE is defined. > OK. That's the whole set, right? Yeah, that's everything, thanks. I've now pushed the series. Richard