From patchwork Wed Jun 28 14:04:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georg-Johann Lay X-Patchwork-Id: 781718 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wyPgZ2W1jz9s7f for ; Thu, 29 Jun 2017 00:04:58 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="kmBjASAs"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:message-id:date:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=tTUwCB8Mf8MYRBPE pP7Wr8dx5drOLPkObrJEyt2A6Wsv6GRkhIF/TPW/AQD7hWZmTwsh2FhIqc5Evnwv 1NCRXrdhLOHH/OjiffdzM55xptv6OJoPd9bcfZvHAksIvy6vT7fRFWCS+VB3c+C9 +rrxYVW7omsf4OUY+189MWAZCPA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:message-id:date:mime-version:content-type :content-transfer-encoding; s=default; bh=4gQFCXmCCWWRJ6HPzmD2Ia Za3i4=; b=kmBjASAsrpq2m2mZ7ZBPCM/sz31PHA1NzChVceSlt9Vyez406WGgKx L9Q4mWGndbaMaabM41UcMhhnJEg0s8GcF9/1tmXxDWKm5fgPYYIrtmXin2yqZnAt 9SwyEtjlUx95sn2BHbHqZmepmukbjH4ldltX0ZK83lLLJkyWDpyOs= Received: (qmail 44201 invoked by alias); 28 Jun 2017 14:04:45 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 44105 invoked by uid 89); 28 Jun 2017 14:04:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=Hx-languages-length:1246 X-HELO: mo4-p00-ob.smtp.rzone.de Received: from mo4-p00-ob.smtp.rzone.de (HELO mo4-p00-ob.smtp.rzone.de) (81.169.146.163) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 28 Jun 2017 14:04:39 +0000 X-RZG-AUTH: :LXoWVUeid/7A29J/hMvvT3ol15ykJcYwR/bcHRirORRW3yMcVao= X-RZG-CLASS-ID: mo00 Received: from [192.168.0.123] (mail.hightec-rt.com [213.135.1.215]) by smtp.strato.de (RZmta 41.0 DYNA|AUTH) with ESMTPSA id C033f1t5SE4Y9BH (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Wed, 28 Jun 2017 16:04:34 +0200 (CEST) To: gcc-patches Cc: Jeff Law , Ian Lance Taylor From: Georg-Johann Lay Subject: [patch][Ping #3] PR80929: Realistic PARALLEL cost in seq_cost. Message-ID: Date: Wed, 28 Jun 2017 16:04:34 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 X-IsSubscribed: yes Ping #3 https://gcc.gnu.org/ml/gcc-patches/2017-06/msg00096.html On 02.06.2017 09:53, Georg-Johann Lay wrote: > Hi, > > this small addition improves costs of PARALLELs in > rtlanal.c:seq_cost(). Up to now, these costs are > assumed to be 1 which gives gross inexact costs for, > e.g. divmod which is represented as PARALLEL. > > The patch just forwards cost computation to insn_rtx_cost > which uses the cost of the 1st SET (if any) and otherwise > assign costs of 1 insn. > > Bootstrapped & regtested on x86_64. > > Moreover, it fixed the division by constant on avr where > the problem popped up since PR79665. > > Ok to install? > > Johann > > gcc/ > PR middle-end/80929 > * rtlanal.c (seq_cost) [PARALLEL]: Get cost from insn_rtx_cost > instead of assuming cost of 1. Index: rtlanal.c =================================================================== --- rtlanal.c (revision 248745) +++ rtlanal.c (working copy) @@ -5300,6 +5300,9 @@ seq_cost (const rtx_insn *seq, bool spee set = single_set (seq); if (set) cost += set_rtx_cost (set, speed); + else if (INSN_P (seq) + && PARALLEL == GET_CODE (PATTERN (seq))) + cost += insn_rtx_cost (PATTERN (seq), speed); else cost++; }