From patchwork Tue May 15 09:17:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 159266 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 3D6F3B6FAF for ; Tue, 15 May 2012 19:18:03 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1337678284; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Date: From:To:Subject:Message-ID:MIME-Version:Content-Type: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=sYaBZqOl4hsAWMi3x1TD E+ebznE=; b=rVTyoop/WEKrxTQYRRU5/5INoW80xZWor6VOpKLjhU+LcvQ5Tvea Zs0tcKDDKXyfxh2KNchrOmFvXvu7/SDJmUPUHvq5oF3+egJPQjoCiENP4t7cdXxk 149H+DxQxFXBW5zdZV0xMLBaddKaYJVLFcGLoVRJfJBW4ZPKEqD3JTM= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Date:From:To:Subject:Message-ID:MIME-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=SrC7fsmmB+CX/pFRG8Owp2zf5eg+wXeHcT4i5UIXw4fpT/sof3rVi4WgxNn9R6 NEwOgedt6KH5wvWqHzTU7STwK3B71tkOeiNuU//+IF0Nez+OU2K/3BZ26zbQPl2z QTx98hJs7YFtr0aKJBkFh4eBhKNUfkgVNmMmc6bncOB28=; Received: (qmail 8356 invoked by alias); 15 May 2012 09:17:56 -0000 Received: (qmail 8334 invoked by uid 22791); 15 May 2012 09:17:54 -0000 X-SWARE-Spam-Status: No, hits=-5.3 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, TW_TM, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 15 May 2012 09:17:40 +0000 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 9E81E8FA97 for ; Tue, 15 May 2012 11:17:38 +0200 (CEST) Date: Tue, 15 May 2012 11:17:38 +0200 (CEST) From: Richard Guenther To: gcc-patches@gcc.gnu.org Subject: [PATCH] Move gimple_set_modified Message-ID: MIME-Version: 1.0 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 This moves gimple_set_modified to be inlined. One important user is update_stmt which looks like static inline void update_stmt (gimple s) { if (gimple_has_ops (s)) { gimple_set_modified (s, true); update_stmt_operands (s); } } and thus either is not worth inlining or we should inline gimple_set_modified, too, to avoid the redundant gimple_has_ops in gimple_set_modified and basically optimize the above to inline if (gimple_code (g) >= GIMPLE_COND && gimple_code (g) <= GIMPLE_RETURN) { s->gsbase.modified = (unsigned) modifiedp; update_stmt_operands (s); } where the gimple_code () check is possibly optimized by preceeding code. Bootstrapped and tested on x86_64-unknown-linux-gnu, applied. Richard. 2012-05-15 Richard Guenther * gimple.c (gimple_set_modified): Move ... * gimple.h (gimple_set_modified): ... here. Index: gcc/gimple.c =================================================================== --- gcc/gimple.c (revision 187456) +++ gcc/gimple.c (working copy) @@ -2394,17 +2394,6 @@ gimple_copy (gimple stmt) } -/* Set the MODIFIED flag to MODIFIEDP, iff the gimple statement G has - a MODIFIED field. */ - -void -gimple_set_modified (gimple s, bool modifiedp) -{ - if (gimple_has_ops (s)) - s->gsbase.modified = (unsigned) modifiedp; -} - - /* Return true if statement S has side-effects. We consider a statement to have side effects if: Index: gcc/gimple.h =================================================================== --- gcc/gimple.h (revision 187456) +++ gcc/gimple.h (working copy) @@ -830,7 +830,6 @@ tree gimple_get_lhs (const_gimple); void gimple_set_lhs (gimple, tree); void gimple_replace_lhs (gimple, tree); gimple gimple_copy (gimple); -void gimple_set_modified (gimple, bool); void gimple_cond_get_ops_from_tree (tree, enum tree_code *, tree *, tree *); gimple gimple_build_cond_from_tree (tree, tree, tree); void gimple_cond_set_condition_from_tree (gimple, tree); @@ -1521,6 +1520,17 @@ gimple_modified_p (const_gimple g) } +/* Set the MODIFIED flag to MODIFIEDP, iff the gimple statement G has + a MODIFIED field. */ + +static inline void +gimple_set_modified (gimple s, bool modifiedp) +{ + if (gimple_has_ops (s)) + s->gsbase.modified = (unsigned) modifiedp; +} + + /* Return the tree code for the expression computed by STMT. This is only valid for GIMPLE_COND, GIMPLE_CALL and GIMPLE_ASSIGN. For GIMPLE_CALL, return CALL_EXPR as the expression code for