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.133.124]) by sourceware.org (Postfix) with ESMTPS id 5429F3858002 for ; Thu, 9 Dec 2021 14:44:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5429F3858002 Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-270-rbUOL0nJM2-kN4jNf-xe8Q-1; Thu, 09 Dec 2021 09:44:50 -0500 X-MC-Unique: rbUOL0nJM2-kN4jNf-xe8Q-1 Received: by mail-qt1-f197.google.com with SMTP id o12-20020a05622a008c00b002aff5552c89so9093253qtw.23 for ; Thu, 09 Dec 2021 06:44:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=NsxqCS0ekH8cp+B+uVADoUcptWkXbYliswyfS3nmFPw=; b=zj9h2jggosuKFK2/WvWI9q6I+QqH7cSjYG3i4X5myLDfL8hvJ0m71BIbh3kEgnYgJ4 8GGB+HyuwuPzqMg3FC2VYXGtIA1jJ4UydYwM1qGIJXx7LH4jHRMrcnFTDJVFkaNpHDeC mPLXstpKIS4bX6bofFMht67hXhVz4TP3FL3YUquo/E80qFt0W3SdBGjYvM3R/rkNqRVr OuwbMyDbsfmknaH0BG0llnblynev35CyX1FIX+nkvsCOMIHPwO4g8owpwheE435XZcuH +6XPgiNmwr0Qimv4+sdsfsIjdYm1ap7izAGRe11GODaZp6934fF5JXRoig8QZfE7e9jY reAg== X-Gm-Message-State: AOAM533ecHEjdYKiCocp2VLgiEL1q+XKOutNoUGSdnhkqeH2SNWjdTjQ A8B75P/HlVITCr8rsdIsn2sDBZ10eY7gVjmVNGv7o5dL8FkWQ4diFMUQ3Faz2kkihOmATlMSAi9 BoYN8LmAbnxlT87W6Lw== X-Received: by 2002:a05:6214:5190:: with SMTP id kl16mr16737642qvb.36.1639061089608; Thu, 09 Dec 2021 06:44:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJxtqKq2yjdhnEnPYnwBcb8zJZ6572yNe+yRklBz7lHPWTynURnK2SpOY4Kc37tZh58o9RMnpw== X-Received: by 2002:a05:6214:5190:: with SMTP id kl16mr16737619qvb.36.1639061089414; Thu, 09 Dec 2021 06:44:49 -0800 (PST) Received: from ?IPV6:2607:fea8:a262:5f00::a0bd? ([2607:fea8:a262:5f00::a0bd]) by smtp.gmail.com with ESMTPSA id v10sm66531qtk.13.2021.12.09.06.44.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Dec 2021 06:44:48 -0800 (PST) Message-ID: <4da1b3d6-0718-9525-1ddb-0014f6593fe1@redhat.com> Date: Thu, 9 Dec 2021 09:44:47 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Subject: Re: [PATCH] Loop unswitching: support gswitch statements. To: =?UTF-8?Q?Martin_Li=c5=a1ka?= , Richard Biener Cc: GCC Patches , Aldy Hernandez References: <7bcc368c-3f26-4503-aec1-a3d6378e33ec@suse.cz> <561a3ffd-8973-d771-418f-76c484085cc5@suse.cz> <20265d97-6350-c234-695d-bc18e2e617b4@suse.cz> <1169b649-e3e2-36c9-f964-0b0ecd2530fa@suse.cz> <33509887-dfa3-6bb0-6fbe-cec8873f651f@suse.cz> <1423649f-7ef6-7408-36dc-4865f458b45e@redhat.com> <8f32d550-124c-9ed6-0ba1-a190a3f46ef0@suse.cz> <757fdb5a-027e-5d3a-91b3-c7a81b597c94@redhat.com> <9cf19620-befb-314f-07a3-d18c3e613dcb@redhat.com> <229e3b6e-74f8-e538-db6d-1ce1d3302bff@suse.cz> From: Andrew MacLeod In-Reply-To: <229e3b6e-74f8-e538-db6d-1ce1d3302bff@suse.cz> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-CA Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, BODY_8BITS, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2021 14:44:52 -0000 On 12/9/21 07:59, Martin Liška wrote: > On 12/3/21 15:09, Andrew MacLeod wrote: >> On 12/2/21 11:02, Martin Liška wrote: >>> On 12/2/21 15:27, Andrew MacLeod wrote: >>>> ranger->gori().outgoing_edge_range_p (irange &r, edge e, tree name, >>>> *get_global_range_query ()); >>> >>> Thank you! It works for me! >>> >>> Martin >>> >> btw, this applies to names not  on the stmt as well.   The function >> returns TRUE if there is an outgoing range calculable, and false if >> not.  so: >> >> a = b + 20 >> if (a > 40)        <- returns TRUE for outgoing range of 'a' or 'b' >>      { >>         c = foo() >>         if (c > 60)   <- returns false for 'a' or 'b' >>             { >>                 if (b < 100)   <- Also returns TRUE for 'a' or 'b' > > Hello. > > That's quite interesting support. However, for the bug mentioned > earlier in this email conversion, > I only want local range for a gcond/gswitch, ignoring all path leading > to the statement. > > Martin In which case just directly invoking gori with the global range query should be fine.   You could go directly to the lower level routines like gimple_range_calc_op1, but this saves you from doing a little footwork to call them.  Ultimately, it works out the same for you on the true side of if (a > 40) as  setting up and invoking:    if (gimple_range_calc_op1  (r, stmt, int_range<2> (boolean_true_node, boolean_true_node), [40,40]) Its just less work to do it thru gori()->outgoing_edge_range_p ()   :-) Andrew