From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by sourceware.org (Postfix) with ESMTPS id 7B2923858D28 for ; Fri, 31 Mar 2023 16:30:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7B2923858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-x102b.google.com with SMTP id f6-20020a17090ac28600b0023b9bf9eb63so23908218pjt.5 for ; Fri, 31 Mar 2023 09:30:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680280207; x=1682872207; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=YaO2P8mKoMnocIZp1hf5ffUHibeAQsHgMkrVcQrMO1U=; b=OwF29q5qdi5q8YWX8t8/iriqMljwPfwFulm+cgvzo7bQ/bVWp9ZSC98k9rzvSwAfk5 AdNMNv0UEjzYOX09aYaOTnEiyJyMUtNEgnZ+QXWXt0EjfCFXj2BGvsWCrqqM3QiAY5CK fNZ3mnkBSr9HKbGzbbxQTzRSYbKBsmtNVySLz9835QdOAi0j8PtWjtttN+X2KMb8SAvd 47Ax0uQ69nRBYUKXO9CjU7IpC93uQ96f/T1ylqR/S59SnQ14UoiCuvM8dv4NwQDko64d jGtRKtczxQUh9mVvSZC/3bNq+SOlPGGWPcH6TQ1aWLJaanKlnoPuuc47kLJdJnIneQwY wnVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680280207; x=1682872207; 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=YaO2P8mKoMnocIZp1hf5ffUHibeAQsHgMkrVcQrMO1U=; b=PdKgD86VzKAzyC3dhiW4su1LNh3mBWIPsQMl/4DDWH0/TRgmZ9gjfpi2Zu4lP8CehC mlCoxFJpbbCWnzpl1eHz66hsPODNUNIwDKFxFaChNbQhXBUtbx+chbG4EiMV2+9v1MJt caOKRMbHFNR+UqQeI0QEWfzwOfOBR353UyKnCmeHJq/ZO7IfC1VzGljMI1pKFjHc1L7f HRnHAGFoN/xhl0SWC1B6J6dpsViW9jhFmQAYA3aIJX0xI26dPbsBakpOlECkcwLCTtUX wGkRhFbtchSh2ARdsBNRs9BJheZUPccfDV6ETx7Ycb2X3V28TdtGKMLTLOP1sG7JFCbh XLzw== X-Gm-Message-State: AAQBX9fBAaiKarvC4S10xfs9pqBF2X6WaguG9rWpBJIR1EsKJFd9YCuv FC83jsYJVf6UEcFl9WvyGGk= X-Google-Smtp-Source: AKy350Z8rD2/d1nCuRZYZAhghRR4x89s5VMSR3rhAwq02fUUkA0yYofYV86iycuX9SM0/Ng4aIZeCA== X-Received: by 2002:a17:902:ec8b:b0:1a2:87a2:c91a with SMTP id x11-20020a170902ec8b00b001a287a2c91amr10315266plg.34.1680280207343; Fri, 31 Mar 2023 09:30:07 -0700 (PDT) Received: from ?IPV6:2601:681:8600:13d0::f0a? ([2601:681:8600:13d0::f0a]) by smtp.gmail.com with ESMTPSA id b13-20020a170902b60d00b0019f387f2dc3sm1799603pls.24.2023.03.31.09.30.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 31 Mar 2023 09:30:06 -0700 (PDT) Message-ID: Date: Fri, 31 Mar 2023 10:30:05 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH] rtl-optimization/109237 - quadraticness in delete_trivially_dead_insns Content-Language: en-US To: Richard Biener , gcc-patches@gcc.gnu.org Cc: Jakub Jelinek References: <20230322100210.AE2793857B9B@sourceware.org> From: Jeff Law In-Reply-To: <20230322100210.AE2793857B9B@sourceware.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 3/22/23 04:01, Richard Biener via Gcc-patches wrote: > The following addresses quadraticness in processing debug insns > in delete_trivially_dead_insns and insn_live_p by using TREE_VISITED > on the INSN_VAR_LOCATION_DECL to indicate a later debug bind > with the same decl and no intervening real insn or debug marker. > That gets rid of the NEXT_INSN walk in insn_live_p in favor of > first clearing TREE_VISITED in the first loop over insn and > the book-keeping of decls we set the bit since we need to clear > them when visiting a real or debug marker insn. > > That improves the time spent in delete_trivially_dead_insns from > 10.6s to 2.2s for the testcase. > > Bootstrapped and tested on x86_64-unknown-linux-gnu. > > OK? > > Thanks, > Richard. > > PR rtl-optimization/109237 > * cse.cc (insn_live_p): Remove NEXT_INSN walk, instead check > TREE_VISITED on INSN_VAR_LOCATION_DECL. > (delete_trivially_dead_insns): Maintain TREE_VISITED on > active debug bind INSN_VAR_LOCATION_DECL. OK jeff