From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15428 invoked by alias); 27 Jul 2014 19:38:02 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 15125 invoked by uid 89); 27 Jul 2014 19:37:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: one.firstfloor.org Received: from one.firstfloor.org (HELO one.firstfloor.org) (193.170.194.197) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Sun, 27 Jul 2014 19:37:56 +0000 Received: from basil.firstfloor.org (184-100-237-164.ptld.qwest.net [184.100.237.164]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by one.firstfloor.org (Postfix) with ESMTPSA id 3AE953F769; Sun, 27 Jul 2014 21:37:49 +0200 (CEST) Received: by basil.firstfloor.org (Postfix, from userid 1000) id 27C45A2A49; Sun, 27 Jul 2014 12:37:08 -0700 (PDT) From: Andi Kleen To: gcc-patches@gcc.gnu.org Cc: Andi Kleen Subject: [PATCH 6/6] Convert tree-ssa-tail-merge to inchash Date: Sun, 27 Jul 2014 19:38:00 -0000 Message-Id: <1406489825-9561-7-git-send-email-andi@firstfloor.org> In-Reply-To: <1406489825-9561-6-git-send-email-andi@firstfloor.org> References: <1406489825-9561-1-git-send-email-andi@firstfloor.org> <1406489825-9561-2-git-send-email-andi@firstfloor.org> <1406489825-9561-3-git-send-email-andi@firstfloor.org> <1406489825-9561-4-git-send-email-andi@firstfloor.org> <1406489825-9561-5-git-send-email-andi@firstfloor.org> <1406489825-9561-6-git-send-email-andi@firstfloor.org> X-SW-Source: 2014-07/txt/msg01851.txt.bz2 From: Andi Kleen gcc/: 2014-07-25 Andi Kleen * tree-ssa-tail-merge.c (same_succ_hash): Convert to inchash. --- gcc/tree-ssa-tail-merge.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/gcc/tree-ssa-tail-merge.c b/gcc/tree-ssa-tail-merge.c index 9600e28..a27af5b 100644 --- a/gcc/tree-ssa-tail-merge.c +++ b/gcc/tree-ssa-tail-merge.c @@ -451,7 +451,7 @@ stmt_update_dep_bb (gimple stmt) static hashval_t same_succ_hash (const_same_succ e) { - hashval_t hashval = bitmap_hash (e->succs); + inchash hstate (bitmap_hash (e->succs)); int flags; unsigned int i; unsigned int first = bitmap_first_set_bit (e->bbs); @@ -472,37 +472,35 @@ same_succ_hash (const_same_succ e) continue; size++; - hashval = iterative_hash_hashval_t (gimple_code (stmt), hashval); + hstate.add_int (gimple_code (stmt)); if (is_gimple_assign (stmt)) - hashval = iterative_hash_hashval_t (gimple_assign_rhs_code (stmt), - hashval); + hstate.add_int (gimple_assign_rhs_code (stmt)); if (!is_gimple_call (stmt)) continue; if (gimple_call_internal_p (stmt)) - hashval = iterative_hash_hashval_t - ((hashval_t) gimple_call_internal_fn (stmt), hashval); + hstate.add_int (gimple_call_internal_fn (stmt)); else { - hashval = iterative_hash_expr (gimple_call_fn (stmt), hashval); + iterative_hstate_expr (gimple_call_fn (stmt), hstate); if (gimple_call_chain (stmt)) - hashval = iterative_hash_expr (gimple_call_chain (stmt), hashval); + iterative_hstate_expr (gimple_call_chain (stmt), hstate); } for (i = 0; i < gimple_call_num_args (stmt); i++) { arg = gimple_call_arg (stmt, i); arg = vn_valueize (arg); - hashval = iterative_hash_expr (arg, hashval); + iterative_hstate_expr (arg, hstate); } } - hashval = iterative_hash_hashval_t (size, hashval); + hstate.add_int (size); BB_SIZE (bb) = size; for (i = 0; i < e->succ_flags.length (); ++i) { flags = e->succ_flags[i]; flags = flags & ~(EDGE_TRUE_VALUE | EDGE_FALSE_VALUE); - hashval = iterative_hash_hashval_t (flags, hashval); + hstate.add_int (flags); } EXECUTE_IF_SET_IN_BITMAP (e->succs, 0, s, bs) @@ -521,7 +519,7 @@ same_succ_hash (const_same_succ e) } } - return hashval; + return hstate.end (); } /* Returns true if E1 and E2 have 2 successors, and if the successor flags -- 2.0.1