From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by sourceware.org (Postfix) with ESMTPS id DBEC93858406 for ; Mon, 22 Nov 2021 08:46:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DBEC93858406 Received: by mail-ed1-x535.google.com with SMTP id x15so73457715edv.1 for ; Mon, 22 Nov 2021 00:46:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=W9suH5lFLqeSKXIXA0wmiJ9R/rvBsMRiv8dti+YZ0T4=; b=iWD2nvqdOvaMfLP6PQ9fa86YclrP8KL6Hldzt0yGVcLdW6gzftgpmuaEvBQyfXCu9r jZXja+on/DBg7EnSOLwOn8f+jkwK9SoxOI0VbnIqyAnOcEnN+XnHTEuhs0+Ja//zxIKv kugzVa6pSq29by9cdvso5Ef4Sam3Yz6FT2jP7Qew+y6i65g+g4ftPMuX1KtqHUsXhiiF x1/6HvztNb1hiv8znQF8UiuVmVtScbrHhpepEXCwVjSc+X2lmDdi2yDRjf5Krmqw+TW7 HOaE0I1zrNMDHK5fuA6cxMNmM9WRGmN0aBJwZjiL47gCCKW63ueQIDLkReT+/BXlcCfr MoWQ== X-Gm-Message-State: AOAM532pY3/kJ7mPzH6A4qtnvQEczm7VV+zUULhY9fWZASDlcUYfRbub 1iHjcg3ZM2e54g3L0D+mbpyGjRtm6cLNFEWaO0Ldjlfo X-Google-Smtp-Source: ABdhPJwA6hvqf/LtALmtRJSGw7+g6MY9qGMNKFH3jNhXMshaeo7q2i0zzKOGNJTd4ebPNNmqd70QhS89g5B4SatWnuo= X-Received: by 2002:a17:906:a10c:: with SMTP id t12mr38782311ejy.429.1637570765762; Mon, 22 Nov 2021 00:46:05 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Richard Biener Date: Mon, 22 Nov 2021 09:45:55 +0100 Message-ID: Subject: Re: [EXTERNAL] Re: [PATCH] PR tree-optimization/96779 Adding a missing pattern to match.pd To: Navid Rahimi Cc: Navid Rahimi via Gcc-patches Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_SHORT, RCVD_IN_DNSWL_NONE, 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: , X-List-Received-Date: Mon, 22 Nov 2021 08:46:08 -0000 On Fri, Nov 19, 2021 at 11:33 PM Navid Rahimi w= rote: > > Hi Richard, > > Thanks for the detailed comment. I am attaching a newer version of the pa= tch which does have required fixes included. Bellow you can see my response= to your feedbacks: > > > you need to check TYPE_OVERFLOW_WRAPS on TREE_TYPE (@0), > > otherwise you check on boolean. > Fixed it. > > > no need for :c on the result pattern. Otherwise it looks OK, but how > > did you check the patch? > Fixed it. For checking the patch, I have script which builds and runs mak= e check for 1) trunk and 2) trunk+patch in a separate directory and diffs t= he test results from each directory. My test script did had a subtle proble= m. The bug was, because of a typo in the path I introduced few days ago, it= was diffing same trunk+patch test results against trunk+patch test results= . OK, please indicate that in the future, like with "Bootstrapped and tested on x86_64-linux" or so. > That was a good reminder to setup an account for myself here asap [1]. > > 1) https://gcc.gnu.org/wiki/CompileFarm The updated patch is OK. Thanks, Richard. > Best wishes, > Navid. > > ________________________________________ > From: Richard Biener > Sent: Friday, November 19, 2021 03:43 > To: Navid Rahimi > Cc: Navid Rahimi via Gcc-patches > Subject: [EXTERNAL] Re: [PATCH] PR tree-optimization/96779 Adding a missi= ng pattern to match.pd > > [You don't often get email from richard.guenther@gmail.com. Learn why thi= s is important at http://aka.ms/LearnAboutSenderIdentification.] > > On Tue, Nov 16, 2021 at 11:51 PM Navid Rahimi via Gcc-patches > wrote: > > > > Hi GCC community, > > > > This patch will add the missed pattern described in bug 102232 [1] to t= he match.pd. > > > > Tree-optimization/96779: Adding new optimization to match.pd: > > > > * match.pd (-x =3D=3D x) -> (x =3D=3D 0): New optimization. > > * gcc.dg/tree-ssa/pr96779.c: testcase for this optimization= . > > * gcc.dg/tree-ssa/pr96779-disabled.c: testcase for this opt= imization when -fwrapv passed. > > > > 1) https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2F= gcc.gnu.org%2Fbugzilla%2Fshow_bug.cgi%3Fid%3D96779&data=3D04%7C01%7Cnav= idrahimi%40microsoft.com%7C11c3214ef8164af4d50008d9ab51d9bc%7C72f988bf86f14= 1af91ab2d7cd011db47%7C1%7C0%7C637729190792397989%7CUnknown%7CTWFpbGZsb3d8ey= JWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&= ;sdata=3DmxYBk6rex%2Bq5UMot%2BWfJqXeTYEYuM16hrvLGyp4PGeI%3D&reserved=3D= 0 > > +/* -x =3D=3D x -> x =3D=3D 0 */ > +(for cmp (eq ne) > + (simplify > + (cmp:c @0 (negate @0)) > + (if (ANY_INTEGRAL_TYPE_P (TREE_TYPE (@0)) > + && !TYPE_OVERFLOW_WRAPS (type)) > > you need to check TYPE_OVERFLOW_WRAPS on TREE_TYPE (@0), > otherwise you check on boolean. > > + (cmp:c @0 { build_zero_cst (TREE_TYPE(@0)); })))) > + > > no need for :c on the result pattern. Otherwise it looks OK, but how > did you check the patch? > > Thanks, > Richard. > > > > Best wishes, > > Navid.