From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11520 invoked by alias); 29 Nov 2017 10:03:04 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 11258 invoked by uid 89); 29 Nov 2017 10:02:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KB_WAM_FROM_NAME_SINGLEWORD,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy=literally X-HELO: mail-wm0-f54.google.com Received: from mail-wm0-f54.google.com (HELO mail-wm0-f54.google.com) (74.125.82.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 29 Nov 2017 10:02:30 +0000 Received: by mail-wm0-f54.google.com with SMTP id t8so4941140wmc.3 for ; Wed, 29 Nov 2017 02:02:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=cAgyC7RLNYMq7rder4Y1bYvZcaFtyZ45vDbsEoRPrzE=; b=Yq51Mju8TbKW+pOb5sCNxe0sfohm5ICtkaoe7ThUiZKIZNJZIukhatT8K8UuxBa/Xk JO9vZBGbcGbxQeCujtYNFKZJ/pgrI9uQAMStrmjltjaKJkdWsk+QgGQfngroxOc0QLA6 4smL7+qm1pXCFRfzOrHPsULhxRNKKqLeCCZqMVRdquppWMSqpekCfguHpBYKva3CHrpG d1uSEeF+0u2VnUekT6FQkIuIwYZwmvyt1Bg1/ISeGgScC2SAydC+9SrK+/PJCXu2mEPi CBOHbfQ7VmFaERFXsCsrq312U74gxpq44bpxHZwjhLWmmG2Hvhs6Mjg8D0qq3WbnKdGC GUBQ== X-Gm-Message-State: AJaThX6VoLKcAJro3h/aJ21Wn68msgxxLLG/cF/JF6cZuyEK4saOHeWi nvD9nJlfQ8VT4CwBRJRy7QiG3UkDsObadkn/jeQ= X-Google-Smtp-Source: AGs4zMbCZmmopw3mJO7qQw9ZgOMr1SiIHY6QXhYDQtrFsmH6L1RJL1j9jh00z38d6id9zk2YUIh/EPLOnxW6GgMYi8Y= X-Received: by 10.80.194.194 with SMTP id u2mr6859034edf.260.1511949748455; Wed, 29 Nov 2017 02:02:28 -0800 (PST) MIME-Version: 1.0 Received: by 10.80.143.34 with HTTP; Wed, 29 Nov 2017 02:02:28 -0800 (PST) In-Reply-To: References: From: Richard Biener Date: Wed, 29 Nov 2017 10:11:00 -0000 Message-ID: Subject: Re: [PATCH GCC]Rename and make remove_dead_inserted_code a simple dce interface To: Bin Cheng Cc: "gcc-patches@gcc.gnu.org" , nd Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg02489.txt.bz2 On Tue, Nov 28, 2017 at 3:48 PM, Bin Cheng wrote: > Hi, > This patch renames remove_dead_inserted_code to simple_dce_from_worklist, moves it to tree-ssa-dce.c > and makes it a simple public DCE interface. Bootstrap and test along with loop interchange. It's required > for interchange pass. Is it OK? + /* ??? Re-use seeds as worklist not only as initial set. This may end up + removing more code as well. If we keep seeds unchanged we could restrict + new worklist elements to members of seed. */ Please remove this comment, while it applies to PRE when one takes remove_dead_inserted_code literally it doesn't apply to a seeded DCE. Please also rename 'seeds' to 'worklist' directly and document that worklist is consumed by the function. The function has linear complexity in the number of dead stmts, the constant factor is the number of SSA use operands in those stmts (so 2 on average I'd say). Ok with that change. Thanks, Richard. > BTW, I will push this along with interchange to branch: gcc.gnu.org/svn/gcc/branches/gimple-linterchange. > > Thanks, > bin > 2017-11-27 Bin Cheng > > * tree-ssa-dce.c (simple_dce_from_worklist): Move and rename from > tree-ssa-pre.c::remove_dead_inserted_code. > * tree-ssa-dce.h: New file. > * tree-ssa-pre.c (tree-ssa-dce.h): Include new header file. > (remove_dead_inserted_code): Move and rename to function > tree-ssa-dce.c::simple_dce_from_worklist. > (pass_pre::execute): Update use.