From patchwork Fri Jul 16 13:02:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 1506158 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=q13ef7YW; dkim=fail reason="signature verification failed" header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=y1aOI69x; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GRBHH0Rx3z9sX3 for ; Fri, 16 Jul 2021 23:02:50 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 085E039A8014 for ; Fri, 16 Jul 2021 13:02:48 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 5CAAA39A7427 for ; Fri, 16 Jul 2021 13:02:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5CAAA39A7427 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de 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-out2.suse.de (Postfix) with ESMTPS id 5D85C205E6; Fri, 16 Jul 2021 13:02:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1626440539; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=X9Xyi5xvd02onMDYMNT1kWvGzxFZgH/2rPh06XIODKM=; b=q13ef7YWMbsu5VhHhB5vWaEuXwy0Msxb6nQX7VTH/Ky91O3r3DIhQDyIcM3wclIndvnvFL FQWeVKx0Ii7CWEVQeW329gkmP2ijc5lWOvI5R20ZjKzsuwtu4YcIVvqHcDjNtW+EQxGyJL dMwVU1WGDH6u4LDnWhhxwSImIoJEjio= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1626440539; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=X9Xyi5xvd02onMDYMNT1kWvGzxFZgH/2rPh06XIODKM=; b=y1aOI69x3l/Ki+04X9FHBzSlTs5yMY7PKJP2pTzji0Gy/GPSsCevQNCNPUculGaLQ45O9b NkGRma9DwTDHZyCA== 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 46B3F13C71; Fri, 16 Jul 2021 13:02:19 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id XQwrEFuD8WDvNwAAMHmgww (envelope-from ); Fri, 16 Jul 2021 13:02:19 +0000 Date: Fri, 16 Jul 2021 15:02:18 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH 1/3] Remove gimple_expr_type uses from value-range code Message-ID: <8rssr9p2-9o4n-oqor-6o65-7no6r55pr9p@fhfr.qr> MIME-Version: 1.0 X-Spam-Status: No, score=-11.4 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 autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" This removes the last uses from value-range code. Bootstrap & regtest running on x86_64-unknown-linux-gnu, OK? Thanks, Richard. 2021-07-16 Richard Biener * tree-vrp.c (register_edge_assert_for_2): Use the type from the LHS. (vrp_folder::fold_predicate_in): Likewise. * vr-values.c (gimple_assign_nonzero_p): Likewise. (vr_values::extract_range_from_comparison): Likewise. (vr_values::extract_range_from_ubsan_builtin): Use the type of the first operand. (vr_values::extract_range_basic): Push down type computation, use the appropriate LHS. (vr_values::extract_range_from_assignment): Use the type of the LHS. --- gcc/tree-vrp.c | 14 +++++++------- gcc/vr-values.c | 28 ++++++++++++++++------------ 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 0565c9b5073..a9c31bcedb5 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -1484,13 +1484,13 @@ register_edge_assert_for_2 (tree name, edge e, } /* Extract NAME2 from the (optional) sign-changing cast. */ - if (gimple_assign_cast_p (def_stmt)) + if (gassign *ass = dyn_cast (def_stmt)) { - if (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (def_stmt)) - && ! TYPE_UNSIGNED (TREE_TYPE (gimple_assign_rhs1 (def_stmt))) - && (TYPE_PRECISION (gimple_expr_type (def_stmt)) - == TYPE_PRECISION (TREE_TYPE (gimple_assign_rhs1 (def_stmt))))) - name3 = gimple_assign_rhs1 (def_stmt); + if (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (ass)) + && ! TYPE_UNSIGNED (TREE_TYPE (gimple_assign_rhs1 (ass))) + && (TYPE_PRECISION (TREE_TYPE (gimple_assign_lhs (ass))) + == TYPE_PRECISION (TREE_TYPE (gimple_assign_rhs1 (ass))))) + name3 = gimple_assign_rhs1 (ass); } /* If name3 is used later, create an ASSERT_EXPR for it. */ @@ -4119,7 +4119,7 @@ vrp_folder::fold_predicate_in (gimple_stmt_iterator *si) if (val) { if (assignment_p) - val = fold_convert (gimple_expr_type (stmt), val); + val = fold_convert (TREE_TYPE (gimple_assign_lhs (stmt)), val); if (dump_file) { diff --git a/gcc/vr-values.c b/gcc/vr-values.c index 190676de2c0..1b3ec38d288 100644 --- a/gcc/vr-values.c +++ b/gcc/vr-values.c @@ -338,16 +338,17 @@ gimple_assign_nonzero_p (gimple *stmt) { enum tree_code code = gimple_assign_rhs_code (stmt); bool strict_overflow_p; + tree type = TREE_TYPE (gimple_assign_lhs (stmt)); switch (get_gimple_rhs_class (code)) { case GIMPLE_UNARY_RHS: return tree_unary_nonzero_warnv_p (gimple_assign_rhs_code (stmt), - gimple_expr_type (stmt), + type, gimple_assign_rhs1 (stmt), &strict_overflow_p); case GIMPLE_BINARY_RHS: return tree_binary_nonzero_warnv_p (gimple_assign_rhs_code (stmt), - gimple_expr_type (stmt), + type, gimple_assign_rhs1 (stmt), gimple_assign_rhs2 (stmt), &strict_overflow_p); @@ -1025,7 +1026,7 @@ vr_values::extract_range_from_comparison (value_range_equiv *vr, gimple *stmt) { enum tree_code code = gimple_assign_rhs_code (stmt); - tree type = gimple_expr_type (stmt); + tree type = TREE_TYPE (gimple_assign_lhs (stmt)); tree op0 = gimple_assign_rhs1 (stmt); tree op1 = gimple_assign_rhs2 (stmt); bool sop; @@ -1164,7 +1165,6 @@ bool vr_values::extract_range_from_ubsan_builtin (value_range_equiv *vr, gimple *stmt) { gcc_assert (is_gimple_call (stmt)); - tree type = gimple_expr_type (stmt); enum tree_code subcode = ERROR_MARK; combined_fn cfn = gimple_call_combined_fn (stmt); scalar_int_mode mode; @@ -1190,7 +1190,8 @@ vr_values::extract_range_from_ubsan_builtin (value_range_equiv *vr, gimple *stmt any overflow, we'll complain, but will actually do wrapping operation. */ flag_wrapv = 1; - extract_range_from_binary_expr (vr, subcode, type, + extract_range_from_binary_expr (vr, subcode, + TREE_TYPE (gimple_call_arg (stmt, 0)), gimple_call_arg (stmt, 0), gimple_call_arg (stmt, 1)); flag_wrapv = saved_flag_wrapv; @@ -1217,7 +1218,6 @@ void vr_values::extract_range_basic (value_range_equiv *vr, gimple *stmt) { bool sop; - tree type = gimple_expr_type (stmt); if (is_gimple_call (stmt)) { @@ -1244,13 +1244,14 @@ vr_values::extract_range_basic (value_range_equiv *vr, gimple *stmt) /* Handle extraction of the two results (result of arithmetics and a flag whether arithmetics overflowed) from {ADD,SUB,MUL}_OVERFLOW internal function. Similarly from ATOMIC_COMPARE_EXCHANGE. */ - else if (is_gimple_assign (stmt) - && (gimple_assign_rhs_code (stmt) == REALPART_EXPR - || gimple_assign_rhs_code (stmt) == IMAGPART_EXPR) - && INTEGRAL_TYPE_P (type)) + if (is_gimple_assign (stmt) + && (gimple_assign_rhs_code (stmt) == REALPART_EXPR + || gimple_assign_rhs_code (stmt) == IMAGPART_EXPR) + && INTEGRAL_TYPE_P (TREE_TYPE (gimple_assign_lhs (stmt)))) { enum tree_code code = gimple_assign_rhs_code (stmt); tree op = gimple_assign_rhs1 (stmt); + tree type = TREE_TYPE (gimple_assign_lhs (stmt)); if (TREE_CODE (op) == code && TREE_CODE (TREE_OPERAND (op, 0)) == SSA_NAME) { gimple *g = SSA_NAME_DEF_STMT (TREE_OPERAND (op, 0)); @@ -1328,6 +1329,9 @@ vr_values::extract_range_basic (value_range_equiv *vr, gimple *stmt) } } } + /* None of the below should need a 'type', but we are only called + for assignments and calls with a LHS. */ + tree type = TREE_TYPE (gimple_get_lhs (stmt)); if (INTEGRAL_TYPE_P (type) && gimple_stmt_nonnegative_warnv_p (stmt, &sop)) set_value_range_to_nonnegative (vr, type); @@ -1355,12 +1359,12 @@ vr_values::extract_range_from_assignment (value_range_equiv *vr, gassign *stmt) extract_range_from_ssa_name (vr, gimple_assign_rhs1 (stmt)); else if (TREE_CODE_CLASS (code) == tcc_binary) extract_range_from_binary_expr (vr, gimple_assign_rhs_code (stmt), - gimple_expr_type (stmt), + TREE_TYPE (gimple_assign_lhs (stmt)), gimple_assign_rhs1 (stmt), gimple_assign_rhs2 (stmt)); else if (TREE_CODE_CLASS (code) == tcc_unary) extract_range_from_unary_expr (vr, gimple_assign_rhs_code (stmt), - gimple_expr_type (stmt), + TREE_TYPE (gimple_assign_lhs (stmt)), gimple_assign_rhs1 (stmt)); else if (code == COND_EXPR) extract_range_from_cond_expr (vr, stmt); From patchwork Fri Jul 16 13:02:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 1506159 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=i35r5Zbi; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=E7UXwBZy; dkim-atps=neutral Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GRBJV3bVBz9sX3 for ; Fri, 16 Jul 2021 23:03:54 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0431A39A28F3 for ; Fri, 16 Jul 2021 13:03:52 +0000 (GMT) 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 9D3FE386103A for ; Fri, 16 Jul 2021 13:02:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9D3FE386103A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de 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 B89CA21FAE for ; Fri, 16 Jul 2021 13:02:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1626440552; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=Z7Aw+LTW9pXxX0j02tTyX7kqrSKjgKEwQeAvWwxgeF8=; b=i35r5ZbijDqwSfPZhUdFiMpEPBwUkIf+SgeoiGMD6sH4lqho7TtWJNhRjNTiWpu5/EGNov xPkxSlgOxUTmOC1fksu8zbH1eTbyGq9AfHWPJgzw6XetQimTDwaRzmQq3DjFy5Zvp6qvfZ g2lieKfYAGY/oUxhHz5ayESt0Xevk8A= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1626440552; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=Z7Aw+LTW9pXxX0j02tTyX7kqrSKjgKEwQeAvWwxgeF8=; b=E7UXwBZyndr3Mry3NmXl38KeCQdKwD02TKqLwo9Yd6DQobqeZj/6tyTzqvXu2mhTAe+Uss Snc47lX4ibh11rCA== 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 A609913C71 for ; Fri, 16 Jul 2021 13:02:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id lUWGJ2iD8WAAOAAAMHmgww (envelope-from ) for ; Fri, 16 Jul 2021 13:02:32 +0000 Date: Fri, 16 Jul 2021 15:02:32 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH 2/3] Remove last gimple_expr_type uses Message-ID: MIME-Version: 1.0 X-Spam-Status: No, score=-11.4 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 autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" This removes the last uses of gimple_expr_type. Bootstrap & regtest running on x86_64-unknown-linux-gnu. 2021-07-16 Richard Biener * tree-ssa-sccvn.c (vn_reference_eq): Handle NULL vr->type. (ao_ref_init_from_vn_reference): Likewise. (vn_reference_lookup_call): Do not set vr->type to random values. * tree-vect-generic.c (expand_vector_piecewise): Pass in whether we expanded parallel. (expand_vector_parallel): Adjust. (expand_vector_addition): Likewise. (expand_vector_comparison): Likewise. (expand_vector_operation): Likewise. (expand_vector_scalar_condition): Likewise. (expand_vector_conversion): Likewise. --- gcc/tree-ssa-sccvn.c | 27 +++++++++++++++++++-------- gcc/tree-vect-generic.c | 25 ++++++++++++------------- 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index 7900df946f4..b8882b64fe3 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -764,14 +764,18 @@ vn_reference_eq (const_vn_reference_t const vr1, const_vn_reference_t const vr2) if (vr1->operands == vr2->operands) return true; - if (COMPLETE_TYPE_P (vr1->type) != COMPLETE_TYPE_P (vr2->type) - || (COMPLETE_TYPE_P (vr1->type) - && !expressions_equal_p (TYPE_SIZE (vr1->type), - TYPE_SIZE (vr2->type)))) + if (!vr1->type || !vr2->type) + { + if (vr1->type != vr2->type) + return false; + } + else if (COMPLETE_TYPE_P (vr1->type) != COMPLETE_TYPE_P (vr2->type) + || (COMPLETE_TYPE_P (vr1->type) + && !expressions_equal_p (TYPE_SIZE (vr1->type), + TYPE_SIZE (vr2->type)))) return false; - - if (INTEGRAL_TYPE_P (vr1->type) - && INTEGRAL_TYPE_P (vr2->type)) + else if (INTEGRAL_TYPE_P (vr1->type) + && INTEGRAL_TYPE_P (vr2->type)) { if (TYPE_PRECISION (vr1->type) != TYPE_PRECISION (vr2->type)) return false; @@ -1049,6 +1053,10 @@ ao_ref_init_from_vn_reference (ao_ref *ref, poly_offset_int size = -1; tree size_tree = NULL_TREE; + /* We don't handle calls. */ + if (!type) + return false; + machine_mode mode = TYPE_MODE (type); if (mode == BLKmode) size_tree = TYPE_SIZE (type); @@ -3671,7 +3679,10 @@ vn_reference_lookup_call (gcall *call, vn_reference_t *vnresult, vr->vuse = vuse ? SSA_VAL (vuse) : NULL_TREE; vr->operands = valueize_shared_reference_ops_from_call (call); - vr->type = gimple_expr_type (call); + tree lhs = gimple_call_lhs (call); + /* For non-SSA return values the referece ops contain the LHS. */ + vr->type = ((lhs && TREE_CODE (lhs) == SSA_NAME) + ? TREE_TYPE (lhs) : NULL_TREE); vr->punned = false; vr->set = 0; vr->base_set = 0; diff --git a/gcc/tree-vect-generic.c b/gcc/tree-vect-generic.c index a1257db82a6..2e00b3ed3ca 100644 --- a/gcc/tree-vect-generic.c +++ b/gcc/tree-vect-generic.c @@ -307,7 +307,7 @@ static tree expand_vector_piecewise (gimple_stmt_iterator *gsi, elem_op_func f, tree type, tree inner_type, tree a, tree b, enum tree_code code, - tree ret_type = NULL_TREE) + bool parallel_p, tree ret_type = NULL_TREE) { vec *v; tree part_width = TYPE_SIZE (inner_type); @@ -317,8 +317,7 @@ expand_vector_piecewise (gimple_stmt_iterator *gsi, elem_op_func f, int i; location_t loc = gimple_location (gsi_stmt (*gsi)); - if (ret_type - || types_compatible_p (gimple_expr_type (gsi_stmt (*gsi)), type)) + if (ret_type || !parallel_p) warning_at (loc, OPT_Wvector_operation_performance, "vector operation will be expanded piecewise"); else @@ -364,13 +363,13 @@ expand_vector_parallel (gimple_stmt_iterator *gsi, elem_op_func f, tree type, if (TYPE_MODE (TREE_TYPE (type)) == word_mode) return expand_vector_piecewise (gsi, f, type, TREE_TYPE (type), - a, b, code); + a, b, code, true); else if (n_words > 1) { tree word_type = build_word_mode_vector_type (n_words); result = expand_vector_piecewise (gsi, f, word_type, TREE_TYPE (word_type), - a, b, code); + a, b, code, true); result = force_gimple_operand_gsi (gsi, result, true, NULL, true, GSI_SAME_STMT); } @@ -410,7 +409,7 @@ expand_vector_addition (gimple_stmt_iterator *gsi, else return expand_vector_piecewise (gsi, f, type, TREE_TYPE (type), - a, b, code); + a, b, code, false); } static bool @@ -501,7 +500,7 @@ expand_vector_comparison (gimple_stmt_iterator *gsi, tree type, tree op0, else t = expand_vector_piecewise (gsi, do_compare, type, TREE_TYPE (TREE_TYPE (op0)), op0, op1, - code); + code, false); } else t = NULL_TREE; @@ -1248,11 +1247,11 @@ expand_vector_operation (gimple_stmt_iterator *gsi, tree type, tree compute_type if (TREE_CODE_CLASS (code) == tcc_unary) return expand_vector_piecewise (gsi, do_unop, type, compute_type, gimple_assign_rhs1 (assign), - NULL_TREE, code); + NULL_TREE, code, false); else return expand_vector_piecewise (gsi, do_binop, type, compute_type, gimple_assign_rhs1 (assign), - gimple_assign_rhs2 (assign), code); + gimple_assign_rhs2 (assign), code, false); } /* Try to optimize @@ -1762,7 +1761,7 @@ expand_vector_scalar_condition (gimple_stmt_iterator *gsi) COND_EXPR); else new_rhs = expand_vector_piecewise (gsi, do_cond, type, compute_type, - rhs2, rhs3, COND_EXPR); + rhs2, rhs3, COND_EXPR, false); if (!useless_type_conversion_p (TREE_TYPE (lhs), TREE_TYPE (new_rhs))) new_rhs = gimplify_build1 (gsi, VIEW_CONVERT_EXPR, TREE_TYPE (lhs), new_rhs); @@ -1885,7 +1884,7 @@ expand_vector_conversion (gimple_stmt_iterator *gsi) { new_rhs = expand_vector_piecewise (gsi, do_vec_conversion, ret_type, arg1_type, arg, - NULL_TREE, code1); + NULL_TREE, code1, false); g = gimple_build_assign (lhs, new_rhs); gsi_replace (gsi, g, false); return; @@ -1953,7 +1952,7 @@ expand_vector_conversion (gimple_stmt_iterator *gsi) do_vec_narrow_conversion, arg_type, dcompute_type, arg, NULL_TREE, code1, - ret_type); + false, ret_type); g = gimple_build_assign (lhs, new_rhs); gsi_replace (gsi, g, false); return; @@ -2065,7 +2064,7 @@ expand_vector_conversion (gimple_stmt_iterator *gsi) new_rhs = expand_vector_piecewise (gsi, do_vec_conversion, arg_type, TREE_TYPE (arg_type), arg, - NULL_TREE, code, ret_type); + NULL_TREE, code, false, ret_type); g = gimple_build_assign (lhs, new_rhs); gsi_replace (gsi, g, false); } From patchwork Fri Jul 16 13:02:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 1506161 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=rTCQPOTt; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=a4Jmb5Nj; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GRBNS2Cc6z9sX3 for ; Fri, 16 Jul 2021 23:07:19 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5DB9D39A802A for ; Fri, 16 Jul 2021 13:07:16 +0000 (GMT) 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 F14E339A28F3 for ; Fri, 16 Jul 2021 13:02:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F14E339A28F3 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de 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 D8CD122019 for ; Fri, 16 Jul 2021 13:02:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1626440565; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=XFGzqk7plySZXBSVqKjmLdERU60tPvtZvck+F/9twuk=; b=rTCQPOTtbx/fmRzI/rIrqEqMY19FHbAiXR770ugMDJtL/gNBnpngLj0/6BdYrMdwjOOri0 kxGnVq0yIXTAjrrlFOodbEUEUgILyy7le07lHHZnDnfdoppQgAgxGPM5n0zJrDDEQ/Q44r 0SNXknqMI59Lmpnd5Zyo6S4ymKYpGo4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1626440565; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=XFGzqk7plySZXBSVqKjmLdERU60tPvtZvck+F/9twuk=; b=a4Jmb5NjLoUBjlTKwoGFz/oTzHZOpcqWsXmdjBjUc8UIejK9cRGjPwfB5U+5U33USMP3A1 5kfo0bhvSkmoJTAg== 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 C74F513C71 for ; Fri, 16 Jul 2021 13:02:45 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id H6d5L3WD8WAMOAAAMHmgww (envelope-from ) for ; Fri, 16 Jul 2021 13:02:45 +0000 Date: Fri, 16 Jul 2021 15:02:45 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH 3/3] Remove gimple_expr_type Message-ID: MIME-Version: 1.0 X-Spam-Status: No, score=-11.4 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 autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" This removes the transitional gimple_expr_type API. Bootstrap & regtest running on x86_64-unknown-linux-gnu. 2021-07-16 Richard Biener * gimple.h (gimple_expr_type): Remove. * gcc/doc/gimple.texi: Remove gimple_expr_type documentation. --- gcc/doc/gimple.texi | 8 -------- gcc/gimple.h | 42 ------------------------------------------ 2 files changed, 50 deletions(-) diff --git a/gcc/doc/gimple.texi b/gcc/doc/gimple.texi index 4b3d7d7452e..5d89dbcc68d 100644 --- a/gcc/doc/gimple.texi +++ b/gcc/doc/gimple.texi @@ -868,14 +868,6 @@ Return the basic block to which statement @code{G} belongs to. Return the lexical scope block holding statement @code{G}. @end deftypefn -@deftypefn {GIMPLE function} tree gimple_expr_type (gimple stmt) -Return the type of the main expression computed by @code{STMT}. Return -@code{void_type_node} if @code{STMT} computes nothing. This will only return -something meaningful for @code{GIMPLE_ASSIGN}, @code{GIMPLE_COND} and -@code{GIMPLE_CALL}. For all other tuple codes, it will return -@code{void_type_node}. -@end deftypefn - @deftypefn {GIMPLE function} {enum tree_code} gimple_expr_code (gimple stmt) Return the tree code for the expression computed by @code{STMT}. This is only meaningful for @code{GIMPLE_CALL}, @code{GIMPLE_ASSIGN} and diff --git a/gcc/gimple.h b/gcc/gimple.h index acf572b81be..29da9198547 100644 --- a/gcc/gimple.h +++ b/gcc/gimple.h @@ -6608,48 +6608,6 @@ is_gimple_resx (const gimple *gs) return gimple_code (gs) == GIMPLE_RESX; } -/* Return the type of the main expression computed by STMT. Return - void_type_node if the statement computes nothing. */ - -static inline tree -gimple_expr_type (const gimple *stmt) -{ - enum gimple_code code = gimple_code (stmt); - /* In general we want to pass out a type that can be substituted - for both the RHS and the LHS types if there is a possibly - useless conversion involved. That means returning the - original RHS type as far as we can reconstruct it. */ - if (code == GIMPLE_CALL) - { - const gcall *call_stmt = as_a (stmt); - if (gimple_call_internal_p (call_stmt)) - switch (gimple_call_internal_fn (call_stmt)) - { - case IFN_MASK_STORE: - case IFN_SCATTER_STORE: - return TREE_TYPE (gimple_call_arg (call_stmt, 3)); - case IFN_MASK_SCATTER_STORE: - return TREE_TYPE (gimple_call_arg (call_stmt, 4)); - default: - break; - } - return gimple_call_return_type (call_stmt); - } - else if (code == GIMPLE_ASSIGN) - { - if (gimple_assign_rhs_code (stmt) == POINTER_PLUS_EXPR) - return TREE_TYPE (gimple_assign_rhs1 (stmt)); - else - /* As fallback use the type of the LHS. */ - return TREE_TYPE (gimple_get_lhs (stmt)); - } - else if (code == GIMPLE_COND) - return boolean_type_node; - else if (code == GIMPLE_PHI) - return TREE_TYPE (gimple_phi_result (stmt)); - else - return void_type_node; -} /* Enum and arrays used for allocation stats. Keep in sync with gimple.c:gimple_alloc_kind_names. */