From patchwork Wed Apr 11 11:50:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleg Endo X-Patchwork-Id: 151764 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]) by ozlabs.org (Postfix) with SMTP id 0119CB7005 for ; Wed, 11 Apr 2012 21:50:37 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1334749838; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Subject:From:To:Content-Type:Date:Message-ID:Mime-Version: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=HQcp233HzugIXG+smsjW Szg2kJE=; b=aaB8Ac36VTLxx8pk8NsXq6YtAo1bNLjcRAMmsfBZ+DL1NF8S9V2T d5UXe0YOZdE6qSpcVnP6Y2BUZ9JHOjj6lKaZmWL2RVGoN/zlJeLDsKMwQ3tg72/A qd2gORuACuTA/48d6sojBea/k+z1OJ2caLtsdh26mM++1Nguutdzqdw= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Subject:From:To:Content-Type:Date:Message-ID:Mime-Version:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=UuBi+/XimLL9oMx0RBxu6eB+6Df6q/uji2SA4Ryj6ym3GhQdAKs7tnyMK7ggDM yOaAV8mKhpoXegiszQROvr7Coi7bddG0rrkAMpzeogKkWwHQD0+NkwWs+hXLT1E3 X9/SKVa53sIYaZpQk8oFq44cbT9yVbVn00LK9jndC6pWo=; Received: (qmail 21725 invoked by alias); 11 Apr 2012 11:50:33 -0000 Received: (qmail 21716 invoked by uid 22791); 11 Apr 2012 11:50:32 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_HOSTKARMA_NO, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY X-Spam-Check-By: sourceware.org Received: from mailout08.t-online.de (HELO mailout08.t-online.de) (194.25.134.20) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 11 Apr 2012 11:50:13 +0000 Received: from fwd19.aul.t-online.de (fwd19.aul.t-online.de ) by mailout08.t-online.de with smtp id 1SHw3v-00073k-EL; Wed, 11 Apr 2012 13:50:11 +0200 Received: from [192.168.0.104] (r4WdfmZUZhWl2R3jJIZuN7RfsZxobmDbcWwjbHC32gd6TK74t4TNaejpLAI2Q4bQ5u@[93.218.180.175]) by fwd19.t-online.de with esmtp id 1SHw3t-2DILya0; Wed, 11 Apr 2012 13:50:09 +0200 Subject: [SH] Merge SCHED_REORDER macro into ready_reorder function From: Oleg Endo To: gcc-patches Date: Wed, 11 Apr 2012 13:50:08 +0200 Message-ID: <1334145008.19154.158.camel@yam-132-YW-E178-FTW> Mime-Version: 1.0 X-IsSubscribed: yes 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 Hi, The attached patch merges the SCHED_REORDER macro into the ready_reorder function, since the macro is used only in that function. Tested with 'make all-gcc' OK? Cheers, Oleg ChangeLog: * config/sh/sh.c (SCHED_REORDER): Merge macro into ... (ready_reorder): ... this function. Index: gcc/config/sh/sh.c =================================================================== --- gcc/config/sh/sh.c (revision 186311) +++ gcc/config/sh/sh.c (working copy) @@ -10559,22 +10559,14 @@ a[i + 1] = insn; } -#define SCHED_REORDER(READY, N_READY) \ - do \ - { \ - if ((N_READY) == 2) \ - swap_reorder (READY, N_READY); \ - else if ((N_READY) > 2) \ - qsort (READY, N_READY, sizeof (rtx), rank_for_reorder); \ - } \ - while (0) - -/* Sort the ready list READY by ascending priority, using the SCHED_REORDER - macro. */ +/* Sort the ready list by ascending priority. */ static void ready_reorder (rtx *ready, int nready) { - SCHED_REORDER (ready, nready); + if (nready == 2) + swap_reorder (ready, nready); + else if (nready > 2) + qsort (ready, nready, sizeof (rtx), rank_for_reorder); } /* Count life regions of r0 for a block. */