From patchwork Sat Nov 5 07:42:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 123827 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 476ECB6F98 for ; Sat, 5 Nov 2011 18:42:46 +1100 (EST) Received: (qmail 25994 invoked by alias); 5 Nov 2011 07:42:43 -0000 Received: (qmail 25975 invoked by uid 22791); 5 Nov 2011 07:42:41 -0000 X-SWARE-Spam-Status: No, hits=-7.0 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, SPF_HELO_PASS, TW_FN, TW_TM X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 05 Nov 2011 07:42:22 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pA57gLat007300 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 5 Nov 2011 03:42:21 -0400 Received: from austin.quesejoda.com (vpn-10-244.rdu.redhat.com [10.11.10.244]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pA57gJPA018086; Sat, 5 Nov 2011 03:42:20 -0400 Message-ID: <4EB4E8DA.6090900@redhat.com> Date: Sat, 05 Nov 2011 00:42:18 -0700 From: Aldy Hernandez User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Thunderbird/3.1.10 MIME-Version: 1.0 To: Michael Matz CC: gcc-patches Subject: Re: [patch] 19/n: trans-mem: compiler tree/gimple stuff References: <4EB2EACC.8050307@redhat.com> In-Reply-To: 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 11/04/11 08:26, Michael Matz wrote: > Hi, > > On Thu, 3 Nov 2011, Aldy Hernandez wrote: > >> +/* GIMPLE_EH_ELSE must be the sole contents of >> + a GIMPLE_TRY_FINALLY node. For all normal exits from the try block, >> + we N_BODY is run; for all exception exits from the try block, > > s/we // Fixed > >> +++ gcc/calls.c (.../branches/transactional-memory) (revision 180773) >> @@ -496,7 +496,60 @@ emit_call_1 (rtx funexp, tree fntree ATT >> static int >> special_function_p (const_tree fndecl, int flags) >> { >> + case BUILT_IN_TM_IRREVOCABLE: >> + case BUILT_IN_TM_GETTMCLONE_IRR: >> + case BUILT_IN_TM_MEMCPY: >> + case BUILT_IN_TM_MEMMOVE: >> + case BUILT_IN_TM_MEMSET: > > Whitespace. Fixed > >> @@ -1751,6 +1787,8 @@ walk_gimple_stmt (gimple_stmt_iterator * >> gcc_assert (tree_ret == NULL); >> >> /* Re-read stmt in case the callback changed it. */ >> + if (wi&& wi->removed_stmt) >> + return NULL; >> stmt = gsi_stmt (*gsi); > > Comment belongs to the stmt assignment, not to the new if/return. Fixed > >> @@ -3085,6 +3153,8 @@ get_call_expr_in (tree t) >> t = TREE_OPERAND (t, 1); >> if (TREE_CODE (t) == WITH_SIZE_EXPR) >> t = TREE_OPERAND (t, 0); >> + if (TREE_CODE (t) == VIEW_CONVERT_EXPR) >> + t = TREE_OPERAND (t, 0); >> if (TREE_CODE (t) == CALL_EXPR) >> return t; > > The function get_call_expr_in is unused in our compiler (and you don't > introduce a new use), so instead of amending it, just remove it. Fixed in previous patch. >> + GF_CALL_NOINLINE = 1<< 8, > This flag is only used by the new accessors gimple_call_noinline_p and > gimple_call_set_noinline_p. The latter is used in > trans-mem.c:ipa_tm_insert_gettmclone_call, but marked as hack. The flag > isn't tested anywhere (i.e. no calls to gimple_call_noinline_p). Hence > this whole thing is unused, presumably the hack was transformed into a > real solution :) So, don't add the flag or the accessors, and remove the > call from trans-mem.c. Excellent catch! Thanks so much. Fixed. The attached patch has been bootstrapped and regtested on x86-64 Linux. Committing to branch. * trans-mem.c (ipa_tm_insert_gettmclone_call): Remove call to gimple_call_set_noinline_p. * gimple.h (enum gf_mask): Remove GF_CALL_NOINLINE. (gimple_call_noinline_p): Remove. (gimple_call_set_noinline_p): Remove. * gimple.c (walk_gimple_stmt): Move comment down. * calls.c (is_tm_builtin): Fix whitespace problem. * gimple.def (GIMPLE_EH_ELSE): Fix typo in comment. Index: gimple.def =================================================================== --- gimple.def (revision 180974) +++ gimple.def (working copy) @@ -161,7 +161,7 @@ DEFGSCODE(GIMPLE_EH_MUST_NOT_THROW, "gim /* GIMPLE_EH_ELSE must be the sole contents of a GIMPLE_TRY_FINALLY node. For all normal exits from the try block, - we N_BODY is run; for all exception exits from the try block, + N_BODY is run; for all exception exits from the try block, E_BODY is run. */ DEFGSCODE(GIMPLE_EH_ELSE, "gimple_eh_else", GSS_EH_ELSE) Index: trans-mem.c =================================================================== --- trans-mem.c (revision 180974) +++ trans-mem.c (working copy) @@ -4367,12 +4367,6 @@ ipa_tm_insert_gettmclone_call (struct cg if (gimple_call_nothrow_p (stmt)) gimple_call_set_nothrow (stmt, true); - /* ??? This is a hack to prevent tree-eh.c inlineable_call_p from - deciding that the indirect call we have after this transformation - might be inlinable, and thus changing the value of can_throw_internal, - and thus requiring extra EH edges. */ - gimple_call_set_noinline_p (stmt); - gimple_call_set_fn (stmt, callfn); /* Discarding OBJ_TYPE_REF above may produce incompatible LHS and RHS Index: calls.c =================================================================== --- calls.c (revision 181004) +++ calls.c (working copy) @@ -634,7 +634,7 @@ is_tm_builtin (const_tree fndecl) case BUILT_IN_TM_GETTMCLONE_IRR: case BUILT_IN_TM_MEMCPY: case BUILT_IN_TM_MEMMOVE: - case BUILT_IN_TM_MEMSET: + case BUILT_IN_TM_MEMSET: CASE_BUILT_IN_TM_STORE (1): CASE_BUILT_IN_TM_STORE (2): CASE_BUILT_IN_TM_STORE (4): Index: gimple.c =================================================================== --- gimple.c (revision 181004) +++ gimple.c (working copy) @@ -1788,9 +1788,10 @@ walk_gimple_stmt (gimple_stmt_iterator * a value to return. */ gcc_assert (tree_ret == NULL); - /* Re-read stmt in case the callback changed it. */ if (wi && wi->removed_stmt) return NULL; + + /* Re-read stmt in case the callback changed it. */ stmt = gsi_stmt (*gsi); } Index: gimple.h =================================================================== --- gimple.h (revision 181004) +++ gimple.h (working copy) @@ -105,7 +105,6 @@ enum gf_mask { GF_CALL_NOTHROW = 1 << 5, GF_CALL_ALLOCA_FOR_VAR = 1 << 6, GF_CALL_INTERNAL = 1 << 7, - GF_CALL_NOINLINE = 1 << 8, GF_OMP_PARALLEL_COMBINED = 1 << 0, /* True on an GIMPLE_OMP_RETURN statement if the return does not require @@ -2490,22 +2489,6 @@ gimple_call_alloca_for_var_p (gimple s) return (s->gsbase.subcode & GF_CALL_ALLOCA_FOR_VAR) != 0; } -/* Return true if S is a noinline call. */ - -static inline bool -gimple_call_noinline_p (gimple s) -{ - GIMPLE_CHECK (s, GIMPLE_CALL); - return (s->gsbase.subcode & GF_CALL_NOINLINE) != 0; -} - -static inline void -gimple_call_set_noinline_p (gimple s) -{ - GIMPLE_CHECK (s, GIMPLE_CALL); - s->gsbase.subcode |= GF_CALL_NOINLINE; -} - /* Copy all the GF_CALL_* flags from ORIG_CALL to DEST_CALL. */ static inline void