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 AA37F3858CDB for ; Thu, 4 May 2023 15:20:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AA37F3858CDB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=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 8B47B2F4; Thu, 4 May 2023 08:20:53 -0700 (PDT) Received: from [10.57.71.144] (unknown [10.57.71.144]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 99E0E3F5A1; Thu, 4 May 2023 08:20:08 -0700 (PDT) Message-ID: <2d38873e-bd4d-394c-6e8a-e4b1e75678d4@arm.com> Date: Thu, 4 May 2023 16:20:04 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH 1/3] Refactor to allow internal_fn's Content-Language: en-US To: Richard Biener Cc: Richard Biener , Richard Sandiford , "gcc-patches@gcc.gnu.org" References: <51ce8969-3130-452e-092e-f9d91eff2dad@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=-11.0 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,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 03/05/2023 12:55, Richard Biener wrote: > On Fri, 28 Apr 2023, Andre Vieira (lists) wrote: > >> Hi, >> >> I'm posting the patches separately now with ChangeLogs. >> >> I made the suggested changes and tried to simplify the code a bit further. >> Where internal to tree-vect-stmts I changed most functions to use code_helper >> to avoid having to check at places we didn't need to. I was trying to simplify >> things further by also modifying supportable_half_widening_operation and >> supportable_convert_operation but the result of that was that I ended up >> moving the code to cast to tree code inside them rather than at the call site >> and it didn't look simpler, so I left those. Though if we did make those >> changes we'd no longer need to keep around the tc1 variable in >> vectorizable_conversion... Let me know what you think. > > I see that > > - else if (CONVERT_EXPR_CODE_P (code) > + else if (CONVERT_EXPR_CODE_P (code.safe_as_tree_code ()) > > is convenient (as much as I dislike safe_as_tree_code). Isn't > the following > > - if (!CONVERT_EXPR_CODE_P (code)) > + if (!CONVERT_EXPR_CODE_P ((tree_code) code)) > return false; For some reason I thought the code could only reach here if code was a tree code, but I guess if we have an ifn and the modes aren't the same as the wide_vectype it would fall to this, which for an ifn this would fail. I am wondering whether it needs to though, the multi-step widening should also work for ifn's no? We'd need to adapt it, to not use c1, c2 but hi, lo in case of ifn I guess.. and then use a different optab look up too? Though I'm thinking, maybe this should be a follow-up and just not have that 'feature' for now. The feature being, supporting multi-step conversion for new widening IFN's.