From patchwork Thu May 19 14:16:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 54211 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0D87E383D83D for ; Thu, 19 May 2022 14:21:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0D87E383D83D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1652970078; bh=sA6Z5q70s86Z3XEFBYNHABW8iUu35WPU8igvylrOyZw=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=jga+R4rUouYmGTqlicxqK7j5QkXTuojpuNpmxy8xzVOq9jypZViYihpAa9mucRG6i wgmBjnQ3lY3PNiDZmEOPtDksYqHfZlFjt7DHpgi5SPbcPEcGz52T4Vrt7lwyXM1EZn wP1a9hqH6nGVLQ7gAiGkc/2d27iAQVdxQk7hnFQk= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id C2644383D83C for ; Thu, 19 May 2022 14:16:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C2644383D83C Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 97F5A21B74 for ; Thu, 19 May 2022 14:16:01 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 7FF6313456 for ; Thu, 19 May 2022 14:16:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id WghbHSFRhmKBQAAAMHmgww (envelope-from ) for ; Thu, 19 May 2022 14:16:01 +0000 Date: Thu, 19 May 2022 16:16:01 +0200 (CEST) To: gcc-patches@gcc.gnu.org Subject: [PATCH] Remove get_or_alloc_expression_id MIME-Version: 1.0 Message-Id: <20220519141601.7FF6313456@imap2.suse-dmz.suse.de> X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Richard Biener via Gcc-patches From: Richard Biener Reply-To: Richard Biener Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" This function is no longer needed. Bootstrapped and tested on x86_64-unknown-linux-gnu with a change to assert it is computed when queried. Pushed. 2022-05-19 Richard Biener * tree-ssa-pre.cc (get_or_alloc_expression_id): Remove. (add_to_value): Use get_expression_id. (bitmap_insert_into_set): Likewise. (bitmap_value_insert_into_set): Likewise. --- gcc/tree-ssa-pre.cc | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/gcc/tree-ssa-pre.cc b/gcc/tree-ssa-pre.cc index 34d77f1e2cf..09a5e2055ca 100644 --- a/gcc/tree-ssa-pre.cc +++ b/gcc/tree-ssa-pre.cc @@ -384,18 +384,6 @@ lookup_expression_id (const pre_expr expr) } } -/* Return the existing expression id for EXPR, or create one if one - does not exist yet. */ - -static inline unsigned int -get_or_alloc_expression_id (pre_expr expr) -{ - unsigned int id = lookup_expression_id (expr); - if (id == 0) - return alloc_expression_id (expr); - return expr->id = id; -} - /* Return the expression that has expression id ID */ static inline pre_expr @@ -729,7 +717,7 @@ add_to_value (unsigned int v, pre_expr e) set = BITMAP_ALLOC (&grand_bitmap_obstack); value_expressions[v] = set; } - bitmap_set_bit (set, get_or_alloc_expression_id (e)); + bitmap_set_bit (set, get_expression_id (e)); } } @@ -792,7 +780,7 @@ bitmap_insert_into_set (bitmap_set_t set, pre_expr expr) 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)); + bitmap_set_bit (&set->expressions, get_expression_id (expr)); } } @@ -1030,7 +1018,7 @@ bitmap_value_insert_into_set (bitmap_set_t set, pre_expr expr) { unsigned int val = get_expr_value_id (expr); - gcc_checking_assert (expr->id == get_or_alloc_expression_id (expr)); + gcc_checking_assert (expr->id == get_expression_id (expr)); /* Constant values are always considered to be part of the set. */ if (value_id_constant_p (val))