From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id D134F3858D35 for ; Thu, 9 Dec 2021 01:26:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D134F3858D35 Received: by mail-pf1-x42a.google.com with SMTP id z6so3980824pfe.7 for ; Wed, 08 Dec 2021 17:26:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=bqA3gGJ5jWWK9u9W8cMGOadYHi0KvppyVAnzK1oB9PQ=; b=l7H7nL+s7nJ9GfHuOHCslWb7tld/YIj3sQNYbHaxcnofrWMrO1/WceliPenD2VCIn8 oR7iw6DeO8QSKbSmnQ1CKdwhPCUY3vlZpLV2uuVxQ9nx56pwiw06ruLqVZ90exmpGOK1 WYadp9eYuL94jk+pq6umT97FkbkuhDzBVYYZgg5O0InlmH3y7hhzgpA9/JOPfshZTac5 L31Do4x8zHolH8o5ThvOq5Ojwi2n7X8LPkMsJfVq2BswtsUkfyBtfu3AexdtYCYksQw/ Zlt+6gVKiANtryVzb48WbIMalgsBRJA5nkjBwdCFGroj7gO0rXXDF1+Km4OKolS5KtI1 35lA== X-Gm-Message-State: AOAM531QcEIUK//8c5aIOs89raY9AJ61wO7Do3TKO0RJfUFbWNKBL5Vc 8inTboTh+oE5HEdhnPtdZF8= X-Google-Smtp-Source: ABdhPJx/TIpzb6W8z/lHmmUmOmJ/2qNTLnzjgneRjbaAoTI01w3OQLDygvBrK26UIWvnk7gz7Ykdwg== X-Received: by 2002:aa7:8017:0:b0:4ad:526b:1b54 with SMTP id j23-20020aa78017000000b004ad526b1b54mr8928947pfi.29.1639013172950; Wed, 08 Dec 2021 17:26:12 -0800 (PST) Received: from [192.168.1.15] (65-130-80-28.slkc.qwest.net. [65.130.80.28]) by smtp.gmail.com with ESMTPSA id m6sm3727701pgs.18.2021.12.08.17.26.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Dec 2021 17:26:12 -0800 (PST) Message-ID: <08d1bedd-7786-ebf4-89ff-5a782085b425@gmail.com> Date: Wed, 8 Dec 2021 18:26:11 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Subject: Re: [PATCH v3 1/7] ifcvt: Check if cmovs are needed. Content-Language: en-US To: Robin Dapp , gcc-patches@gcc.gnu.org, richard.sandiford@arm.com References: <20211206184352.42264-1-rdapp@linux.ibm.com> <20211206184352.42264-2-rdapp@linux.ibm.com> From: Jeff Law In-Reply-To: <20211206184352.42264-2-rdapp@linux.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.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.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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, 09 Dec 2021 01:26:19 -0000 On 12/6/2021 11:43 AM, Robin Dapp via Gcc-patches wrote: > When if-converting multiple SETs and we encounter a swap-style idiom > > if (a > b) > { > tmp = c; // [1] > c = d; > d = tmp; > } > > ifcvt should not generate a conditional move for the instruction at > [1]. > > In order to achieve that, this patch goes through all relevant SETs > and marks the relevant instructions. This helps to evaluate costs. > > On top, only generate temporaries if the current cmov is going to > overwrite one of the comparands of the initial compare. > --- > gcc/ifcvt.c | 174 ++++++++++++++++++++++++++++++++++++++++++++-------- > 1 file changed, 150 insertions(+), 24 deletions(-) OK.  Needs a ChangeLog entry though. Jeff