From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 114356 invoked by alias); 19 Jun 2017 14:45:54 -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 91237 invoked by uid 89); 19 Jun 2017 14:45:25 -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,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 19 Jun 2017 14:45:24 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 79A2580D; Mon, 19 Jun 2017 07:45:27 -0700 (PDT) Received: from e105689-lin.cambridge.arm.com (e105689-lin.cambridge.arm.com [10.2.207.32]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CB3683F587; Mon, 19 Jun 2017 07:45:26 -0700 (PDT) Subject: Re: [rtlanal] Do a better job of costing parallel sets containing flag-setting operations. To: Segher Boessenkool Cc: gcc-patches References: <66275bc9-7d97-b990-4c86-2de1f4a6a2fa@arm.com> <20170619140802.GK16550@gate.crashing.org> From: "Richard Earnshaw (lists)" Message-ID: Date: Mon, 19 Jun 2017 14:45:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <20170619140802.GK16550@gate.crashing.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2017-06/txt/msg01320.txt.bz2 On 19/06/17 15:08, Segher Boessenkool wrote: > Hi! > > On Mon, Jun 19, 2017 at 02:46:59PM +0100, Richard Earnshaw (lists) wrote: >> Many parallel set insns are of the form of a single set that also sets >> the condition code flags. In this case the cost of such an insn is >> normally the cost of the part that doesn't set the flags, since updating >> the condition flags is simply a side effect. >> >> At present all such insns are treated as having unknown cost (ie 0) and >> combine assumes that such insns are infinitely more expensive than any >> other insn sequence with a non-zero cost. > > That's not what combine does: it optimistically assumes any combination > with unknown costs is an improvement. Actually the logic is int reject = old_cost > 0 && new_cost > old_cost; So reject will never be true if old cost is zero. R. > >> This patch addresses this problem by allowing insn_rtx_cost to ignore >> the condition setting part of a PARALLEL iff there is exactly one >> comparison set and one non-comparison set. If the only set operation is >> a comparison we still use that as the basis of the insn cost. > > I'll test this on a zillion archs, see what the effect is. > > Have you considered costing general parallels as well? > > > Segher >