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 044553858D39 for ; Mon, 1 Aug 2022 10:21:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 044553858D39 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 56746139F; Mon, 1 Aug 2022 03:21:19 -0700 (PDT) Received: from [10.1.28.154] (E121495.arm.com [10.1.28.154]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1A7323F67D; Mon, 1 Aug 2022 03:21:17 -0700 (PDT) Message-ID: <69abe824-94f5-95b5-fb7f-6fa076973e05@arm.com> Date: Mon, 1 Aug 2022 11:21:13 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [RFC] Teach vectorizer to deal with bitfield reads Content-Language: en-US To: Richard Biener , Jakub Jelinek Cc: Richard Sandiford , "gcc-patches@gcc.gnu.org" References: <4a6f2350-f070-1473-63a5-3232968d3a89@arm.com> <4ea91767-de43-9d30-5bd2-a9a0759760c7@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=-18.8 required=5.0 tests=BAYES_00, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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, 01 Aug 2022 10:21:20 -0000 On 29/07/2022 11:52, Richard Biener wrote: > On Fri, 29 Jul 2022, Jakub Jelinek wrote: > >> On Fri, Jul 29, 2022 at 09:57:29AM +0100, Andre Vieira (lists) via Gcc-patches wrote: >>> The 'only on the vectorized code path' remains the same though as vect_recog >>> also only happens on the vectorized code path right? >> if conversion (in some cases) duplicates a loop and guards one copy with >> an ifn which resolves to true if that particular loop is vectorized and >> false otherwise. So, then changes that shouldn't be done in case of >> vectorization failure can be done on the for vectorizer only copy of the >> loop. > And just to mention, one issue with lowering of bitfield accesses > is bitfield inserts which, on some architectures (hello m68k) have > instructions operating on memory directly. For those it's difficult > to not regress in code quality if a bitfield store becomes a > read-modify-write cycle. That's one of the things holding this > back. One idea would be to lower to .INSV directly for those targets > (but presence of insv isn't necessarily indicating support for > memory destinations). > > Richard. Should I account for that when vectorizing though? From what I can tell (no TARGET_VECTOR_* hooks implemented) m68k does not have vectorization support. So the question is, are there currently any targets that vectorize and have vector bitfield-insert/extract support? If they don't exist I suggest we worry about it when it comes around, if not just for the fact that we wouldn't be able to test it right now. If this is about not lowering on the non-vectorized path, see my previous reply, I never intended to do that in the vectorizer. I just thought it was the plan to do lowering eventually.