From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id C5C463858011 for ; Tue, 25 Oct 2022 09:15:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C5C463858011 Authentication-Results: sourceware.org; dmarc=pass (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 B80571FB3E for ; Tue, 25 Oct 2022 09:15:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1666689309; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=d1pGRJTseKnPaR6jR5Wb7Pd77mPWd2gqNYiN34bEpy8=; b=XwJyT5ghNJGIUd1OaPdGFC4lHdU6lESEvkyPt1XyavxweTmn7BqwFOjfYlR2K/c9e06k5J ZvEuAJpzDeYNdNxwwQEM98qwrGXuA/dL5SI9Mkz9859HCTVTFUTgY+UZ2HdWDyhyFLKyOC pJtjfZgXlGsQ0rfh6BUVS4Md+7HDW1c= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1666689309; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=d1pGRJTseKnPaR6jR5Wb7Pd77mPWd2gqNYiN34bEpy8=; b=J5cysVm4/bJLo6muVK4WKwRlv5ZZevFy/xhRYFx3yCYF2E5y+J0Ackl/t+9zwsEoFC3xJT 3GJzrPO3Ih7pFyCA== 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 A7EBC134CA for ; Tue, 25 Oct 2022 09:15:09 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id V8gbKB2pV2PLOQAAMHmgww (envelope-from ) for ; Tue, 25 Oct 2022 09:15:09 +0000 Date: Tue, 25 Oct 2022 11:15:09 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] Move NOP stripping in SCEV analysis MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Message-Id: <20221025091509.A7EBC134CA@imap2.suse-dmz.suse.de> X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: The following moves a pair of STRIP_USELESS_TYPE_CONVERSIONS to where it belongs and adds a comment on why we handle GENERIC there at all. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. * tree-scalar-evolution.cc (follow_ssa_edge_expr): Move STRIP_USELESS_TYPE_CONVERSIONS to where it matters. --- gcc/tree-scalar-evolution.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/tree-scalar-evolution.cc b/gcc/tree-scalar-evolution.cc index 9f30f78cb5d..8b927094324 100644 --- a/gcc/tree-scalar-evolution.cc +++ b/gcc/tree-scalar-evolution.cc @@ -1214,6 +1214,8 @@ tail_recurse: { code = TREE_CODE (expr); type = TREE_TYPE (expr); + /* Via follow_ssa_edge_inner_loop_phi we arrive here with the + GENERIC scalar evolution of the inner loop. */ switch (code) { CASE_CONVERT: @@ -1224,6 +1226,8 @@ tail_recurse: case MINUS_EXPR: rhs0 = TREE_OPERAND (expr, 0); rhs1 = TREE_OPERAND (expr, 1); + STRIP_USELESS_TYPE_CONVERSION (rhs0); + STRIP_USELESS_TYPE_CONVERSION (rhs1); break; default: rhs0 = expr; @@ -1260,8 +1264,6 @@ tail_recurse: case PLUS_EXPR: case MINUS_EXPR: /* This case is under the form "rhs0 +- rhs1". */ - STRIP_USELESS_TYPE_CONVERSION (rhs0); - STRIP_USELESS_TYPE_CONVERSION (rhs1); if (TREE_CODE (rhs0) == SSA_NAME && (TREE_CODE (rhs1) != SSA_NAME || code == MINUS_EXPR)) { -- 2.35.3