From patchwork Thu Nov 27 11:27:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Renlin Li X-Patchwork-Id: 415458 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 900AF140188 for ; Thu, 27 Nov 2014 22:27:28 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=m0tRHjtRn4a+c2QVZgHjvuZg05S4FeFC6VcuVXcTK8R m23Jx6zIglCJ2xyebLL+0zlgHGAGiWUtxmIj9dIaWe2AMxApkY4s/kl7hJa1aqfn aTEwJ/TFYfKluRurr2C/hIIWEBN9oeGGaDrnD1a6lyOzaySKDO476HiVasVneF54 = 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 :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=merJTHOlgcVvEONl7rF0avQCelg=; b=mFU/9hxIVLyP+de5v KB2RUUP3kMEUWfxcIDXdGb2KTa+JpdomdI8Nq4cEN90tz5fplLmsUvIvriP290Oh MfvlBQTTBSNKfR1yWf5yadxHe8kaYcsA4iurHtA+av7s8ut1x0yLoi2FSiq29j+l oKkHAaoYgZBium5aMF67bT3iNo= Received: (qmail 14552 invoked by alias); 27 Nov 2014 11:27:22 -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 14540 invoked by uid 89); 27 Nov 2014 11:27:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: service87.mimecast.com Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Nov 2014 11:27:20 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by service87.mimecast.com; Thu, 27 Nov 2014 11:27:18 +0000 Received: from [10.1.203.158] ([10.1.255.212]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 27 Nov 2014 11:27:18 +0000 Message-ID: <54770A95.2000108@arm.com> Date: Thu, 27 Nov 2014 11:27:17 +0000 From: Renlin Li User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: marcus Shawcroft , ramana Radhakrishnan Subject: [PATCH][AARCH64]Use selected cpu's tuning when no tuning parameter is specified. X-MC-Unique: 114112711271800201 X-IsSubscribed: yes Hi all, We have the following code in aarch64_override_options() function. /* The selected cpu may be an architecture, so lookup tuning by core ID. */ if (!selected_tune) selected_tune = &all_cores[selected_cpu->core]; However, the logic here is not right any more according to our current code. selected_cpu will never be an architecture at this point. This patch will correct the behaviour and use selected_cpu's tuning directly if selected_tune is still not decided at this point. We have the following consequence after the change. Previously we have the following tuning settings with the following command line options: -march=armv8-a --> selected_cpu = generic, aarch64_tune_params = cortexa53_tunings Nothing specified and selected_cpu == generic --> aarch64_tune_params = cortexa53_tunings After the change, we got something different: -march=armv8-a --> selected_cpu = generic, aarch64_tune_params = generic_tunings Nothing specified and selected_cpu == generic --> aarch64_tune_params = generic_tunings All other configuration(-march, -mcpu, -mtune) combinations should be unaffected. aarch64-none-elf has been built and tested on the model, no issue. Is it Okay for trunk? gcc/ChangeLog: 2014-11-27 Renlin Li * config/aarch64/aarch64.c (aarch64_parse_cpu): Don't define selected_tune. (aarch64_override_options): Use selected_cpu's tuning. diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 1809513..0a8c303 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -6613,7 +6613,6 @@ aarch64_parse_cpu (void) if (strlen (cpu->name) == len && strncmp (cpu->name, str, len) == 0) { selected_cpu = cpu; - selected_tune = cpu; aarch64_isa_flags = selected_cpu->flags; if (ext != NULL) @@ -6709,9 +6708,8 @@ aarch64_override_options (void) gcc_assert (selected_cpu); - /* The selected cpu may be an architecture, so lookup tuning by core ID. */ if (!selected_tune) - selected_tune = &all_cores[selected_cpu->core]; + selected_tune = selected_cpu; aarch64_tune_flags = selected_tune->flags; aarch64_tune = selected_tune->core;