From patchwork Fri Sep 1 17:30:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 137405 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c792:0:b0:3f2:4152:657d with SMTP id b18csp1039109vqu; Fri, 1 Sep 2023 10:32:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHSReCSpQt8GqZdzLI4p+9SprA0/OdQxlhUnGnyQ0iAMj+8egpauA/ZvqJPVFSE+sdqLZlv X-Received: by 2002:a05:6402:2c4:b0:525:6772:1595 with SMTP id b4-20020a05640202c400b0052567721595mr2435320edx.6.1693589536901; Fri, 01 Sep 2023 10:32:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693589536; cv=none; d=google.com; s=arc-20160816; b=nHEjOnQVz3EWg7d1TF0yg21gq4ZDCPQKDV50tsiIWxUd6UimeqRqx5lUnOK/2qF7c0 /FgRoOrETdqMwaomcJco8QNWgG218i2apY4EeTO0JtM+pA30o53xBDFMQNGHvVNIwXwI sTM1Wuam/Dky9/cNrzGSbIPomQg+D1tWXlktu1c2jXlJZWercXDa5anjcvO8aC6dkf9c HmOL0YueWbZVBdXMvrlavbPGCpD2nGoiJG+G4DTRWZrGPRKrRwWpUnNwrTw1SFuere7L 3uhDXPM8Go0fb2BTo1UKL3eZvVpa1Gtr0ko2rz/Do8qgLAhX1r8+cAq9QtWW4Cfhf6le lUxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=TWYIaIqrHosFMO+bumP/KWEiOdW3W2arQ5RzoCo70c4=; fh=XbcmRug6/SzczusyoNU1I7Lu5oY0AN2u0mWDzKoxdSs=; b=SPhcV4XrHCURndGuT0JtvLLXMKV43sUFeXH52G4ZyRkwPRa/nqy2oJ/qBfnF4SV9mJ 23bex8TS4mBkYa/vG2BfwfDHQWEx7MMCnSPs+YDbaJoWbgfrzOG5fDoIsOKBMWpYUzo8 5gsEedrpXQcl+1zZAg45rjPCLx+nvh4vNzmYtO1vBp2nH4TpZzk3RGtHqtueD5wpMil5 7wj/giNk+aiA+XjHVuE1e9t1VzUiOPG3BJ5w+JkWQLiL/hGLxXdkFsQR6e1JlGEvOhPF /bYtoa1NhhUjo2qeNgXwG95RAmOLgINTnScqymKn+tOS48tLYTxhIzhpN1tbhYh1x/qI /oeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=UVzCuscI; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id n5-20020a056402514500b00529fa8b352fsi2958904edd.471.2023.09.01.10.32.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Sep 2023 10:32:16 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=UVzCuscI; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D2DEF3857BA4 for ; Fri, 1 Sep 2023 17:32:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D2DEF3857BA4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1693589524; bh=TWYIaIqrHosFMO+bumP/KWEiOdW3W2arQ5RzoCo70c4=; h=To:CC:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=UVzCuscIZtw9FaV4isoA73FmbdlFlfU+KYqrAMmufSCI5yn83cHDslGoIWQZ9rr2n 787nSRz4JteYjJ7YGnZ6UxciBITj2SWmtxVO6CZHvMl5kBk6DjFLmwieZegzPTTMZx 13oDE+sr4pBSjSLmBSo0m63utkz8ZSsD9bGpaYcY= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by sourceware.org (Postfix) with ESMTPS id BAE523858D20 for ; Fri, 1 Sep 2023 17:31:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BAE523858D20 Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3818ZhD1021766 for ; Fri, 1 Sep 2023 10:31:10 -0700 Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3sucjvsmbw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Fri, 01 Sep 2023 10:31:10 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Fri, 1 Sep 2023 10:31:08 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Fri, 1 Sep 2023 10:31:08 -0700 Received: from vpnclient.wrightpinski.org.com (unknown [10.69.242.187]) by maili.marvell.com (Postfix) with ESMTP id C41673F7086; Fri, 1 Sep 2023 10:31:07 -0700 (PDT) To: CC: Andrew Pinski Subject: [PATCH 1/2] VR-VALUES: Rename op0/op1 to op1/op2 for test_for_singularity Date: Fri, 1 Sep 2023 10:30:58 -0700 Message-ID: <20230901173059.791894-1-apinski@marvell.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Proofpoint-GUID: L8cReq7l2v7QY-mR_ZnFTscad9cSR8qH X-Proofpoint-ORIG-GUID: L8cReq7l2v7QY-mR_ZnFTscad9cSR8qH X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-01_14,2023-08-31_01,2023-05-22_02 X-Spam-Status: No, score=-14.6 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Andrew Pinski via Gcc-patches From: Andrew Pinski Reply-To: Andrew Pinski Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1775857342253697964 X-GMAIL-MSGID: 1775857342253697964 As requested and make easier to understand with the new ranger code, rename the arguments op0/op1 to op1/op2. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions gcc/ChangeLog: * vr-values.cc (test_for_singularity): Rename arguments op0/op1 to op1/op2. --- gcc/vr-values.cc | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/gcc/vr-values.cc b/gcc/vr-values.cc index a4fddd62841..52ab4fe6109 100644 --- a/gcc/vr-values.cc +++ b/gcc/vr-values.cc @@ -903,7 +903,7 @@ simplify_using_ranges::simplify_bit_ops_using_ranges return true; } -/* We are comparing trees OP0 and OP1 using COND_CODE. OP0 has +/* We are comparing trees OP1 and OP2 using COND_CODE. OP1 has a known value range VR. If there is one and only one value which will satisfy the @@ -913,8 +913,8 @@ simplify_using_ranges::simplify_bit_ops_using_ranges the conditional, then set *STRICT_OVERFLOW_P to true. */ static tree -test_for_singularity (enum tree_code cond_code, tree op0, - tree op1, const value_range *vr) +test_for_singularity (enum tree_code cond_code, tree op1, + tree op2, const value_range *vr) { tree min = NULL; tree max = NULL; @@ -923,13 +923,13 @@ test_for_singularity (enum tree_code cond_code, tree op0, written. */ if (cond_code == LE_EXPR || cond_code == LT_EXPR) { - min = TYPE_MIN_VALUE (TREE_TYPE (op0)); + min = TYPE_MIN_VALUE (TREE_TYPE (op1)); - max = op1; + max = op2; if (cond_code == LT_EXPR) { - tree one = build_int_cst (TREE_TYPE (op0), 1); - max = fold_build2 (MINUS_EXPR, TREE_TYPE (op0), max, one); + tree one = build_int_cst (TREE_TYPE (op1), 1); + max = fold_build2 (MINUS_EXPR, TREE_TYPE (op1), max, one); /* Signal to compare_values_warnv this expr doesn't overflow. */ if (EXPR_P (max)) suppress_warning (max, OPT_Woverflow); @@ -937,13 +937,13 @@ test_for_singularity (enum tree_code cond_code, tree op0, } else if (cond_code == GE_EXPR || cond_code == GT_EXPR) { - max = TYPE_MAX_VALUE (TREE_TYPE (op0)); + max = TYPE_MAX_VALUE (TREE_TYPE (op1)); - min = op1; + min = op2; if (cond_code == GT_EXPR) { - tree one = build_int_cst (TREE_TYPE (op0), 1); - min = fold_build2 (PLUS_EXPR, TREE_TYPE (op0), min, one); + tree one = build_int_cst (TREE_TYPE (op1), 1); + min = fold_build2 (PLUS_EXPR, TREE_TYPE (op1), min, one); /* Signal to compare_values_warnv this expr doesn't overflow. */ if (EXPR_P (min)) suppress_warning (min, OPT_Woverflow); @@ -951,10 +951,10 @@ test_for_singularity (enum tree_code cond_code, tree op0, } /* Now refine the minimum and maximum values using any - value range information we have for op0. */ + value range information we have for op1. */ if (min && max) { - tree type = TREE_TYPE (op0); + tree type = TREE_TYPE (op1); tree tmin = wide_int_to_tree (type, vr->lower_bound ()); tree tmax = wide_int_to_tree (type, vr->upper_bound ()); if (compare_values (tmin, min) == 1)