From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by sourceware.org (Postfix) with ESMTPS id C639E3854835 for ; Thu, 24 Jun 2021 15:11:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C639E3854835 Received: by mail-pj1-x1033.google.com with SMTP id g4so3690854pjk.0 for ; Thu, 24 Jun 2021 08:11:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=y0xTKuZ/2MFpYLOEYR1jFzU8MLkAZvqwErCtPyr/N+c=; b=Ca4MU2ONZIPwlCbGrrlCzbQHduzBIkKjkF796XRQ5twPX/7wsrlHkceugEQFnh+Xcw fWuWR3IkE1odh1q4qN+lpFCozh1WXl8oilebhoJYwtyWvNpyYXxi5s2eWv9pM9yD7qSg 8WhxqJ5Z5F1tldNnb0vW77lMdXNxDyiI/OkGsV8WoGiTy6LHG4MTFTZaozobCmMrovwr o104UW2z4bnSEGixdHfFibxaAJefqCm+xOHt+77n7181MHjeJ2aiyEhcBWCNFMDSke7K BQBumVFwhRF8TPYK3bcWMlL2zx5eGw7DINr5vVBVhLJS4uYzRkmdeKeTUSepQaK5ZHKx gWRQ== X-Gm-Message-State: AOAM533jS8CBdAd0cuk+pK3B6NKJdm9ayGytwx+rzFD+hZciubDIzjB9 UDtEaNt9lxGCZxA9yJOTi4JZpis+00Qh5A== X-Google-Smtp-Source: ABdhPJzhVuFMxy8fz5EwWC9k4O8vjbfZv73EC20WrbUbc75GuI58AN2yzaPmklMS3OvLVmO8WCWnEA== X-Received: by 2002:a17:90a:4fe3:: with SMTP id q90mr13833963pjh.113.1624547469814; Thu, 24 Jun 2021 08:11:09 -0700 (PDT) Received: from [192.168.1.39] (65-130-1-109.slkc.qwest.net. [65.130.1.109]) by smtp.gmail.com with ESMTPSA id x5sm3183350pff.37.2021.06.24.08.11.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Jun 2021 08:11:09 -0700 (PDT) Subject: Re: [PATCH 1/7] Expand the comparison argument of fold_cond_expr_with_comparison To: apinski@marvell.com, gcc-patches@gcc.gnu.org References: <1624486755-12879-1-git-send-email-apinski@marvell.com> <1624486755-12879-2-git-send-email-apinski@marvell.com> From: Jeff Law Message-ID: <9675b02b-6cf3-a171-6fde-126d7205f6dc@gmail.com> Date: Thu, 24 Jun 2021 09:11:06 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: <1624486755-12879-2-git-send-email-apinski@marvell.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Spam-Status: No, score=-1.9 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.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2021 15:11:13 -0000 On 6/23/2021 4:19 PM, apinski--- via Gcc-patches wrote: > From: Andrew Pinski > > To make things slightly easiler to convert fold_cond_expr_with_comparison > over to match.pd, expanding the arg0 argument into 3 different arguments > is done. Also this was simple because we don't use arg0 after grabbing > the code and the two operands. > Also since we do this, we don't need to fold the comparison to > get the inverse but just use invert_tree_comparison directly. > > OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. > > gcc/ChangeLog: > > * fold-const.c (fold_cond_expr_with_comparison): > Exand arg0 into comp_code, arg00, and arg01. > (fold_ternary_loc): Use invert_tree_comparison > instead of fold_invert_truthvalue for the case > where we have A CMP B ? C : A. OK jeff