Message ID | 20230830101400.1539313-1-manolis.tsamis@vrull.eu |
---|---|
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a7d1:0:b0:3f2:4152:657d with SMTP id p17csp4441062vqm; Wed, 30 Aug 2023 03:15:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF+w1zxSrzpUDjW4c2kebE0TkTp5dNM3kL22uaczVTIKc3XMSmFco3Jw6KsCHIM6hkUXsfM X-Received: by 2002:aa7:d0d0:0:b0:523:3853:e01a with SMTP id u16-20020aa7d0d0000000b005233853e01amr1435254edo.36.1693390513085; Wed, 30 Aug 2023 03:15:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693390513; cv=none; d=google.com; s=arc-20160816; b=rGFJy7gvOKqhxoREGYVEuIsKJ/WtAcyIjJYRM4bgnLWlDhq6w4kDB0WGkE6lONS0JC XrVlR2B6Jk9DV45NmhYxhO9UYVI9kP8g8A9h76nhZXwDR6/33FWxTYWN4Ww2TkZloSyI kjt8HmopCAFeCFa31KQwJQT7jZSdp2++SYlp0foTiRvfJXKUya6E92eI1Alq06QobPz4 vG2lfm4tSTqW5npoYwJguuMJXwMq71b1qXmPxydFxbr5nsKSuQyJj+OIbZeMFWG3HwNJ VcobjvCIY1QXvkB4+HEbxVOamf7VxQheG+yQfJqiwcPYHgOU2MYXLx2E70w2VczVR6gv /HAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :dmarc-filter:delivered-to; bh=Jzttm+PY8Rhz/O4DrvWbOQsSvbS1o0xSJjhb60RQhqY=; fh=woiY3K3H7Cf0yJyo65+kvTYqCFQ1uf3TZPnMDzMwLaw=; b=KSgyZd5OA4x4iuBkbjP0G9Tpze5mA1lx8MuEsw7okJyaJ6OIJ+Jen2xn6WyYxcYUg+ tZ6trY7STAZ2Lct2hfDv4wmxSaiQMiqHUeHpQrBEMg5378jlzZPkku4NQzSrvF6Q5B9a akXIMFzW6xDkuvOT9vikUGU7BMEtovT0HACqjmutrgHLhNhCDUNjhkLbDpoP20NsPUVr NX7Zon1Qhkgb4Cvk7nNy1JloZZSqoa0IM1KcMJbnrbQ0JNE/Y6A7TWtSIWnzDhXaOpcp HalBAlmqgXw9HzRWzMqXMvyhWolTdw+o/jBpsqiQQuMJ2k0qHc6a1oKV3i1fN4IiWTUJ Ph1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@vrull.eu header.s=google header.b=Ue5aHDU0; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id n26-20020aa7c69a000000b00522bafb8d08si5823549edq.144.2023.08.30.03.15.12 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Aug 2023 03:15:13 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=fail header.i=@vrull.eu header.s=google header.b=Ue5aHDU0; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 51F5B3856275 for <ouuuleilei@gmail.com>; Wed, 30 Aug 2023 10:14:51 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by sourceware.org (Postfix) with ESMTPS id CF8F93858C30 for <gcc-patches@gcc.gnu.org>; Wed, 30 Aug 2023 10:14:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CF8F93858C30 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=vrull.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=vrull.eu Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-500a8b2b73eso7893557e87.0 for <gcc-patches@gcc.gnu.org>; Wed, 30 Aug 2023 03:14:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; t=1693390460; x=1693995260; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Jzttm+PY8Rhz/O4DrvWbOQsSvbS1o0xSJjhb60RQhqY=; b=Ue5aHDU0U2DDC45a8T1RDROXV00Wi1zpcII/XC7kgOWz4HaR70/O4yE2E5dzKKzxc2 wiP5RSm8BBV1+smMBpsfrTjsAmHBOcjtj3QEz3k7yGqnhqJrq7hdaKLcqR9ZpmK90pfy M8j0AjdAO4dZgQyFg8Ul4+QDYl6iFXgLWUgfRNmVqHrDZnSilvYUWiIolzH3rKQ9Pjc9 8izMQPOeQXVpeuZ8sqzuQGmkl/e29mQUfO6NrHwpZC+NCLgJSZJwi18Dyu6/jminDAuB w1X/2Jw0fROf+7ICoODB5XiMw1gk/pGM6Pms7DHXq6hR6hYThNClL2NSL0bJQIcQbpcp kE6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693390460; x=1693995260; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Jzttm+PY8Rhz/O4DrvWbOQsSvbS1o0xSJjhb60RQhqY=; b=NVMbywc9m0A8WB2io/qYsRcvm5WYzHbsicmXwdnUzZG50NWqnc63je+CW13rK9wHgQ Ms6NnI92E2PVpEIHKodsjUIj5EUytNlWTDKWTvTcyGFUpcj++ITNLZNZEx6VdLRtmPls U6dsbWa+VtEL0q44L62wcouf05eeiIiwgYII3U3L680vQ9UaZMC8+6+fG+TVaohwGyuf E62cvJKRPDwoEnls3ErisYR555s62h4gdsUpJ0Ur+Z6loCBY+eu6hRqk+ihRQL7bis+5 DKpiATixe159geRCVU/9wGyzYMm74B547nnCJQRmJr57TUtBoHNfXlnYCSx4obj4wqc9 RNZQ== X-Gm-Message-State: AOJu0YxqafcKFt5tWyZvmmYzhZ2wiMWPrit673wybp5EMXm7dK482viq rUK/qYbPrnooUTsUHYktqh+URPa1bgLpHdXTH4M= X-Received: by 2002:a05:6512:130c:b0:500:cb2b:866f with SMTP id x12-20020a056512130c00b00500cb2b866fmr1434180lfu.30.1693390459732; Wed, 30 Aug 2023 03:14:19 -0700 (PDT) Received: from helsinki-03.engr ([2a01:4f9:6b:2a47::2]) by smtp.gmail.com with ESMTPSA id w7-20020a19c507000000b004fe36e673b8sm2327579lfe.178.2023.08.30.03.14.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Aug 2023 03:14:19 -0700 (PDT) From: Manolis Tsamis <manolis.tsamis@vrull.eu> To: gcc-patches@gcc.gnu.org Subject: [PATCH v3 0/4] ifcvt: Allow if conversion of arithmetic in basic blocks with multiple sets Date: Wed, 30 Aug 2023 12:13:56 +0200 Message-Id: <20230830101400.1539313-1-manolis.tsamis@vrull.eu> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, JMQ_SPF_NEUTRAL, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Cc: Jakub Jelinek <jakub@redhat.com>, Richard Sandiford <richard.sandiford@arm.com> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1775648650429644807 X-GMAIL-MSGID: 1775648650429644807 |
Series |
ifcvt: Allow if conversion of arithmetic in basic blocks with multiple sets
|
|
Message
Manolis Tsamis
Aug. 30, 2023, 10:13 a.m. UTC
noce_convert_multiple_sets has been introduced and extended over time to handle if conversion for blocks with multiple sets. Currently this is focused on register moves and rejects any sort of arithmetic operations. This series is an extension to allow more sequences to take part in if conversion. The first patch is a required change to emit correct code and the second patch whitelists a larger number of operations through bb_ok_for_noce_convert_multiple_sets. The third patch adds support to rewire multiple registers in noce_convert_multiple_sets_1 and refactors the code with a new helper info struct. The fourth patch removes some old code that should not be needed anymore. For targets that have a rich selection of conditional instructions, like aarch64, I have seen an ~5x increase of profitable if conversions for multiple set blocks in SPEC benchmarks. Also tested with a wide variety of benchmarks and I have not seen performance regressions on either x64 / aarch64. Some samples that previously resulted in a branch but now better use these instructions can be seen in the provided test cases. Bootstrapped and tested on AArch64 and x86-64. Changes in v3: - Add SCALAR_INT_MODE_P check in bb_ok_for_noce_convert_multiple_sets. - Allow rewiring of multiple regs. - Refactor code with noce_multiple_sets_info. - Remove old code for subregs. Manolis Tsamis (4): ifcvt: handle sequences that clobber flags in noce_convert_multiple_sets ifcvt: Allow more operations in multiple set if conversion ifcvt: Handle multiple rewired regs and refactor noce_convert_multiple_sets ifcvt: Remove obsolete code for subreg handling in noce_convert_multiple_sets gcc/ifcvt.cc | 403 ++++++++---------- gcc/ifcvt.h | 16 + .../aarch64/ifcvt_multiple_sets_arithm.c | 79 ++++ .../aarch64/ifcvt_multiple_sets_rewire.c | 20 + 4 files changed, 290 insertions(+), 228 deletions(-) create mode 100644 gcc/testsuite/gcc.target/aarch64/ifcvt_multiple_sets_arithm.c create mode 100644 gcc/testsuite/gcc.target/aarch64/ifcvt_multiple_sets_rewire.c
Comments
Kind ping for V3 of these ifcvt changes https://gcc.gnu.org/pipermail/gcc-patches/2023-August/628820.html Thanks, Manolis On Wed, Aug 30, 2023 at 1:14 PM Manolis Tsamis <manolis.tsamis@vrull.eu> wrote: > > > noce_convert_multiple_sets has been introduced and extended over time to handle > if conversion for blocks with multiple sets. Currently this is focused on > register moves and rejects any sort of arithmetic operations. > > This series is an extension to allow more sequences to take part in if > conversion. The first patch is a required change to emit correct code and the > second patch whitelists a larger number of operations through > bb_ok_for_noce_convert_multiple_sets. The third patch adds support to rewire > multiple registers in noce_convert_multiple_sets_1 and refactors the code with > a new helper info struct. The fourth patch removes some old code that should > not be needed anymore. > > For targets that have a rich selection of conditional instructions, > like aarch64, I have seen an ~5x increase of profitable if conversions for > multiple set blocks in SPEC benchmarks. Also tested with a wide variety of > benchmarks and I have not seen performance regressions on either x64 / aarch64. > > Some samples that previously resulted in a branch but now better use these > instructions can be seen in the provided test cases. > > Bootstrapped and tested on AArch64 and x86-64. > > > Changes in v3: > - Add SCALAR_INT_MODE_P check in bb_ok_for_noce_convert_multiple_sets. > - Allow rewiring of multiple regs. > - Refactor code with noce_multiple_sets_info. > - Remove old code for subregs. > > Manolis Tsamis (4): > ifcvt: handle sequences that clobber flags in > noce_convert_multiple_sets > ifcvt: Allow more operations in multiple set if conversion > ifcvt: Handle multiple rewired regs and refactor > noce_convert_multiple_sets > ifcvt: Remove obsolete code for subreg handling in > noce_convert_multiple_sets > > gcc/ifcvt.cc | 403 ++++++++---------- > gcc/ifcvt.h | 16 + > .../aarch64/ifcvt_multiple_sets_arithm.c | 79 ++++ > .../aarch64/ifcvt_multiple_sets_rewire.c | 20 + > 4 files changed, 290 insertions(+), 228 deletions(-) > create mode 100644 gcc/testsuite/gcc.target/aarch64/ifcvt_multiple_sets_arithm.c > create mode 100644 gcc/testsuite/gcc.target/aarch64/ifcvt_multiple_sets_rewire.c > > -- > 2.34.1 >
Hi all, Pinging once more ( https://gcc.gnu.org/pipermail/gcc-patches/2023-August/628820.html). Manolis On Mon, Sep 18, 2023 at 11:18 AM Manolis Tsamis <manolis.tsamis@vrull.eu> wrote: > > Kind ping for V3 of these ifcvt changes > https://gcc.gnu.org/pipermail/gcc-patches/2023-August/628820.html > > Thanks, > Manolis > > On Wed, Aug 30, 2023 at 1:14 PM Manolis Tsamis <manolis.tsamis@vrull.eu> wrote: > > > > > > noce_convert_multiple_sets has been introduced and extended over time to handle > > if conversion for blocks with multiple sets. Currently this is focused on > > register moves and rejects any sort of arithmetic operations. > > > > This series is an extension to allow more sequences to take part in if > > conversion. The first patch is a required change to emit correct code and the > > second patch whitelists a larger number of operations through > > bb_ok_for_noce_convert_multiple_sets. The third patch adds support to rewire > > multiple registers in noce_convert_multiple_sets_1 and refactors the code with > > a new helper info struct. The fourth patch removes some old code that should > > not be needed anymore. > > > > For targets that have a rich selection of conditional instructions, > > like aarch64, I have seen an ~5x increase of profitable if conversions for > > multiple set blocks in SPEC benchmarks. Also tested with a wide variety of > > benchmarks and I have not seen performance regressions on either x64 / aarch64. > > > > Some samples that previously resulted in a branch but now better use these > > instructions can be seen in the provided test cases. > > > > Bootstrapped and tested on AArch64 and x86-64. > > > > > > Changes in v3: > > - Add SCALAR_INT_MODE_P check in bb_ok_for_noce_convert_multiple_sets. > > - Allow rewiring of multiple regs. > > - Refactor code with noce_multiple_sets_info. > > - Remove old code for subregs. > > > > Manolis Tsamis (4): > > ifcvt: handle sequences that clobber flags in > > noce_convert_multiple_sets > > ifcvt: Allow more operations in multiple set if conversion > > ifcvt: Handle multiple rewired regs and refactor > > noce_convert_multiple_sets > > ifcvt: Remove obsolete code for subreg handling in > > noce_convert_multiple_sets > > > > gcc/ifcvt.cc | 403 ++++++++---------- > > gcc/ifcvt.h | 16 + > > .../aarch64/ifcvt_multiple_sets_arithm.c | 79 ++++ > > .../aarch64/ifcvt_multiple_sets_rewire.c | 20 + > > 4 files changed, 290 insertions(+), 228 deletions(-) > > create mode 100644 gcc/testsuite/gcc.target/aarch64/ifcvt_multiple_sets_arithm.c > > create mode 100644 gcc/testsuite/gcc.target/aarch64/ifcvt_multiple_sets_rewire.c > > > > -- > > 2.34.1 > >