From patchwork Sat Jul 17 16:52:03 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Kuvyrkov X-Patchwork-Id: 59143 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 AD24FB70A4 for ; Sun, 18 Jul 2010 02:52:14 +1000 (EST) Received: (qmail 29624 invoked by alias); 17 Jul 2010 16:52:13 -0000 Received: (qmail 29616 invoked by uid 22791); 17 Jul 2010 16:52:12 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 17 Jul 2010 16:52:07 +0000 Received: (qmail 20600 invoked from network); 17 Jul 2010 16:52:05 -0000 Received: from unknown (HELO ?172.16.1.24?) (maxim@127.0.0.2) by mail.codesourcery.com with ESMTPA; 17 Jul 2010 16:52:05 -0000 Message-ID: <4C41DFB3.1090000@codesourcery.com> Date: Sat, 17 Jul 2010 20:52:03 +0400 From: Maxim Kuvyrkov User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.4) Gecko/20100608 Thunderbird/3.1 MIME-Version: 1.0 To: Richard Earnshaw CC: gcc-patches Subject: Tune hoisting for ARM References: <4C18F225.2040509@codesourcery.com> <4C227243.9080104@codesourcery.com> In-Reply-To: <4C227243.9080104@codesourcery.com> 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 The attached patch tunes code hoisting parameter gcse-unrestricted-cost for ARM. It is provides a small (~0.3%), but measurable size reduction to use a bit lesser cost cutoff for ARM PIC. Tuning was done on SPEC2K benchmarks. OK to check in? Thank you, diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 9f00416..b5cc3ed 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -56,6 +56,7 @@ #include "df.h" #include "intl.h" #include "libfuncs.h" +#include "params.h" /* Forward definitions of types. */ typedef struct minipool_node Mnode; @@ -1872,6 +1873,14 @@ arm_override_options (void) flag_reorder_blocks = 1; } + if (!PARAM_SET_P (PARAM_GCSE_UNRESTRICTED_COST) + && flag_pic) + /* Hoisting PIC address calculations more aggressively provides a small, + but measurable, size reduction for PIC code. Therefore, we decrease + the bar for unrestricted expression hoisting to the cost of PIC address + calculation, which is 2 instructions. */ + set_param_value ("gcse-unrestricted-cost", 2); + /* Register global variables with the garbage collector. */ arm_add_gc_roots (); } diff --git a/gcc/config/arm/t-arm b/gcc/config/arm/t-arm index de2bbc4..4879211 100644 --- a/gcc/config/arm/t-arm +++ b/gcc/config/arm/t-arm @@ -45,6 +45,15 @@ $(srcdir)/config/arm/arm-tune.md: $(srcdir)/config/arm/gentune.sh \ $(srcdir)/config/arm/arm-cores.def > \ $(srcdir)/config/arm/arm-tune.md +arm.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(RTL_H) $(TREE_H) $(OBSTACK_H) $(REGS_H) hard-reg-set.h \ + insn-config.h conditions.h output.h \ + $(INSN_ATTR_H) $(FLAGS_H) reload.h $(FUNCTION_H) \ + $(EXPR_H) $(OPTABS_H) toplev.h $(RECOG_H) $(CGRAPH_H) \ + $(GGC_H) except.h $(C_PRAGMA_H) $(INTEGRATE_H) $(TM_P_H) \ + $(TARGET_H) $(TARGET_DEF_H) debug.h langhooks.h $(DF_H) \ + intl.h libfuncs.h $(PARAMS_H) + arm-c.o: $(srcdir)/config/arm/arm-c.c $(CONFIG_H) $(SYSTEM_H) \ coretypes.h $(TM_H) $(TREE_H) output.h $(C_COMMON_H) $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \