From patchwork Mon Nov 14 22:56:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kugan Vivekanandarajah X-Patchwork-Id: 82200 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp1247074qge; Mon, 14 Nov 2016 14:56:38 -0800 (PST) X-Received: by 10.99.122.92 with SMTP id j28mr32585409pgn.64.1479164198291; Mon, 14 Nov 2016 14:56:38 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id m5si23953763pgj.182.2016.11.14.14.56.37 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Nov 2016 14:56:38 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-441407-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-441407-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-441407-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=NnuleGOG2O6yvBEwQ Jt/rbxM9c/lVz9HdHfUxvcY2MkKrofzZHK0hHGNDlPg1SAyyXDb6ci7su2oE7tc0 Dwkv+4tbKkHOj9Rb1BRqsHz3DtPSFsO1y291/LRn7NC1ha4nQSrNaJdLHom+owX8 pP3LuPUfEf6BAbTBaePCxahRO8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=zKMmN2cId3wXGBuHnCaHOcy 8Xlw=; b=eaI89gwhDg7gEON+oAePRajynD7v2RQJicpsnck2EldcCC6B9WZAVxP lgW4Y4acMnX0YF1A4QwGJ4P1hFYOBZgbJkYrNctcZiwSQwRyOfrb+k8QAjkczjT/ P0+bB/4xJe4oMPyZsEbIaDhi5bmFuN9Wm1W6dtGZ8wR5Vs79MKTo= Received: (qmail 69802 invoked by alias); 14 Nov 2016 22:56:24 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 69790 invoked by uid 89); 14 Nov 2016 22:56:23 -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, SPF_PASS autolearn=ham version=3.3.2 spammy=1091, 7, 10917, Renamed, tree-ssa-live.h X-HELO: mail-pg0-f54.google.com Received: from mail-pg0-f54.google.com (HELO mail-pg0-f54.google.com) (74.125.83.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 14 Nov 2016 22:56:12 +0000 Received: by mail-pg0-f54.google.com with SMTP id 3so59004917pgd.0 for ; Mon, 14 Nov 2016 14:56:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to; bh=NiISwma5KaEtuOOsV7dh9voy/IzVGgtx74NQ9z2qAtw=; b=bLAThtJZfLeBPNeWIvNj29dSk26wanYDJD/p6wI/6EYs3BJsGYdZTIzkSluCyJlCIt GUmr1x9t/z0OmzdYiIGmYI0Cvgr0LbXJR5M8HTzR+XMgaSN/yHfZmrIG0/zcvTIVH71B CDVXD69pwvdL9IMY00/sg/X5TFcuGuja0nc2Z27T3MnoCUPLygFQni2CSyPwrLvIHGGd APp2N7AUm7tJn/GVk0Sxj9Qqs+F5MuztApM41iFSIOEAae9ll/jsP0KWXk3QdaRj0efg uQwdRywWFYydFKjiHwAzBVm4C1L3GR4sAFgQY52zN7hrYn8hZRYbviRBiEKCKzPjYvL/ Soow== X-Gm-Message-State: ABUngvfYQVNE2QWYBYePRFRzoyvB68OjKFizF0ViISp6ra0zT39oLjTRKy3LF+1LY43LT703 X-Received: by 10.99.130.198 with SMTP id w189mr32552542pgd.172.1479164171238; Mon, 14 Nov 2016 14:56:11 -0800 (PST) Received: from [10.1.1.7] (58-6-183-210.dyn.iinet.net.au. [58.6.183.210]) by smtp.gmail.com with ESMTPSA id b126sm37520692pfg.90.2016.11.14.14.56.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Nov 2016 14:56:10 -0800 (PST) Subject: Re: [ssa-coalesce] Rename register_ssa_partition To: Richard Biener References: Cc: "gcc-patches@gcc.gnu.org" From: kugan Message-ID: Date: Tue, 15 Nov 2016 09:56:06 +1100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: X-IsSubscribed: yes Hi Richard, On 08/11/16 23:45, Richard Biener wrote: > On Tue, Nov 8, 2016 at 3:32 AM, kugan wrote: >> Hi, >> >> In tree-ssa-coalesce, register_ssa_partition ) and >> register_ssa_partition_check have lost their meaning over various commits >> and now just verifies that ssa_var is indeed a SSA_NAME and not a >> virtual_operand_p. It is confusing when one look at if for the fist time and >> would expect more while reading the register_ssa_partition. >> >> Attached patch just changes it to verify_ssa_for_coalesce to better reflect >> what it is doing now. >> >> Bootstrap and regression testing is ongoing. Is this OK for trunk if no >> regressions? > > Hum, can you retain the inline wrapper please? I find the new name > verify_ssa_for_coalesce bad as tree-ssa-live.h is something generic, > not just coalescing related. I'd say a better improvement would be to remove > register_ssa_partition completely. Do you like the attached patch which completely removes this. Thanks, Kugan > > Richard. > >> Thanks, >> Kugan >> >> >> >> gcc/ChangeLog: >> >> 2016-11-08 Kugan Vivekanandarajah >> >> * tree-ssa-coalesce.c (register_default_def): Remove usage of arg >> map which is not used at all. >> (create_outofssa_var_map): Use renamed verify_ssa_for_coalesce from >> register_ssa_partition. >> * tree-ssa-live.c (verify_ssa_for_coalesce): Renamed >> register_ssa_partition. >> (register_ssa_partition_check): Remove. >> * tree-ssa-live.h (register_ssa_partition): Renamed to >> verify_ssa_for_coalesce diff --git a/gcc/tree-ssa-coalesce.c b/gcc/tree-ssa-coalesce.c index 6423cdd..d2574df 100644 --- a/gcc/tree-ssa-coalesce.c +++ b/gcc/tree-ssa-coalesce.c @@ -1040,17 +1040,13 @@ create_default_def (tree var, void *arg ATTRIBUTE_UNUSED) /* Register VAR's default def in MAP. */ static void -register_default_def (tree var, void *map_) +register_default_def (tree var, void *arg ATTRIBUTE_UNUSED) { - var_map map = (var_map)map_; - if (!is_gimple_reg (var)) return; tree ssa = ssa_default_def (cfun, var); gcc_assert (ssa); - - register_ssa_partition (map, ssa); } /* If VAR is an SSA_NAME associated with a PARM_DECL or a RESULT_DECL, @@ -1088,7 +1084,6 @@ create_outofssa_var_map (coalesce_list *cl, bitmap used_in_copy) gimple *stmt; tree first; var_map map; - ssa_op_iter iter; int v1, v2, cost; unsigned i; @@ -1096,7 +1091,7 @@ create_outofssa_var_map (coalesce_list *cl, bitmap used_in_copy) map = init_var_map (num_ssa_names); - for_all_parms (register_default_def, map); + for_all_parms (register_default_def, NULL); FOR_EACH_BB_FN (bb, cfun) { @@ -1114,7 +1109,6 @@ create_outofssa_var_map (coalesce_list *cl, bitmap used_in_copy) res = gimple_phi_result (phi); ver = SSA_NAME_VERSION (res); - register_ssa_partition (map, res); /* Register ssa_names and coalesces between the args and the result of all PHI. */ @@ -1125,7 +1119,6 @@ create_outofssa_var_map (coalesce_list *cl, bitmap used_in_copy) if (TREE_CODE (arg) != SSA_NAME) continue; - register_ssa_partition (map, arg); if (gimple_can_coalesce_p (arg, res) || (e->flags & EDGE_ABNORMAL)) { @@ -1152,10 +1145,6 @@ create_outofssa_var_map (coalesce_list *cl, bitmap used_in_copy) if (is_gimple_debug (stmt)) continue; - /* Register USE and DEF operands in each statement. */ - FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, (SSA_OP_DEF|SSA_OP_USE)) - register_ssa_partition (map, var); - /* Check for copy coalesces. */ switch (gimple_code (stmt)) { diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c index b9eef20..9de03d1 100644 --- a/gcc/tree-ssa-live.c +++ b/gcc/tree-ssa-live.c @@ -1276,22 +1276,6 @@ debug (tree_live_info_d *ptr) } -/* Verify that SSA_VAR is a non-virtual SSA_NAME. */ - -void -register_ssa_partition_check (tree ssa_var) -{ - gcc_assert (TREE_CODE (ssa_var) == SSA_NAME); - if (virtual_operand_p (ssa_var)) - { - fprintf (stderr, "Illegally registering a virtual SSA name :"); - print_generic_expr (stderr, ssa_var, TDF_SLIM); - fprintf (stderr, " in the SSA->Normal phase.\n"); - internal_error ("SSA corruption"); - } -} - - /* Verify that the info in LIVE matches the current cfg. */ static void diff --git a/gcc/tree-ssa-live.h b/gcc/tree-ssa-live.h index 6df102a..440efa9 100644 --- a/gcc/tree-ssa-live.h +++ b/gcc/tree-ssa-live.h @@ -80,7 +80,6 @@ extern void remove_unused_locals (void); extern void dump_var_map (FILE *, var_map); extern void debug (_var_map &ref); extern void debug (_var_map *ptr); -extern void register_ssa_partition_check (tree ssa_var); /* Return number of partitions in MAP. */ @@ -174,18 +173,6 @@ num_basevars (var_map map) } - -/* This routine registers a partition for SSA_VAR with MAP. Any unregistered - partitions may be filtered out by a view later. */ - -static inline void -register_ssa_partition (var_map map ATTRIBUTE_UNUSED, tree ssa_var) -{ - if (flag_checking) - register_ssa_partition_check (ssa_var); -} - - /* ---------------- live on entry/exit info ------------------------------ This structure is used to represent live range information on SSA based