From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 115124 invoked by alias); 2 Aug 2017 06:51:10 -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 115102 invoked by uid 89); 2 Aug 2017 06:51:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 02 Aug 2017 06:51:07 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 7F080AC6C for ; Wed, 2 Aug 2017 06:51:05 +0000 (UTC) Date: Wed, 02 Aug 2017 06:51:00 -0000 From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] More PRE TLC Message-ID: User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SW-Source: 2017-08/txt/msg00141.txt.bz2 Bootstrapped and tested on x86_64-unknown-linux-gnu, applied. Richard. 2017-08-02 Richard Biener * tree-ssa-pre.c (bitmap_insert_into_set_1): Remove and inline into ... (bitmap_insert_into_set): ... this. Index: gcc/tree-ssa-pre.c =================================================================== --- gcc/tree-ssa-pre.c (revision 250777) +++ gcc/tree-ssa-pre.c (working copy) @@ -540,8 +540,6 @@ static void bitmap_set_copy (bitmap_set_ static void bitmap_set_and (bitmap_set_t, bitmap_set_t); static bool bitmap_set_contains_value (bitmap_set_t, unsigned int); static void bitmap_insert_into_set (bitmap_set_t, pre_expr); -static void bitmap_insert_into_set_1 (bitmap_set_t, pre_expr, - unsigned int, bool); static bitmap_set_t bitmap_set_new (void); static tree create_expression_by_pieces (basic_block, pre_expr, gimple_seq *, tree); @@ -732,27 +730,22 @@ bitmap_remove_from_set (bitmap_set_t set } } +/* Insert an expression EXPR into a bitmapped set. */ + static void -bitmap_insert_into_set_1 (bitmap_set_t set, pre_expr expr, - unsigned int val, bool allow_constants) +bitmap_insert_into_set (bitmap_set_t set, pre_expr expr) { - if (allow_constants || !value_id_constant_p (val)) + unsigned int val = get_expr_value_id (expr); + if (! value_id_constant_p (val)) { - /* We specifically expect this and only this function to be able to - insert constants into a set. */ + /* Note this is the only function causing multiple expressions + for the same value to appear in a set. This is needed for + TMP_GEN, PHI_GEN and NEW_SETs. */ bitmap_set_bit (&set->values, val); bitmap_set_bit (&set->expressions, get_or_alloc_expression_id (expr)); } } -/* Insert an expression EXPR into a bitmapped set. */ - -static void -bitmap_insert_into_set (bitmap_set_t set, pre_expr expr) -{ - bitmap_insert_into_set_1 (set, expr, get_expr_value_id (expr), false); -} - /* Copy a bitmapped set ORIG, into bitmapped set DEST. */ static void @@ -2471,7 +2515,8 @@ compute_antic (void) { /* For partial antic we ignore backedges and thus we do not need to perform any iteration when we process blocks in postorder. */ - int postorder_num = pre_and_rev_post_order_compute (NULL, postorder.address (), false); + int postorder_num + = pre_and_rev_post_order_compute (NULL, postorder.address (), false); for (i = postorder_num - 1 ; i >= 0; i--) { basic_block block = BASIC_BLOCK_FOR_FN (cfun, postorder[i]);