From patchwork Wed May 21 23:44:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kugan Vivekanandarajah X-Patchwork-Id: 30553 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f199.google.com (mail-ve0-f199.google.com [209.85.128.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5FDEC20671 for ; Wed, 21 May 2014 23:44:43 +0000 (UTC) Received: by mail-ve0-f199.google.com with SMTP id oz11sf9498065veb.2 for ; Wed, 21 May 2014 16:44:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mailing-list:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:sender :delivered-to:message-id:date:from:user-agent:mime-version:to:cc :subject:x-original-sender:x-original-authentication-results :content-type; bh=e5KcDUlvk8kksyS5dij7JQ+aZ4YPJ4d0W/Ln4C8Yxtw=; b=hyH+AQIW0IjZVAgNBEAkHOAMlSMwOIhoSeXwjVDcprAiY1y7X1E/wovz5hV58hgXYy rom0iwEvb6QZoC60b//5iXz2iXmiLqeMyPnrXYvXl2smtNksmikpsYqUJKryKwyk/Oq4 Pav2S0bZZCArzSHhDYa/3n+ns5xnhlILIon3QScco11nSNx2xPMZ5nXQNaa3bNfLbvwE dCIYBbXXs2liYCBCadp281uVEf6gi9+Tpb/8NjjPM0pLM3aXJFNIgx+zbl5fqGTep4wt 6vDsheb9uZhzbAXEEGd0jPd0kJfSFMnn8KGxo+ucR5VvxdXaqrx6DzjckorkHzRNGL0a KHzw== X-Gm-Message-State: ALoCoQnaSzjWzeFD3aippF9mxMNlJrIGDb4yqECC0f7Ze0aA/Ci1shLr/FZywX2N+qcIeY9CJcXX X-Received: by 10.58.143.66 with SMTP id sc2mr10696923veb.14.1400715882902; Wed, 21 May 2014 16:44:42 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.24.42 with SMTP id 39ls1006395qgq.26.gmail; Wed, 21 May 2014 16:44:42 -0700 (PDT) X-Received: by 10.220.162.6 with SMTP id t6mr12564562vcx.12.1400715882768; Wed, 21 May 2014 16:44:42 -0700 (PDT) Received: from mail-ve0-x231.google.com (mail-ve0-x231.google.com [2607:f8b0:400c:c01::231]) by mx.google.com with ESMTPS id ml3si3868254vcb.64.2014.05.21.16.44.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 21 May 2014 16:44:42 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c01::231 as permitted sender) client-ip=2607:f8b0:400c:c01::231; Received: by mail-ve0-f177.google.com with SMTP id db11so3375707veb.8 for ; Wed, 21 May 2014 16:44:42 -0700 (PDT) X-Received: by 10.52.110.195 with SMTP id ic3mr2881179vdb.53.1400715882548; Wed, 21 May 2014 16:44:42 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp153558vcb; Wed, 21 May 2014 16:44:41 -0700 (PDT) X-Received: by 10.66.164.135 with SMTP id yq7mr63160799pab.126.1400715881516; Wed, 21 May 2014 16:44:41 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id xd9si31131994pab.19.2014.05.21.16.44.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 May 2014 16:44:41 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-368201-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 29243 invoked by alias); 21 May 2014 23:44:29 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list 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 29229 invoked by uid 89); 21 May 2014 23:44:28 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pd0-f172.google.com Received: from mail-pd0-f172.google.com (HELO mail-pd0-f172.google.com) (209.85.192.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 21 May 2014 23:44:26 +0000 Received: by mail-pd0-f172.google.com with SMTP id x10so1862092pdj.3 for ; Wed, 21 May 2014 16:44:24 -0700 (PDT) X-Received: by 10.66.251.101 with SMTP id zj5mr63426725pac.154.1400715864533; Wed, 21 May 2014 16:44:24 -0700 (PDT) Received: from [10.1.1.3] (58-6-183-210.dyn.iinet.net.au. [58.6.183.210]) by mx.google.com with ESMTPSA id y2sm25347374pas.45.2014.05.21.16.44.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 21 May 2014 16:44:23 -0700 (PDT) Message-ID: <537D3A51.2090006@linaro.org> Date: Thu, 22 May 2014 09:44:17 +1000 From: Kugan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: Marcus Shawcroft , Richard Earnshaw Subject: [RFC][AArch64] Define TARGET_SPILL_CLASS X-IsSubscribed: yes X-Original-Sender: kugan.vivekanandarajah@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c01::231 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@gcc.gnu.org X-Google-Group-Id: 836684582541 Compiling some applications with -mgeneral-regs-only produces better code (runs faster) compared to not using it. The difference here is that when -mgeneral-regs-only is not used, floating point register are also used in register allocation. Then IRA/LRA has to move them to core registers before performing operations. I experimented with TARGET_SPILL_CLASS (as in attached patch) to make floating point register class as just spill class for integer pseudos. Though this benefits the application which had this issue. Overall performance with speck2k is neutral (some of the benchmarks benefits a lot but others regress). I am looking to see if I can make it perform better overall. Any suggestions welcome. Attached experimental patch passes regression but 168.wupwise and 187.facerec miscompares now. I am looking at fixing this as well. Thanks, Kugan gcc/ 2014-05-22 Kugan Vivekanandarajah * config/aarch64/aarch64.c (generic_regmove_cost) : Adjust GP2FP and FP2GP costs. (aarch64_spill_class) : New function. (TARGET_SHIFT_TRUNCATION_MASK) : Define. diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index a3147ee..16d1b51 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -184,8 +184,8 @@ __extension__ static const struct cpu_regmove_cost generic_regmove_cost = { NAMED_PARAM (GP2GP, 1), - NAMED_PARAM (GP2FP, 2), - NAMED_PARAM (FP2GP, 2), + NAMED_PARAM (GP2FP, 5), + NAMED_PARAM (FP2GP, 5), /* We currently do not provide direct support for TFmode Q->Q move. Therefore we need to raise the cost above 2 in order to have reload handle the situation. */ @@ -4882,6 +4882,18 @@ aarch64_register_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED, return regmove_cost->FP2FP; } +/* Return class of registers which could be used for pseudo of MODE + and of class RCLASS for spilling instead of memory. */ +static reg_class_t +aarch64_spill_class (reg_class_t rclass, enum machine_mode mode) +{ + if ((GET_MODE_CLASS (mode) == MODE_INT) + && reg_class_subset_p (rclass, GENERAL_REGS)) + return FP_REGS; + return NO_REGS; +} + + static int aarch64_memory_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED, reg_class_t rclass ATTRIBUTE_UNUSED, @@ -8431,6 +8443,9 @@ aarch64_cannot_change_mode_class (enum machine_mode from, #undef TARGET_SECONDARY_RELOAD #define TARGET_SECONDARY_RELOAD aarch64_secondary_reload +#undef TARGET_SPILL_CLASS +#define TARGET_SPILL_CLASS aarch64_spill_class + #undef TARGET_SHIFT_TRUNCATION_MASK #define TARGET_SHIFT_TRUNCATION_MASK aarch64_shift_truncation_mask