From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 74634 invoked by alias); 23 Jun 2015 08:49:44 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 74608 invoked by uid 89); 23 Jun 2015 08:49:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (207.82.80.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 23 Jun 2015 08:49:39 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-16-pX0cXTDdSz28g_9glXuZkg-1 Received: from e106375-lin.cambridge.arm.com ([10.1.2.79]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 23 Jun 2015 09:49:30 +0100 From: James Greenhalgh To: gcc-patches@gcc.gnu.org Cc: marcus.shawcroft@arm.com, richard.earnshaw@arm.com Subject: [Patch AArch64 0/4] Add "-moverride" option for overriding tuning parameters Date: Tue, 23 Jun 2015 08:49:00 -0000 Message-Id: <1435049360-10990-1-git-send-email-james.greenhalgh@arm.com> MIME-Version: 1.0 X-MC-Unique: pX0cXTDdSz28g_9glXuZkg-1 Content-Type: multipart/mixed; boundary="------------2.2.0" X-IsSubscribed: yes X-SW-Source: 2015-06/txt/msg01511.txt.bz2 This is a multi-part message in MIME format. --------------2.2.0 Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: quoted-printable Content-length: 5495 Hi, This patch set adds support for a new command line option "-moverride". The purpose of this command line is to allow expert-level users of the compiler, and those comfortable with experimenting with the compiler, *unsupported* full access to the tuning structures used in the AArch64 back-end. For now, we only enable command-line access to the fusion pairs to enable and whether or not to use the Cortex-A57 FMA register renaming pass. Though in future we can expand this further. With this patch, you might write something like: -moverride=3Dfuse=3Dadrp+add.cmp+branch:tune=3Drename_fma_regs To enable fusion of adrp+add and cmp+branch and to enable the cortex-a57-fma-steering pass. The registration of a new sub-option is table driven, you add an option name and a function which mutates the tuning parameters having parsed the string you are given to aarch64_tuning_override_functions. Expanding this for some of the other options (or groups of options) is therefore fairly easy, but I haven't done it yet. The patch set first refactors the fusion and pass tuning structures to drive them through definitions in tables ( config/aarch64/aarch64-fusion-pairs.def, config/aarch64/aarch64-tuning-flags.def ). We then de-constify the tune_params structure, as it can now modify. Finally we wire up the new option, and add the parsing code to give the desired behaviour. I've bootstrapped and tested the patch set on aarch64-none-linux-gnu with BOOT_CFLAGS set to the example string above, and again in the standard configuration with no issues. OK for trunk? Thanks, James --- [Patch AArch64 1/4] Define candidates for instruction fusion in a .def file gcc/ 2015-06-23 James Greenhalgh * config/aarch64/aarch64-fusion-pairs.def: New. * config/aarch64/aarch64-protos.h (aarch64_fusion_pairs): New. * config/aarch64/aarch64.c (AARCH64_FUSE_NOTHING): Move to aarch64_fusion_pairs. (AARCH64_FUSE_MOV_MOVK): Likewise. (AARCH64_FUSE_ADRP_ADD): Likewise. (AARCH64_FUSE_MOVK_MOVK): Likewise. (AARCH64_FUSE_ADRP_LDR): Likewise. (AARCH64_FUSE_CMP_BRANCH): Likewise. --- [Patch AArch64 2/4] Control the FMA steering pass in tuning structures rather than as core property gcc/ 2015-06-23 James Greenhalgh * config/aarch64/aarch64.h (AARCH64_FL_USE_FMA_STEERING_PASS): Delete. (aarch64_tune_flags): Likewise. (AARCH64_TUNE_FMA_STEERING): Likewise. * config/aarch64/aarch64-cores.def (cortex-a57): Remove reference to AARCH64_FL_USE_FMA_STEERING_PASS. (cortex-a57.cortex-a53): Likewise. (cortex-a72): Use cortexa72_tunings. (cortex-a72.cortex-a53): Likewise. (exynos-m1): Likewise. * config/aarch64/aarch64-protos.h (tune_params): Add a field: extra_tuning_flags. * config/aarch64/aarch64-tuning-flags.def: New. * config/aarch64/aarch64-protos.h (AARCH64_EXTRA_TUNING_OPTION): New. (aarch64_extra_tuning_flags): Likewise. (aarch64_tune_params): Declare here. * config/aarch64/aarch64.c (generic_tunings): Set extra_tuning_flags. (cortexa53_tunings): Likewise. (cortexa57_tunings): Likewise. (thunderx_tunings): Likewise. (xgene1_tunings): Likewise. (cortexa72_tunings): New. * config/aarch64/cortex-a57-fma-steering.c: Include aarch64-protos.h. (gate): Check against aarch64_tune_params. * config/aarch64/t-aarch64 (cortex-a57-fma-steering.o): Depend on aarch64-protos.h. --- [Patch AArch64 3/4] De-const-ify struct tune_params gcc/ 2015-06-23 James Greenhalgh * config/aarch64/aarch64-protos.h (tune_params): Remove const from members. (aarch64_tune_params): Remove const, change to no longer be a pointer. * config/aarch64/aarch64.c (aarch64_tune_params): Remove const, change to no longer be a pointer, initialize to generic_tunings. (aarch64_min_divisions_for_recip_mul): Change dereference of aarch64_tune_params to member access. (aarch64_reassociation_width): Likewise. (aarch64_rtx_mult_cost): Likewise. (aarch64_address_cost): Likewise. (aarch64_branch_cost): Likewise. (aarch64_rtx_costs): Likewise. (aarch64_register_move_cost): Likewise. (aarch64_memory_move_cost): Likewise. (aarch64_sched_issue_rate): Likewise. (aarch64_builtin_vectorization_cost): Likewise. (aarch64_override_options): Take a copy of the selected tuning struct in to aarch64_tune_params, rather than just setting a pointer, change dereferences of aarch64_tune_params to member accesses. (aarch64_override_options_after_change): Change dereferences of aarch64_tune_params to member access. (aarch64_macro_fusion_p): Likewise. (aarch_macro_fusion_pair_p): Likewise. * config/aarch64/cortex-a57-fma-steering.c (gate): Likewise. --- [Patch AArch64 4/4] Add -moverride tuning command, and wire it up for control of fusion and fma-steering gcc/ 2015-06-23 James Greenhalgh * config/aarch64/aarch64.opt: (override): New. * doc/invoke.texi (override): Document. * config/aarch64/aarch64.c (aarch64_flag_desc): New (aarch64_fusible_pairs): Likewise. (aarch64_tuning_flags): Likewise. (aarch64_tuning_override_function): Likewise. (aarch64_tuning_override_functions): Likewise. (aarch64_parse_one_option_token): Likewise. (aarch64_parse_boolean_options): Likewise. (aarch64_parse_fuse_string): Likewise. (aarch64_parse_tune_string): Likewise. (aarch64_parse_one_override_token): Likewise. (aarch64_parse_override_string): Likewise. (aarch64_override_options): Parse the -override string if it is present.= --------------2.2.0--