From patchwork Sun Sep 5 20:41:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatoly Sokolov X-Patchwork-Id: 63861 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 0FC1EB70E7 for ; Mon, 6 Sep 2010 06:41:02 +1000 (EST) Received: (qmail 19810 invoked by alias); 5 Sep 2010 20:41:00 -0000 Received: (qmail 19778 invoked by uid 22791); 5 Sep 2010 20:40:59 -0000 X-SWARE-Spam-Status: No, hits=2.1 required=5.0 tests=AWL, BAYES_50, KAM_THEBAT, RCVD_IN_DNSWL_NONE, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from contrabass.post.ru (HELO contrabass.post.ru) (85.21.78.5) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 05 Sep 2010 20:40:52 +0000 Received: from corbina.ru (mail.post.ru [195.14.50.16]) by contrabass.post.ru (Postfix) with ESMTP id DF7E6A887; Mon, 6 Sep 2010 00:40:48 +0400 (MSD) Received: from [95.25.59.74] (account aesok@post.ru HELO Vista.corbina.ru) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPA id 253073921; Mon, 06 Sep 2010 00:40:48 +0400 Date: Mon, 6 Sep 2010 00:41:11 +0400 From: Anatoly Sokolov Message-ID: <148942246.20100906004111@post.ru> To: gcc-patches@gcc.gnu.org CC: nickc@redhat.com Subject: [FRV] Hookize CLASS_LIKELY_SPILLED_P 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. This patch removes obsolete CLASS_LIKELY_SPILLED_P macro from the FRV back end in the GCC and introduces equivalent TARGET_CLASS_LIKELY_SPILLED_P target hook. Regression tested on frv-unknown-elf. OK to install? * config/frv/frv.h (CLASS_LIKELY_SPILLED_P): Remove. * config/frv/frv-protos.h (frv_class_likely_spilled_p): Remove. * config/frv/frv.c (frv_class_likely_spilled_p): Make static. Change argument type to reg_class_t. Change result type to bool. (TARGET_CLASS_LIKELY_SPILLED_P): Define. Anatoly. Index: gcc/config/frv/frv.h =================================================================== --- gcc/config/frv/frv.h (revision 163880) +++ gcc/config/frv/frv.h (working copy) @@ -1257,22 +1257,6 @@ #define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS, MODE, X) \ frv_secondary_reload_class (CLASS, MODE, X) -/* A C expression whose value is nonzero if pseudos that have been assigned to - registers of class CLASS would likely be spilled because registers of CLASS - are needed for spill registers. - - The default value of this macro returns 1 if CLASS has exactly one register - and zero otherwise. On most machines, this default should be used. Only - define this macro to some other expression if pseudo allocated by - `local-alloc.c' end up in memory because their hard registers were needed - for spill registers. If this macro returns nonzero for those classes, those - pseudos will only be allocated by `global.c', which knows how to reallocate - the pseudo to another register. If there would not be another register - available for reallocation, you should not change the definition of this - macro since the only effect of such a definition would be to slow down - register allocation. */ -#define CLASS_LIKELY_SPILLED_P(CLASS) frv_class_likely_spilled_p (CLASS) - /* A C expression for the maximum number of consecutive registers of class CLASS needed to hold a value of mode MODE. Index: gcc/config/frv/frv-protos.h =================================================================== --- gcc/config/frv/frv-protos.h (revision 163880) +++ gcc/config/frv/frv-protos.h (working copy) @@ -102,7 +102,6 @@ extern enum reg_class frv_secondary_reload_class (enum reg_class, enum machine_mode, rtx); -extern int frv_class_likely_spilled_p (enum reg_class rclass); extern int frv_hard_regno_mode_ok (int, enum machine_mode); extern int frv_hard_regno_nregs (int, enum machine_mode); extern int frv_class_max_nregs (enum reg_class rclass, Index: gcc/config/frv/frv.c =================================================================== --- gcc/config/frv/frv.c (revision 163880) +++ gcc/config/frv/frv.c (working copy) @@ -391,6 +391,7 @@ static bool frv_frame_pointer_required (void); static bool frv_can_eliminate (const int, const int); static void frv_trampoline_init (rtx, tree, rtx); +static bool frv_class_likely_spilled_p (reg_class_t); /* Allow us to easily change the default for -malloc-cc. */ #ifndef DEFAULT_NO_ALLOC_CC @@ -481,6 +482,9 @@ #define TARGET_ASM_OUTPUT_DWARF_DTPREL frv_output_dwarf_dtprel #endif +#undef TARGET_CLASS_LIKELY_SPILLED_P +#define TARGET_CLASS_LIKELY_SPILLED_P frv_class_likely_spilled_p + #undef TARGET_SECONDARY_RELOAD #define TARGET_SECONDARY_RELOAD frv_secondary_reload @@ -6533,23 +6537,10 @@ } -/* A C expression whose value is nonzero if pseudos that have been assigned to - registers of class RCLASS would likely be spilled because registers of RCLASS - are needed for spill registers. +/* Worker function for TARGET_CLASS_LIKELY_SPILLED_P. */ - The default value of this macro returns 1 if RCLASS has exactly one register - and zero otherwise. On most machines, this default should be used. Only - define this macro to some other expression if pseudo allocated by - `local-alloc.c' end up in memory because their hard registers were needed - for spill registers. If this macro returns nonzero for those classes, those - pseudos will only be allocated by `global.c', which knows how to reallocate - the pseudo to another register. If there would not be another register - available for reallocation, you should not change the definition of this - macro since the only effect of such a definition would be to slow down - register allocation. */ - -int -frv_class_likely_spilled_p (enum reg_class rclass) +static bool +frv_class_likely_spilled_p (reg_class_t rclass) { switch (rclass) { @@ -6574,10 +6565,10 @@ case EVEN_ACC_REGS: case ACC_REGS: case ACCG_REGS: - return TRUE; + return true; } - return FALSE; + return false; }