From patchwork Mon Nov 15 03:22:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Maciej W. Rozycki" X-Patchwork-Id: 47645 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 024BC3858036 for ; Mon, 15 Nov 2021 03:22:31 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by sourceware.org (Postfix) with ESMTPS id 2D1293858407 for ; Mon, 15 Nov 2021 03:22:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2D1293858407 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-ed1-x52e.google.com with SMTP id g14so65392627edz.2 for ; Sun, 14 Nov 2021 19:22:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:subject:message-id:user-agent:mime-version; bh=R+zFrcPRvtg8u31Mzd5lXDpw3+Y/gTefPtlcqvItovw=; b=ZN3FDCZeVabf8kXB2DYF4IUaxbIidRF+zeZZ6mbgoUHoRwvKkArmFjyAAQQg9Bajd+ Xdrpt4HXzQwdDydr675ou3FUmaqRO2TrvMncnw6E7dqeZkKcYTbq/ohWWLYSxv/2Eis/ Ycag7P4MbW6DSfDEAbR+c9PRDwgvfCzxgxVZa1NX2Tp5Yr270SIR6ZaPCVwTXwa5umXB rLBwEzGvjHCGWTG3kjDUPu8/Pmk+e0AoHB10GslUe80K3ELKrMjS4q/oiRmpONyU7HH0 FUkNLqSyrQEtR8UNq4/kP0sHW1PY25s8Rm9TBTerYcxoMJw97tXCVoq05tT39ZohpEFQ XJaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:subject:message-id:user-agent :mime-version; bh=R+zFrcPRvtg8u31Mzd5lXDpw3+Y/gTefPtlcqvItovw=; b=VSrxeYGAtt2B2+qr2pN8qnBQQexRCvfy/kMTXbxC9NHIwuP3MQq/s2ukvgEHvXzwHU R6/3jOk6j/Q2gpeH956j3ZAFwxqGSmZmnzTrK/oYFgyHXrnNpD0MWocvMEvAisQq9PrI 7REwlpsMkJp8Fh8RgMoYiotMOAjwhnTkkj9T5r121Vx2aFEvXE//8PBfZ6c8y/MAC8dU blxYqmbpHplnu1IsAxik3LvmmE6YSGAwv3Xb+cpk8OYQNxo7khXy7fa87jln2InVFGCX MnQIVGVu5X1DyVhIKhgEhSRNCBpNPG8M10ELo84wFW+wOXv52/EdM2+dAle3LjwbOD/z P5Hw== X-Gm-Message-State: AOAM533McGviowD76Gukk0PV5NB9RjDiO0M1ka8NPa9yldjUIFKyFEnR ew+jhWRIq3oMUWfOoHL71mPPKJGzveWIeg== X-Google-Smtp-Source: ABdhPJznFUrtWgRi1++wdj0BQGFQyyXEvtF090dqCFu/0LhcvSoukj+JYBk6IxgbfLPUg9bRAf9THw== X-Received: by 2002:a50:d4d1:: with SMTP id e17mr50171000edj.348.1636946532177; Sun, 14 Nov 2021 19:22:12 -0800 (PST) Received: from annie.orcam.me.uk (annie.orcam.me.uk. [2001:4190:8020::48]) by smtp.gmail.com with ESMTPSA id s3sm5745025ejm.49.2021.11.14.19.22.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Nov 2021 19:22:11 -0800 (PST) Date: Mon, 15 Nov 2021 03:22:10 +0000 (GMT) From: "Maciej W. Rozycki" To: gcc-patches@gcc.gnu.org Subject: [committed] VAX: Implement the `-mlra' command-line option Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Add the the `-mlra' command-line option for the VAX target, with the usual semantics of enabling Local Register Allocation, off by default. LRA remains unstable with the VAX target, with numerous ICEs throughout the testsuite and worse code produced overall where successful, however the presence of a command line option to enable it makes it easier to experiment with it as the compiler does not have to be rebuilt to flip between the old reload and LRA. gcc/ * config/vax/vax.c (vax_lra_p): New prototype and function. (TARGET_LRA_P): Wire it. * config/vax/vax.opt (mlra): New option. * doc/invoke.texi (Option Summary, VAX Options): Document the new option. --- gcc/config/vax/vax.c | 11 ++++++++++- gcc/config/vax/vax.opt | 4 ++++ gcc/doc/invoke.texi | 9 ++++++++- 3 files changed, 22 insertions(+), 2 deletions(-) gcc-vax-mlra.diff Index: gcc/gcc/config/vax/vax.c =================================================================== --- gcc.orig/gcc/config/vax/vax.c +++ gcc/gcc/config/vax/vax.c @@ -62,6 +62,7 @@ static rtx vax_function_arg (cumulative_ static void vax_function_arg_advance (cumulative_args_t, const function_arg_info &); static rtx vax_struct_value_rtx (tree, int); +static bool vax_lra_p (void); static void vax_asm_trampoline_template (FILE *); static void vax_trampoline_init (rtx, tree, rtx); static poly_int64 vax_return_pops_args (tree, tree, poly_int64); @@ -114,7 +115,7 @@ static HOST_WIDE_INT vax_starting_frame_ #define TARGET_STRUCT_VALUE_RTX vax_struct_value_rtx #undef TARGET_LRA_P -#define TARGET_LRA_P hook_bool_void_false +#define TARGET_LRA_P vax_lra_p #undef TARGET_LEGITIMATE_ADDRESS_P #define TARGET_LEGITIMATE_ADDRESS_P vax_legitimate_address_p @@ -1221,6 +1222,14 @@ vax_struct_value_rtx (tree fntype ATTRIB return gen_rtx_REG (Pmode, VAX_STRUCT_VALUE_REGNUM); } +/* Return true if we use LRA instead of reload pass. */ + +static bool +vax_lra_p (void) +{ + return TARGET_LRA; +} + /* Output integer move instructions. */ bool Index: gcc/gcc/config/vax/vax.opt =================================================================== --- gcc.orig/gcc/config/vax/vax.opt +++ gcc/gcc/config/vax/vax.opt @@ -42,6 +42,10 @@ munix Target RejectNegative Mask(UNIX_ASM) Generate code for UNIX assembler. +mlra +Target Mask(LRA) +Enable Local Register Allocation. + mvaxc-alignment Target RejectNegative Mask(VAXC_ALIGNMENT) Use VAXC structure conventions. Index: gcc/gcc/doc/invoke.texi =================================================================== --- gcc.orig/gcc/doc/invoke.texi +++ gcc/gcc/doc/invoke.texi @@ -1364,7 +1364,7 @@ See RS/6000 and PowerPC Options. -mbig-switch} @emph{VAX Options} -@gccoptlist{-mg -mgnu -munix} +@gccoptlist{-mg -mgnu -munix -mlra} @emph{Visium Options} @gccoptlist{-mdebug -msim -mfpu -mno-fpu -mhard-float -msoft-float @gol @@ -30523,6 +30523,13 @@ GNU assembler is being used. @item -mg @opindex mg Output code for G-format floating-point numbers instead of D-format. + +@item -mlra +@itemx -mno-lra +@opindex mlra +@opindex mno-lra +Enable Local Register Allocation. This is still experimental for the VAX, +so by default the compiler uses standard reload. @end table @node Visium Options