From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by sourceware.org (Postfix) with ESMTPS id 50EDB3853D74 for ; Mon, 21 Nov 2022 17:40:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 50EDB3853D74 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-pj1-x102d.google.com with SMTP id 71-20020a17090a09cd00b00218adeb3549so3534460pjo.1 for ; Mon, 21 Nov 2022 09:40:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=zBHOIZvu37dozwLgQxN4jsOpiA6ePzmrz9pLNX9INI0=; b=b7Tw1BfunJY/pCvJ0D0Bx8Z+1/IDOjHF/Q7lyFIGNjk/oIg7pOAjPbwI9zC59AlOCv xzv6VZp6Dss3MIsLGG9PBQx32EFiD/ZUj3cLv7trmc2qVsZhpIodb1Pu60stFkXp34if bn3FV2t28jACDaQ8OBAYjmEv9tE84afxQfzHn5DydsS4AVS1gUaHyTpxBeyI4seX+AlZ 6L2heqf0ieT5PdhsMymh9YxoV9wE4Gm0KTuE0BY4YzdX1fUj5x1I/yaZYw5m2piAkmOk QBqxR79UTYLZo2ZIMFXlFzyL6sigJP8CA1efyAisbOoE8tbCvBN2LNNLiXb34eNaHU7n J2bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=zBHOIZvu37dozwLgQxN4jsOpiA6ePzmrz9pLNX9INI0=; b=yfBkkUsMifVhjxdUBsUVNThy54FyJHT4yrk6xtlifIUJso79zIFGQZC2K3kxJee6ik Dmw9lN0jB3e/41ntTlnvDrHaz7+oB5bX/dtrtKuOhcJbwqEE241mR2iy1eBVwRPe5ouO FA/qxGywOerhBpb3sLld+2MMmZqEYxXgutPno0Qe2tUAvAO8uO5vbvOYEqY1QHlJ8JTc YY7/JapPrR46AxHfnRsLRIhIs1ivLHZ5lGguC8sZUZD9D6VuY4k7/K/XVzDgtu5ABHDV +9S0StrQxgzMg05bd0NYxiNu6aKv20zt7+rfMbaaKSuUaOTGO+UkmuaFSZWHEcvCQr0y +pCg== X-Gm-Message-State: ANoB5pm6MhoByVmR6G8xUEbHB2yWYjTEqD45Ra3FjgYmixib/yG6hVqa ZjBsFMJ3T8MGKjyF59jGQSg= X-Google-Smtp-Source: AA0mqf7DD73aIw+plpp1eVBGVFvBKGZw6wMvSRA7cly5d1pI339heZI1Q0HR3sJhuoiXMurb9rCZQQ== X-Received: by 2002:a17:90a:2ec9:b0:213:fa78:6395 with SMTP id h9-20020a17090a2ec900b00213fa786395mr27031850pjs.107.1669052455114; Mon, 21 Nov 2022 09:40:55 -0800 (PST) Received: from ?IPV6:2601:681:8600:13d0::f0a? ([2601:681:8600:13d0::f0a]) by smtp.gmail.com with ESMTPSA id 85-20020a621958000000b0056b4c5dde61sm9237488pfz.98.2022.11.21.09.40.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 21 Nov 2022 09:40:54 -0800 (PST) Message-ID: <72ce55ba-2cda-6185-b89a-6d30ea95a383@gmail.com> Date: Mon, 21 Nov 2022 10:40:52 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH] i386: Only enable small loop unrolling in backend [PR 107602] Content-Language: en-US To: Hongyu Wang , gcc-patches@gcc.gnu.org Cc: richard.guenther@gmail.com, ubizjak@gmail.com, hongtao.liu@intel.com References: <20221119062532.75190-1-hongyu.wang@intel.com> From: Jeff Law In-Reply-To: <20221119062532.75190-1-hongyu.wang@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,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 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. jeff