From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw1-x112d.google.com (mail-yw1-x112d.google.com [IPv6:2607:f8b0:4864:20::112d]) by sourceware.org (Postfix) with ESMTPS id 5C0D03858296 for ; Tue, 22 Nov 2022 01:05:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5C0D03858296 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-yw1-x112d.google.com with SMTP id 00721157ae682-37063f855e5so130377367b3.3 for ; Mon, 21 Nov 2022 17:05:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=HVKQaxQ4Ify8vQbxWz9lX05d99pG1FrB0pHu1KwUzEc=; b=j26qObAciUCO76faD7sAuKFvTT+VF79h0HHaQfQHp0LS3R+BHpy+tyBdpFqkil2aLz yi3dXbsr4omQCC54RRmbetctZciGNGtpkQR6bzEqlKlHh8Ox60Z3sqs13b8bKBGpUnIs TGs3ia+/uHPA674Z7Dg5tekjwt1k4+6gUIPU1kEB8qsoofdXUXhWWyF1toahZtqjlHs6 H4qo1rAfwJmxX3O70bTIhmXgTAV9+J3t1R4zuGh/eMTSkOdSrEeE8lhlX/1duBmGogaE uuyP7+vfjBz3RwXehY3bArwmHiAvRFhyRkp2xdJmGW2d3BMWRyfeEoWcRoTW6rHol0oY hskg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=HVKQaxQ4Ify8vQbxWz9lX05d99pG1FrB0pHu1KwUzEc=; b=RwTsYnqO8I6+u8FQwAR9GAW7e4Z0B0JN8o6Yt08cn4jDhCyQ+bvOXPV9uOZNqMebNO 8HcA/Oz0v5Ewni+ivCAjIZ4nsXPkn1jUm/iIwHd1N0cWF2bfUGHoLRXHaSBGMxkR3KOp cQzJYjoRTWqJQ/XSQTTxn8rXtHCkVuFkpCEW5gLT+yfyhy5rTPJ7GQCl+4TwY6swIzou CSisgA0rhX9iuB4M7bUgLiumFsi38NeI5VCxFaqSeksPPuhi4ytCN6ld9PtbhLplDtny cJNL1j/E8dX8eYKpfEPKUf7YvHah/KQ893xCwyw+J5vWRavkBD1rMLfiSQd3MlJ0g8wE ja5g== X-Gm-Message-State: ANoB5pmY5h4GqXmW4wKsLh8DxhXtiOKxev0rFEVPm5fDftdnare7TBWR KcWQrhNZcwYgqddTOMoWiVajGPevbyQNg4vYtls= X-Google-Smtp-Source: AA0mqf5H505YkhDoGtl1mdnhQsO7URSwR56x9CvZ56wPFA+NS6VpBnDWYpCf6m6Rpdr0IAhJxJjTtBhwAsn1fL/5JB8= X-Received: by 2002:a81:52d8:0:b0:3aa:e921:3139 with SMTP id g207-20020a8152d8000000b003aae9213139mr243397ywb.486.1669079108720; Mon, 21 Nov 2022 17:05:08 -0800 (PST) MIME-Version: 1.0 References: <20221119062532.75190-1-hongyu.wang@intel.com> <72ce55ba-2cda-6185-b89a-6d30ea95a383@gmail.com> In-Reply-To: <72ce55ba-2cda-6185-b89a-6d30ea95a383@gmail.com> From: Hongtao Liu Date: Tue, 22 Nov 2022 09:08:17 +0800 Message-ID: Subject: Re: [PATCH] i386: Only enable small loop unrolling in backend [PR 107602] To: Jeff Law Cc: Hongyu Wang , gcc-patches@gcc.gnu.org, richard.guenther@gmail.com, ubizjak@gmail.com, hongtao.liu@intel.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,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 Tue, Nov 22, 2022 at 1:41 AM Jeff Law via Gcc-patches wrote: > > > On 11/18/22 23:25, Hongyu Wang via Gcc-patches wrote: > > Hi, > > > > Followed by the discussion in pr107602, -munroll-only-small-loops > > Does not turns on/off -funroll-loops, and current check in > > pass_rtl_unroll_loops::gate would cause -funroll-loops do not take > > effect. Revert the change about targetm.loop_unroll_adjust and apply > > the backend option change to strictly follow the rule that > > -funroll-loops takes full control of loop unrolling, and > > munroll-only-small-loops just change its behavior to unroll small size > > loops. > > > > Bootstrapped and regtested on x86-64-pc-linux-gnu. > > > > Ok for trunk? > > > > gcc/ChangeLog: > > > > PR target/107602 > > * common/config/i386/i386-common.cc (ix86_optimization_table): > > Enable loop unroll O2, disable -fweb and -frename-registers > > by default. > > * config/i386/i386-options.cc > > (ix86_override_options_after_change): > > Disable small loop unroll when funroll-loops enabled, reset > > cunroll_grow_size when it is not explicitly enabled. > > (ix86_option_override_internal): Call > > ix86_override_options_after_change instead of calling > > ix86_recompute_optlev_based_flags and ix86_default_align > > separately. > > * config/i386/i386.cc (ix86_loop_unroll_adjust): Adjust unroll > > factor if -munroll-only-small-loops enabled. > > * loop-init.cc (pass_rtl_unroll_loops::gate): Do not enable > > loop unrolling for -O2-speed. > > (pass_rtl_unroll_loops::execute): Rmove > > targetm.loop_unroll_adjust check. > The reversion of the loop-init.cc changes is fine. The x86 maintainers > will need to chime in on the rest. Consider installing the loop-init.cc > reversion immediately as the current state has regressed s390 and > potentially other targets. x86 part is ok. > > > jeff > -- BR, Hongtao