From patchwork Fri Jun 2 07:53:27 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: 770139 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 3wfGgD04tMz9sDG for ; Fri, 2 Jun 2017 17:53:43 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="jN3ULC5M"; 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 :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=jSG1vppiNN2n6eTKbbPcguSPif7MDscrsAeq/pofBUE2wGUMks WT+qG0OPW1P1rQm1O2AaNrLkA8UNuTAMzNAMMkDeEizS80JKJHErA5BqWeXEJ8k6 4SkrvVhZI7B0ewWRIAW8y7EUqngm+bxBHAxY/8TRQ1nPyKb1YeebEZnfg= 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 :from:subject:message-id:date:mime-version:content-type; s= default; bh=2yeMy3L2AfR9FeUCZE+HIKaSzt8=; b=jN3ULC5MMIUMMJ3aaIjS xzQUwweXfANgtyQ6zAELRCTPmtJVKPmfa+0tfF5LJ8dxacAsk0L2M/2ZYiQSXnqu ryIOFpg1vB012XGp3f645HRa2bR2a+qL13ASy2SGwFxTM6KVEmn1aBvHrrhttqoZ xF3Eo8kI6GB6bINejNy9FWc= Received: (qmail 86399 invoked by alias); 2 Jun 2017 07:53:29 -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 86379 invoked by uid 89); 2 Jun 2017 07:53:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-12.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=gross, realistic, popped 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.216) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 02 Jun 2017 07:53:26 +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 40.7 DYNA|AUTH) with ESMTPSA id z070f4t527rSM7O (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate) for ; Fri, 2 Jun 2017 09:53:28 +0200 (CEST) To: gcc-patches From: Georg-Johann Lay Subject: [patch] Fix PR80929: Realistic PARALLEL cost in seq_cost. Message-ID: <14699546-2dd9-29d7-93f8-ef893fe513ed@gjlay.de> Date: Fri, 2 Jun 2017 09:53:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 X-IsSubscribed: yes 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++; }