From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) by sourceware.org (Postfix) with ESMTPS id 57DBB3858C5E for ; Fri, 10 Nov 2023 21:53:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 57DBB3858C5E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 57DBB3858C5E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::d2d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699653204; cv=none; b=DGBNjV15OZz+oAu3M77RWdu+wxoPYG6WanXvDvAPWr6fTUiF4y9XrKHazQbqt3u6+XtfsLWE6YTCd1dTLqOZxIahgoUXFwV2g6bXumzuVyTNUapZf4redQwCHyfyyvfLC9bhqtYtmFn4v0IAAIbrH+dlRNQJ/fAB+zf3upKaf+4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699653204; c=relaxed/simple; bh=Jgtwy3C7PGPz9Px60AN9n8ROlHIsydwhPwhve7fWz2A=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=R9HsIOQn6t8rJy+MyD1scxVi6hZFR9Q61FWEOSVIB50HYcfG3KaLgp+i3bBTVEq2ghW2wqi3ieOop7ViXpkJUmrGBeuALFbJHSpu9Sm5euFxzezjd0o4JJXaLYExwlcRwaOJyjk9kG738PA5eQSa0uTd/LFUbjW7r8OG8hrQ52A= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-io1-xd2d.google.com with SMTP id ca18e2360f4ac-7a67f447bf0so89608839f.2 for ; Fri, 10 Nov 2023 13:53:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699653202; x=1700258002; darn=gcc.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=ByrnTFj1XUg8H4uWmy5ZoISnryRYIUNJr/JLJZii8No=; b=bsEYF/u76gJfue8+E9d0Yvg0gnrkGzBodXJm4VWtFNfNF8RQSHmuLf7ZFE7z1cmgYO 43U5Qxq2WxEwyB/z/2eJgXWEM/p48biaZzL5OwauAL9i/YzgVN1a4OiGEHk3+uUu3bZ0 tHZjhSkkUNeE70UfFROR5BajpVU3aKT1M0UVV/bV8gqdWyROZyn8CvHEW1qm9g9g8Eo+ sEWRJHBy1bvcIfoGRQrRDbreRSlIprFY9qfjwDn17/gHMeeNV3suvQCgnE9viVOTJgl3 n7i4UpVmzUpOxqrL6qa0hISUzYJ4oqveeY4O2S90o0M7eqmMAKoXLgiMPRoBfTMBwrsG G3jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699653202; x=1700258002; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ByrnTFj1XUg8H4uWmy5ZoISnryRYIUNJr/JLJZii8No=; b=B/qCmG3MFrXkn1RUjkjX/chYHfhG7EpWcQSzJJazabTW9FX46eGd92vCUf5/LID4Mg oB9X9WuE6lLNcwzZB37xOaFt3dFBIUiWFtfwYSSBuG/W+ghIQsXLWjuG3SCexXoVY8Gy Dj3+d5a8XL6g4FqBs9mKZyfoHRE8BqeqTJnLY3pJWvrgKqEKVXLVB7NpuF98WmSW4yUO zz4Ehc85fniq8ZuPFNCidUR4Bki3O4BDal1i8z0R8LG4Ty20rYGvXMHObpnny7EJkwu9 fpnrWywynF0F4qxgHNWHPGDpVdP11bUpxzJ/LPcZaQt8jkta3fxsko0OfeFqUNlY4WMT iTSw== X-Gm-Message-State: AOJu0YxT/6kSfXlkKK6OqUuTmyATxc1AmaJVBBZPoyONLnjqUSmw6n6W +ca0td06EUhZgwt/rCueOtg= X-Google-Smtp-Source: AGHT+IGtJQTDUeRBKuAW/zNYOtB75juqzHuy0RqQfLkOapt1yvM+sm/8sFCHLjmVhPi1kCfr7p4OQw== X-Received: by 2002:a05:6602:2747:b0:791:385c:f8b0 with SMTP id b7-20020a056602274700b00791385cf8b0mr595130ioe.3.1699653202417; Fri, 10 Nov 2023 13:53:22 -0800 (PST) Received: from [172.31.0.109] ([136.36.130.248]) by smtp.gmail.com with ESMTPSA id 18-20020a5d9c12000000b0079fd98bbe9bsm66393ioe.15.2023.11.10.13.53.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Nov 2023 13:53:21 -0800 (PST) Message-ID: Date: Fri, 10 Nov 2023 14:53:20 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 2/4] ifcvt: Allow more operations in multiple set if conversion Content-Language: en-US To: Manolis Tsamis , gcc-patches@gcc.gnu.org, Philipp Tomsich , Robin Dapp , Jakub Jelinek , richard.sandiford@arm.com References: <20230830101400.1539313-1-manolis.tsamis@vrull.eu> <20230830101400.1539313-3-manolis.tsamis@vrull.eu> From: Jeff Law In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 10/19/23 13:46, Richard Sandiford wrote: >> + /* Allow a wide range of operations and let the costing function decide >> + if the conversion is worth it later. */ >> + enum rtx_code code = GET_CODE (src); >> + if (!(CONSTANT_P (src) >> + || code == REG >> + || code == SUBREG >> + || code == ZERO_EXTEND >> + || code == SIGN_EXTEND >> + || code == NOT >> + || code == NEG >> + || code == PLUS >> + || code == MINUS >> + || code == AND >> + || code == IOR >> + || code == MULT >> + || code == ASHIFT >> + || code == ASHIFTRT >> + || code == NE >> + || code == EQ >> + || code == GE >> + || code == GT >> + || code == LE >> + || code == LT >> + || code == GEU >> + || code == GTU >> + || code == LEU >> + || code == LTU >> + || code == COMPARE)) >> return false; > > I'm nervous about lists of operations like these, for two reasons: > > (1) It isn't obvious what criteria are used to select the codes. > > (2) It requires the top-level code to belong to a given set, but it > allows subrtxes of src to be arbitrarily complex. E.g. (to pick > a silly example) a toplevel (popcount ...) would be rejected, but > (plus (popcount ...) (const_int 1)) would be OK. > > Could we just remove this condition instead? I'd be all for that. We've actually got a similar problem in Joern's ext-dce code that I'm working on. At least in that case I think we'll be able to enumerate how/why things are on the list if we still need it after the cleanup phase. So I think the guidance on patch #2 would be to remove the list entirely if we can. jeff