From patchwork Wed Aug 27 14:49:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kito Cheng X-Patchwork-Id: 383472 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 EE36C14009C for ; Thu, 28 Aug 2014 00:50:09 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=iXfPiD+v7MhL9GA5V80bUtfTr3uJURVEB2nHal0d0LD98v IVIarBXJ1q3kFSNZHsd4QzxbjyBzea7+IDLgQe6Y8xSQndQhzN6UlhG9wwzZ619b VEYYqhDhaCWac+RItCApbgfNAXt+ADz7hp4gw2a+ruUlnPyEWwvf7Bpn8+DV8= 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 :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=o6J1fo4Eb8kiQGKkure3qodhdO4=; b=mn0X0aZU8t5lspR3HYUh w58RbVr3bFcRKtM3zJcBe+EukNUWZ0icOeIwoVGiFSHkDxJNPsXi7jycr9DlNmyh ISr0XC0nFn91XsN/eJx1fCWLyTS5g+Ys1mCcnoabZFeOWvKduvG3JJ8PKunVhjQH 11DzrLKDLaaJ++Qth7shLHM= Received: (qmail 1153 invoked by alias); 27 Aug 2014 14:49:52 -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 1143 invoked by uid 89); 27 Aug 2014 14:49:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS, UNWANTED_LANGUAGE_BODY autolearn=ham version=3.3.2 X-HELO: mail-ie0-f173.google.com Received: from mail-ie0-f173.google.com (HELO mail-ie0-f173.google.com) (209.85.223.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 27 Aug 2014 14:49:50 +0000 Received: by mail-ie0-f173.google.com with SMTP id tr6so400467ieb.18 for ; Wed, 27 Aug 2014 07:49:48 -0700 (PDT) X-Received: by 10.50.176.202 with SMTP id ck10mr30826010igc.2.1409150988657; Wed, 27 Aug 2014 07:49:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.15.161 with HTTP; Wed, 27 Aug 2014 07:49:28 -0700 (PDT) From: Kito Cheng Date: Wed, 27 Aug 2014 22:49:28 +0800 Message-ID: Subject: [PATCH] Don't init ira_spilled_reg_stack_slots in ira if using lra. To: "gcc-patches@gcc.gnu.org" , Vladimir Makarov X-IsSubscribed: yes Hi all: This patch is clean up useless initialize for IRA with LRA. 2014-08-27 Kito Cheng * ira.c (ira): Don't initialize ira_spilled_reg_stack_slots and ira_spilled_reg_stack_slots_num if using lra. (do_reload): Remove release ira_spilled_reg_stack_slots part. * ira-color.c (ira_sort_regnos_for_alter_reg): Add assertion to make sure not using lra. (ira_reuse_stack_slot): Likewise. (ira_mark_new_stack_slot): Likewise. From 8355e31fd26e7930d7e80303dab9901c9263bcbe Mon Sep 17 00:00:00 2001 From: Kito Cheng Date: Wed, 20 Aug 2014 15:55:54 +0800 Subject: [PATCH] Don't init ira_spilled_reg_stack_slots in ira if using lra. 2014-08-27 Kito Cheng * ira.c (ira): Don't initialize ira_spilled_reg_stack_slots and ira_spilled_reg_stack_slots_num if using lra. (do_reload): Remove release ira_spilled_reg_stack_slots part. * ira-color.c (ira_sort_regnos_for_alter_reg): Add assertion to make sure not using lra. (ira_reuse_stack_slot): Likewise. (ira_mark_new_stack_slot): Likewise. --- gcc/ira-color.c | 6 ++++++ gcc/ira.c | 21 ++++++++++----------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/gcc/ira-color.c b/gcc/ira-color.c index e2ea359..6846567 100644 --- a/gcc/ira-color.c +++ b/gcc/ira-color.c @@ -4067,6 +4067,8 @@ ira_sort_regnos_for_alter_reg (int *pseudo_regnos, int n, ira_allocno_iterator ai; ira_allocno_t *spilled_coalesced_allocnos; + ira_assert (! ira_use_lra_p); + /* Set up allocnos can be coalesced. */ coloring_allocno_bitmap = ira_allocate_bitmap (); for (i = 0; i < n; i++) @@ -4416,6 +4418,8 @@ ira_reuse_stack_slot (int regno, unsigned int inherent_size, bitmap_iterator bi; struct ira_spilled_reg_stack_slot *slot = NULL; + ira_assert (! ira_use_lra_p); + ira_assert (inherent_size == PSEUDO_REGNO_BYTES (regno) && inherent_size <= total_size && ALLOCNO_HARD_REGNO (allocno) < 0); @@ -4528,6 +4532,8 @@ ira_mark_new_stack_slot (rtx x, int regno, unsigned int total_size) int slot_num; ira_allocno_t allocno; + ira_assert (! ira_use_lra_p); + ira_assert (PSEUDO_REGNO_BYTES (regno) <= total_size); allocno = ira_regno_allocno_map[regno]; slot_num = -ALLOCNO_HARD_REGNO (allocno) - 2; diff --git a/gcc/ira.c b/gcc/ira.c index 7c18496..e8d5b44 100644 --- a/gcc/ira.c +++ b/gcc/ira.c @@ -5260,14 +5260,16 @@ ira (FILE *f) #ifdef ENABLE_IRA_CHECKING print_redundant_copies (); #endif - - ira_spilled_reg_stack_slots_num = 0; - ira_spilled_reg_stack_slots - = ((struct ira_spilled_reg_stack_slot *) - ira_allocate (max_regno - * sizeof (struct ira_spilled_reg_stack_slot))); - memset (ira_spilled_reg_stack_slots, 0, - max_regno * sizeof (struct ira_spilled_reg_stack_slot)); + if (! ira_use_lra_p) + { + ira_spilled_reg_stack_slots_num = 0; + ira_spilled_reg_stack_slots + = ((struct ira_spilled_reg_stack_slot *) + ira_allocate (max_regno + * sizeof (struct ira_spilled_reg_stack_slot))); + memset (ira_spilled_reg_stack_slots, 0, + max_regno * sizeof (struct ira_spilled_reg_stack_slot)); + } } allocate_initial_values (); @@ -5303,9 +5305,6 @@ do_reload (void) FOR_ALL_BB_FN (bb, cfun) bb->loop_father = NULL; current_loops = NULL; - - if (ira_conflicts_p) - ira_free (ira_spilled_reg_stack_slots); ira_destroy (); -- 1.9.3