From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-xe2e.google.com (mail-vs1-xe2e.google.com [IPv6:2607:f8b0:4864:20::e2e]) by sourceware.org (Postfix) with ESMTPS id 685963858D32 for ; Mon, 8 May 2023 09:20:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 685963858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-vs1-xe2e.google.com with SMTP id ada2fe7eead31-43278f6d551so1397832137.1 for ; Mon, 08 May 2023 02:20:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683537611; x=1686129611; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=N7Oa0p18ubWQjuQ6PhDuJ3RmoxLMkZzDOfo/SmbhMB8=; b=WJfin5Yy7OWWVwPNEeOhBRdau/Y7n8hf29LWpacYClCgFderTGSVfrOtDQhsImsnsL 7cJ4EWzqxcZsRLKuHYCp/jzZLe+QQS1B7maqmEWgFd3YdoT6d5er3/VSoBf5xle1hWbQ TaNZwCbq7jN7y/k/tMW6tmYG7wYC+lADWcF6Hx7URYTqHEOlIr71Cea0h4OZwZ5ouRHc SN98+VpRKIyXNr0+XN+BOmVoZMHUYyiw7qWMZjKcy8AFql15edqi3hqMnzKQDOlPLzCB IVW2I20wP4KILONslSRIPxOTWNQ8zYDeoQYI9efjFbhl6ZbjploDvKCScnd02HazpiZM djbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683537611; x=1686129611; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=N7Oa0p18ubWQjuQ6PhDuJ3RmoxLMkZzDOfo/SmbhMB8=; b=UqzSD7wlu6Ou6fAXaEDds+ZzjuUKXwvu4zOuFTKTfMxkkPhlnFalzXyJP0I2A8dyU/ eVWa+1NgWVv2rznI7L36yYzt3bXA2CsNTX/82Md9EfXy/wWtWbRtCJqgLtk6SFBdr1hN YvC/7l9HrsdokNDP15TE2gXRXwdcgip9mV5B7Hbo71HUno1pnQZKgLyJhDSrkJGxZPmx 1tN2uLU0Dc+i+lgFTtc5gMDwUgYF887zKTdlo8l85oq3P+pCSDhO2iOomuhN5qrj9/W8 xhVGnaUANjLdBwvbQAL7YJfL7YfksgRb4kTGDOnxk3xq21secQu2HJ6076khLcl5mSZg dxRQ== X-Gm-Message-State: AC+VfDx/TyqfFJprfWLVohKPGHC1oleaVROknhAMoG/ddI9eGQLd//B6 jtpCmf5tXKgWUltPV+Wv8eHkMGxxrjMPFe0r8LA= X-Google-Smtp-Source: ACHHUZ4eTyue27C5+9Y6Bkc0Mwszft1i16VAfdXJFU2iqzC4RP+Z7ZS97Xe8IcwwbHzv+mshBAVy65gtpKS8efLM0M8= X-Received: by 2002:a67:e28a:0:b0:434:6d1b:8b15 with SMTP id g10-20020a67e28a000000b004346d1b8b15mr2802716vsf.25.1683537611471; Mon, 08 May 2023 02:20:11 -0700 (PDT) MIME-Version: 1.0 References: <20230506083939.22097-1-gaofei@eswincomputing.com> <20230506083939.22097-2-gaofei@eswincomputing.com> <20230508165427631224154@eswincomputing.com> In-Reply-To: <20230508165427631224154@eswincomputing.com> From: Kito Cheng Date: Mon, 8 May 2023 17:20:00 +0800 Message-ID: Subject: Re: Re: [PATCH 1/2] [RISC-V] disable shrink-wrap-separate if zcmp enabled. To: Fei Gao Cc: Andrew Pinski , gcc-patches , Palmer Dabbelt , jeffreyalaw , Sinan , jiawei , liaozhangjin Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,LIKELY_SPAM_BODY,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: -msave-restore is a different story; it's only enabled when the user requests, but `-march` describes the capability of the target architecture, not specify the preference of performance or size, which should be determined by -O1~-O3/-Ofast or -Os/-Oz. On Mon, May 8, 2023 at 4:54=E2=80=AFPM Fei Gao = wrote: > > On 2023-05-08 16:05 Kito Cheng wrote: > > > >> > diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc > >> > index 45a63cab9c9..629e5e45cac 100644 > >> > --- a/gcc/config/riscv/riscv.cc > >> > +++ b/gcc/config/riscv/riscv.cc > >> > @@ -5729,7 +5729,8 @@ riscv_get_separate_components (void) > >> > > >> > if (riscv_use_save_libcall (&cfun->machine->frame) > >> > || cfun->machine->interrupt_handler_p > >> > - || !cfun->machine->frame.gp_sp_offset.is_constant ()) > >> > + || !cfun->machine->frame.gp_sp_offset.is_constant () > >> > + || TARGET_ZCMP) > >> > return components; > >> > >> I think this is a bad idea. I have a use case where we use the C > >> extensions but still compile for -O2 because we want the code to be > >> fast as possible but still having the savings of the C extensions. > > > >Yeah, agree, so I would prefer to drop this from the patch series. > > Zcmp is a little different here than C. > C extension is done fully in AS. So we have the code to be > fast as possible but still having the savings of the C extensions. > > Zcmp and shrink-wrap-separate are both done in prologue/epilogue pass > and you can only have one switch active to direct sregs save and restore. > In my understanding, zcmp push and pop insns seem to > be mutually exclusive in functionality to shrink-wrap-separate. > It's not expected to see zcmp insns at the begining/end of prologue/epilo= gue, > and also repeated store/load sregs in separate blocks. > > Same for save and restore, and i guess that's why we have > riscv_use_save_libcall (&cfun->machine->frame) check here. > > BR, > Fei > > > > >> Thanks, > >> Andrew Pinski