From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by sourceware.org (Postfix) with ESMTPS id 27AE33858D32 for ; Sun, 19 Nov 2023 05:52:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 27AE33858D32 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 27AE33858D32 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::62d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700373151; cv=none; b=AdV97KqybtVop7VtZ6jzPfHa1ZcG6AQ4HnE9X1YHnDMxo16nhgaXiD/aZg6qghLJRkcwnICHniB/k10ZmJ3cpXWA5Tr/ZNnQ3EHS8a54h+cOqtYorrXP6FEcx6zp/2y5sQg4DnuTp2TvBJhIyL3hku7gcB2Y6cnQ3X1Mb8Yt9vg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700373151; c=relaxed/simple; bh=ZDe4HWwoylKlI5Ix9b9dNSX7HdI485VXgtOcMBGk9vw=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=MrmygcTkPfViYc33WJ3GZwuc3y73S+hlSOcMntfBZ6p3Wv136ldZ6mJ1mbRsjqauJVqC3VS3vQa6A0SDMGMJmeVS3lAjPBWjVEYwS1UbpQIMrYIIHAMmPIf6wm1oKHSDQ4uQnfDEVd5kqkTtzBEJhpQTaJpXknFuBQHq6b5Y/jE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-9c773ac9b15so446820966b.2 for ; Sat, 18 Nov 2023 21:52:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700373148; x=1700977948; darn=gcc.gnu.org; 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=WBXmM8C6N//3+2QvC9dhMFwYzdE3FyxTmSjzoZbi3iE=; b=IZ7gQ6SfuoactOME2b2V8dFtLMLEkItafZzXhATf3xzu7xOPyG5F3NlUx4HfBir3/S L10iMw/zRKIKZx0d2B8ZBcqesbpvJMZQr2dPc5zdM1xd75bA3Ar/TXQMPjr12hMFZ5LP 5Wp66tgpI56fEJ3nFhyYUbbtTUZ3TJg3xVWeAWDi7NqG5wciRdtwwNEdZ/Gwy7lHBEE9 v2GUd/GGNGuVQNzrbavyJZ4hMBnZgNiN2vzbZcuk7qtf/fg5qIgnVDpZrrGEAYWn0BJc wVUH87DlS7BkJSAoQg+0wAT9UwmD12ZdOYTDAeCbVGEIKnPNpMmrjS9ZM5XbuMls5GFK PpeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700373148; x=1700977948; 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=WBXmM8C6N//3+2QvC9dhMFwYzdE3FyxTmSjzoZbi3iE=; b=nZVIQcwAemBBCm5JmVRFGvua735dnR0VToULbOl6PYxdjVJC+h5mKPsHr+ik7paSS6 as40Qdx9PKmxi+qHqeS/9pH9MBMn979wrayIencJ/xgWE2FXVVQw7r62g1pnfNqAk2eo FMBYy5LS4aKWSQ3UrIfwp9bVDCpIDxfs5zgLybQdz0Rmew+7EPQGu5EifrgBS24th8hV Mh1/QU/QENggXglhx2AkZdViKmd6LvLLCW0TzEarEz/03wTs6nXtX3SvaT9yt5wxg6ok qRvWIRz/3zGuK7uIFQ/jZxmaOVAOLgxkPaBEmVZNBy28NuRobc3wySGE7EVG3yHUB5m6 nAdA== X-Gm-Message-State: AOJu0Yzko57xwyyZn9yj/bdVv1rTM2uee68T/4ogIaWq3hv/WNTal4uY 24fYoXtoWC+9Tu5iXyrxGVFUKEfj2lvtie69fY3hJSR4rNI= X-Google-Smtp-Source: AGHT+IFqHaEFqDAHaJtzIt7cT6szQpDjRRAUMsxPWUwEi2qCLnRICY/ezwWgSmX1ezQ42Dwh1wpkMqX4nXEfTjxYmPs= X-Received: by 2002:a17:906:51cf:b0:9e4:7d6:3730 with SMTP id v15-20020a17090651cf00b009e407d63730mr2336226ejk.11.1700373147284; Sat, 18 Nov 2023 21:52:27 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Kito Cheng Date: Sun, 19 Nov 2023 13:52:14 +0800 Message-ID: Subject: Re: [PATCH 00/44] RISC-V: Various if-conversion fixes and improvements To: "Maciej W. Rozycki" Cc: gcc-patches@gcc.gnu.org, Andrew Waterman , Jim Wilson , Palmer Dabbelt Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3.0 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: quick response for this patch set, it's a really huge number of patches, so I'll review it individually, and feel free to commit individual one once got LGTM for each single patch :P On Sun, Nov 19, 2023 at 1:35=E2=80=AFPM Maciej W. Rozycki wrote: > > Hi, > > This patch series has come out from a simple change to add generic > conditional-move and conditional-add expansions for a yet-out-of-tree > target, which has relatively expensive branches and no conditional > operations beyond the base architecture conditional-set instructions. At > one point I have concluded it may make sense to release this code to the > general public, especially as some of the conditional execution sequences > will trigger for targets we already have support for. Naturally as a par= t > of a proper upstream submission I chose to add suitable test cases. > > Now these test cases triggered a lot of issues in our existing code and > as I fixed them what was supposed to be a couple of patches has turned > into this humongous patch series, including a branch costing model rework= . > Oh well. > > Please see individual change descriptions for the details. The overall > patch series structure is as follows: > > - 01-02 add test cases covering the existing state that won't change > throughout the patch series, > > - 03-08 make small preparatory clean-ups that do not change semantics, > > - 09-13 implement a branch cost model rework and add the associated test > cases, > > - 14-24 make various improvements for integer conditional operations and > add the associated test cases, > > - 25-28 add generic `movMODEcc' support and the associated test cases, > > - 29-31 add generic `addMODEcc' support and the associated test cases, > > - 32-44 make various improvements for floating-point conditional > operations and add the associated test cases. > > There is potential here for middle end improvement, in particular branch > costing is already documented in if-cvt.cc to be intended to consistently > use BRANCH_COST, and then the generic conditional-move and conditional-ad= d > sequences could I suppose be emitted there in a target-agnostic way rathe= r > than being supplied by the backend. This I suppose could be investigated > in the future if the RISC-V approach turned out potentially useful for > other targets. > > This has been so far verified as follows, using SiFive HiFive Unmatched > hardware and the `riscv64-linux-gnu' target: > > - New target test cases have been run with `-mtune=3Dsifive-5-series', > `-mtune=3Dsifive-5-series/-march=3Drv32gc/-mabi=3Dilp32d' and > `-mtune=3Dsifive-5-series/-mmovcc/-mbranch-cost=3D8' DejaGNU board opti= ons. > > - The C language test suite has been run at significant points in the > patch series with `-mtune=3Dsifive-5-series' and (past 26/44) also with > `-mtune=3Dsifive-5-series/-mmovcc/-mbranch-cost=3D8', and selectively w= ith > `-mtune=3Dsifive-7-series' and > `-mtune=3Dsifive-7-series/-mmovcc/-mbranch-cost=3D8' DejaGNU board opti= ons. > > Since this is huge and every test iteration takes a couple of hours I wil= l > continue running testing and may investigate running QEMU testing for the > features the Unmatched does not support such as Zicond. I don't expect > real issues however. > > There are a bunch of issues triggered with `-mmovcc/-mbranch-cost=3D8' o= r > with lone `-mbranch-cost=3D8' even and the vector test cases, which are > either due to match patterns expecting an assembly label that has been > reordered or are similar to PR target/112092 and which are not a problem > with this patch series, but rather one with the vector testsuite or code. > > Any questions, comments, or concerns? Otherwise OK to apply? > > Maciej