From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by sourceware.org (Postfix) with ESMTPS id B5D733858D28 for ; Mon, 24 Apr 2023 12:02:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B5D733858D28 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-x232.google.com with SMTP id 38308e7fff4ca-2a8db10a5d4so41885791fa.1 for ; Mon, 24 Apr 2023 05:02:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682337751; x=1684929751; 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=1i4ZeKkrKh1xQLJldY3XPJrcMVn434BYaz/w2cHtt3k=; b=TtD3xR/mtpUhREz798+3yn08Q0ns1DgtPCwQwFS+KBe1fv5eaxZfvQ7utsHGI+hhvq rY3COfzozZRdo5N1ztXznwLIW1+DtWQxRa5NhOTlmxrp3fqp+NuXyS4NoAicRmuvDubt 9Kuz0sBAMm3s9l2J/rjKOiuAeZ4oUGLlu7jPZFkUVFQXsKQ+it6GDuqGZ+UEl7WegfDq rcWs/8DjUIJSausiliyfSzFf8tueYFIZ/0pH6LAv98EACI5s2XLWaQPRyzzEJq46dWbs 4Q4sxGMYqFtaNMX7idef++FS+tgpQ4xeNa+8hCV1gWUddTqLyE8XTM0zwQmruFpNvTyv 5kqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682337751; x=1684929751; 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=1i4ZeKkrKh1xQLJldY3XPJrcMVn434BYaz/w2cHtt3k=; b=TH7bnltY+EblJI6PfpIrPCuWAO6YjNhGp/nzgCoUKrdWYqOIqrxlNtVj9YFRB4NA9I 0rGKNUA3S75GC87l8qrgbsgTy6YDY3IwcI2DyAaabsNXeEHCDIfh++C09E5uVnHKWZq1 4pcs7EAaoBjTw5xZUsLxyM9afmMD94uoqpwPpmoHvQgWxT8qxynhiywk5/arxbtuExbY r5SIycUEVxwXD/vgm/WPPC2WPV/AqLw24vhSDXMxFQMC2ow5iIC/doPxzswMZomynRLh 1YazW52H2fZiJ1SzprUYEhVEfrwwzUsEU4WKqBTSujL0QSHbAvGgxLAspvton9c8/7Vq AAOg== X-Gm-Message-State: AAQBX9fSjj3pEQ2L/WJtZMwjqNepo+MnFlFKZemocm7EvVwUNvtsIJUX qW48/USkIV2Um0nLSle+XutUZltVyn5viIsHgWAYH8TE X-Google-Smtp-Source: AKy350Zn7QFUBekOuUqEl4T7+SuW/+Q36y8MLN88FFGzZx1E7Qca1hNJI2uxv3KfznvgFEQ/YYRYSzKELlQqafrV4w4= X-Received: by 2002:a2e:800c:0:b0:2a8:b133:6597 with SMTP id j12-20020a2e800c000000b002a8b1336597mr2520035ljg.9.1682337751077; Mon, 24 Apr 2023 05:02:31 -0700 (PDT) MIME-Version: 1.0 References: <20230422220921.452264-1-apinski@marvell.com> <20230422220921.452264-2-apinski@marvell.com> In-Reply-To: <20230422220921.452264-2-apinski@marvell.com> From: Richard Biener Date: Mon, 24 Apr 2023 14:01:05 +0200 Message-ID: Subject: Re: [PATCH 1/6] PHIOPT: Move check on diamond bb to tree_ssa_phiopt_worker from minmax_replacement To: Andrew Pinski Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,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 Sun, Apr 23, 2023 at 12:11=E2=80=AFAM Andrew Pinski via Gcc-patches wrote: > > This moves the check to make sure on the diamond shaped form bbs that > the the two middle bbs are only for that diamond shaped form earlier > in the shared code. > Also remove the redundant check for single_succ_p since that was already > done before hand. > The next patch will simplify the code even further and remove redundant > checks. OK. > gcc/ChangeLog: > > * tree-ssa-phiopt.cc (tree_ssa_phiopt_worker): Move the > diamond form check from ... > (minmax_replacement): Here. > --- > gcc/tree-ssa-phiopt.cc | 14 ++++++++------ > 1 file changed, 8 insertions(+), 6 deletions(-) > > diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc > index d886c88215b..296ba646e62 100644 > --- a/gcc/tree-ssa-phiopt.cc > +++ b/gcc/tree-ssa-phiopt.cc > @@ -220,6 +220,14 @@ tree_ssa_phiopt_worker (bool do_store_elim, bool do_= hoist_loads, bool early_p) > continue; > } > > + if (diamond_p) > + { > + if (!single_pred_p (bb1) > + || !single_pred_p (bb2) > + || !single_succ_p (bb2)) > + continue; > + } > + > if (do_store_elim && !diamond_p) > { > /* Also make sure that bb1 only have one predecessor and that i= t > @@ -2032,12 +2040,6 @@ minmax_replacement (basic_block cond_bb, basic_blo= ck middle_bb, basic_block alt_ > tree alt_lhs, alt_op0, alt_op1; > bool invert =3D false; > > - if (!single_pred_p (middle_bb) > - || !single_pred_p (alt_middle_bb) > - || !single_succ_p (middle_bb) > - || !single_succ_p (alt_middle_bb)) > - return false; > - > /* When THREEWAY_P then e1 will point to the edge of the final tra= nsition > from middle-bb to end. */ > if (true_edge =3D=3D e0) > -- > 2.39.1 >