From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id DFDB23858C1F for ; Wed, 7 Jun 2023 22:56:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DFDB23858C1F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-652dd220d67so6925944b3a.3 for ; Wed, 07 Jun 2023 15:56:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686178599; x=1688770599; 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=9LVTT0r3iE3Zp1VMW9EmIxc8QgcniN5dmHmiksU/LBA=; b=L/kRXo3NcZbsJ4OfJWaYsRqNuWDQv129+E7GFokNgk4oXkpTZdHcp9JRqNt5QfOTqV znpMWJIDCtn0lWhMFsV4I8F8m1B23uIxDkJpetevE6sFokKEVmBDSdq5o80ImAj0Kn5c 6EeoKOhtjFKOqyicl0LV7062WCkbbC4IWC6HLeaZ41O/jtgDbiTISfyQZwTRbsNGAcq4 GnILC46OXFHGbCZxkVLPG5YyWFepaGacQcFAYEhWQh27VHqh5qvVn/p0Lzc0HHkn32HJ rZZqX+zyD67QzTMHOS9LdjwtZsy/fZOx7Xyee0dCQV+LtdAQSf7p4U2Cf/aES1EnM6mB Yijg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686178599; x=1688770599; 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=9LVTT0r3iE3Zp1VMW9EmIxc8QgcniN5dmHmiksU/LBA=; b=imBDdOgwvlMZksP8Blks+CGEluUaKFr2QZKLbyy20kpASOxcm6nyvTSMluLGv7FKSW Bpse1jsKezFoPEwTOYEizcSA/PrKvSpnrsFwEEntRT/p60kVbCe6rl80uJV7h6DSZkLP zLK5qtnpY6ekCOixEDi3pVKktTHbyNyY/m1wLDM0CAJ6NSjBLmCoz4bhhwcYOchyw1hQ JFkml8cyaC7l85W62SvBE+gMNYcxq8svaGtb7bg9dRTGHWCvbqjZkLQE6V0ra9uBrgb7 rF3jlyQydNKKp+es7+B9ojEoHWm9QjGgnZzJjyCe0sM3JL/6VAaPdzGl+Wd3K8AyETDV XNfg== X-Gm-Message-State: AC+VfDyoVnjmS4/Sj4/skNwaL50DdGpChRNYu6moeaFxiYYMGcP5EK4m y0fM4RUew91a4loTV6r38/U= X-Google-Smtp-Source: ACHHUZ4FWfB/suBBwIuj8GAocs4B3Sjf2886lCdb2HgBMzjTI2s4Moc3s9H3x27uADAk841/2xZs4g== X-Received: by 2002:a05:6a00:1494:b0:63f:18ae:1d5f with SMTP id v20-20020a056a00149400b0063f18ae1d5fmr8398874pfu.29.1686178598534; Wed, 07 Jun 2023 15:56:38 -0700 (PDT) Received: from [172.31.0.109] ([136.36.130.248]) by smtp.gmail.com with ESMTPSA id j17-20020aa79291000000b006410f4f3ecdsm8826896pfa.83.2023.06.07.15.56.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 07 Jun 2023 15:56:38 -0700 (PDT) Message-ID: Date: Wed, 7 Jun 2023 16:56:36 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH 2/3] Change the `zero_one ==/!= 0) ? y : z y` patterns to use multiply rather than `(-zero_one) & z` Content-Language: en-US To: Andrew Pinski , gcc-patches@gcc.gnu.org References: <20230607213217.3052696-1-apinski@marvell.com> <20230607213217.3052696-2-apinski@marvell.com> From: Jeff Law In-Reply-To: <20230607213217.3052696-2-apinski@marvell.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,PLING_QUERY,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 6/7/23 15:32, Andrew Pinski via Gcc-patches wrote: > Since there is a pattern to convert `(-zero_one) & z` into `zero_one * z` already, > it is better if we don't do a secondary transformation. This reduces the extra > statements produced by match-and-simplify on the gimple level too. > > gcc/ChangeLog: > > * match.pd (`zero_one ==/!= 0) ? y : z y`): Use > multiply rather than negation/bit_and. Don't you need to check the types in a manner similar to what the A & -Y -> X * Y pattern does before you make this transformation? jeff