From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by sourceware.org (Postfix) with ESMTPS id AA71F3858D1E for ; Tue, 25 Apr 2023 07:21:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AA71F3858D1E 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-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2aa39ce5d26so44494321fa.1 for ; Tue, 25 Apr 2023 00:21:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682407312; x=1684999312; 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=hJo9w53A17gNel3PP/jtQjSqYR/nIcXzuckRxXrvVLM=; b=TKVvULWWv3WhnLooRSAJPI3HcLq88X68TMUnm342Z+XXVZIJVllAUuw6og0MR3n/7t L6Nrf+pcnuvJNXO3y1UEtFM6Qe18qb8N2To3ZDYfQj0F0Em67SszBxRFXdrxydHP2Tdm MTlinjnb5HYx6hKgnFgGjVLETOymC95J+SELg63TJAlZ+af59IzzUZMQOCbN72gW7+Fg NSqqz2LP6s1H3tyyNR8GvxBxAv2C0Hj5oAFXY+PwrA3ltCWKEjsmOiCslg3WbwdPZwd+ 9SpWrkW24/lua04BArsZZ7ZOuwuvaks18hMC3X30b2WNxUAReQNQmHy5wXf1xornR+Il +Twg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682407312; x=1684999312; 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=hJo9w53A17gNel3PP/jtQjSqYR/nIcXzuckRxXrvVLM=; b=BhuPCGIn7/tlknpKEP/zyEaee0MbRcFDYnhba/9yd6/MYVhg9rNibiRaO5UNp+9ohU pCBzfCW5JJp0XNforaQn6OteGkBjmIfPYGgbiJrxbBohWobu/WzepQSgLZ8ss+yTJ8WM ZprX6yp+OEJ/RWooCGDrOpehzmwwOOIdlz2m6/fFuyYt4dRZJifGyyjQdnUHIcTUFL70 IYsQQvWwCzQzV/Cqjzi1V8l9BZsXtf2t7zh4Bbiy88wgXMuufTuqNM+HGg0l/FdwtS2N HONCJVvEXm49soOqlJf9I7HAHa+XDk20+Eqs9rjiaq132YWZg2lz9kBNV+IF7c7DsDRX orgg== X-Gm-Message-State: AAQBX9cWPpy7dVts6Yqt81iQ0tJIOtVYHPmXWA9yamHhdAvj5DprUOB8 6+V7A3I1NY/RyZgAE/wY6CjA3NeXy5N6UCkHYlM= X-Google-Smtp-Source: AKy350b1QWIVvd00JIp+VgAJ179p6gVOmm6s2DUcFwI8SsM9xqT2sDOEBcwHAXE9GWghiRCswpbAh6zNaG0xLvtcnI4= X-Received: by 2002:a2e:9e17:0:b0:2a8:b300:acb5 with SMTP id e23-20020a2e9e17000000b002a8b300acb5mr3101144ljk.9.1682407312079; Tue, 25 Apr 2023 00:21:52 -0700 (PDT) MIME-Version: 1.0 References: <20230316152706.2214124-1-manolis.tsamis@vrull.eu> <8bd8b246-a252-0e05-414c-ab1e35975aea@gmail.com> In-Reply-To: <8bd8b246-a252-0e05-414c-ab1e35975aea@gmail.com> From: Richard Biener Date: Tue, 25 Apr 2023 09:21:39 +0200 Message-ID: Subject: Re: [PATCH v1] [RFC] Improve folding for comparisons with zero in tree-ssa-forwprop. To: Jeff Law Cc: Philipp Tomsich , Manolis Tsamis , Andrew MacLeod , gcc-patches@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.5 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,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: On Tue, Apr 25, 2023 at 1:05=E2=80=AFAM Jeff Law wr= ote > > > > > On 4/24/23 02:06, Richard Biener via Gcc-patches wrote: > > On Fri, Apr 21, 2023 at 11:01=E2=80=AFPM Philipp Tomsich > > wrote: > >> > >> Any guidance on the next steps for this patch? > > > > I think we want to perform this transform later, in particular when > > the test is a loop exit test we do not want to do it as it prevents > > coalescing of the IV on the backedge at out-of-SSA time. > > > > That means doing the transform in folding and/or before inlining > > (the test could become a loop exit test) would be a no-go. In fact > > for SSA coalescing we'd want the reverse transform in some cases, see > > PRs 86270 and 70359. > > > > If we can reliably undo for the loop case I suppose we can do the > > canonicalization to compare against zero. In any case please split > > up the patch (note > I've also > > hoped we could eventually get rid of that part of > > tree-ssa-forwprop.cc > in favor > > of match.pd patterns since it uses GENERIC folding :/). > > > Do we have enough information to do this at expansion time? That would > avoid introducing the target dependencies to drive this in gimple. I think so, but there isn't any convenient place to do this I think. I sup= pose there's no hope to catch it during RTL opts? > Jeff