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 A6EF83858D28 for ; Tue, 17 Jan 2023 10:59:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A6EF83858D28 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=1673953198; 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=aKbbCtTh5bBmblaax8lC5uQ4KtHIeYAKwHC9B4t6E+I=; b=J6yxoFtVYAqHGmda1jrGgN3HBApXIUJoCXlhUHWNLyXg+FTV/tG7I36gAuUoT8edKdYLVK fn85zLzMT1qwzO1J5ga6jtEA14bq3bnktdr3oCsoSxLBaT2RW3U9lrALKSK7ywMjppV+wY y83FHyC9k9QHBg3wLtT68RpDbBPq5r4= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-515-RAn3PG2AN02pGwscdOGEkA-1; Tue, 17 Jan 2023 05:59:56 -0500 X-MC-Unique: RAn3PG2AN02pGwscdOGEkA-1 Received: by mail-wm1-f69.google.com with SMTP id g9-20020a7bc4c9000000b003d214cffa4eso6646379wmk.5 for ; Tue, 17 Jan 2023 02:59:56 -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=aKbbCtTh5bBmblaax8lC5uQ4KtHIeYAKwHC9B4t6E+I=; b=488tHhog4O7eY0Ch/3oUBqeiPC30ghM0pM1ppGV7SWB2xy0dTkSzt8OdZwP+3sdzGN FP8Agjkw+QFobJaVXk+u8IQ4ZP1NPZTYUV3ilNgADNsa86yVF33+jPvohZ4UXXyIRHvZ LPxh+4eH4Z6M8QnBpCuYFn/LqeCED1A/aLkqIGBWKALiFys2th4kGSK+8L9jPRwAlRW1 rVlQS/CwE7DMf8+4+8UTMsjZJpEKNAfRuI4SNQRQ4iKN/Uu2uj8RPv8g64qT6ufmjp6X 5CqLY7uSAxSxPPCPwVGq+193RdNbsudheou/DeYBPPNHJBKEUdxtSeSdgoNP17LMkkbV 7/Pg== X-Gm-Message-State: AFqh2kpGJQwq384CdH05JRnKtX6hBgzVS1OibTUW2Z2FT7xvGk5BNv5p pZscQPcjQKdvIrLBam+qIFwLwNnj5f3bvTDlOaXoNw+GvXjU615/6BoSCKaPX99DqCCzZXb4Sli m8o76BrypRVtZ/gzKVw== X-Received: by 2002:a05:6000:1f81:b0:2bd:f444:9677 with SMTP id bw1-20020a0560001f8100b002bdf4449677mr2386082wrb.66.1673953195696; Tue, 17 Jan 2023 02:59:55 -0800 (PST) X-Google-Smtp-Source: AMrXdXsXvpic9xEFi5qZnFptwowTnZva1Im4qjQykrmRh5JV6I+bCn9T8bsBZ/oXLs1zPiqsVyfEBw== X-Received: by 2002:a05:6000:1f81:b0:2bd:f444:9677 with SMTP id bw1-20020a0560001f8100b002bdf4449677mr2386067wrb.66.1673953195422; Tue, 17 Jan 2023 02:59:55 -0800 (PST) Received: from [192.168.1.201] ([139.47.32.75]) by smtp.gmail.com with ESMTPSA id s1-20020a5d4ec1000000b002882600e8a0sm28628742wrv.12.2023.01.17.02.59.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 17 Jan 2023 02:59:54 -0800 (PST) Message-ID: Date: Tue, 17 Jan 2023 11:59:53 +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: Fix up rotate pattern matching [PR106523] To: Jakub Jelinek , Richard Biener , Andrew MacLeod Cc: gcc-patches@gcc.gnu.org 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.5 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/17/23 10:47, Jakub Jelinek wrote: > Aldy/Andrew, is the ranger query ok or should I use something different > when check_range_stmt is non-NULL and I know on which statement to ask? > + int_range_max r; > + if (!get_global_range_query ()->range_of_expr (r, rotcnt, > + check_range_stmt)) > + return false; range_of_expr will work with and without a statement. If no statement is provided, it will return the global range. So you can use the same range_of_expr call with a statement or without one if you don't know it. Note that get_global_range_query () will always return a global query object (think SSA_NAME_RANGE_INFO). It will never use an existing ranger (for example, if called within VRP or another pass that has an active ranger enabled). If simplify_rotate() may be used from some of these passes you *may* want to use get_range_query() which will pick up the active ranger, or a global query object if no ranger is active. For that matter, since get_global_range_query() uses a global query, it really doesn't matter if you pass a statement or not, since our global range store has no context (SSA_NAME_RANGE_INFO). Although, I personally always pass the statement if known, because it's good form, and if things ever change to an active ranger, everything will just work. Aldy