From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by sourceware.org (Postfix) with ESMTPS id 780F13858CDA for ; Tue, 11 Jul 2023 06:51:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 780F13858CDA Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=vrull.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=vrull.eu Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-51e278e344bso6419518a12.0 for ; Mon, 10 Jul 2023 23:51:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; t=1689058283; x=1691650283; 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=XE/6l5w3ynVtsAtqf/eKs3h+PVy022qMQgwPcDHMrTg=; b=YeWfWuQUMZnxbM/DLJxrEwgwizUQcW0/uLI8P2w4ujwhhvcXJKoN8zn2ounKcGtkQ0 2HRg5H+kEWHkvtJN6ZT8Khi/xlvi/o/g5RhV7kVuyNLlSVcXxW2YzNo8T/zLVMDE9sPv 8qQDmtZD0XVE0rw7Ikk5kYT2WHs79we1IWfOulIMERSqJhoUDjRSbJJBO4TGkGFHJZQ9 CW1UwmMIhyc5RjN/kPPo5mutoi2flJckYQ9iy3e2quYnCsVGLYB0T2qXb8AysRxyOBFU H5/MFLDfs91EFkmfRmuXVSw8YTlI4eclRJLHZk2H6XbVOJBq7vB6VP7dM49pb3rNeyA3 kgFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689058283; x=1691650283; 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=XE/6l5w3ynVtsAtqf/eKs3h+PVy022qMQgwPcDHMrTg=; b=Rg7wxvKEANQSz1jaXVxR6qn04dVHcyLhj4RJD6GdJ36HcGywGzrXZvBXYPezfMMecz OdhOv/W7T5i9LJuQjhqoQ/fIJTQIvDVv04lYykJyndNoaDKslu9/cZzanJozYBu9ymzD PQ9jYW1K1AB2P05MEZOt0aN4DKnqHYlIYHKDZKOevisMmOjvkcshq6kzug2TOsdMkofE Otm4u3ZyfzZgRsADbQfe4fWp66kRfw6h4QrXqY4bF2As/Lv+z4SlexTjL7NI8WKOwz+r zQMPrgijVuq+sX8J0X0bMr+YkSQarl8AHh0RdaWadx4ScNXM9QuL++0znH0JyXp9KlvW clyQ== X-Gm-Message-State: ABy/qLbDr1QsgxkYxs9nmJYf51skySjwmxH/J1TuQJbl3oLS/k0nxJ80 ijMw3Zq7/lkubs8d5xbu28KsDHtjrfA8aIvXb8sgLQ== X-Google-Smtp-Source: APBJJlEGUEus/85Ik676D8O2u8yYTTUHG62JkLqkwp4E6P+j8WZ5J8RgsUOQpVt2abiL5SEaf4+ZJpBcULUaPETa8c0= X-Received: by 2002:a05:6402:120b:b0:51b:ec86:b49a with SMTP id c11-20020a056402120b00b0051bec86b49amr14086413edw.7.1689058282730; Mon, 10 Jul 2023 23:51:22 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Philipp Tomsich Date: Tue, 11 Jul 2023 08:51:11 +0200 Message-ID: Subject: Re: [PATCH v2] tree-optimization/110279- Check for nested FMA chains in reassoc To: Jakub Jelinek Cc: "gcc-patches@gcc.gnu.org" , Di Zhao OS Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Jakub, it looks like you did a lot of work on reassoc in the past =E2=80=94 could = you have a quick look and comment? Thanks, Philipp. On Tue, 11 Jul 2023 at 04:59, Di Zhao OS wr= ote: > > Attached is an updated version of the patch. > > Based on Philipp's review, some changes: > > 1. Defined new enum fma_state to describe the state of FMA candidates > for a list of operands. (Since the tests seems simple after the > change, I didn't add predicates on it.) > 2. Changed return type of convert_mult_to_fma_1 and convert_mult_to_fma > to tree, to remove the in/out parameter. > 3. Added description of return value values of rank_ops_for_fma. > > --- > gcc/ChangeLog: > > * tree-ssa-math-opts.cc (convert_mult_to_fma_1): Added new parame= ter > check_only_p. Changed return type to tree. > (struct fma_transformation_info): Moved to header. > (class fma_deferring_state): Moved to header. > (convert_mult_to_fma): Added new parameter check_only_p. Changed > return type to tree. > * tree-ssa-math-opts.h (struct fma_transformation_info): Moved fr= om .cc. > (class fma_deferring_state): Moved from .cc. > (convert_mult_to_fma): Add function decl. > * tree-ssa-reassoc.cc (enum fma_state): Defined new enum to descr= ibe > the state of FMA candidates for a list of operands. > (rewrite_expr_tree_parallel): Changed boolean parameter to enum t= ype. > (rank_ops_for_fma): Return enum fma_state. > (reassociate_bb): Avoid rewriting to parallel if nested FMAs are = found. > > Thanks, > Di Zhao > >