From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2069.outbound.protection.outlook.com [40.107.105.69]) by sourceware.org (Postfix) with ESMTPS id AE7FC3858C62 for ; Thu, 9 Nov 2023 16:22:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AE7FC3858C62 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 AE7FC3858C62 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.105.69 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699546960; cv=pass; b=sWQw3pgQInJHOuUVMTPjcmFK5lh4BC1zt1rEJMAkQgHLynMDGv1UZ2bdaXOVfqTPALIkd4TCvbraM/kWoxucM5Q6GFMjl6uPZMgZTtwUtChWStKFt5P5SuhKgXiwDDyg8cWOA8pk8itMfLXXvaUNKFrx3mguDPyx+/rNzEROLOM= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699546960; c=relaxed/simple; bh=+TLhhEFoduw516jd3uV7d98++Yc1YAo0nwz6aG98o4Y=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=ioPL6UfZ3oilJYfjoXEx9pmALBkw7PTDu/imtoFL2rB23rLoKYZuzkwO5zqz3QOVEosNB5CFHESG3XnLlzFDFPPzGeCmNDI+bzR8FGZnm0f2l1/IZxYT1Pf+VC0IMsSi8Q7zB79SgJwWgWEMIOG+nMs/9O41pdh2KC3y+xZzLqE= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=iuUG6VEcXuMsmigPyDPjz/w34CoDU5Oct9/XC6FRr1RQcnoY/3ix2NpFyedgEMqK7vQS68aB4v+7NmyaFD0BpGeM2hoGWZ4OGEi9xZWiW8gfSpZ/vuvg4XMIr48A3PHYIHwnxSzLDwyZsDETzMyDK5YYxN5OAnriAWFQe9bTIaevA5ALzJf2fk18XjmuJmZAvQV/onyVqk28Yg1GjetDk07E6OJyjtjvvzAGV+JdCuZCV1A42Fr9vWT59kXHdx4gr32i2scqdHRiNWMn4Yf6T/EiciuI1Vv003E72eL0NIYuR5BzjscYnRE1+UiM69jLVeDhqYCFQKx1ugOKOVhuZw== ARC-Message-Signature: i=2; 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=Pd9JooJ2VBIGUEeWLKXJz8OhIx2EIXpmhZD4tvRqvkY=; b=ecH7KdaaWiiYXK5IbkPTBz93ApVKidC+UZvOkEHWnku8hK4gmFN5Z6hSC8SE18z3XU8oP44tZwEFTf5g216eh5YDWT+MgeKuWhiCplsLVoc1KEHjbhHSI84oK7Tv6ycOtv2BLp6J63+3IIEjYGLMbLrGRtt42iG14mQTOssUoioXTMPEIfyGJzfsnN2jsmSlU8EV4zoZJ4hj8DzbcB0Kg6PwjvDEcn0SqBrmhMTccchrg+t1IOVrF8hZrCCK4bydawvAwD8Tz+xZwXarxBIYpc7SQHC3RM3hXg4eOSXnPLYbInQz/Kku3cLlTifMID+et+Cc4EFqdBdeOWiKUFTHuw== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) 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=Pd9JooJ2VBIGUEeWLKXJz8OhIx2EIXpmhZD4tvRqvkY=; b=zPqMdB41qkBVGjQKCcyLrHHxbNZn1ngSf6cOBjukcyk/iZNFWrlw0LkYNitczJJhoz54d7zgk84EGdZYM6Agh+6fEaSz21xcB6X6wKNMdXjLsvQcLWoHatnVjwshn06eXazLr2nZHmBYuFS9KceZABBN6CLqYKKmSa+A3XNeLaw= Received: from DUZPR01CA0067.eurprd01.prod.exchangelabs.com (2603:10a6:10:3c2::6) by GVXPR08MB10430.eurprd08.prod.outlook.com (2603:10a6:150:14e::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.29; Thu, 9 Nov 2023 16:22:35 +0000 Received: from DU6PEPF0000B61E.eurprd02.prod.outlook.com (2603:10a6:10:3c2:cafe::6) by DUZPR01CA0067.outlook.office365.com (2603:10a6:10:3c2::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.18 via Frontend Transport; Thu, 9 Nov 2023 16:22:35 +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 DU6PEPF0000B61E.mail.protection.outlook.com (10.167.8.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.16 via Frontend Transport; Thu, 9 Nov 2023 16:22:35 +0000 Received: ("Tessian outbound e243565b0037:v228"); Thu, 09 Nov 2023 16:22:35 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 52e774a09ca970c5 X-CR-MTA-TID: 64aa7808 Received: from eedb1ac073de.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 12A24376-F26E-469B-91D8-37046DADB21C.1; Thu, 09 Nov 2023 16:22:28 +0000 Received: from EUR02-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id eedb1ac073de.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 09 Nov 2023 16:22:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ceCLQxMtUFAQkZhBHQANT1yBeroCCWzbH796ukIR/NUfn7yY6XgdJL1hCKgdrvLaw8d4zUTa+YyxNnMzRMaZvOR/GybmRA+PzTSlHIne0jGz4oC68+XJnXI88AUIYA8wkO7veQE72h/f6HHbpMHylq604+hUREEWMUIh3ZZSKMtX0m4nIiLG1Abj0WWfvgch5YmTIVR7maQb4BFUIJFxVN4N73TbYPlhX//SMv972n8fc2LC8i6VaqBB478dn18Lci5lPyjsmEW/kDEhEDgBso/TJXQxNuhqI5tTZWK5YhMhigEAKQq/+NBfzEHFN7dRMMfa3FufpbQFrnMqJaKw9g== 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=Pd9JooJ2VBIGUEeWLKXJz8OhIx2EIXpmhZD4tvRqvkY=; b=Ty34i8+TG+/vgjieXA8BUetzND+slFvZKvb6nafqi+KMj18CUZaS1BDDluuQes/mtZSOe1N8+8vxwyYvJaY3Q1aDjj9Bmuh4CqagKLOtoYhz9xn5abn/6QFSmo3nlO98duc/UvDlu755t7geZwgaf7jwZrU+vnx2Pj2//G9iV39JwJcW7zfMAAAp2nH9RivmMjOk4MGEhXIbzFcsjTw7eDBrznN3aXR3EriRMJWZ30mng1a+t7ioRzo8f0t3vUgjMtyz5KkFOcDYKiOe5XDEpwq30TJHAyAJVLwS/wJT7zRc2Sn6COz63Wopxeh+hfhrvIUldOldSgyYB9VtxNMcsg== 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=Pd9JooJ2VBIGUEeWLKXJz8OhIx2EIXpmhZD4tvRqvkY=; b=zPqMdB41qkBVGjQKCcyLrHHxbNZn1ngSf6cOBjukcyk/iZNFWrlw0LkYNitczJJhoz54d7zgk84EGdZYM6Agh+6fEaSz21xcB6X6wKNMdXjLsvQcLWoHatnVjwshn06eXazLr2nZHmBYuFS9KceZABBN6CLqYKKmSa+A3XNeLaw= Received: from VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) by VI0PR08MB10509.eurprd08.prod.outlook.com (2603:10a6:800:1b9::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.27; Thu, 9 Nov 2023 16:22:26 +0000 Received: from VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::9679:2ab0:99c6:54a3]) by VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::9679:2ab0:99c6:54a3%6]) with mapi id 15.20.6977.019; Thu, 9 Nov 2023 16:22:25 +0000 From: Tamar Christina To: Richard Biener CC: "gcc-patches@gcc.gnu.org" Subject: RE: [PATCH] tree-optimization/111950 - vectorizer loop copying Thread-Topic: [PATCH] tree-optimization/111950 - vectorizer loop copying Thread-Index: AQHaELMwEfH/nQCvNU6mnrIAyt2yeLBxtGkggAAHAwCAAA9nAIAAGqgAgABI/fA= Date: Thu, 9 Nov 2023 16:22:23 +0000 Message-ID: References: <33fb3bb3-9548-4867-95f6-f7319bde2270@AMS1EPF00000043.eurprd04.prod.outlook.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; x-ms-traffictypediagnostic: VI1PR08MB5325:EE_|VI0PR08MB10509:EE_|DU6PEPF0000B61E:EE_|GVXPR08MB10430:EE_ X-MS-Office365-Filtering-Correlation-Id: a826a579-170f-4286-5d20-08dbe1401566 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: ZG7QeX9T4U07VTpMAwQcIo+5t+xzCXDpth4UU7Q0OoQGxuEBsDgCC99aIwBpiavhPUUaZR5HN9nuIbu+Ej8zgdBN6j64lbzwi+OcUt46XwimRIMuqEshGigttpdS2xsZ70Wit7E9gHnKYO99R+huegB3Xq75cvVJ+eIPDrsqiNnT3gulBcGya/Vh/bEBUN0s3y3LOF7SW1IwuHp+XfEY/JSWogQhtuZm6kPqmqgqxodutsmAYVOWHofo1B0FPNZ8OiPzQ8ouPvBBYkwspNdCYS/bsBEIj8ez1BHXqOWA5Uw7sDT8t1zghCYXQJpXaKENdx1gFJcZmK2e21Sax/7GDPw9l2t/oTj6MKnjdgCuSJWlefHADGn58aXqXOL69SKISxcTfU/26pKPaLPha7T9oqOx2acMhdUFvdEF7Yc/B0Se/9rqRhzX6m04OIZusTPp/Gk2EU5+U3g+e5Gw39vumRvEJcAqncyRgCUyxaAMNYHzB+m3KFKA6w0EECoeYJGqgERsVoFiiP11svyr0uu4vzLjtKkVZDQku9pdeSZ+BQX5aa7t837q+EbLgnQZsM8PEa7XD2JtfBFcjp+eaIEkSLXe7Ndx4C7HrIxbPRcenn0= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR08MB5325.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(39860400002)(366004)(396003)(346002)(136003)(230922051799003)(64100799003)(451199024)(186009)(1800799009)(55016003)(2906002)(38100700002)(8676002)(4326008)(41300700001)(83380400001)(86362001)(76116006)(316002)(9686003)(8936002)(5660300002)(33656002)(122000001)(52536014)(64756008)(71200400001)(66946007)(66556008)(66476007)(6916009)(66446008)(6506007)(53546011)(7696005)(38070700009)(478600001)(966005)(26005);DIR:OUT;SFP:1101; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI0PR08MB10509 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: DU6PEPF0000B61E.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: af8f98ac-60ab-43f5-8207-08dbe1400e21 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mCliv/2shCqWKWsB5U7P6JLmTjRiLocH5zvGwz93QJsyrIJZC4rn0efCs9mbO7CCvm3ZYJnGTrs2KWttSI1cSXuQow5WLC+YZFeBpPC6H53J2/7MitFD9KMdaktcjZKMUmhDuqIkvWC07vuDbX61MOOA/tT15heWDl4n5c+IP1knOhmt/G0zZTQCVf1KTpM0kwY+PPU7ZMlY/uBPRU592lcZlADIpk8NusoQEzhoEifUe/xsjailNVOCsYIrJiwUqMy6Do9nmJ7f6En2lly3ZVAy6RvD1ru7S0IdPDjbYX+/1ledyrHS2Bnt1SQsDqkq6dWADSBt+siiff4GOTvbDfDAcdmCMbka/pdnjQPZy0JJ4BqVjBFKGClnjRhTU5p37Vu/Mcj4G5WXZ7B+6bDqyy36uFIKWy0iij+CUa3+aaAtzI63LQteCDnGHHsSx1hI1zsSFb8qzV7I9gZmulcHBFJ0EHaAIxLZ2ST7gsEJ7tGLrexRS6/21vEIoW/ZWSHKgHwM1iFpuNs1BTeEzeN5BRjSiIRO8xQX/YQHeFtEWvdr3EPOOeUNC4ArN95sFUwuZ7LgUGtkkAJHkdDNk2gwtE5YbuzUtw2dxf6bTqULK+flOP5dUjMB45kI+YuEn/5M0RAuMm7QN7gupbHi96Iy0p+VQGwCZ+RnF4SXJpkrqIM75N4jvetf23FiNqRsFgdfmsdBTiQXc9AQAqkHrifhQm47aNzNXHzdbznJvJVv5k4= 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)(346002)(136003)(396003)(376002)(39860400002)(230922051799003)(1800799009)(64100799003)(186009)(82310400011)(451199024)(46966006)(40470700004)(36840700001)(70586007)(478600001)(966005)(6506007)(26005)(70206006)(336012)(316002)(9686003)(7696005)(6862004)(4326008)(8936002)(52536014)(8676002)(2906002)(41300700001)(5660300002)(33656002)(86362001)(36860700001)(47076005)(83380400001)(81166007)(356005)(82740400003)(53546011)(40480700001)(55016003)(40460700003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2023 16:22:35.5306 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a826a579-170f-4286-5d20-08dbe1401566 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: DU6PEPF0000B61E.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR08MB10430 X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,KAM_DMARC_NONE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE,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 List-Id: > -----Original Message----- > From: Richard Biener > Sent: Thursday, November 9, 2023 11:54 AM > To: Tamar Christina > Cc: gcc-patches@gcc.gnu.org > Subject: RE: [PATCH] tree-optimization/111950 - vectorizer loop copying >=20 > On Thu, 9 Nov 2023, Tamar Christina wrote: >=20 > > > -----Original Message----- > > > From: Richard Biener > > > Sent: Thursday, November 9, 2023 9:24 AM > > > To: Tamar Christina > > > Cc: gcc-patches@gcc.gnu.org > > > Subject: RE: [PATCH] tree-optimization/111950 - vectorizer loop > > > copying > > > > > > On Thu, 9 Nov 2023, Tamar Christina wrote: > > > > > > > > guard_bb =3D LOOP_VINFO_IV_EXIT (loop_vinfo)->dest; > > > > > edge epilog_e =3D LOOP_VINFO_EPILOGUE_IV_EXIT (loop_vinfo); > > > > > - guard_to =3D split_edge (epilog_e); > > > > > + guard_to =3D epilog_e->dest; > > > > > guard_e =3D slpeel_add_loop_guard (guard_bb, guard_cond, guar= d_to, > > > > > skip_vector ? anchor : guard_bb, > > > > > prob_epilog.invert (), > > > > > @@ -3443,8 +3229,30 @@ vect_do_peeling (loop_vec_info > > > > > loop_vinfo, tree niters, tree nitersm1, > > > > > if (vect_epilogues) > > > > > epilogue_vinfo->skip_this_loop_edge =3D guard_e; > > > > > edge main_iv =3D LOOP_VINFO_IV_EXIT (loop_vinfo); > > > > > - slpeel_update_phi_nodes_for_guard2 (loop, epilog, main_iv, > > > > > guard_e, > > > > > - epilog_e); > > > > > + gphi_iterator gsi2 =3D gsi_start_phis (main_iv->dest); > > > > > + for (gphi_iterator gsi =3D gsi_start_phis (guard_to); > > > > > + !gsi_end_p (gsi); gsi_next (&gsi)) > > > > > + { > > > > > + /* We are expecting all of the PHIs we have on epilog_e > > > > > + to be also on the main loop exit. But sometimes > > > > > + a stray virtual definition can appear at epilog_e > > > > > + which we can then take as the same on all exits, > > > > > + we've removed the LC SSA PHI on the main exit before > > > > > + so we wouldn't need to create a loop PHI for it. */ > > > > > + if (virtual_operand_p (gimple_phi_result (*gsi)) > > > > > + && (gsi_end_p (gsi2) > > > > > + || !virtual_operand_p (gimple_phi_result (*gsi2)))) > > > > > + add_phi_arg (*gsi, > > > > > + gimple_phi_arg_def_from_edge (*gsi, > epilog_e), > > > > > + guard_e, UNKNOWN_LOCATION); > > > > > + else > > > > > + { > > > > > + add_phi_arg (*gsi, gimple_phi_result (*gsi2), > guard_e, > > > > > + UNKNOWN_LOCATION); > > > > > + gsi_next (&gsi2); > > > > > + } > > > > > + } > > > > > + > > > > > > > > I've been having some trouble incorporating this change into the > > > > early break > > > work. > > > > My understanding is that here you've removed the lookup that > > > > find_guard did and are assuming that the order between the PHI > > > > nodes between loop->exit and epilog->exit are the same - sporadic > > > > virtual > > > operands. > > > > > > > > But the loop->exit for early break has to materialize all PHI > > > > nodes from the main loop into the epilog loop since we need them > > > > to restart the > > > scalar loop iteration. > > > > > > > > This means that the number of PHI nodes between the first loop and > > > > the second Loop are not the same, so we end up mis-linking phi node= s. > > > > i.e. consider this loop > > > > > > > > > https://gist.github.com/Mistuke/65d476b18f991772fdec159a09b81869 > > > > > > I don't see any multi-exits here? I think you need exactly the same > > > PHIs you need for the branch to the epilogue, no? > > > > > > > Ah it's a failing testcase but not one with an early break, > > > > > If you can point me to a testcase that fails on your branch I can > > > try to have a look. > > > > I've updated the branch refs/users/tnfchris/heads/gcc-14-early-break > > > > Quite a few tests fail, a simple one is vect-early-break_5.c and > > vect-early-break_20.c > > > > But what you just said above makes me wonder.. at the moment before we > > have differening amount because we require to have the loop counters > > and IVs as PHI nodes such that vect_update_ivs_after_vectorizer can > > thread them through correctly as it searches for PHI nodes. However > > for the epilog exit, those that are not live are not needed. This is w= hy we get > different counts. > > > > Maybe.. the solution is that I need to do the same thing as > > vectorizable_live_operations In that when > > vect_update_ivs_after_vectorizer is done I should either remove the PHI > nodes or turn them into simple assignments. Since they're always single = value. > > > > Looking at a few examples that seems like it would fix the issue.. Does= that > sound right to you? >=20 > Without diving deep into it I can't say for sure. I'd say any complex ma= ngling > of things should happen after we've set up the basic loop structure with > prologue, epilogue end exit edges (I've hesitated with that virtual PHIs, > thinking we should eventually delay removing it until we're ready with al= l the > copying for example). >=20 Ok, thank you, the hint you gave: > I think you need exactly the same > > > PHIs you need for the branch to the epilogue, no? Made me realize what the issue is. I realize now that your change Is essen= tially assuming that the main loop exit and the epilog exit contain the same numbe= r of PHI nodes. And indeed for the main exit there's no reason why they can'= t since all the phi nodes are singular. We don't need them. I was creating = them because vect_update_ivs_after_vectorizer normally searches for PHI nodes, but it searches for PHI nodes on the merge block. In the case of a single = exit that means that there's nothing to update for the missing PHI nodes since peeling has already done the right thing. There's no need to update the IVs because in the guard block they'll be upd= ate based on niters instead. So the PHIs are not needed. For multiple exits the connection was already done by peeling when it maint= ained LCSSA. So the correct fix is just to for the main exit not create the unne= eded singular PHI nodes to begin with. The order is then maintained by redirect= _branch and flush. Then it all works and no change is needed elsewhere. This also allows me to simplify the code for peeling a bit. You'll get th= e updated patch series with all the comments made so far addressed on Tuesday. Thanks for the hint! Regards, Tamar > Maybe vect_update_ivs_after_vectorizer is a similar thing. >=20 > Richard. >=20 > > Regards, > > Tamar > > > > > > > which now goes wrong (throw that in a dotgraph viewer). > > > > > > > > I'm struggling to figure out how to handle this without doing a loo= kup. > > > > > > > > Any advice? > > > > > > > > Thanks, > > > > Tamar > > > > > > > > > > > > > /* Only need to handle basic block before epilog loop if it's= not > > > > > the guard_bb, which is the case when skip_vector is true. = */ > > > > > if (guard_bb !=3D bb_before_epilog) > > > > > -- > > > > > 2.35.3 > > > > > > > > > > -- > > > Richard Biener > > > SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 > > > Nuernberg, Germany; > > > GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG > > > Nuernberg) > > >=20 > -- > Richard Biener > SUSE Software Solutions Germany GmbH, > Frankenstrasse 146, 90461 Nuernberg, Germany; > GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG > Nuernberg)