From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25658 invoked by alias); 12 May 2017 18:34:02 -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 25299 invoked by uid 89); 12 May 2017 18:34:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 12 May 2017 18:34:00 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E382E7F7DE; Fri, 12 May 2017 18:34:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E382E7F7DE Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=law@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E382E7F7DE Received: from localhost.localdomain (ovpn-116-74.phx2.redhat.com [10.3.116.74]) by smtp.corp.redhat.com (Postfix) with ESMTP id 168A01898C; Fri, 12 May 2017 18:34:01 +0000 (UTC) Subject: Re: [RFC PATCH, i386]: Enable post-reload compare elimination pass To: Uros Bizjak , Jakub Jelinek Cc: "gcc-patches@gcc.gnu.org" , Richard Earnshaw , Nick Clifton References: <20170510142710.GY1809@tucnak> From: Jeff Law Message-ID: Date: Fri, 12 May 2017 18:38:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-05/txt/msg01062.txt.bz2 On 05/10/2017 01:05 PM, Uros Bizjak wrote: > On Wed, May 10, 2017 at 5:18 PM, Uros Bizjak wrote: >> On Wed, May 10, 2017 at 4:27 PM, Jakub Jelinek wrote: >>> On Tue, May 09, 2017 at 06:06:47PM +0200, Uros Bizjak wrote: >>>> Attached patch enables post-reload compare elimination pass by >>>> providing expected patterns (duplicates of existing patterns with >>>> setters of reg and flags switched in the parallel) for flag setting >>>> arithmetic instructions. >>>> >>>> The merge triggers more than 3000 times during the gcc bootstrap, >>>> mostly in cases where intervening memory load or store prevents >>>> combine from merging the arithmetic insn and the following compare. >>>> >>>> Also, some recent linux x86_64 defconfig build results in ~200 merges, >>>> removing ~200 test/cmp insns. Not much, but I think the results still >>>> warrant the pass to be enabled. >>> >>> Isn't the right fix instead to change the compare-elim.c pass to either >>> accept both reg vs. flags orderings in parallel, or both depending >>> on some target hook, or change it to the order i386.md and most other >>> major targets use and just fix up mn10300/rx (and aarch64?) to use the same >>> order? > > Attached patch changes compare-elim.c order to what i386.md expects. > > Thoughts? I think with an appropriate change to the canonicalization rules in the manual this is fine. I've got the visium, rx and mn103 patches handy to ensure they don't regress. aarch64 doesn't seem to be affected either way but I didn't investigate why -- I expected it to improve with your change. I'll write up a ChangeLog and commit the mn103, rx and visium changes after you commit the compare-elim & documentation bits. jeff