From patchwork Fri Oct 21 13:52:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?RGltaXRyaWplIE1pbG/FoWV2acSH?= X-Patchwork-Id: 488 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp710595wrr; Fri, 21 Oct 2022 06:56:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4YoFBBzWxL6TMLj8gVNUD51c732z3p5703ToBB5Aaj2wwqqEzV+i9A+TFKmxAXvbC4uYNT X-Received: by 2002:a17:907:2cd6:b0:78d:b3ae:5450 with SMTP id hg22-20020a1709072cd600b0078db3ae5450mr14804745ejc.541.1666360564361; Fri, 21 Oct 2022 06:56:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1666360564; cv=pass; d=google.com; s=arc-20160816; b=JEVf7Sg1Tm1jtR891+2bEByCv3VaE/C8lrPTNGmAVZjbZbzhGjYbzRjcVqMskDXjGu 31FLqn2Uc0ojs9DfqPu0xrbK9LBM2/ca+1nSlKjMV5pw8y/AJnmHA1/u/Otq3z6N/G7M 2MCS0U800p3V1CcrekPJkcesqmmC/+bMgE2AEiTnxArS3i9c1brtnDqRxmAAXDgK8YpQ oVU2ZjO23zbjF3dyXBNkpzphvTI++snUbzghOthPpPSAN8qCzJ/oC8bYMXu1oRTug2BH wOYPngswM5ny1dRPDa6DfQiEo8GgQc/rNgjNUnMSzjKwNdpY1RFmsXa5sGj61c0zUumQ KPHQ== ARC-Message-Signature: i=2; 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:mime-version :content-transfer-encoding:message-id:date:subject:to:from :dkim-signature:dmarc-filter:delivered-to; bh=aoItd4ZqmqsEbAyBiyWE6GA2SckGLeDTgRLkmmX4dYk=; b=ujQ0rODI0KFwPR+0XSRXVodVlVwORH1q5gJoMByDo5bsNWy4t/vdNeTEuDof4Pe6aG OmoRNGwCR29I7L4JJoRA1T6f8E3A+qDKIVyEVdqLV9PsZMoq+vxIPqKkW+1J8LQ2738Q Mw3QVrlryzsHb+reHXppRD+cotPRSFuiCShXHXvD5se+PcRYUFQu+cBL3vVY6udy43Nw 3YKYzhgD5aYN6QQjCPns1iTsi2ne3BlbqSjxagOaXbBS03eYsxKGAzQjaZ2woHm1pFRs bs+wrwXm0ddjBcntabORqg/5pE3IeiULl9pr/MDF+lpDAsM83//JwCBXZ3X1y51Rumn+ HKiw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@syrmia.com header.s=selector1 header.b=ZKeArUlD; arc=pass (i=1 spf=pass spfdomain=syrmia.com dkim=pass dkdomain=syrmia.com dmarc=pass fromdomain=syrmia.com); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id x10-20020a05640226ca00b0045d9a3adf40si13774950edd.371.2022.10.21.06.56.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 06:56:04 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@syrmia.com header.s=selector1 header.b=ZKeArUlD; arc=pass (i=1 spf=pass spfdomain=syrmia.com dkim=pass dkdomain=syrmia.com dmarc=pass fromdomain=syrmia.com); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 644AA3839DF0 for ; Fri, 21 Oct 2022 13:55:09 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80133.outbound.protection.outlook.com [40.107.8.133]) by sourceware.org (Postfix) with ESMTPS id 384883856DC0 for ; Fri, 21 Oct 2022 13:54:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 384883856DC0 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=syrmia.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Syrmia.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VJN/KsLiaCFC3scOp239n4+YtjIESWWwnveAkuHQdA4wd2IxXlbC3gZuAvsX1nTr/9Vy/CQ4kVjrx+ij5rRgYNnSD53LK5zLISy8I3R35BQ4brOIyt/Um+oBRi90IEcVHVszQIApBW34qg70T7kFF3Ig2arRqafC+3/nZS69DLVn/NmJ9scfdFfmhlHESg2eOyHi0OGgt47OIo+nLo3ySMGC+D2ntetBWTsiL9cFIeJmMxhjZp2xrnjf7VByylbMemQ0HztGeseybVdN7LZpsrzzbvz51lzyIaUfkXMFLaKGFH8yDFVIxl+CrxUf/bFSj3UshF7bYKBJb++WuRMz+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=aoItd4ZqmqsEbAyBiyWE6GA2SckGLeDTgRLkmmX4dYk=; b=jnMtTzIi5eFZqn+XtpTybuoKn0/XyNnDEwYHOe5RPUeyV39jZ6p99AMjgczHHW5JvgdyrE8M9VVj9fWiaNwWSQN+OFPoVLRqbfzeWH3UrB/7TtMh2Gv62ho7qTl3cBZLMD7/kBQfmlPu1IZnoyiiGAmHblax4rEkVtlfVR5v899ptHUqiKLjr9yHD+tIk+n7YhRlsP9ExTTJ4FylciAwNpQ/cZFZnaUSDr9VQPZw/U/hi2wTdQPBc2+IzImHl3pOZGVD1gfjojf/yMd5hbYhE0vEAhHFNIqKv6hlY+EotQ5uuLMqnTiwAj7zk+LKuT7NHl7BGSdagbDaJMI9teV6nA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=syrmia.com; dmarc=pass action=none header.from=syrmia.com; dkim=pass header.d=syrmia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=syrmia.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aoItd4ZqmqsEbAyBiyWE6GA2SckGLeDTgRLkmmX4dYk=; b=ZKeArUlD42UueWejGn6lLnd0PIiUTqnhXY+yHmPc5dAGkB6gpi8WMIYEFZ+ShRQf/O2VSIAri8F+WHMcLU4YwvIoa4GrRTrXKuWTMDoGSGeJ9/0X8lqKkBKrDWmsohxNczelqPR/lRhZ/ULwxu/FseFSe3g4S9EUXsXUcKcikGU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=syrmia.com; Received: from AM0PR03MB4882.eurprd03.prod.outlook.com (2603:10a6:208:fb::17) by VI1PR03MB6189.eurprd03.prod.outlook.com (2603:10a6:800:142::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.30; Fri, 21 Oct 2022 13:54:34 +0000 Received: from AM0PR03MB4882.eurprd03.prod.outlook.com ([fe80::7f26:4554:fc25:8412]) by AM0PR03MB4882.eurprd03.prod.outlook.com ([fe80::7f26:4554:fc25:8412%3]) with mapi id 15.20.5723.035; Fri, 21 Oct 2022 13:54:34 +0000 From: Dimitrije Milosevic To: gcc-patches@gcc.gnu.org Subject: [PATCH 0/2] ivopts: Fix candidate selection for architectures with limited addressing modes. Date: Fri, 21 Oct 2022 15:52:01 +0200 Message-Id: <20221021135203.626255-1-dimitrije.milosevic@syrmia.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: VE1PR03CA0044.eurprd03.prod.outlook.com (2603:10a6:803:118::33) To AM0PR03MB4882.eurprd03.prod.outlook.com (2603:10a6:208:fb::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR03MB4882:EE_|VI1PR03MB6189:EE_ X-MS-Office365-Filtering-Correlation-Id: 1ede493a-3b66-41c2-91ad-08dab36bc920 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sZEfBFSy3qnB5KkjWtZ5U0pLIjxIxMKJwJBgCWpsDawF2v/ABbigR7UV6xWBrs99aXoibf8x5NFpTTX5PFJa6CFYBENLELyY2A+QcZpC5YUNmm2sZcjPhfwu8n0CmK+HSgzE8DtC5RD5psYnagpL58AaHe77Wcmb7t315uN7BsXv3K/bIHfocPH2JXMW9htCWM8XZQ3bHel4N9+jcM/ugYvjOJz2A7+KHsAkP61r4ZcdYHLCE18ut7rUIboTJG5gBpeymAyP3mFu6scVKPxnIEG1YTbNGr6RPz+K156lU5gOj5rzx1TuyHB8kzAoLDsF8ZQUnxIKfY6DLddmHQwyhVyLTFTbvvjxwCUToKK4FCFna7zzRW7JnKFuABuuM5jSdN4dLcGxMFa9yxMzkUGXB3g3EdY7umKA3hjovk73vU0s204S9MzyuNOn4/YQCSi0NT/Moxz8ashhIeHNKC3KTZSQKLK7F7ii+4z1lYAtdszcjIkisPa824dFOOFdQ2Djs8jEQPCwuDDtmxPEThcRVVNwt7KulJVy3qgqxkLyf8731A6yZy7wuk2kxPfQ5B22YcQI19PbVpn2INNMcc5LScyU2LVE2kdb3kNfHd7tgzWJC3Fy7GDiGaIN1g7PUAdwsrwfPfI3B8bIfqSy2ecrEJlbQHexRTJwv4k3B/ZMmSVIpwa1VebHHKJYyhluvldTs+P0+aLo+OB15pMWDGXDm7hczcChdPIbjGpCJPjv333oYcNRF2S9kAWkpVN1O09o X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR03MB4882.eurprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(366004)(39830400003)(376002)(136003)(346002)(396003)(451199015)(66556008)(66946007)(6916009)(44832011)(107886003)(36756003)(41300700001)(26005)(6512007)(52116002)(6506007)(8676002)(66476007)(5660300002)(6666004)(4326008)(8936002)(316002)(2616005)(38350700002)(38100700002)(1076003)(2906002)(186003)(83380400001)(86362001)(6486002)(478600001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: b6KyaNam8KA5UtrPphSeG+OLDoIO8RiVNT8oJvKBsFnt7iCBHd9UHZYTlX4pv+IfzKlx3pVwkLmGXUMmFsqxea4RYLSeAOX6pSDCfIl2V5cD4nFtu+mPSZ4craXy+jTolyhGTbhvHCZzTk3AGzdsfG7fYj9uLXt7AWtRMVUj/Feqx7wdfgxEVFaWdTxB5rvocNDPd49MtiS/81Tpy1/tyWEXJDBbT5NG6hlBnzvoJg0jlDf51xFxSzIbkAgFQMdTxn49TMiQuu2mfXrfFcY7GTT6vzmQ54TkMXigyGWPccbfdeFH09mFpcyjQW5Ksrq89bLeBPAcNO7956VDEfCdl/qjMaCFtEXaSI2ywdlwFOxQwRQgyB9Ie7O94aZgfY11fCpbdYF3zBwFVK+L7GdMBXQ6FxyXIUqYT1j+XQV31cvbhuNYXiDkixxNzR8YtCy9ZR7lsWxGnCpmTzhmOOKKPKs7Dbh9NYHr1qEny2uo+oBy9CW8vXqxL+bStxdWxGsoyGKxzmVT29Pc8dFd8JwgNI0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WxYdXlISTQIEMptTHvDwPOGoOn6/Tbto= X-OriginatorOrg: syrmia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1ede493a-3b66-41c2-91ad-08dab36bc920 X-MS-Exchange-CrossTenant-AuthSource: AM0PR03MB4882.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2022 13:54:34.5292 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 19214a73-c1ab-4e19-8f59-14bdcb09a66e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: htY2VRd0am9zr1noxya0iUt6Axp0FP8cMzQ9UKYUYf4U4W5SkjnUfAr6SX/hSk0yOZbRMduSR6Y/oNhiLt3SJ98IUjN2rSHeAc6OQ2Uf1ls= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR03MB6189 X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: djordje.todorovic@syrmia.com Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747305695030541457?= X-GMAIL-MSGID: =?utf-8?q?1747305695030541457?= Architectures like Mips are very limited when it comes to addressing modes. Therefore, the expected behavior would be that, for the BASE + OFFSET addressing mode, complexity is lower, while, for more complex addressing modes (e.g. BASE + INDEX << SCALE), which are not supported, complexity is higher. Currently, the complexity calculation algorithm bails out if BASE + INDEX addressing mode is not supported by the target architecture, resuling in 0-complexities for all candidates, which leads to non-optimal candidate selection, especially in scenarios where there are multiple nested loops. Additionally, when bumping up the register pressure cost, the number of invariants should also be considered, in addition to the number of candidates. Dimitrije Milosevic (2): ivopts: Revert computation of address cost complexity. ivopts: Consider number of invariants when calculating register pressure. gcc/tree-ssa-address.cc | 2 +- gcc/tree-ssa-address.h | 2 + gcc/tree-ssa-loop-ivopts.cc | 220 +++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 210 insertions(+), 14 deletions(-) --- 2.25.1