From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28023 invoked by alias); 19 Jun 2017 14:08:06 -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 27624 invoked by uid 89); 19 Jun 2017 14:08:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: gate.crashing.org Received: from gate.crashing.org (HELO gate.crashing.org) (63.228.1.57) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 19 Jun 2017 14:08:04 +0000 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id v5JE83iX002409; Mon, 19 Jun 2017 09:08:03 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id v5JE82n0002408; Mon, 19 Jun 2017 09:08:02 -0500 Date: Mon, 19 Jun 2017 14:08:00 -0000 From: Segher Boessenkool To: "Richard Earnshaw (lists)" Cc: gcc-patches Subject: Re: [rtlanal] Do a better job of costing parallel sets containing flag-setting operations. Message-ID: <20170619140802.GK16550@gate.crashing.org> References: <66275bc9-7d97-b990-4c86-2de1f4a6a2fa@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <66275bc9-7d97-b990-4c86-2de1f4a6a2fa@arm.com> User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg01309.txt.bz2 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. > 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