From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 ; 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 ; 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-Google-Smtp-Source: AGHT+IEEWsaTQ8VHm/yJYqgaKwER7HLeVoUjXfJJZoYGAaO3vHEWxcQjlVkYOoRWDdnxugKlS8O1Dw== 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 To: gcc-patches@gcc.gnu.org Cc: Philipp Tomsich , Robin Dapp , Jakub Jelinek , Richard Sandiford , Manolis Tsamis 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 List-Id: 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