From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1666) id 8C59E3857B83; Tue, 25 Oct 2022 09:15:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8C59E3857B83 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666689333; bh=12lL09BjPbtTwmyL/QrFoG3I2GEWLxeU24xsQifr5rs=; h=From:To:Subject:Date:From; b=pZlxTlWKjppToQPYYj20l7c+7NcPxnpggmI0ncPsewwU/HWq4QoPImKml1tyg2o+0 oORzGipRkpF+HV7D3X6tjw5xDTvNFFvtBQj+daOG+sdmLyb0KMI/Ee37nevCMid9AH HvVKs6DGUZiOfsT74pFPYiAEwB5HHMihfmyzzlKk= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Richard Biener To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-3484] Move NOP stripping in SCEV analysis X-Act-Checkin: gcc X-Git-Author: Richard Biener X-Git-Refname: refs/heads/master X-Git-Oldrev: d93171509aa7ca23148508b96f1c1f70b941d808 X-Git-Newrev: 3ee675724cb27eb2e8cfd82f6e234edc4a63f6be Message-Id: <20221025091533.8C59E3857B83@sourceware.org> Date: Tue, 25 Oct 2022 09:15:33 +0000 (GMT) List-Id: https://gcc.gnu.org/g:3ee675724cb27eb2e8cfd82f6e234edc4a63f6be commit r13-3484-g3ee675724cb27eb2e8cfd82f6e234edc4a63f6be Author: Richard Biener Date: Tue Oct 25 10:04:56 2022 +0200 Move NOP stripping in SCEV analysis 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. * tree-scalar-evolution.cc (follow_ssa_edge_expr): Move STRIP_USELESS_TYPE_CONVERSIONS to where it matters. Diff: --- 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)) {