From patchwork Tue Oct 17 20:45:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Coplan X-Patchwork-Id: 15513 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4389348vqb; Tue, 17 Oct 2023 13:46:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHFgtd/LAJBBNPGqtZZcUMS4JlmGSePSzDvQE67YTP8Xf+kVfhM+QQTtHG4sUuFQMbyX9RI X-Received: by 2002:a05:6808:144d:b0:3ae:24bb:381f with SMTP id x13-20020a056808144d00b003ae24bb381fmr4770131oiv.46.1697575571026; Tue, 17 Oct 2023 13:46:11 -0700 (PDT) Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id l6-20020a0cd6c6000000b00656506a1886si1522370qvi.429.2023.10.17.13.46.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 13:46:10 -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=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=6nNPT88B; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=6nNPT88B; arc=fail (previous hop failed); 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C0E913858298 for ; Tue, 17 Oct 2023 20:46:10 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2085.outbound.protection.outlook.com [40.107.249.85]) by sourceware.org (Postfix) with ESMTPS id F2CB13858C52 for ; Tue, 17 Oct 2023 20:45:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F2CB13858C52 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org F2CB13858C52 Authentication-Results: server2.sourceware.org; arc=fail smtp.remote-ip=40.107.249.85 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1697575546; cv=fail; b=dutrisEAFkIhfvxLwidHv0BK6Ur+mjB/Csa0HmbZRiA4VqjKN3iFVKJCd8rddRcZwpYLORurTJOPH8sR20PPFknysyD/xv7r4mhvELPztGuKQHpYqzVXxQ09IanbMKOOIeGdHsw57FrABjD07n46OlP3ewbsvE/aftWQrzZ6Bfs= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1697575546; c=relaxed/simple; bh=EktRhn6a18dGYI0wI1AcCyq5cId62x140/jHS5nZezo=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:Message-ID: MIME-Version; b=X1A5Zw7ttUb7nfRx+9j6HnUr1oKwmugUGimmcppF//CGGwWCpUAs0hGk/GBkOpaM4WEjl6qbW3RlXYhDazRLq28o+hAoKmvUyQTYbvaAhXJvpjueSk5mzlnJ/NhCyxf4ZuDHlvrUD9UnToMTu/fIxvdDJSqYBa5Kzr2kkwgblRM= ARC-Authentication-Results: i=2; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vwmvwHdL8oIYlAWhZvvy5ZZKD+lOAld4BmKi1L2nRsM=; b=6nNPT88BP1vwvFpXIsjaiAul1T3eXec/GbUwU6svM+KNVtSV7SxtjkIgBwkMpUsNugzG4ZwhDhH6dTsx/BvDXHXsP3gVMIz6cBBoxCsfULQe9VkenJwKa8uNroCpMtfmuou/V1Ego+L+MOnEWEwXiPOtVlQoTYuC1RxJOiEuFKs= Received: from AM8P191CA0028.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21a::33) by AS8PR08MB9454.eurprd08.prod.outlook.com (2603:10a6:20b:5ee::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.36; Tue, 17 Oct 2023 20:45:42 +0000 Received: from AM7EUR03FT029.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:21a:cafe::af) by AM8P191CA0028.outlook.office365.com (2603:10a6:20b:21a::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.36 via Frontend Transport; Tue, 17 Oct 2023 20:45:42 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT029.mail.protection.outlook.com (100.127.140.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.20 via Frontend Transport; Tue, 17 Oct 2023 20:45:42 +0000 Received: ("Tessian outbound 9aeaca65ec26:v211"); Tue, 17 Oct 2023 20:45:41 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 1a3058fbd29d7b50 X-CR-MTA-TID: 64aa7808 Received: from 6dbfd6b36cc3.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 9E88CEE6-E718-4C06-B125-7D8048F39525.1; Tue, 17 Oct 2023 20:45:34 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 6dbfd6b36cc3.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 17 Oct 2023 20:45:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cjoOOhA634bZPbxk1MyuOlCBxEsXHM1p0Jxw/QKz7CeRF1lQQdHER/RAsb3RAMeGAzxlfK/3LkHtcM8iavl+JTbYiHEM/6gbl6oS3kjhkY9zEpZ/VQ9yz1h/IN1yl0WtKdGbVEsxfyd42bVT07lDTUOX1yilcqPdj9uYBAs8+XzpCTBKHWew3F97dlnKdwQAEpr/2vrIHWqmKWZo36pfoANBMUsZPLdx3mgXpMSveJ4wE+oJX6ieuma0OKonQAPYMYQ/vk3hOpkjp3E+kQqbiWVBShGSSIC9spDLMN4MfUU50sydQjfNoV/nFn6g9Rpw1M4IqJAWg43XkjwlfDYZwQ== 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=vwmvwHdL8oIYlAWhZvvy5ZZKD+lOAld4BmKi1L2nRsM=; b=OmMpuL8PpRrR4TVTfkkHm/d68tFjpC8Z5n8PPI/D9lWA81wzwpdH+mE6WxlJ4O8qeU5axgGXtmMIK2HUhYyHPjfTDUdjJQkIkBJmNoU6iIY9aGAMrTbEPNJn3yQWkcHXpGAKP+ZkmBg4Jhr9OZxo6ss0I2bTLdbFRtnrbPCJ34I+YRRw/xQJiib135LRliJI9/3enW5iOBCzwtbEjqAv7TeS5pUXqyVX/T91Q47ewg+zHEjQRvnCUe2dGGtgH5knGXCRxUpu09ZqNuLKn354tIVvoUmJeSL4sSOAEh+r9UAsTmsxspmnoSS5SbPCMDk0VGjoiyUe5vsfMzE+h2HSyQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vwmvwHdL8oIYlAWhZvvy5ZZKD+lOAld4BmKi1L2nRsM=; b=6nNPT88BP1vwvFpXIsjaiAul1T3eXec/GbUwU6svM+KNVtSV7SxtjkIgBwkMpUsNugzG4ZwhDhH6dTsx/BvDXHXsP3gVMIz6cBBoxCsfULQe9VkenJwKa8uNroCpMtfmuou/V1Ego+L+MOnEWEwXiPOtVlQoTYuC1RxJOiEuFKs= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from PAWPR08MB8958.eurprd08.prod.outlook.com (2603:10a6:102:33e::15) by AS4PR08MB7580.eurprd08.prod.outlook.com (2603:10a6:20b:4ff::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.36; Tue, 17 Oct 2023 20:45:33 +0000 Received: from PAWPR08MB8958.eurprd08.prod.outlook.com ([fe80::f41:4ae1:dba2:70f4]) by PAWPR08MB8958.eurprd08.prod.outlook.com ([fe80::f41:4ae1:dba2:70f4%6]) with mapi id 15.20.6863.046; Tue, 17 Oct 2023 20:45:33 +0000 Date: Tue, 17 Oct 2023 21:45:27 +0100 From: Alex Coplan To: gcc-patches@gcc.gnu.org Cc: Richard Earnshaw , Richard Sandiford , Kyrylo Tkachov Subject: [PATCH 00/11] aarch64: Add new load/store pair fusion pass Message-ID: Content-Disposition: inline X-ClientProxiedBy: LO2P265CA0112.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:c::28) To PAWPR08MB8958.eurprd08.prod.outlook.com (2603:10a6:102:33e::15) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: PAWPR08MB8958:EE_|AS4PR08MB7580:EE_|AM7EUR03FT029:EE_|AS8PR08MB9454:EE_ X-MS-Office365-Filtering-Correlation-Id: 058e5776-98ea-469c-43ff-08dbcf520762 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: AL5cpfeSuKpYxcIeCozSoa5CFe5gn9jEjBYwdAu6n7yuco+7F6uGDuGw/jEizFZ8H6PR7z8yo9bRirqSu8pHa6MAnLU8JeIVvtKjqVvmB8jfx3ceuvv65lSITdqDcfcQGTqMS9g57G6OKAF9EYgN1CH4VIPLY1oDaktqmjfdWyAUtw5MaSZziX1PyioOy37v7VjaA2UqkzNAoG/mM6pGbK3/J90aGNOCUIJ9hMvIhNI9CH/enbPkHLpio/vMP51HI6PKgaTIZgiU7selJ+iKxf9tcniay9UXH5b/+wCDWl2U+XoO4A3fq1Tqda+5yXiWYXG8DFMO5589O+ABlcZ1C2ZicLNtOU7ySLIfL16ARAUXK/MqTpLO2ZH5uXEsgeToTcxLWy/BALH0cowwXgHWnkL40XbvoLINfxSFOYfAFY1IN8FAVXe9u9K3R1vD1YhE03eksktdTCWOmo2ZBJyGCUB2Tl1GdP1qPkESAWYoe7kIV6/WaTXvbNFF2xp3vl4nRyUEu0RMvsqk/vOBUQ3UsxCC9rvexzvLS+weh375mIMypn1IopFvCDCl63ccmKGe X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAWPR08MB8958.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(346002)(396003)(366004)(136003)(39860400002)(376002)(230922051799003)(64100799003)(451199024)(1800799009)(186009)(316002)(54906003)(66556008)(66946007)(66476007)(8936002)(8676002)(6916009)(38100700002)(6512007)(6666004)(478600001)(2616005)(6486002)(6506007)(83380400001)(4326008)(26005)(2906002)(5660300002)(44832011)(86362001)(41300700001)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB7580 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT029.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 537fdeb8-bfb2-4e1b-aa7c-08dbcf5201c3 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Kq/0X7yMhOaIAqOwuc6QvYp3qRmy+Fc/ZhKAhCTsg3ORtT94lh8jHBMxGsaexIoff5q4o4T2Wq4BOEv2dyWGJn8Utu72elkOnPS8ipRIiUzd2OdT8dJezr0Jsz8fYZz3b65629D80H/WtPSwlpflexv4XpiSDGFj8sKbpStpe6jqhqij02nsn9rz6eN9wRoufVb9pI3+qjdY3IZlldU3l2g8R1nWOoGWCDtMQTyub3aGcuYTraeK59ozFx87hM8JUYHQRFHrCqym0+BtIh9eYRQfnZR9czvmn26lOH0SB25zlirFHEiViBFRTCs6Mav+lgPf6JXex3L3irvGxMC1xAFOBQrbBhnXlygmSpZSNPSp9u5wwdBjAg9iW0W52oFTW3p9XqQaQAKuObWqmKKy4aKWn+Na4gLbpA5J6yjH7SbmwRX7fToKv6JeVekQFLvw03zFj6USXInuPiZUqZRf264D2KhoC9wNJ7qOaMb2kM+DjLMO8/Mf5FISkW1KHLVf2rsHphHjq8y6KJTR6uYURpnx8IjrfAgh2LPthslO6Zlogi9ZhorKHqGZc7PxMIQR1JiRKE2P33O5Cio8UQjES7Qh2Ku3BULgWb2qHxberemZc9knvlCzyKDvl51HKANSGjExEqw0s9BmIILIKBOu22/xZPYmM9NFNDwYk9v0guX158CufhyypU6Hlh1GrD1UZpHJ3YfJu0gCYqHVrVSR8thLA4ujwuBLydoZNtUYjsWW5EmbuzVA3mmmpm0UJxQw X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230031)(4636009)(136003)(346002)(396003)(376002)(39860400002)(230922051799003)(82310400011)(64100799003)(451199024)(1800799009)(186009)(40470700004)(36840700001)(46966006)(40480700001)(6666004)(2906002)(6506007)(40460700003)(6486002)(478600001)(8936002)(4326008)(8676002)(44832011)(6916009)(5660300002)(70586007)(70206006)(316002)(54906003)(2616005)(41300700001)(36756003)(83380400001)(47076005)(356005)(82740400003)(26005)(336012)(36860700001)(6512007)(81166007)(86362001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2023 20:45:42.0736 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 058e5776-98ea-469c-43ff-08dbcf520762 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM7EUR03FT029.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9454 X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, KAM_DMARC_NONE, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, UNPARSEABLE_RELAY 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780037002240757316 X-GMAIL-MSGID: 1780037002240757316 Hi, This patch series adds a new aarch64-specific RTL-SSA pass for forming load and store pairs (LDPs and STPS). See the cover letter on patch 11/11 for more details on the pass itself. Patch 1/11 fixes a latent bug in RTL-SSA. Patches 2-5 add features to RTL-SSA that are needed by the pass. Patch 6/11 fixes a latent bug in haifa-sched.cc that is exposed by the pass. Patches 7-9 adjust the aarch64 testsuite to account for the new codegen. Patch 10/11 extends the TFmode load/store pattern to TImode and TDmode. Finally, patch 11/11 adds the new pass. Bootstrapped/regtested as a series on aarch64-linux-gnu, OK for trunk? Thanks, Alex Alex Coplan (11): rtl-ssa: Fix bug in function_info::add_insn_after rtl-ssa: Add drop_memory_access helper rtl-ssa: Add entry point to allow re-parenting uses rtl-ssa: Support inferring uses of mem in change_insns rtl-ssa: Support for inserting new insns haifa-sched: Allow for NOTE_INSN_DELETED at start of epilogue aarch64, testsuite: Prevent stp in lr_free_1.c aarch64, testsuite: Tweak sve/pcs/args_9.c to allow stps aarch64, testsuite: Fix up pr71727.c aarch64: Generalise TFmode load/store pair patterns aarch64: Add new load/store pair fusion pass. gcc/config.gcc | 4 +- gcc/config/aarch64/aarch64-ldp-fusion.cc | 2378 +++++++++++++++++ gcc/config/aarch64/aarch64-passes.def | 2 + gcc/config/aarch64/aarch64-protos.h | 1 + gcc/config/aarch64/aarch64.md | 22 +- gcc/config/aarch64/aarch64.opt | 20 + gcc/config/aarch64/iterators.md | 3 + gcc/config/aarch64/t-aarch64 | 7 + gcc/haifa-sched.cc | 11 + gcc/rtl-ssa/access-utils.h | 11 + gcc/rtl-ssa/accesses.cc | 18 + gcc/rtl-ssa/accesses.h | 4 + gcc/rtl-ssa/changes.cc | 104 +- gcc/rtl-ssa/changes.h | 2 + gcc/rtl-ssa/functions.h | 19 +- gcc/rtl-ssa/insns.cc | 19 +- gcc/rtl-ssa/insns.h | 7 +- gcc/rtl-ssa/internals.inl | 1 + gcc/rtl-ssa/member-fns.inl | 12 + gcc/rtl-ssa/movement.h | 8 +- gcc/testsuite/gcc.target/aarch64/lr_free_1.c | 2 +- gcc/testsuite/gcc.target/aarch64/pr71727.c | 2 +- .../gcc.target/aarch64/sve/pcs/args_9.c | 4 +- 23 files changed, 2623 insertions(+), 38 deletions(-) create mode 100644 gcc/config/aarch64/aarch64-ldp-fusion.cc