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 C5AE138582BC for ; Thu, 19 Jan 2023 09:34:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C5AE138582BC 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=1674120894; 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=9SgnX6DOfRjL10Ozn5Pqml58D2XS5T+hGg4FRwnFBoY=; b=SlJCOrQC1jF18Q55rIFNAHAkkwaP0vnoQrrw91ApiHQdNuy7rNbxXbqp9JYShqZCd3tHhR 3vR/oaJyDM7xK8yIziK33MHj2oP3I5YI0GEJE+VQoNXAu+vf0DuVAa4Ubb7r96ysSKh7hZ b1mZNEfPElCyOziQc70U0ZWQBhJCHzs= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-621-KQvKse58PSyeDZG0cPPjcQ-1; Thu, 19 Jan 2023 04:34:53 -0500 X-MC-Unique: KQvKse58PSyeDZG0cPPjcQ-1 Received: by mail-wr1-f70.google.com with SMTP id g24-20020adfa498000000b002bbeb5fc4b7so228610wrb.10 for ; Thu, 19 Jan 2023 01:34:52 -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:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9SgnX6DOfRjL10Ozn5Pqml58D2XS5T+hGg4FRwnFBoY=; b=OCbVtrCWT1ODbIpy24n+YUT3TeweNfg8HPSco0bTHyF99bRrEYI+3TXvGED9P2/PaS ugnd1sduI/HCPhPnGJn2MV/8/wGEueMsFdv8FV16IxJsHVgI1iLfmCpOjkZ7vd81OJS2 P8UFRJ9CDU9xTb4l7IjCQAh9vGTfJD17lx6N6uieoosHZC0FUjdr0IefgEKWs07PqWFg timRcXX//a+nv0IjFxVx3hbgg6WUnvCMmDqmwt6oyY17l3ahxas6a/GP20bzW/89PX2y RY9mTrynruLDYcs7FlJXKtvJgjV9OEtDVsrGn/9j1nclDEdfzfG2xGQJ1I/ZnTP/aKT9 Ecgg== X-Gm-Message-State: AFqh2koK6SNIn2sw0BPtQ1tMMv+SF5q8pdSKZBO4F5Qc/W1I5tCAGScm e54qaemvbpdD7vMz2uhrqxgifrAeaHZEEHiewACa7sFmC8ri7xroL5845WF2/oFsFTNzf5p0RRQ 2Ae5ztg9Kx1ERwMdOWg== X-Received: by 2002:a05:600c:ad4:b0:3db:11d0:21e2 with SMTP id c20-20020a05600c0ad400b003db11d021e2mr5495501wmr.29.1674120891933; Thu, 19 Jan 2023 01:34:51 -0800 (PST) X-Google-Smtp-Source: AMrXdXvT6h4q9PybTZeSEDi1qlZhgdxj4luEx3GfxMQW09Qrig8pg7KGI9d8X0BXKTYj9jCBh/mvSw== X-Received: by 2002:a05:600c:ad4:b0:3db:11d0:21e2 with SMTP id c20-20020a05600c0ad400b003db11d021e2mr5495486wmr.29.1674120891680; Thu, 19 Jan 2023 01:34:51 -0800 (PST) Received: from [192.168.1.201] ([139.47.32.75]) by smtp.gmail.com with ESMTPSA id f11-20020a05600c154b00b003d35c845cbbsm4433055wmg.21.2023.01.19.01.34.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 Jan 2023 01:34:51 -0800 (PST) Message-ID: Date: Thu, 19 Jan 2023 10:34:50 +0100 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] forwprop: Further fixes for simplify_rotate [PR108440] To: Jakub Jelinek , Richard Biener Cc: gcc-patches@gcc.gnu.org, Andrew MacLeod References: From: Aldy Hernandez 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: 7bit X-Spam-Status: No, score=-4.6 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 1/19/23 09:41, Jakub Jelinek wrote: > + range_query *q = get_range_query (cfun); > + if (q == get_global_range_query ()) > + q = enable_ranger (cfun); Oh, neat. Clever. I hadn't thought about that. > + if (!q->range_of_expr (r, rotcnt, check_range_stmt)) > + { > + if (check_range > 0) > + return false; > + r.set_varying (TREE_TYPE (rotcnt)); > + } > int prec = TYPE_PRECISION (TREE_TYPE (rotcnt)); > signop sign = TYPE_SIGN (TREE_TYPE (rotcnt)); > wide_int min = wide_int::from (TYPE_PRECISION (rtype), prec, sign); > wide_int max = wide_int::from (wider_prec - 1, prec, sign); > - int_range<2> r2 (TREE_TYPE (rotcnt), min, max); > + if (check_range < 0) > + max = min; > + int_range<1> r2 (TREE_TYPE (rotcnt), min, max); > r.intersect (r2); Currently int_range<1> is a legacy range (anti ranges and such internally). It's better to use <2> as the use of r2 will have to be converted to a multi-range before intersecting. FYI, <2> is the smallest multi-range. This is really an implementation detail, so don't bother changing it, even though it's slightly slower. In the next release we'll nuke legacy, and <1> will mean what you think it means...the smallest range with one sub-range (and none of that anti range business internally). Thanks. Aldy