From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by sourceware.org (Postfix) with ESMTPS id 538D43858D32 for ; Thu, 13 Jul 2023 14:09:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 538D43858D32 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-x132.google.com with SMTP id 2adb3069b0e04-4fbf09a9139so1297682e87.2 for ; Thu, 13 Jul 2023 07:09:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; t=1689257356; x=1691849356; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=jDFDoTfa3dTCWYI3+YSIxZM9s2cTPJcQWeBZPVLunUs=; b=oSfM9FJnH/LKN38XU8/N7kfoXPOaUJ++JtKMl6DdzQ6T4Nnt7ODYFFZfT3ai9BcNFZ Jl7tSFZ7GinXKlioxQsqdcYVXba4zdcGkP/f7X53GHykc/qU7io58q8d+pBuB5lr+hkG ZY5pAsDdJcWUdXQFCIQQCC2bsJtcTIlTHPYBav/6OYoHDDrAQ0xMxPc4LtfWKd5qmYUp Xa/VMENrKxvLTg9FD5EiTglL8EOiQ1XZCLq/WJEbFlscgr6kVlR4580xyKxKk7iVDaeO v1Xx+W8Py1eb+pRqvKZ/NqKtM7jua3g5qdjoN/GKpAVxLM9GltBy7dQHZoTTOE78fMMV 3QUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689257356; x=1691849356; 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=jDFDoTfa3dTCWYI3+YSIxZM9s2cTPJcQWeBZPVLunUs=; b=jgcT6rVi0jVvUtvvXxwtiOQHoBk+Sq4eU2oge6ZwX9NxUyWxK050TxTKapmYx/QKBq G252ermyGPWCFDl3tDrAv/HTh3fvKVHq4aFD1sUE7dmH8DgWssOtqBwZLszEXIoGI9rB Bl1IBDO40kVV1gQ2w+G5/vyXEFw3I4/IiO9Aj5tfanly1WDcYiReIb/+b3RvkHa8WcDV KJF+7PoaXrsrnVz/GpIxXF5kTxWOc8MqKAmWjOGoh+4MMbYkUx75QiWgl57iwOghVyAf VOUTgPqsdzofxIZ9NY04AUBl4q+izeyxvlLWdWS3cO83t+7woP64HguXnrZYsMimxK4H 50EQ== X-Gm-Message-State: ABy/qLbloEj3qQBRfM7zSzsQSsIxXzczLMQRHAE84Fb647FATUMhHrws mtGzCTk1fVSEszcSH01ynszE9oAdMOSeGaMBk/A= X-Google-Smtp-Source: APBJJlH+RWxu3J3lIaWKZhpFtXWbmHpfuVHY9bWsJQxrZuKMEDd6fNjCzx7Ko1Nlcv5ZQQiV4nY1NA== X-Received: by 2002:a2e:9992:0:b0:2b6:d77b:92b8 with SMTP id w18-20020a2e9992000000b002b6d77b92b8mr1613235lji.16.1689257355847; Thu, 13 Jul 2023 07:09:15 -0700 (PDT) Received: from helsinki-03.engr ([2a01:4f9:6b:2a47::2]) by smtp.gmail.com with ESMTPSA id d9-20020a2e8909000000b002b6e3337fd5sm1528181lji.7.2023.07.13.07.09.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jul 2023 07:09:15 -0700 (PDT) From: Manolis Tsamis To: gcc-patches@gcc.gnu.org Cc: Philipp Tomsich , Jakub Jelinek , Andrew Pinski , Robin Dapp , Manolis Tsamis Subject: [PATCH v2 0/2] ifcvt: Allow if conversion of arithmetic in basic blocks with multiple sets Date: Thu, 13 Jul 2023 16:09:02 +0200 Message-Id: <20230713140904.3274306-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.2 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,T_SCC_BODY_TEXT_LINE 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. 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 case. Tested on aarch64 and x64; On x64 some tests that use __builtin_rint are failing with an ICE but I believe that it's not an issue of this change. force_operand crashes when (and:DF (not:DF (reg:DF 88)) (reg/v:DF 83 [ x ])) is provided through emit_conditional_move. Changes in v2: - Change "conditional moves" to "conditional instructions" in bb_ok_for_noce_convert_multiple_sets's comment. Manolis Tsamis (2): ifcvt: handle sequences that clobber flags in noce_convert_multiple_sets ifcvt: Allow more operations in multiple set if conversion gcc/ifcvt.cc | 109 ++++++++++-------- .../aarch64/ifcvt_multiple_sets_arithm.c | 67 +++++++++++ 2 files changed, 127 insertions(+), 49 deletions(-) create mode 100644 gcc/testsuite/gcc.target/aarch64/ifcvt_multiple_sets_arithm.c -- 2.34.1