From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by sourceware.org (Postfix) with ESMTPS id B1A37385843A for ; Mon, 15 Nov 2021 22:42:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B1A37385843A Received: by mail-pj1-x102e.google.com with SMTP id h24so14114288pjq.2 for ; Mon, 15 Nov 2021 14:42:24 -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:references:from:in-reply-to; bh=v5FMshWVG9yZRZJxwbKGN11jW8G+kgMg5anvDinXkRo=; b=5Zw0zd/19tRqgWFMBTenuqgCnburFjr2ot8x+LBriIq+DHAU7hig/wB+djDuWO1bUJ ckrICOXpfs6m6LodRFl/CRr2cK+gnJAq+MFHJ86yzhozPDKhfkPrF4oIhm75OXcvfsJ4 +zArc3mNG/rwd8YY9SYOxQeTWT9uskLceeBnayvWxuX1SDOskYfI/rBituWEcqzzJr7a UqeyvSz7K+GGX7Ic24jueyoX46ClhkyHq5NVUhIi8Oo8z7t7wx7rw40z5rJ9J4BzdnKE 5WROTR5RwTFEtXbcSkqE3hezVsQYY0GyIOVY8UWfOcQlZ5A1Yx/Qvd6+Z/HScABTBlRm XEew== X-Gm-Message-State: AOAM531FyNhYE+6+f8k30NECP07bTaSivXQDdSbobgd6s5AO8lfRpdII YAwVxfcavx5l+V+zx267mgQ= X-Google-Smtp-Source: ABdhPJwljRL/CJ3KnfEjL2m/mFOEi4zwlZU8OMObVcDwXjBe7CD1LUrW7nYZ1TDQuNzC6n8oggliGQ== X-Received: by 2002:a17:90b:4d0e:: with SMTP id mw14mr2685752pjb.43.1637016143683; Mon, 15 Nov 2021 14:42:23 -0800 (PST) Received: from [172.31.0.175] (c-98-202-48-222.hsd1.ut.comcast.net. [98.202.48.222]) by smtp.gmail.com with ESMTPSA id j16sm17382266pfj.16.2021.11.15.14.42.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 15 Nov 2021 14:42:23 -0800 (PST) Message-ID: <9a0805ad-604e-e590-99fa-ccd82d23fa99@gmail.com> Date: Mon, 15 Nov 2021 15:42:21 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [PATCH] simplify get_range_strlen interface Content-Language: en-US To: Martin Sebor , gcc-patches References: <72f82121-dbd8-f457-06f3-19e4c5c9bf4f@gmail.com> From: Jeff Law In-Reply-To: <72f82121-dbd8-f457-06f3-19e4c5c9bf4f@gmail.com> X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: Mon, 15 Nov 2021 22:42:26 -0000 On 11/15/2021 3:05 PM, Martin Sebor via Gcc-patches wrote: > The deeply nested PHI handling in get_range_strlen_dynamic makes > the code bigger and harder to follow than it would be if done in > its own function.  The attached patch does that. > > In addition, the get_range_strlen family of functions use a bitmap > to avoid infinite recursion.  Rather than dynamically allocating > and freeing it on demand the attached patch simplifies the code > by using an instance of auto_bitmap.  This avoids the risk of > neglecting to deallocate the bitmap. > > Tested on x86_64-linux. > > Martin > > gcc-get_range_strlen_dynamic.diff > > Slightly simplify get_range_strlen interface. > > gcc/ChangeLog: > > * gimple-fold.c (get_range_strlen): Take bitmap as an argument rather > than a pointer to it. > (get_range_strlen_tree): Same. Remove bitmap allocation. Use > an auto_bitmap. > (get_maxval_strlen): Use an auto_bitmap. > * tree-ssa-strlen.c (get_range_strlen_dynamic): Factor out PHI > handling... > (get_range_strlen_phi): ...into this function. > (printf_strlen_execute): Dump pointer query cache contents when > details are requisted. No really a bugfix, but I'll go ahead and ACK for the trunk. Obviously the bar is going to be going up now that we're in stage3 :-) jeff