From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by sourceware.org (Postfix) with ESMTPS id E245F3858D28 for ; Tue, 29 Aug 2023 01:46:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E245F3858D28 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-pl1-x636.google.com with SMTP id d9443c01a7336-1bc83a96067so22746465ad.0 for ; Mon, 28 Aug 2023 18:46:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693273587; x=1693878387; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=37MbdKtse7C1Dsi+kGEDskAxzIyJ6En0byzxOCvQnQI=; b=EIXB9PWUNi3qpj6n2yUTqAe+2NRtNaelo/6oAAgw8+Sw4jcvHBN5nI0Q6vPHZU7kvj 3+CeDU4m5yey26FLM77aoBYesBz4qw8otZyX/w656zD+dowg7y/3TZic+pxYjlq9zo0k 1otZlaCLMnnVjwG66LHYwLoVp74PLB+c7rIibhwSK/h2Ey4EosloxSfmcIi5nDjcUO3t xH0RLYb+ADcqosldZgh/46M7+M3zJGYuo+S4AdtzHiY84RM1zA0piPKJI9VRVJq1Ptiu w+YDzb/u2nr/aXPoip4Q0hD/QTMmE7dxApE9qgi3b0JqVN3UEm4LugpvXg/Wz0sK83FP 64ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693273587; x=1693878387; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=37MbdKtse7C1Dsi+kGEDskAxzIyJ6En0byzxOCvQnQI=; b=XNc+lLGe+fneRXMixX9FpBYS3fbMwCZJbJma+2x6nO1+2B9guwqaqFZOjiaiqJoys+ jFy9RfON8wk1EecQinQ9FpLotBfgMyIaiuukaMO3h/Mu66Z7FtqVX+39VS9IzgVNRcHT mVo3x091LFVefQTNzhhs2xlMiyH0qWoNQdIj22Q2RcRYVgDKWv6tU7sayo8CdyHRcW7a dKckdGLsJZde/quDxYarXFJvcZHIElx4dfrZE2FXRcIa+kzfGY+WXN+LiMXF1wDxkujo vSs9QzKdiraMRXFZVs/smHdrOiXum/H4hc1uNfRPalhgLBz6IVpx47zj8ksdw5QNWzs6 uZ+w== X-Gm-Message-State: AOJu0Yz7dLwjZVCngmraD/9+uchFifp4Naax3TMmK+KAXiId5Rte2dIa ykx0ZDW2X7iWj2Xb+57S0Vs= X-Google-Smtp-Source: AGHT+IGuYFx1t+hM+XZCEAxvMjaH48Xt05NOGWthsq+24V7VQE3HcJLvCN3PpdNCv8GUZiyi2PVy1Q== X-Received: by 2002:a17:902:b58a:b0:1bb:bc6d:457 with SMTP id a10-20020a170902b58a00b001bbbc6d0457mr20310560pls.36.1693273586856; Mon, 28 Aug 2023 18:46:26 -0700 (PDT) Received: from [172.31.0.109] ([136.36.130.248]) by smtp.gmail.com with ESMTPSA id a11-20020a170902eccb00b001b86dd825e7sm8028626plh.108.2023.08.28.18.46.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Aug 2023 18:46:26 -0700 (PDT) Message-ID: <3dd78d60-0d79-bf88-28cc-b6239ebb63ab@gmail.com> Date: Mon, 28 Aug 2023 19:46:25 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH 1/2] allow targets to check shrink-wrap-separate enabled or not Content-Language: en-US To: Fei Gao , gcc-patches Cc: Kito Cheng , Palmer Dabbelt , Sinan , jiawei References: <20230828074759.21049-1-gaofei@eswincomputing.com> <20230828074759.21049-2-gaofei@eswincomputing.com> <9879d7a7-7635-b5b8-7bef-c1691208b9d8@gmail.com> <2023082909283749551438@eswincomputing.com> From: Jeff Law In-Reply-To: <2023082909283749551438@eswincomputing.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP 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: On 8/28/23 19:28, Fei Gao wrote: > On 2023-08-29 06:54  Jeff Law wrote: >> >> >> >> On 8/28/23 01:47, Fei Gao wrote: >>> no functional changes but allow targets to check shrink-wrap-separate enabled or not. >>> >>>     gcc/ChangeLog: >>> >>>           * shrink-wrap.cc (try_shrink_wrapping_separate):call >>>             use_shrink_wrapping_separate. >>>           (use_shrink_wrapping_separate): wrap the condition >>>             check in use_shrink_wrapping_separate. >>>           * shrink-wrap.h (use_shrink_wrapping_separate): add to extern >> So as I mentioned earlier today in the older thread, can we use >> override_options to do this? >> >> If we look at aarch64_override_options we have this: >> >>    /* The pass to insert speculation tracking runs before >>       shrink-wrapping and the latter does not know how to update the >>       tracking status.  So disable it in this case.  */ >>    if (aarch64_track_speculation) >>      flag_shrink_wrap = 0; >> >> We kind of want this instead >> >>    if (flag_shrink_wrap) >>      { >>        turn off whatever target bits enable the cm.push/cm.pop insns >>      } >> >> >> This does imply that we have a distinct target flag to enable/disable >> those instructions.  But that seems like a good thing to have anyway. > I'm afraid we cannot simply resolve the confilict based on > flag_shrink_wrap/flag_shrink_wrap_separate only, as they're set true from -O1 onwards, > which means zcmp is disabled almostly unless -fno-shrink-warp/-fno-shrink-warp-separate > are explictly given. Yea, but I would generally expect that if someone is really concerned about code size, they're probably using -Os which (hopefully) would not have shrink-wrapping enabled. > > So after discussion with Kito, we would like to turn on zcmp for -Os and shrink-warp-separate > for the speed perfered optimization. use_shrink_wrapping_separate in this patch provide the > chance for this check. No new hook is needed. Seems reasonable to me if Kito is OK with it. jeff