From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <> Received: from fx409.security-mail.net (smtpout140.security-mail.net [85.31.212.149]) by sourceware.org (Postfix) with ESMTPS id E120F3955409 for ; Tue, 10 Aug 2021 11:04:25 +0000 (GMT) Authentication-Results: sourceware.org; dkim=permerror (bad message/signature format) Received: by fx409.security-mail.net (Postfix) id 8968A3237BB; Tue, 10 Aug 2021 13:04:23 +0200 (CEST) Date: Tue, 10 Aug 2021 13:04:23 +0200 (CEST) From: MAILER-DAEMON (Mail Delivery System) Subject: Undelivered Mail Returned to Sender To: gcc-patches@gcc.gnu.org Auto-Submitted: auto-replied MIME-Version: 1.0 Content-Type: multipart/report; report-type=delivery-status; boundary="4CF1C3237ED.1628593463/fx409.security-mail.net" Message-Id: <20210810110423.8968A3237BB@fx409.security-mail.net> X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, HTML_MESSAGE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: , X-List-Received-Date: Tue, 10 Aug 2021 11:04:37 -0000 This is a MIME-encapsulated message. --4CF1C3237ED.1628593463/fx409.security-mail.net Content-Description: Notification Content-Type: text/plain; charset=us-ascii This is the mail system at host fx409.security-mail.net. I'm sorry to have to inform you that your message could not be delivered to one or more recipients. It's attached below. For further assistance, please send mail to postmaster. If you do so, please include this problem report. You can delete your own text from the attached returned message. The mail system : host zimbra2.kalray.eu[195.135.97.26] said: 550 5.1.1 : Recipient address rejected: User unknown in virtual mailbox table (in reply to RCPT TO command) --4CF1C3237ED.1628593463/fx409.security-mail.net Content-Description: Delivery report Content-Type: message/delivery-status Reporting-MTA: dns; fx409.security-mail.net X-Postfix-Queue-ID: 4CF1C3237ED X-Postfix-Sender: rfc822; gcc-patches@gcc.gnu.org Arrival-Date: Tue, 10 Aug 2021 13:04:23 +0200 (CEST) Final-Recipient: rfc822; marc.poulhies@kalray.eu Original-Recipient: rfc822;marc.poulhies@kalray.eu Action: failed Status: 5.1.1 Remote-MTA: dns; zimbra2.kalray.eu Diagnostic-Code: smtp; 550 5.1.1 : Recipient address rejected: User unknown in virtual mailbox table --4CF1C3237ED.1628593463/fx409.security-mail.net Content-Description: Undelivered Message Content-Type: message/rfc822 Return-Path: Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) by fx409.security-mail.net (Postfix) with ESMTPS id BCDE232383C for ; Tue, 10 Aug 2021 13:04:21 +0200 (CEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 052673955418 for ; Tue, 10 Aug 2021 11:04:19 +0000 (GMT) Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id AEA2C3858007 for ; Tue, 10 Aug 2021 11:03:21 +0000 (GMT) Received: by mail-ej1-x630.google.com with SMTP id e19so34629234ejs.9 for ; Tue, 10 Aug 2021 04:03:21 -0700 (PDT) X-Quarantine-ID: X-Virus-Scanned: E-securemail, by Secumail X-Spam-Status: No, score=-1.576 tagged_above=-1000 required=7.5 tests=[AB_ENVFROM_LONG_40=0.5, AB_FAKE_WORD_1=0.2, AB_IN_REPLY_TO_EXISTS=-1, AB_LONG_SUBJ_30=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-1, DKIM_VALID_AU=-0.1, FAKE_REPLY_SURE_A=1, FAKE_REPLY_SURE_B=1, FSL_RCVD_EX_3=0.01, FSL_RCVD_UT_3=0.01, HEAD_NEWS=-0.5, MISSING_MID=0.14, MM_ENVFROM_BOUNCE=1, RCVD_IN_DNSWL_MED=-1.3, RDNS_DYNAMIC=0.363, S_FROM_GREY_MINUS_2=-2] autolearn=disabled Authentication-Results: fx409.security-mail.net (amavisd-new); dkim=pass (1024-bit key) header.d=gcc.gnu.org Secumail-id: <1dac.61125d35.60598.0> DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 052673955418 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1628593459; bh=3VPFUe2EAnfzGRfxoW0++HlaSvbIfN9slvlCu+XiZFE=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=k+Y6Nwbw/1Y7ICrK+sXN/8Ohj0BQpZjbgJjKInSDB6Ry23mi5mrWzs1faB0kDRcIY KqQLSzvL/z+Z3jVC5/63CbS3ja2mr/KrxAh95lYM+R09VCN811x1kwdG41sjn7aTAw ozjVyv/QCOiykr9ak302BWj18IDzec6NVbY0Nk9g= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AEA2C3858007 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3VPFUe2EAnfzGRfxoW0++HlaSvbIfN9slvlCu+XiZFE=; b=hg2/95dBbTs14pGZJo5b2Af9x4evlEcbJKERvmou1nMW9xXPyuCArAV5GwOL6QYk9b oGpdw+d2zwpnd8fa6sugNVPTuIxRrY7c73WJisIcyK4FgqqXhAb6JkWTQN4dDP8tdan4 /k4oTyu7IxLMII7tE+Q4vTn3+/AcsgxtdtMI4doCMFrDxYoAAfKL3ux3iz8jCLQWXj2Q 2unikmzmku70Q+25SrEiNAhLlhBEPxdYn3tctNfevLNy6z2V1btwTl0SLy+hkAZGEZpI g+wVLz/V9oiaBUXt3GZeJEB5DuS4s8UrvMzN7hvmgSk/J3D/RveeyBQrY3FQAQcWOaIt C0pQ== X-Gm-Message-State: AOAM533dRT2g+GATXHtFg3yPUCAU7YM57oba4F2Nprni7DroGLGPr5QM P+bDD0UocPVMql43jtBBkh73x6yia7Pk2IP4C0Y= X-Google-Smtp-Source: ABdhPJz1UKMNokMvBaAu8qhHVR2i3uITaEvIJZVs/qaorE82f8O6V2z86LtyVLVovSbKtCxjFyx7fY87tzRkRQZheqo= X-Received: by 2002:a17:906:1901:: with SMTP id a1mr27068741eje.129.1628593400584; Tue, 10 Aug 2021 04:03:20 -0700 (PDT) MIME-Version: 1.0 References: <20210810083222.51212-1-rjiejie@linux.alibaba.com> In-Reply-To: <20210810083222.51212-1-rjiejie@linux.alibaba.com> Date: Tue, 10 Aug 2021 13:03:09 +0200 Message-ID: Subject: Re: [PATCH] Adding target hook allows to reject initialization of register To: Jojo R , Richard Sandiford 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: , From: Richard Biener via Gcc-patches Reply-To: Richard Biener Cc: GCC Patches Errors-To: gcc-patches-bounces+marc.poulhies=kalray.eu@gcc.gnu.org Sender: Gcc-patches X-ALTERMIMEV2_in: done Content-Type: text/plain; charset=utf-8 On Tue, Aug 10, 2021 at 10:33 AM Jojo R via Gcc-patches wrote: > > Some target like RISC-V allow to group vector register as a whole, > and only operate part of it in fact, but the 'init-regs' pass will add initialization > for uninitialized registers. Add this hook to reject this action for reducing instruction. Are these groups "visible"? That is, are the pseudos multi-reg pseudos? I wonder if there's a more generic way to tame down initregs w/o introducing a new target hook. Btw, initregs is a red herring - it ideally should go away. See PR61810. So instead of adding to it can you see whether disabling the pass for RISC-V works w/o fallout (and add a comment to the PR)? Maybe some more RTL literate (in particular DF literate) can look at the remaining issue. Richard, did you ever have a look into the "issue" that initregs covers up (whatever that exactly is)? Thanks, Richard. > gcc/ > * init-regs.c (initialize_uninitialized_regs): Call register_reject_init_p. > * target.def (register_reject_init_p): New hook. > * doc/tm.texi.in: Add TARGET_REGISTER_REJECT_INIT_P. > * doc/tm.texi: Regenerated. > --- > gcc/doc/tm.texi | 6 ++++++ > gcc/doc/tm.texi.in | 2 ++ > gcc/init-regs.c | 5 +++++ > gcc/target.def | 8 ++++++++ > 4 files changed, 21 insertions(+) > > diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi > index a30fdcbbf3d6..83fd5496ca3f 100644 > --- a/gcc/doc/tm.texi > +++ b/gcc/doc/tm.texi > @@ -12588,3 +12588,9 @@ Return an RTX representing @var{tagged_pointer} with its tag set to zero. > Store the result in @var{target} if convenient. > The default clears the top byte of the original pointer. > @end deftypefn > + > +@deftypefn {Target Hook} bool TARGET_REGISTER_REJECT_INIT_P (rtx @var{reg}) > +This target hook should return @code{true} if reject initialization for a uninitialized @var{reg}. > + > +The default value of this hook is @code{NULL}. > +@end deftypefn > diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in > index 611fc500ac86..13174ce66d59 100644 > --- a/gcc/doc/tm.texi.in > +++ b/gcc/doc/tm.texi.in > @@ -8180,3 +8180,5 @@ maintainer is familiar with. > @hook TARGET_MEMTAG_EXTRACT_TAG > > @hook TARGET_MEMTAG_UNTAGGED_POINTER > + > +@hook TARGET_REGISTER_REJECT_INIT_P > diff --git a/gcc/init-regs.c b/gcc/init-regs.c > index 72e898f3e334..51c0d669d30b 100644 > --- a/gcc/init-regs.c > +++ b/gcc/init-regs.c > @@ -21,6 +21,7 @@ along with GCC; see the file COPYING3. If not see > #include "system.h" > #include "coretypes.h" > #include "backend.h" > +#include "target.h" > #include "rtl.h" > #include "tree.h" > #include "df.h" > @@ -101,6 +102,10 @@ initialize_uninitialized_regs (void) > rtx_insn *move_insn; > rtx reg = DF_REF_REAL_REG (use); > > + if (targetm.register_reject_init_p > + && targetm.register_reject_init_p (reg)) > + continue; > + > bitmap_set_bit (already_genned, regno); > > start_sequence (); > diff --git a/gcc/target.def b/gcc/target.def > index 7676d5e626e3..c2b54421618d 100644 > --- a/gcc/target.def > +++ b/gcc/target.def > @@ -4545,6 +4545,14 @@ by a subtarget.", > unsigned HOST_WIDE_INT, (void), > NULL) > > +/* Return true if reject initialization for a uninitialized register. */ > +DEFHOOK > +(register_reject_init_p, > + "This target hook should return @code{true} if reject initialization for a uninitialized @var{reg}.\n\ > +\n\ > +The default value of this hook is @code{NULL}.", > + bool, (rtx reg), NULL) > + > /* Functions relating to calls - argument passing, returns, etc. */ > /* Members of struct call have no special macro prefix. */ > HOOK_VECTOR (TARGET_CALLS, calls) > -- > 2.24.3 (Apple Git-128) > To declare a filtering error, please use the following link : https://www.security-mail.net/reporter.php?mid=1dac.61125d35.60598.0&r=marc.poulhies%40kalray.eu&s=gcc-patches-bounces%2Bmarc.poulhies%3Dkalray.eu%40gcc.gnu.org&o=Re%3A+%5BPATCH%5D+Adding+target+hook+allows+to+reject+initialization+of+register&verdict=C&c=531bdddedefc24be9cb5af751a905f00acebd76f --4CF1C3237ED.1628593463/fx409.security-mail.net--