From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by sourceware.org (Postfix) with ESMTPS id DA20F3AA9815 for ; Thu, 17 Nov 2022 16:39:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DA20F3AA9815 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-pl1-x62f.google.com with SMTP id y10so934885plp.3 for ; Thu, 17 Nov 2022 08:39:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=vpedZ7BR84lRvy5EZk3yhSfdbp+iYS+2Nzkvkkt8BCc=; b=RjdLREMS1hZ9uZTnsL8M1Q3wkTW5WP/p4IO02T9VJsk8+/A4IVYPJsFFODXQUP27hi qjPp51XAu5/p4+M3twP3xJBRpgzgSjXVT4gTS0iuchq4g1LNeQfVKfm174MApZste0q0 PnOQ/DJcHTeTIrzc6vOz4hztGLB9KdDoNrUOsXrQ7V4Nx5WyQL7HMm0wGhUmJApFlZ2a TWnDPHBCya+6rtUfI5sxPWlGVHtgAh4mXwsd8ojWruuP/ADUgY/4iPv4m7kdP4wB73nE HQieywlgmpylmGvPkuEyBfLHLIS1hII0YOWMDOP8RXPE/KEwySi15VAqmWoyqM3tDCTT qkRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc: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=vpedZ7BR84lRvy5EZk3yhSfdbp+iYS+2Nzkvkkt8BCc=; b=FgED9AIFdmv/5SvUl994AsIHMjT8b8bwZ2vAhstMtoltfbui7DqI1nTcxOl7jcOHXM kUiLdSE+s0H2PEDafARWlk0YchHBIViJNOEp9moDQq9WkLobz395SQIawzdi3WP7/yP+ elJWjK3ghZkCPDR+YqAwfVTgVyLHHr4uKraFuu9L8LsgEPjw//wvphv2anocM/gPv9lS sjp0tjqgSLzFd3gP3ucALmXuXZgr8mMeXykJzdTW03O+XUhR+j3b4+HsarDHsmc591TL K9/ImeuXXDxuxP9jRchkxLoW0a9Jq23z9v18zprmVc4/BBt7rzaGgIMrRfkOVUO4Y7rS Hp2Q== X-Gm-Message-State: ANoB5pmxxgAQYYEqNEd1lwM+uyo+NQCQqb0oF6bDiv5aH9n0IdjkZwTE fQXCIWAW+dgrDwvb1wcoCD8= X-Google-Smtp-Source: AA0mqf4PnuZESAE8WIaH7Qcv9wp6fYhmvGUf6TpP5M+PD5n1Hddz/6kjNkHYuWEkU8hp3ocnt0V5VQ== X-Received: by 2002:a17:90a:e388:b0:213:2230:96d0 with SMTP id b8-20020a17090ae38800b00213223096d0mr3565286pjz.136.1668703191775; Thu, 17 Nov 2022 08:39:51 -0800 (PST) Received: from ?IPV6:2601:681:8600:13d0::f0a? ([2601:681:8600:13d0::f0a]) by smtp.gmail.com with ESMTPSA id y15-20020a17090264cf00b00188f7ad561asm462029pli.249.2022.11.17.08.39.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Nov 2022 08:39:50 -0800 (PST) Message-ID: Date: Thu, 17 Nov 2022 09:39:49 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH] RISC-V: Handle "(a & twobits) == singlebit" in branches using Zbs Content-Language: en-US To: Philipp Tomsich Cc: gcc-patches@gcc.gnu.org, Christoph Muellner , Kito Cheng , Vineet Gupta , Jeff Law , Palmer Dabbelt References: <20221113204858.4062163-1-philipp.tomsich@vrull.eu> <71d8d0ca-c249-28fd-7327-5a3b932dad94@gmail.com> From: Jeff Law In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP 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 11/17/22 08:12, Philipp Tomsich wrote: > > This serves as an assertion only, as that case is non-sensical and > will be optimized away by earlier passes (as "a & C == T" with C and T > sharing no bits will always be false). > IFAIK the preceding transforms should always clean such a check up, > but we can't exclude the possibility that with enough command line > overrides and params we might see such a non-sensical test making it > all the way to the backend. Good!  I was thinking in the back of my mind that the no-sharing-bits case should have been handled in the generic optimizers.  Thanks for clarifying. > > What would you recommend? Adding this to the pattern's condition feels > a bit redundant. We can leave it in the splitter. > In fact, I am leaning towards hiding the !SMALL_OPERAND check in yet > another predicate that combines const_twobits_operand with a > match_test for !SMALL_OPERAND. Sure. jeff