From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by sourceware.org (Postfix) with ESMTPS id CA44E3858D39 for ; Sun, 30 Apr 2023 19:37:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CA44E3858D39 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-pf1-x432.google.com with SMTP id d2e1a72fcca58-63b70f0b320so2184065b3a.1 for ; Sun, 30 Apr 2023 12:37:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682883424; x=1685475424; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=jNCGTEk6ns+ac67FbJ5PnjugXf7D/oVqKvpzbhwugkI=; b=CXOjG54QMGtkLV+QJj9I4muofJc+qwd3TqZlsrwf6316L59bh8tQ9J6ki/hCzWb2g+ jgGIBTK1JucNADVmJ0D+GifdvIMpuyUauTqses0K1DHSEu+PtqRp0m8UwyqGFOjg5CQR Dag0Hu6UTsmf52pk+aU0eiBe5xcfF1pQ1atTHnVduPKfuWRDLu2fTaNpKLxb/fdsw7sV S8+kilnhrtabHjwMMlvnOmxu/ERjxHmRuKui9pX6XyMNUwKhi/wnj9dUqVEHKmnrL/Hl Je8IP7XQxu+ugqvxT3KWaKQikyFK6tDL3rPFlwad9/c+XEqRC0xgNKZDzAle5qbHLuJ0 tWmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682883424; x=1685475424; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jNCGTEk6ns+ac67FbJ5PnjugXf7D/oVqKvpzbhwugkI=; b=jkkxRGYv42NP6V9sbOLqh7XkmZ9cV9UtnyB6VTNV1ok7oIfuzfHiiQP8t3D/dKp2hY 73GHSdLcBusa0hf9aaksaF/KrvZcRkWHX2QtBN4m12Q0ZXEexuaFBW1NogMQCjB+DxMq jLyUU3nxWzR+jD1fI+T4b64jHBfP8Cr1FNc2WDwUHaNMbjmiHRUJT1CirycLW1XrZX/r byjTF5s2jTDJ4YPw3tD9/GG/2Hm03sBcGE2n07+Uzxpp3X7siX0pOrPCDeWtAue1X+a5 AVGj4NklmrndW8IVsyFRhfHyxa2piMO8ihA9I441E2VkEGqJO0ZnKh0e1LG4RozzuMsB IaAg== X-Gm-Message-State: AC+VfDxwrg1CiuW4q2BkDczRMAnHqnc7hDnWvkIrD4er6rE5uvfQ95XH 3oWJyBQQcTT3pcdC+OUu2Rg= X-Google-Smtp-Source: ACHHUZ7/8/iTcVR7Nh35B43XU5Z6eQtrXYi4ajfFScMrdSwie7WaO+M3fVw2ylLT2QtOwPrAuTzq3Q== X-Received: by 2002:a05:6a00:1255:b0:63c:6485:d5fd with SMTP id u21-20020a056a00125500b0063c6485d5fdmr16167072pfi.2.1682883423700; Sun, 30 Apr 2023 12:37:03 -0700 (PDT) Received: from ?IPV6:2601:681:8600:13d0::99f? ([2601:681:8600:13d0::99f]) by smtp.gmail.com with ESMTPSA id z21-20020a62d115000000b0063d24fcc2b7sm18583322pfg.1.2023.04.30.12.37.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 30 Apr 2023 12:37:03 -0700 (PDT) Message-ID: <1995c643-47bb-6376-ce72-d5440e59196b@gmail.com> Date: Sun, 30 Apr 2023 13:37:01 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH] Canonicalize vec_merge when mask is constant. Content-Language: en-US To: liuhongt , gcc-patches@gcc.gnu.org Cc: crazylht@gmail.com, hjl.tools@gmail.com References: <20230420035821.4113007-1-hongtao.liu@intel.com> From: Jeff Law In-Reply-To: <20230420035821.4113007-1-hongtao.liu@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.3 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,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 4/19/23 21:58, liuhongt via Gcc-patches wrote: > Use swap_communattive_operands_p for canonicalization. When both value > has same operand precedence value, then first bit in the mask should > select first operand. > > The canonicalization should help backends for pattern match. .i.e. x86 > backend has lots of vec_merge patterns, combine will create any form > of vec_merge(mask, or inverted mask), then backend need to add 2 > patterns to match exact 1 instruction. The canonicalization can > simplify 2 patterns to 1. > > Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}, aarch64-linux-gnu. > Ok for trunk? > > gcc/ChangeLog: > > * combine.cc (maybe_swap_commutative_operands): Canonicalize > vec_merge when mask is constant. ISTM that if we're going to call this the canonical form, then we should document it in rtl.texi. Otherwise it looks pretty good to me. So let's get the docs updated and get this installed. jeff