From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 34B3F385841A for ; Fri, 10 Feb 2023 20:58:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 34B3F385841A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676062736; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0PuijrHF/w+ovf4lvWWpA1o8bZg1FS6xuaTCn6XyfgI=; b=WCJ8gY95SGY4OcM/5RsDjj/ydR5bhXac4PUcxtOohfPeDgvXHRa+rSluR26WgTe7DWy57n JVPK6RUjIZjJxSHq+2753mXirU6kimaejZV0FylcsuC5oP+fqoAYpbLvBFRkOJdb5L0j0k jnE0VAJiWZVZvar26kzIfF2HPkH+vu0= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-83-nboopd9vNiSgmmktfJRlxw-1; Fri, 10 Feb 2023 15:58:55 -0500 X-MC-Unique: nboopd9vNiSgmmktfJRlxw-1 Received: by mail-qk1-f199.google.com with SMTP id x7-20020a05620a098700b007242aa494ddso4016602qkx.19 for ; Fri, 10 Feb 2023 12:58:55 -0800 (PST) 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=0PuijrHF/w+ovf4lvWWpA1o8bZg1FS6xuaTCn6XyfgI=; b=BiQSHD37Tm/B8z3Y00+e7XBrV/NslX4agq6VR15KKFJpIPqAy9GxBPF/UAX399N54b ucLj8JiwEbFDY66aNAMPO4ZgcaFLJux6L8ITcLdLH1bARhW7J37u7ws1DqPL8uwlG+F5 Lq6u2bIVPqwlmbp0IHo4GUdQEaZDgO3eevTqyCayIH9LhIW0AsP1AKNi31eH9J1VbsV7 s9c/HCFnvqvW5QFXrp9ukyukDBE6qvv28wi3yPVupBB9XKBgO0yPfTh9iBVtUIsFEvtG mr1Uh4ywmsutwAwVtzQbPa1hnpAkaEE3rJcagW+xW4AOiiDTRmKOmFvrICoEFF7YAh6E jLqw== X-Gm-Message-State: AO0yUKVmPIB2eFYYJqTLzsWBwarWs3f3B4LFifaDaq1vXxP9uJbekv6K os1UCGheQICuxO66gj+gBIeWUIvg+e1tQPy6zq52o2RtCkz7tCL4q0VueWlXlGLgH2wRI6aElY9 WUbUYJPfn1mpEwzeKYQ== X-Received: by 2002:ac8:5acb:0:b0:3b8:6b6b:28c2 with SMTP id d11-20020ac85acb000000b003b86b6b28c2mr30317008qtd.68.1676062735125; Fri, 10 Feb 2023 12:58:55 -0800 (PST) X-Google-Smtp-Source: AK7set9z+Fs1dmBhrbQ6Gg2t6egC/+QKLPlNJH8Gx1SDJOY32U5f6RNMUTag01hpN2rYjy9C6UUbfQ== X-Received: by 2002:ac8:5acb:0:b0:3b8:6b6b:28c2 with SMTP id d11-20020ac85acb000000b003b86b6b28c2mr30316978qtd.68.1676062734799; Fri, 10 Feb 2023 12:58:54 -0800 (PST) Received: from ?IPV6:2607:fea8:a263:f600::de2a? ([2607:fea8:a263:f600::de2a]) by smtp.gmail.com with ESMTPSA id e8-20020ac85988000000b003b68d445654sm4099218qte.91.2023.02.10.12.58.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Feb 2023 12:58:54 -0800 (PST) Message-ID: Date: Fri, 10 Feb 2023 15:58:52 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH 1/2]middle-end: Fix wrong overmatching of div-bitmask by using new optabs [PR108583] To: Richard Biener , Richard Sandiford Cc: Tamar Christina , Tamar Christina via Gcc-patches , nd , jlaw@ventanamicro.com References: From: Andrew MacLeod In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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 2/10/23 13:34, Richard Biener wrote: > >>> In any case, if you disagree I don’t' really see a way forward aside from making this its own pattern >>> running it before the overwidening pattern. >> I think we should look to see if ranger can be persuaded to provide the >> range of the 16-bit addition, even though the statement that produces it >> isn't part of a BB. It shouldn't matter that the addition originally >> came from a 32-bit one: the range follows directly from the ranges of >> the operands (i.e. the fact that the operands are the results of >> widening conversions). > I think you can ask ranger on operations on names defined in the IL, so you can work yourself through the sequence of operations in the pattern sequence to compute ranges on their defs (and possibly even store them in the SSA info). You just need to pick the correct ranger API for this…. Andrew CCed > > Its not clear to me whats being asked... Expressions don't need to be in the IL to do range calculations.. I believe we support arbitrary tree expressions via range_of_expr. if you have 32 bit ranges that you want to do 16 bit addition on, you can also cast those ranges to a 16bit type, my32bitrange.cast (my16bittype); then invoke range-ops directly via getting the handler: handler = range_op_handler (PLUS_EXPR, 16bittype_tree); if (handler)    handler->fold (result, my16bittype, mycasted32bitrange, myothercasted32bitrange) There are higher level APIs if what you have on hand is closer to IL than random ranges Describe exactly what it is you want to do... and I'll try to direct you to the best way to do it. Andrew