From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by sourceware.org (Postfix) with ESMTPS id D9B9B385841E for ; Sat, 1 Jul 2023 09:42:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D9B9B385841E 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-x12a.google.com with SMTP id 2adb3069b0e04-4fba8f2197bso1193474e87.3 for ; Sat, 01 Jul 2023 02:42:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; t=1688204563; x=1690796563; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=hud2iqoPjkZt5/AH5htiSQfYIeqyz5MyMflcAcmVMog=; b=Rdydb+uUpbrJS9CjBPds0FwdXZpnbOzzyoDajCv8XhVIJO21Q4e5kJkKVA8SSSHgNr XEMKqs9MDS2EtQEaQEf1hlAYKGaxs3e7/++EU9xq0zZ7OryReGujKFbR/ROXmvCxuO9s LvpcUlPSg0vyVStpWta58tzqJ9HajnV4Y6vX4BEn02R7BVWnn3OWa22oyOeTnRgbHxOe luYznMXSKMAENAYdgGxbXDso15i8Z9ZKpM7C9bPvKXH7RjFhn0cc1rxabgeom/8wEQmW T9CAu3WR2Sr0rkGxwGezgq2F9vdkX6drPAZeoiOj8zutrnp/QFoqAc0pCE/lWrsk4A2C 9CVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688204563; x=1690796563; 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=hud2iqoPjkZt5/AH5htiSQfYIeqyz5MyMflcAcmVMog=; b=J3XqlYvNr6K9fBxNUN5uRKKtlgRBr0pfQ/6/p+uWAO+Xh0mXYq9Pz+5Gt3frcG4BTy 1s845FQCBLlvWnl8eN8XyfP0f3kQ8ZpfHJV4dBBnxlwguAd5SJriG2wmNaFFGjBFTU3x wz8ZhzOyoh+ps2mwZ602J7DV1qddVAPW5w6kD7PWi/BbxhF9X1aQB7wZ9UUWRVuvUEvf oCUIQYy2QuC6sO9qdVJSnOoFMFncReDtspr5XiW1hZcPQRD3FYxmIlWGR3HmRXu6tsr4 uKXNFNAC8P3e1LgGOp6QjdOZECeUSX9WbmvjPBVyFln6bktd1MOzs9li71lGxc2TnUJD NKaw== X-Gm-Message-State: ABy/qLbz4AY3T1lmuclPi+9aLg9lZbny4OG5K1noqswLYZB3FptovRln SGubwuNLBdQu7ntT1NB1XubDi3Lx6WdaCGM8a9VgwA== X-Google-Smtp-Source: APBJJlFD30ynqL9WSWBKs+l60zQPSeZGeutIlFCk2SviDz8Lt0nrXUupbea3t7BZxeiHj95o8PV4aQ== X-Received: by 2002:ac2:5f74:0:b0:4fb:a0f1:f8b8 with SMTP id c20-20020ac25f74000000b004fba0f1f8b8mr3389997lfc.63.1688204563461; Sat, 01 Jul 2023 02:42:43 -0700 (PDT) Received: from helsinki-03.engr ([2a01:4f9:6b:2a47::2]) by smtp.gmail.com with ESMTPSA id d27-20020ac244db000000b004f27471e0aesm3296374lfm.79.2023.07.01.02.42.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Jul 2023 02:42:43 -0700 (PDT) From: Manolis Tsamis To: gcc-patches@gcc.gnu.org Cc: Jakub Jelinek , Philipp Tomsich , Robin Dapp , Andrew Pinski , Manolis Tsamis Subject: [PATCH 0/2] ifcvt: Allow if conversion of arithmetic in basic blocks with multiple sets Date: Sat, 1 Jul 2023 11:24:11 +0200 Message-Id: <20230701092413.2488806-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.4 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. 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