From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x134.google.com (mail-il1-x134.google.com [IPv6:2607:f8b0:4864:20::134]) by sourceware.org (Postfix) with ESMTPS id 5CA07385840C for ; Wed, 17 Jan 2024 14:37:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5CA07385840C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5CA07385840C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::134 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705502257; cv=none; b=VxYaS/nVEvW0aPMGxbm0hBw5nA19LizDPxBwx1r+Bg/jqpx6D50ZDxjz7782kd2go/pPn2LRvwqjp3DeCsgE3n2YXPOvQSxJZZB1W1DF4JBJuUE1o715lmvZN/J6yViCjBBd+ao+Mp5t0K9oMzSkCMFRP4VkfWUReb41IbgWz1k= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705502257; c=relaxed/simple; bh=Ce2LUH6vLi/hkfq85AEz6YtomzESihVr2wITpTlJKXk=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=EN3WIEm0jNSYz/xEiy49wCR0mcYMBeafGr2RKFsUMsr+r9eI1i5k2yUmj8YQV5mgTR25S8+bTls1m2CbPPf/Dn5k5+KjrKgsuQ/zlng0dHuXuCoFOaDdtx5OwsB3SVhjJDbLl+KHe9rAkrFkL0Cw08z2sMkqOjplliTETQIgIlg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-il1-x134.google.com with SMTP id e9e14a558f8ab-36199ab6e68so664025ab.0 for ; Wed, 17 Jan 2024 06:37:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705502253; x=1706107053; darn=gcc.gnu.org; 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=rKhZUfeeaIuRNl0uwKAdqj6NPahd/nWp0ipIhs9syE4=; b=gVGfS5CHA32m0DlYdqkPJRatNpAUMEZL4flm2vvALNdPbhjLg9KXNEjNJ9ZR3r59QF Oj0VuvCR0aiVebP2kvnQsDWslLYfy6VVXVnrRvd5bWhmcUb7EDePfb0KZvF5zsVrTMFk /r4gp9Am+0/hm/zU9IRlbH9osbiWJKmDzzZrLCBYeZWT2xEwtkV6kjgn5uWtQtHHrlcV GzKbQHw0r9N40o93EiH1019wqwk0NTsyhMtGkzpFRtOaEKkrlYgcZWjjnDXDYgejUf5D 9ow2tKc26nGeXA5lqtJPMu/8tF6Q0YKf9TEmUygSAvhOLCJBfPkipvcjPRqUY97f4yRo r19A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705502253; x=1706107053; 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=rKhZUfeeaIuRNl0uwKAdqj6NPahd/nWp0ipIhs9syE4=; b=CYRrZN8wGYAwzBWkXbTH1lpHCGodzCrR/kalyBTXiIv3DIA9dLFlIQBnFKQQTHUGhS TnxDjuXeI1fE8kNK/ng9/DeQoX8E0gMNouur7bBqV+3knDqeQsZko+3+JMFFzIHPWttT 6TAC0Xko/nUIcx6UPbx3iGlG14/mCOvHG1BMUt0V0Zj4XcAlOoRkxJ5fzJD6sM9fs+Hm 60cqIfhaGZUPyYKsM6LeqmmQXSspQ9IqHD2/h92fEqm2OC1H//GmJqX1UKaFSfCCXvxB EF3uTGOFrrchPPu0/rZAbjRBUvy4b/bYb65Zg2huXpK93kEadlmhZ1dxOhRgFehJIpBx VzqA== X-Gm-Message-State: AOJu0YxzPuPprh80VKWN9babZ0UA2VnTd1kPpxEXfibWSrBNn5o/ErTR iauTNpXOl8thxcIvi9rhGfTbQ3iGTP+kr0wX9KPKfvDjfnerNIzf X-Google-Smtp-Source: AGHT+IFk8yPIPY9hNpZgCiUKXBZYqjbN7PuVvdWIoEi1fdTW8ELbQ3wZH2rWTXp0pXJSFFG8GEaq/Q== X-Received: by 2002:a05:6e02:1546:b0:361:9320:5b41 with SMTP id j6-20020a056e02154600b0036193205b41mr604350ilu.20.1705502253355; Wed, 17 Jan 2024 06:37:33 -0800 (PST) Received: from [172.31.0.109] ([136.36.72.243]) by smtp.gmail.com with ESMTPSA id y6-20020a02a386000000b0046e917416c8sm427387jak.89.2024.01.17.06.37.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 17 Jan 2024 06:37:32 -0800 (PST) Message-ID: Date: Wed, 17 Jan 2024 07:37:31 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] match: Do not select to branchless expression when target has movcc pattern [PR113095] Content-Language: en-US To: Richard Biener , Monk Chiang Cc: gcc-patches@gcc.gnu.org, apinski@marvell.com References: <20240117095055.119853-1-monk.chiang@sifive.com> <2qs20n6p-pnr5-72nq-00ss-3n7rr919912s@fhfr.qr> From: Jeff Law In-Reply-To: <2qs20n6p-pnr5-72nq-00ss-3n7rr919912s@fhfr.qr> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,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 1/17/24 05:14, Richard Biener wrote: > On Wed, 17 Jan 2024, Monk Chiang wrote: > >> This allows the backend to generate movcc instructions, if target >> machine has movcc pattern. >> >> branchless-cond.c needs to be updated since some target machines have >> conditional move instructions, and the experssion will not change to >> branchless expression. > > While I agree this pattern should possibly be applied during RTL > expansion or instruction selection on x86 which also has movcc > the multiplication is cheaper. So I don't think this isn't the way to go. > > I'd rather revert the change than trying to "fix" it this way? WRT reverting -- the patch in question's sole purpose was to enable branchless sequences for that very same code. Reverting would regress performance on a variety of micro-architectures. IIUC, the issue is that the SiFive part in question has a fusion which allows it to do the branchy sequence cheaply. ISTM this really needs to be addressed during expansion and most likely with a RISC-V target twiddle for the micro-archs which have short-forward-branch optimizations. jeff