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 829393858C2C for ; Tue, 30 Nov 2021 11:36:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 829393858C2C 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 1F0D01063; Tue, 30 Nov 2021 03:36:57 -0800 (PST) Received: from [10.57.1.52] (unknown [10.57.1.52]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 830E73F766; Tue, 30 Nov 2021 03:36:56 -0800 (PST) Message-ID: <5477e0cb-6dc9-e828-7c20-a99de3c6840c@arm.com> Date: Tue, 30 Nov 2021 11:36:54 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Subject: Re: [PATCH 1v2/3][vect] Add main vectorized loop unrolling Content-Language: en-US To: Richard Biener Cc: "gcc-patches@gcc.gnu.org" , richard.sandiford@arm.com References: <4a2e6dde-cc5c-97fe-7a43-bd59d542c2ce@arm.com> <27777876-4201-5e86-bf9a-063143d38641@arm.com> <4272814n-8538-p793-157q-5n6q16r48n51@fhfr.qr> <623fbfd9-b97c-8c6e-0348-07d6c4496592@arm.com> <5c887c48-7f7e-c02b-2998-7a7c41b11af8@arm.com> <33cb143e-bb2e-e214-cd5f-66fd2d1bd20b@arm.com> <5op15ns-4sq8-2sn3-41qs-49q44417sp6@fhfr.qr> <99qs2o2p-pn87-n164-q8n9-9p814r6n75r1@fhfr.qr> <475fae98-9541-5dca-2e60-eaff172ff787@arm.com> <8p72o15s-5894-4or0-409r-oo4p74o238r1@fhfr.qr> <21e3500d-6cf5-ed46-6f95-1f554c5dbc50@arm.com> From: "Andre Vieira (lists)" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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, 30 Nov 2021 11:36:59 -0000 On 25/11/2021 12:46, Richard Biener wrote: > Oops, my fault, yes, it does. I would suggest to refactor things so > that the mode_i = first_loop_i case is there only once. I also wonder > if all the argument about starting at 0 doesn't apply to the > not unrolled LOOP_VINFO_EPIL_USING_PARTIAL_VECTORS_P as well? So > what's the reason to differ here? So in the end I'd just change > the existing > > if (LOOP_VINFO_EPIL_USING_PARTIAL_VECTORS_P (first_loop_vinfo)) > { > > to > > if (LOOP_VINFO_EPIL_USING_PARTIAL_VECTORS_P (first_loop_vinfo) > || first_loop_vinfo->suggested_unroll_factor > 1) > { > > and maybe revisit this when we have an actual testcase showing that > doing sth else has a positive effect? > > Thanks, > Richard. So I had a quick chat with Richard Sandiford and he is suggesting resetting mode_i to 0 for all cases. He pointed out that for some tunings the SVE mode might come after the NEON mode, which means that even for not-unrolled loop_vinfos we could end up with a suboptimal choice of mode for the epilogue. I.e. it could be that we pick V16QI for main vectorization, but that's VNx16QI + 1 in the array, so we'd not try VNx16QI for the epilogue. This would simplify the mode selecting cases, by just simply restarting at mode_i in all epilogue cases. Is that something you'd be OK? Regards, Andre