From patchwork Fri Mar 24 18:48:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 743342 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 3vqXWB5DHXz9s7F for ; Sat, 25 Mar 2017 05:48:38 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="s0+Wlpp3"; 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=cuNC5n1EO9ieCnl4sZFSSuMnv9cngz3CV3Nx/6iwzyvZzw1A75 8PKDtXHDcV1lDn81RKuK9xdEXDnDth0fzSzzbtfXovTV+nx03+RyPeDiVFt+it9E gLgaC5huprILgB+QuxQd4dSOo+HE3gVmF/OuBJcZP6Vm4pE22ItGN9GMk= 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=wtAvPyjq6Gxe1w4c1NlbHjX6lPw=; b=s0+Wlpp3otTCg9FitAHb ev2EzhX5jlUb7vr+pGQj9qgO7ThERT7jmgTfgPdmWG7jchPLs8QiSiU+jmDv5Vuh ymf3nreLw7y1wbYNe8eToBZSikdPMiq3EzE1hm7zlkxaX0WpjE9dGeVxlw8AMok5 l9S4fAzI3XPUhNPdJl7zkeM= Received: (qmail 10970 invoked by alias); 24 Mar 2017 18:48: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 10916 invoked by uid 89); 24 Mar 2017 18:48:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=cycling, sk:vmakaro, U*vmakarov 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, 24 Mar 2017 18:48:24 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 531063F722 for ; Fri, 24 Mar 2017 18:48:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 531063F722 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=vmakarov@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 531063F722 Received: from [10.10.124.14] (ovpn-124-14.rdu2.redhat.com [10.10.124.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 11A2F5C88E for ; Fri, 24 Mar 2017 18:48:24 +0000 (UTC) To: "gcc-patches@gcc.gnu.org" From: Vladimir Makarov Subject: patch to fix PR80148 Message-ID: Date: Fri, 24 Mar 2017 14:48:22 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 X-IsSubscribed: yes The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80148 The test file is too big so there is no a testcase. The patch was successfully bootstrapped and tested on x86-64. Committed as rev. 246467. Index: ChangeLog =================================================================== --- ChangeLog (revision 246466) +++ ChangeLog (working copy) @@ -1,3 +1,9 @@ +2017-03-24 Vladimir Makarov + + PR target/80148 + * lra-assigns.c (assign_by_spills): Add spilled non-reload pseudos + to consider in curr_insn_transform. + 2017-03-24 Jakub Jelinek * genrecog.c (validate_pattern): Add VEC_SELECT validation. Index: lra-assigns.c =================================================================== --- lra-assigns.c (revision 246466) +++ lra-assigns.c (working copy) @@ -1507,6 +1507,14 @@ assign_by_spills (void) sorted_pseudos[nfails++] = conflict_regno; former_reload_pseudo_spill_p = true; } + else + /* It is better to do reloads before spilling as after the + spill-subpass we will reload memory instead of pseudos + and this will make reusing reload pseudos more + complicated. Going directly to the spill pass in such + case might result in worse code performance or even LRA + cycling if we have few registers. */ + bitmap_set_bit (&all_spilled_pseudos, conflict_regno); if (lra_dump_file != NULL) fprintf (lra_dump_file, " Spill %s r%d(hr=%d, freq=%d)\n", pseudo_prefix_title (conflict_regno), conflict_regno,