From patchwork Fri Sep 5 01:52:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Malcolm X-Patchwork-Id: 386083 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 CA12F140096 for ; Fri, 5 Sep 2014 11:49:47 +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:from :to:cc:subject:date:message-id:in-reply-to:references; q=dns; s= default; b=jSB9t1DBCZJpeRTIgInDu6FMhyTGVqVi+lEJi1o8CsuacgYRV3h8Y E3bUGIyv9FkIdsUZ7YahgBxxwAEK6sMdLNF4AfKEMUSP7DWZgr38MeonMdzJDy9m ZYT9G0TT7eWBiMG/A+pYTrDTQo76bs5QC6dQRFq0A6CGdwvExAdKSc= 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:from :to:cc:subject:date:message-id:in-reply-to:references; s= default; bh=xUwammvA676MwbGKuuN8Ek72NG8=; b=QileWCr4WkTSyeN6qY0P ffLNZS81RMozBUmOHIVz0jULmTKIv4+kG6lvomj5e0gc+k7mDzAvUZpqLDWaNuyV XrosuTbp//9wEfAubGZoI6TcGizDgOxK4ysUNtA3dwAxSoHEbrIhnh47TBVqmG+W AGJcwZ6Z+iIIw4RXGGESIF4= Received: (qmail 17170 invoked by alias); 5 Sep 2014 01:47:21 -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 17047 invoked by uid 89); 5 Sep 2014 01:47:20 -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 autolearn=ham version=3.3.2 X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 05 Sep 2014 01:47:17 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPicD-00037A-7H for gcc-patches@gcc.gnu.org; Thu, 04 Sep 2014 21:47:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11354) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPicC-00036w-Vj for gcc-patches@gcc.gnu.org; Thu, 04 Sep 2014 21:47:05 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s851l4mO019660 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 4 Sep 2014 21:47:04 -0400 Received: from c64.redhat.com (vpn-228-103.phx2.redhat.com [10.3.228.103]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s851kw8k012763; Thu, 4 Sep 2014 21:47:03 -0400 From: David Malcolm To: gcc-patches@gcc.gnu.org Cc: David Malcolm Subject: [PATCH 08/10] Use rtx_insn_list within haifa-sched.c Date: Thu, 4 Sep 2014 21:52:05 -0400 Message-Id: <1409881927-61672-9-git-send-email-dmalcolm@redhat.com> In-Reply-To: <1409881927-61672-1-git-send-email-dmalcolm@redhat.com> References: <1409881927-61672-1-git-send-email-dmalcolm@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 X-IsSubscribed: yes gcc/ * haifa-sched.c (check_clobbered_conditions): Strengthen local "link" from rtx to rtx_insn_list *, and use its methods for clarity and type-safety. (toggle_cancelled_flags): Likewise. (restore_last_backtrack_point): Likewise. (queue_to_ready): Use insn method of "link" in one place. (schedule_block): Strengthen local "link" from rtx to rtx_insn_list *, and use its methods for clarity and type-safety. --- gcc/haifa-sched.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c index 83ea5bd..fb92bb2 100644 --- a/gcc/haifa-sched.c +++ b/gcc/haifa-sched.c @@ -3148,13 +3148,13 @@ check_clobbered_conditions (rtx insn) } for (i = 0; i <= max_insn_queue_index; i++) { - rtx link; + rtx_insn_list *link; int q = NEXT_Q_AFTER (q_ptr, i); restart_queue: - for (link = insn_queue[q]; link; link = XEXP (link, 1)) + for (link = insn_queue[q]; link; link = link->next ()) { - rtx_insn *x = as_a (XEXP (link, 0)); + rtx_insn *x = link->insn (); if (TODO_SPEC (x) == DEP_CONTROL && cond_clobbered_p (x, t)) { queue_remove (x); @@ -4239,10 +4239,10 @@ toggle_cancelled_flags (bool set) for (i = 0; i <= max_insn_queue_index; i++) { int q = NEXT_Q_AFTER (q_ptr, i); - rtx link; - for (link = insn_queue[q]; link; link = XEXP (link, 1)) + rtx_insn_list *link; + for (link = insn_queue[q]; link; link = link->next ()) { - rtx insn = XEXP (link, 0); + rtx_insn *insn = link->insn (); FOR_EACH_DEP (insn, SD_LIST_BACK, sd_it, dep) if (!DEBUG_INSN_P (DEP_PRO (dep))) { @@ -4349,7 +4349,6 @@ unschedule_insns_until (rtx insn) static void restore_last_backtrack_point (struct sched_block_state *psched_block) { - rtx link; int i; struct haifa_saved_data *save = backtrack_queue; @@ -4384,9 +4383,9 @@ restore_last_backtrack_point (struct sched_block_state *psched_block) { int q = NEXT_Q_AFTER (q_ptr, i); - for (link = insn_queue[q]; link; link = XEXP (link, 1)) + for (rtx_insn_list *link = insn_queue[q]; link; link = link->next ()) { - rtx_insn *x = as_a (XEXP (link, 0)); + rtx_insn *x = link->insn (); QUEUE_INDEX (x) = QUEUE_NOWHERE; INSN_TICK (x) = INVALID_TICK; } @@ -4416,9 +4415,9 @@ restore_last_backtrack_point (struct sched_block_state *psched_block) insn_queue[q] = save->insn_queue[q]; - for (link = insn_queue[q]; link; link = XEXP (link, 1)) + for (rtx_insn_list *link = insn_queue[q]; link; link = link->next ()) { - rtx_insn *x = as_a (XEXP (link, 0)); + rtx_insn *x = link->insn (); QUEUE_INDEX (x) = i; TODO_SPEC (x) = recompute_todo_spec (x, true); INSN_TICK (x) = save->clock_var + i; @@ -4991,7 +4990,7 @@ queue_to_ready (struct ready_list *ready) { for (; link; link = link->next ()) { - insn = as_a (XEXP (link, 0)); + insn = link->insn (); q_size -= 1; if (sched_verbose >= 2) @@ -6545,12 +6544,12 @@ schedule_block (basic_block *target_bb, state_t init_state) if (q_size) for (i = 0; i <= max_insn_queue_index; i++) { - rtx link; - for (link = insn_queue[i]; link; link = XEXP (link, 1)) + rtx_insn_list *link; + for (link = insn_queue[i]; link; link = link->next ()) { rtx_insn *x; - x = as_a (XEXP (link, 0)); + x = link->insn (); QUEUE_INDEX (x) = QUEUE_NOWHERE; TODO_SPEC (x) = HARD_DEP; }