From patchwork Sat Mar 5 05:14:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Law X-Patchwork-Id: 592323 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 0335814076E for ; Sat, 5 Mar 2016 16:15:03 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=mJhAeEe4; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=gtP7dT4u0EOec8Ur1ByxYUjzqXKaVonxIEA++hERnCeiX77GTE 2w7iEsiNE/Pl+faRLvJzRDFTFg4ddwcDFLhq6JCq4Or82GImZskmajJhqLqqQKWW AiK4rviiv564/QZGOmGa+El91ncawFqnHAQYbZDu0IxgYGaOjoPaVDmWg= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=MLKuPS0GuBibCeiFgMBXjUgYB/g=; b=mJhAeEe4eavoblHs8A5Q zO3s+II43owvodpTTEHhE+e+0sc6vIFQyp/4eOG9J+F3KE+dTCsNGeZJzr1K/SK/ ZF2Aw7K1emi4yFVHCpwFTOZnigq0wr1SMbxKR/GwO3FnX1+gR9eU8JRSa29Pc4K6 1RHtymu04y0cbN9iCX62rF4= Received: (qmail 89559 invoked by alias); 5 Mar 2016 05:14:49 -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 89500 invoked by uid 89); 5 Mar 2016 05:14:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=20160305, 2016-03-05, Until, 3117 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sat, 05 Mar 2016 05:14:44 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 28D8464375 for ; Sat, 5 Mar 2016 05:14:43 +0000 (UTC) Received: from slagheap.utah.redhat.com ([10.3.113.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u255EgpK017270 for ; Sat, 5 Mar 2016 00:14:42 -0500 To: gcc-patches From: Jeff Law Subject: [PATCH] [PR tree-optimization/69196] Consider two anonymous SSA_NAMEs unassociated Message-ID: <56DA6B42.6010009@redhat.com> Date: Fri, 4 Mar 2016 22:14:42 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 X-IsSubscribed: yes As pointed out by Richi, the code did not precisely match the comment in the case of two anonymous SSA_NAMEs. In that case we don't have enough information to determine if the names are associated. Until we do something like build partitions (similar to what's done in tree-ssa-coalesce), it seems best to consider two anonymous SSA_NAMEs to be unassociated and count the PHI against the statement count for threading. Bootstrapped and regression tested on x86-64. Installed on the trunk. Jeff commit 2ef58c4014fc23573d8ff10e50381c6cbdcba6e6 Author: law Date: Sat Mar 5 05:10:58 2016 +0000 PR tree-optimization/69196 * tree-ssa-threadbackward.c (fsm_find_control_statement_thread_paths): If the both SSA_NAMEs are anonymous, then consider them unassociated and include the PHI in the statement count. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233999 138bc75d-0d04-0410-961f-82ee72b054a4 diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5c23836..09a2714 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2016-03-04 Jeff Law + + PR tree-optimization/69196 + * tree-ssa-threadbackward.c (fsm_find_control_statement_thread_paths): + If the both SSA_NAMEs are anonymous, then consider them unassociated + and include the PHI in the statement count. + 2016-03-05 Tom de Vries * omp-low.c (check_omp_nesting_restrictions): Check for non-oacc diff --git a/gcc/tree-ssa-threadbackward.c b/gcc/tree-ssa-threadbackward.c index 747296b..6f1b757 100644 --- a/gcc/tree-ssa-threadbackward.c +++ b/gcc/tree-ssa-threadbackward.c @@ -311,7 +311,11 @@ fsm_find_control_statement_thread_paths (tree name, gphi *phi = gsip.phi (); tree dst = gimple_phi_result (phi); - if (SSA_NAME_VAR (dst) != SSA_NAME_VAR (name) + /* Note that if both NAME and DST are anonymous + SSA_NAMEs, then we do not have enough information + to consider them associated. */ + if ((SSA_NAME_VAR (dst) != SSA_NAME_VAR (name) + || !SSA_NAME_VAR (dst)) && !virtual_operand_p (dst)) ++n_insns; }