From patchwork Mon Oct 18 22:16:48 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pat Haugen X-Patchwork-Id: 68243 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]) by ozlabs.org (Postfix) with SMTP id 929B3B70DF for ; Tue, 19 Oct 2010 09:17:13 +1100 (EST) Received: (qmail 25229 invoked by alias); 18 Oct 2010 22:16:59 -0000 Received: (qmail 25221 invoked by uid 22791); 18 Oct 2010 22:16:58 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e39.co.us.ibm.com (HELO e39.co.us.ibm.com) (32.97.110.160) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 18 Oct 2010 22:16:54 +0000 Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) by e39.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id o9IM5woL025668 for ; Mon, 18 Oct 2010 16:05:58 -0600 Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o9IMGneP208862 for ; Mon, 18 Oct 2010 16:16:49 -0600 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o9IMGnjI004127 for ; Mon, 18 Oct 2010 16:16:49 -0600 Received: from [127.0.0.1] (9-10-243-106.rchland.ibm.com [9.10.243.106]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id o9IMGlda003490; Mon, 18 Oct 2010 16:16:48 -0600 Message-ID: <4CBCC750.3030408@linux.vnet.ibm.com> Date: Mon, 18 Oct 2010 17:16:48 -0500 From: Pat Haugen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 MIME-Version: 1.0 To: Richard Guenther CC: Eric Botcazou , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Modify TER to not propagate expressions across call References: <4C8A90C5.4020306@linux.vnet.ibm.com> <201010180918.34483.ebotcazou@adacore.com> In-Reply-To: X-IsSubscribed: yes 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 On 10/18/2010 4:33 AM, Richard Guenther wrote: > >> The NOT operation used to be propagated into the AND operation; it isn't any >> more after the patch. Now this propagation was a complete win: an SSA name >> was eliminated and lifetimes didn't change globally. >> >> Could the patch be tweaked so as to fix the pessimization this case? > We could allow the TER if the operation just has a single operand as > that doesn't pessimize register allocation across calls The following appears to work, if it's the right approach I can bootstrap/regtest. else mark_replaceable (tab, use, stmt_replaceable); Index: tree-ssa-ter.c =================================================================== --- tree-ssa-ter.c (revision 165656) +++ tree-ssa-ter.c (working copy) @@ -645,7 +645,8 @@ find_replaceable_in_bb (temp_expr_table_ substitution list, or the def and use span a call such that we'll expand lifetimes across a call. */ if (gimple_has_volatile_ops (stmt) || same_root_var || - tab->call_cnt[ver] != cur_call_cnt) + (tab->call_cnt[ver] != cur_call_cnt && + SINGLE_SSA_USE_OPERAND (SSA_NAME_DEF_STMT (use), SSA_OP_USE) == NULL_USE_OPERAND_P)) finished_with_expr (tab, ver, true);