From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 47914 invoked by alias); 30 May 2019 06:57:22 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 47534 invoked by uid 89); 30 May 2019 06:57:22 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 30 May 2019 06:57:21 +0000 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4U6uhgq114177 for ; Thu, 30 May 2019 02:57:19 -0400 Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.150]) by mx0a-001b2d01.pphosted.com with ESMTP id 2st7tkpm4x-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 30 May 2019 02:57:19 -0400 Received: from localhost by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 30 May 2019 07:57:18 +0100 Received: from b03cxnp08025.gho.boulder.ibm.com (9.17.130.17) by e32.co.us.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 30 May 2019 07:57:14 +0100 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x4U6vDtL25297202 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 30 May 2019 06:57:14 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D6B37136055; Thu, 30 May 2019 06:57:13 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 53FF0136059; Thu, 30 May 2019 06:57:13 +0000 (GMT) Received: from genoa.aus.stglabs.ibm.com (unknown [9.40.192.157]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTPS; Thu, 30 May 2019 06:57:13 +0000 (GMT) From: Jiufu Guo To: Richard Biener Cc: Jeff Law , gcc-patches@gcc.gnu.org, Jakub Jelinek , Daniel Berlin , segher@kernel.crashing.org, wschmidt@linux.ibm.com Subject: Re: [PATCH] A jump threading opportunity for condition branch References: <1558446288-52444-1-git-send-email-guojiufu@linux.ibm.com> <2B6D408A-3173-4575-8896-0604672976B3@suse.de> Date: Thu, 30 May 2019 06:58:00 -0000 In-Reply-To: <2B6D408A-3173-4575-8896-0604672976B3@suse.de> (Richard Biener's message of "Thu, 30 May 2019 08:44:04 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain x-cbid: 19053006-0004-0000-0000-00001515FDC5 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00011183; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000286; SDB=6.01210625; UDB=6.00636061; IPR=6.00991658; MB=3.00027114; MTD=3.00000008; XFM=3.00000015; UTC=2019-05-30 06:57:16 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19053006-0005-0000-0000-00008BDBC9B3 Message-Id: X-IsSubscribed: yes X-SW-Source: 2019-05/txt/msg01992.txt.bz2 Richard Biener writes: > On May 29, 2019 10:21:46 PM GMT+02:00, Jeff Law wrote: >>On 5/24/19 6:45 AM, Richard Biener wrote: >>[ Aggressive snipping ] >> >>> As said in my first review I'd just check whether for the >>> edge we want to thread through the definition comes from a CMP. >>> Suppose you have >>> >>> # val_1 = PHI >>> if (val_1 != 0) >>> >>> and only one edge has a b_3 = d_5 != 0 condition it's still >>> worth tail-duplicating the if block. >>Agreed. The cost of tail duplicating here is so small we should be >>doing it highly aggressively. About the only case where we might not >>want to would be if we're optimizing for size rather than speed. That >>case isn't clearly a win either way. > > Even there the PHI likely causes edge copies to be inserted. So I > wouldn't care for the moment. The proper check would be ! > Optimize_edge_for_size_p (e). For most of this kind of case where the bb contains just one conditional jump stmt, it may not increase the size especially for there are combinings in follow passes -- it may save size ;) > > Richard. > >>jeff