From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by sourceware.org (Postfix) with ESMTPS id 9B01A3858035 for ; Wed, 23 Nov 2022 01:53:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9B01A3858035 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-ej1-x636.google.com with SMTP id m22so39609129eji.10 for ; Tue, 22 Nov 2022 17:53:33 -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=WjvsPm7v+fm/n06sWg1RvIiqKOQrLuZX1tX/goqntkI=; b=i/aypLn7RI+dqYK9YzDnnp589iTlcUeO2mDMRo8K/SoVlSwXqwXpm9+llRvYQ+YC3K bMgUonqCXR7gtahLc6mpyxq9jzWFBi85pfpcLO2ucEUd1UFlHF8UxfteDGRwblWISMCb yFwOYonGCotxidvW19+1M+5YaPzIVCPsTuFpGH4bdALcZ47ai0cuDoixkfFLBCE4Z5Di 28EQrbrdELLClH136Qde7JS6cGkkR0CkQ4UdtIqMRp51T0d6yxWYfRI0cc42EtYfb7je SrnVZEOYUkEvjOU9BcToU16KWfFW8I57xo0qX4nS9uuMoX9EmtkpdGXDqXRVN9qj683j mVPg== 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=WjvsPm7v+fm/n06sWg1RvIiqKOQrLuZX1tX/goqntkI=; b=yM4W5AZns40BKyM/bJ4G27OxdJN5jRlzF3Z+MqFyDS1puu0EP/Yv6VfJStAmV1UU/u C9iuJibRjJ6lc0fx5kCiSNF4ut8BWZIGl3IrnjQwok4xr+Jk0MIXHcUiQ21KjCDtudWj MgEL1y5JMqoGnEgBWsfUwbwuZq32wB/0mDYf0XHX08v5WCbIFinP2ebvo/qAv4zzEeT5 Ck2Ap1A9acgY+Aac2CIXU8jgkumjGAAjqu6ADuabzX9gEAKE02DRKtGe/FilHDBOayVu bPyUkiMSsA0tb7WTt4J2sn/nrl//ctgKwPpUVgrxLNEB40tfyXCA/qKz0d73RgzcwyFG TLYw== X-Gm-Message-State: ANoB5pn8LQz1yAYcTnEsTCMo3Uv+0FkqYsKt/PvcNxwKEsUrcL1y/Qyh X3e5rRhciUT4uaZcQ4DTiTQvoAnQAsEpJQ5fENw= X-Google-Smtp-Source: AA0mqf7ayHxSbWWr1+FReCqVRZUKSOQqEykReZhRjarU5th1Raoz5f2FSXPWokTpIfF8EYAOkO4rGfZM9KSeTIm0NLk= X-Received: by 2002:a17:906:8a6d:b0:7ad:d18f:c2d6 with SMTP id hy13-20020a1709068a6d00b007add18fc2d6mr22385182ejc.271.1669168412206; Tue, 22 Nov 2022 17:53:32 -0800 (PST) MIME-Version: 1.0 References: <20221116235429.25268-1-hongyu.wang@intel.com> <20221118144600.GZ25951@gate.crashing.org> In-Reply-To: From: Hongyu Wang Date: Wed, 23 Nov 2022 09:53:20 +0800 Message-ID: Subject: Re: [PATCH] rs6000: Adjust loop_unroll_adjust to match middle-end change [PR 107692] To: Richard Biener Cc: Segher Boessenkool , Hongyu Wang , gcc-patches@gcc.gnu.org, dje.gcc@gmail.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,KAM_SHORT,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: Hi, Segher and Richard > > Something in your patch was wrong, please fix that (or revert the > > patch). You should not have to touch config/rs6000/ at all. > > Sure something is wrong, but I think there's the opportunity to > simplify rs6000/ and s390x/, the only other two implementors of > the hook used. If I understand correctly, the wrong part is we should not break the logic of -funroll-loops and check OPTION_SET_P in targetm.loop_unroll_adjust to pretend the loop-unrolling is disabled with -fno-unroll-loops. I don't have a good idea to resolve this, perhaps add another hook and check OPTION_SET_P (flag_unroll_loops) && munroll_only_small_loops there and use that hook in rtl_loop_unroll::gate (), but still it doesn't work if we want to strictly follow the logic that -munroll-only-small-loops should not enable loop unrolling. IMHO the middle-end part with target hook looks quite tricky (and of course the OPTION_SET_P in the target hook). So Richard if you agree, I'd like to install the reversion patch posted in https://gcc.gnu.org/pipermail/gcc-patches/2022-November/606774.html and move all them to the backend first. -- Regards, Hongyu, Wang