From patchwork Wed Jul 26 15:58:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Malcomson X-Patchwork-Id: 126475 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a985:0:b0:3e4:2afc:c1 with SMTP id t5csp497677vqo; Wed, 26 Jul 2023 08:59:59 -0700 (PDT) X-Google-Smtp-Source: APBJJlG4AjlnTqTgPJHOY5zGlelUQbr7JXlUhI8JhVKvqmcqiyqPkBg/G56EzvcOCguRgKxUINLf X-Received: by 2002:a17:906:7a15:b0:991:d9cb:247d with SMTP id d21-20020a1709067a1500b00991d9cb247dmr2067159ejo.57.1690387199451; Wed, 26 Jul 2023 08:59:59 -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 s23-20020a170906455700b0099318060d55si9865879ejq.516.2023.07.26.08.59.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 08:59:59 -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=@gcc.gnu.org header.s=default header.b=vjkSBt43; arc=fail (signature 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=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EA7EA385701C for ; Wed, 26 Jul 2023 15:59:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EA7EA385701C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1690387198; bh=+uMamreedjqxnkzokEAURO2B0u/yXWV1K5YrT4dyxXc=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=vjkSBt43BVFKz7R700lzVlzn1TJnCtwyCjiOfp0JKIJy98yp9H17fnKrayYoBQNlS OGtG40T+rugndSbPmsiMmZl/pZ79+UHEY2WhgSsnRmTttaDfg9w7iYKNUQHqQezYeu dx4rKjsxOdnpaV40utoUCx+mQszr84mN8no0ZJU4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2048.outbound.protection.outlook.com [40.107.105.48]) by sourceware.org (Postfix) with ESMTPS id 2E4A33858D35 for ; Wed, 26 Jul 2023 15:59:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2E4A33858D35 Received: from AS9PR06CA0022.eurprd06.prod.outlook.com (2603:10a6:20b:462::14) by AS8PR08MB8565.eurprd08.prod.outlook.com (2603:10a6:20b:568::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Wed, 26 Jul 2023 15:59:08 +0000 Received: from AM7EUR03FT013.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:462:cafe::f1) by AS9PR06CA0022.outlook.office365.com (2603:10a6:20b:462::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29 via Frontend Transport; Wed, 26 Jul 2023 15:59:08 +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 AM7EUR03FT013.mail.protection.outlook.com (100.127.140.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29 via Frontend Transport; Wed, 26 Jul 2023 15:59:07 +0000 Received: ("Tessian outbound f5de790fcf89:v145"); Wed, 26 Jul 2023 15:59:07 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: f5099dadd3375aa9 X-CR-MTA-TID: 64aa7808 Received: from e7e586122432.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 0E650CAB-3A94-4897-A78D-35E161560154.1; Wed, 26 Jul 2023 15:59:00 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e7e586122432.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 26 Jul 2023 15:59:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hFZRF29WH3U3ACdxafBBPWFy6vv4lvasaHS8R5F5a0TfmGCwnktY3a00E3n0ln5FNeThp7M6G3KvACXp2pY+vio5OuXO+3jTfWzxBSeJ+6Ef+SFGKClS07xxGXgpU16AaipIBEFL4Ij30V6hjqlPMnBz69QDdBIB1zU5nwuYiIDZ7Q2XHT2T3gY8rVm783wLTVmkEHN/IJ7jCutrH0bJZduMBYB9W0Nz6vX885I7sQPZcD48Mp2NvWQA4rxYhhQRmVvoLJMIBzFuxkiTcTx9Flkh52bXOEpy8ydOgyhEHUbx5S82z7d06msRtrUciZF5OEqO0o7Ei+kIp2IML96ZmQ== 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=+uMamreedjqxnkzokEAURO2B0u/yXWV1K5YrT4dyxXc=; b=jy/4Buj2528NqukTR+QEme40t8s5Kjm5ol0LmiIoJEkrd+yzgb40msu48znbqNVdGJGrTtHpKto0EkQWjkhbJIMav1ZiOcBOKASDp2e7FbdYKAy92z+ujhv4IVireKnwohJ10CKfGNKbGYSDfgJSqAE67iM4UoecMyLB2XGeTdHQ+HXVMmlvbkO2x2gktxxchpA7FfRMYsmR/GcEbJzOoaERE9dq3S06DKGPaGlKQK6515xaAwUJmyYPwLsWREQHnSow/DqITAiOimFCLeK7Wwme1gPESVDUJWBcULNcaKAdC1UZnAmkltWtuK9lOJZ9IJ5OqbZnPHr6boRbkuw+Ug== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none Received: from AS8PR04CA0004.eurprd04.prod.outlook.com (2603:10a6:20b:310::9) by GV2PR08MB8001.eurprd08.prod.outlook.com (2603:10a6:150:a9::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Wed, 26 Jul 2023 15:58:56 +0000 Received: from AM7EUR03FT055.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:310:cafe::7b) by AS8PR04CA0004.outlook.office365.com (2603:10a6:20b:310::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.31 via Frontend Transport; Wed, 26 Jul 2023 15:58:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by AM7EUR03FT055.mail.protection.outlook.com (100.127.141.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6631.29 via Frontend Transport; Wed, 26 Jul 2023 15:58:55 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 26 Jul 2023 15:58:54 +0000 Received: from e124762.cambridge.arm.com (10.57.32.137) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend Transport; Wed, 26 Jul 2023 15:58:54 +0000 MIME-Version: 1.0 To: Subject: [committed] Add check_vect in a testcase Date: Wed, 26 Jul 2023 16:58:54 +0100 Message-ID: X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT055:EE_|GV2PR08MB8001:EE_|AM7EUR03FT013:EE_|AS8PR08MB8565:EE_ X-MS-Office365-Filtering-Correlation-Id: 4a6f5a41-ae08-4b48-e64e-08db8df13e86 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: 3URN8OdgNoGe+27BmCLs+l8SiyLZ5bGIO7eNkeK6hp1hHX5+qC8a2izJYaFEe1qUh+RCcoJEXdWY7Pn7Ekh1uhz6Qj1j3NbvYuH5UMegN18AzQHAGukJSeTTFrPGa4Ua8gXnJo+rjFv4/qMfx3iZjr8JQX0xoT+2kz40bL5LIAgLzvvJUqOENOqx9HIspQkPg83OXDKhrOZDg3PMqzCTxUZV2ECVg3r1iUGAypPXkjBrWIByT9GiqlVT/v+JNTO2/Exm0sejS8AJ/ajhHIPBWWwIQ1w2W10qOY0quKRQRtCXdkDKIu2XSK+Jpmg9971DOPvd2+syG+D1IenfdC7jNN4/jWF+STvSFZwpOtCpoc+Qa9rLzAYHHShl57EBlbH6kClUcHl7K2yEd9xECbyaecSFnUei6Q9WxtJf8GQ4+cFT3M2dZQNS4eSeDbYEDh92Eb34QVMzbSwvLf21oSAGeyaepFqC2bK2tyFZ51QbZI6vcodSmGlkVLCbP56IzaTtFTBCoGbASIpC+0RZ+jWVwc4FMXyVh8fCQFHWlwPf7uYXl7S+++ltI6bAYlYoo6YyzeOJuQss5cJkqh50/52MninW3bdkJLmlMN0OElTi/ngtykkjtv0dXhYWVK8ZfpAMuVOZTvCF+jwdQ68TRDCPNRJ3FNaP+I7YyY22TS4r8GpbGTOfplx7jSYa9tTrOlTZUVeZ95RAksoE6XCxnep561XPf0owyFRI20hBC0oVx06sLcGMGIL2SsKPjY/psnVF X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230028)(4636009)(376002)(39860400002)(346002)(136003)(396003)(82310400008)(451199021)(36840700001)(46966006)(40470700004)(31686004)(31696002)(86362001)(44832011)(2906002)(84970400001)(40460700003)(40480700001)(70206006)(186003)(426003)(83380400001)(47076005)(336012)(36860700001)(26005)(33964004)(81166007)(356005)(478600001)(70586007)(6916009)(316002)(8676002)(8936002)(41300700001)(82740400003)(5660300002)(235185007)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB8001 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT013.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 974b421a-5836-48fe-5f93-08db8df13778 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: A6fW0gljpU4fL23qlZ+xphJZdaOWiuCbh7U9fqs+8QoSEJx6R2Ued4PHrR4PmQJoLl7mq7wWpJeA4EkO25k9OfwB4uET6GZxYj9/flz9jGMs++JQkt8f95rwFYwCfoluLUMJd77oS54eiipotlF2rTPKBqb9ZwFwPrtLYiO0+PdI3cIs5n3pTFVzhHZOEO+evwNXUYr/64Lmohf9XtM/JbyeeaXp/ibQCIoQ/OIvMlNRhPN8sQgURQVNj4FNvVjIANH7u38D03+klp2bcScj7mB5i/gq1weYzufcpzUBNXhFoOoBQOUzg8Hq9um1poA77mEykiiIUWB0BfrjJ5YE0xIXfMW1bSNEmFs4+dVVv5hWIACJsd2T9Y1zQXBen4Af7NdogIO2+yqSCqd9LG+tPAjVCjHcxk1e6lMWb0pIQk3O/6F0/gcgQ/5oxtpuUyUVn0mVtaZmr2PoCXuSvFw9aWnt4aYtd52jAymGZw4Pqxi6om9keIeK/1D6uTuW2cazppclH66M1HHML+AjBw3dNpSMbjyraiAEpMuEnZq6yGlaAvqhK/ZpA2FRYnOQkYu4i39MAf9iy1A8lRVrUrM7CACPfUSGz+UWkqog8Eu9wMoZpAO7FDWdNWdrMeSPuasrlVUk1gJwkt3nIOq+IPaXrqdJQ8dWlb/oT9GcsPwh2mZa0jMGLvRwwDqfyQOY1FYz/+ZHbDzz1uxyun3GADaZpYjsOw9kfgSqBIOpevcQMB8= 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:(13230028)(4636009)(136003)(376002)(346002)(396003)(39860400002)(82310400008)(451199021)(40470700004)(46966006)(36840700001)(40460700003)(186003)(426003)(26005)(336012)(47076005)(36860700001)(83380400001)(8936002)(316002)(70586007)(6916009)(70206006)(44832011)(41300700001)(8676002)(5660300002)(235185007)(33964004)(2906002)(478600001)(40480700001)(82740400003)(81166007)(86362001)(31696002)(84970400001)(31686004); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 15:59:07.8095 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4a6f5a41-ae08-4b48-e64e-08db8df13e86 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: AM7EUR03FT013.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB8565 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, KAM_LOTSOFHASH, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY 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: , X-Patchwork-Original-From: Matthew Malcomson via Gcc-patches From: Matthew Malcomson Reply-To: Matthew Malcomson Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772499447810699181 X-GMAIL-MSGID: 1772499447810699181 Also reformat a comment that had too long lines. Commit c5bd0e5870a introduced both these problems to fix. Committed as obvious after ensuring that when running the testcase on AArch64 it still fails before the original c5bd0e5870a commit and passes after it. gcc/ChangeLog: * tree-vect-stmts.cc (get_group_load_store_type): Reformat comment. gcc/testsuite/ChangeLog: * gcc.dg/vect/vect-multi-peel-gaps.c: Add `check_vect` call into `main` of this testcase. ############### Attachment also inlined for ease of reply ############### diff --git a/gcc/testsuite/gcc.dg/vect/vect-multi-peel-gaps.c b/gcc/testsuite/gcc.dg/vect/vect-multi-peel-gaps.c index 1aab4c5a14d1e8346d89587bd9544a1516535a45..7e7db3c7a45fa1ecc748f51353170ec66c5dfed7 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-multi-peel-gaps.c +++ b/gcc/testsuite/gcc.dg/vect/vect-multi-peel-gaps.c @@ -9,6 +9,7 @@ /* { dg-require-effective-target mmap } */ #include #include +#include "tree-vect.h" #define MMAP_SIZE 0x20000 #define ADDRESS 0x1122000000 @@ -24,6 +25,7 @@ void initialise_s(int *s) { } int main() { void *s_mapping; void *end_s; + check_vect (); s_mapping = mmap ((void *)ADDRESS, MMAP_SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); if (s_mapping == MAP_FAILED) diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc index 99e61f8a85dc6cebbb3cd4183f8bd7fdfe9aa1de..5018bd23e6ec457a8e4790d333752b7e009228e0 100644 --- a/gcc/tree-vect-stmts.cc +++ b/gcc/tree-vect-stmts.cc @@ -2214,8 +2214,9 @@ get_group_load_store_type (vec_info *vinfo, stmt_vec_info stmt_info, we can end up with no gap recorded but still excess elements accessed, see PR103116. Make sure we peel for gaps if necessary and sufficient and give up if not. - If there is a combination of the access not covering the full vector and - a gap recorded then we may need to peel twice. */ + + If there is a combination of the access not covering the full + vector and a gap recorded then we may need to peel twice. */ if (loop_vinfo && *memory_access_type == VMAT_CONTIGUOUS && SLP_TREE_LOAD_PERMUTATION (slp_node).exists () diff --git a/gcc/testsuite/gcc.dg/vect/vect-multi-peel-gaps.c b/gcc/testsuite/gcc.dg/vect/vect-multi-peel-gaps.c index 1aab4c5a14d1e8346d89587bd9544a1516535a45..7e7db3c7a45fa1ecc748f51353170ec66c5dfed7 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-multi-peel-gaps.c +++ b/gcc/testsuite/gcc.dg/vect/vect-multi-peel-gaps.c @@ -9,6 +9,7 @@ /* { dg-require-effective-target mmap } */ #include #include +#include "tree-vect.h" #define MMAP_SIZE 0x20000 #define ADDRESS 0x1122000000 @@ -24,6 +25,7 @@ void initialise_s(int *s) { } int main() { void *s_mapping; void *end_s; + check_vect (); s_mapping = mmap ((void *)ADDRESS, MMAP_SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); if (s_mapping == MAP_FAILED) diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc index 99e61f8a85dc6cebbb3cd4183f8bd7fdfe9aa1de..5018bd23e6ec457a8e4790d333752b7e009228e0 100644 --- a/gcc/tree-vect-stmts.cc +++ b/gcc/tree-vect-stmts.cc @@ -2214,8 +2214,9 @@ get_group_load_store_type (vec_info *vinfo, stmt_vec_info stmt_info, we can end up with no gap recorded but still excess elements accessed, see PR103116. Make sure we peel for gaps if necessary and sufficient and give up if not. - If there is a combination of the access not covering the full vector and - a gap recorded then we may need to peel twice. */ + + If there is a combination of the access not covering the full + vector and a gap recorded then we may need to peel twice. */ if (loop_vinfo && *memory_access_type == VMAT_CONTIGUOUS && SLP_TREE_LOAD_PERMUTATION (slp_node).exists ()