From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2083.outbound.protection.outlook.com [40.107.7.83]) by sourceware.org (Postfix) with ESMTPS id BF5CB3858C29 for ; Mon, 8 Jan 2024 14:20:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BF5CB3858C29 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 BF5CB3858C29 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.7.83 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1704723612; cv=pass; b=wCiBdC+td+fqFyyJBok+gBeCL1euc8K4M8HoTJuyX4X8yS1pf1E6Gfn+bhLTM9iJk3s535YLXVP4GmfLdSYR09GWijykp6hDx+8AICo8SMyQ6n4uezz7WLO9uXjsgUKSVuw7K9XCJ6pTnBZYFduTnjFHIUbSDWJA/M9CiYP87kE= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1704723612; c=relaxed/simple; bh=eX7KPtFBvEq0LxIYTihUlX1oNf1OKkl1TliAtiETpFM=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=BflhwogA86EZXw+M1PXEv5hkNIMji/1KFq3an8VjcOFoTX4zpk7pOjrhdIocj7JWeZ8KnbPHixi+a8oCI8hST1NHcp6DxgnyXyaTws+dHWFUtpZbLpYY5WZkmTmOtpBdssdzZxLgWoEfRtPHLg0jPbtdOlpvAgJ1DJqOrzO77SQ= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=k9BZUmEOZUJHyzZ5TtH+rNW3YDpGJ+j51ckURZEwf/Y2dz4fLEKdKuOQBClw1VXJGOsTB9fVAZWHTVe67hjERBNtD+RGQjpXsESeA0CTgbXbIhZTuth0Av6PG7P2aT+PvS/sTr9WRamdH6cxjWKxc6oI3f/FVgnvQLnAvwjVXMoxsO1x19pNzvUUajOb/cdKytxNF2/Ywh/8yJVMx0/PdDOZh3d8q+ULhIowIlknX1Qwxr54C7FlgmE4i9eyTQwpFKgZGM6uRr7pTQ58EMfwLFaHRkla6ermQRx+Tk//fmAPTko4r4983V8GQY9YxabsnPW4VWH9nm2UHdh3Du7o2Q== 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=kb8bno47VvXZYjo1bKXLuoJWFMqiw5ICAwLCZV2gapU=; b=VEtVTZz6fK0gK7bxhHYEHj72RJvqAcyMGEAzjgo+OZzTBixeJQgVTQcXFiDzkXn26rVUV60hPqz8yJtmYK8DBaKykk/4/quDY9lmm2R9QjPVCifxYm65EKcwrqP1Xp6VmaczuzwAmDkKd/AAwONtgGSQP4P5QrbPme+RaYZtqNaKJq0kC+ukOZ+C0H8Ute/VdCMuJ4EUR9mH7eVZcgbRk0YG8fmsT9VqWLVt7HBSKaFlNj/k70bwaQ96qnqeqQ8Edopm2gb+gJ7q9Kl40iY6C8o9+Q3a53JOXfUZaKUZwfi2jWkavpQJQfw4RzOUG4Co3AAmbqu4qQtScGYd/TG9Ag== 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=kb8bno47VvXZYjo1bKXLuoJWFMqiw5ICAwLCZV2gapU=; b=KgOJH8fNoLsfLj5HsuGLWcEHDHn4cV7fLJPEg2O9ajX5Qr09KfJ/17nw2j9JcgUOgfAtWYFQCueAlUMGKzt7OInbyN3Gwb5lRRps7vL9twLwOW/Y3vqyGNrUKG3hh2Ec6AsajOnw1BMLAmYEvyTqO+sze1G2SA7e0HSZVGCiz2Q= Received: from AM0PR04CA0096.eurprd04.prod.outlook.com (2603:10a6:208:be::37) by DB9PR08MB6521.eurprd08.prod.outlook.com (2603:10a6:10:254::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.21; Mon, 8 Jan 2024 14:20:03 +0000 Received: from AM4PEPF00027A60.eurprd04.prod.outlook.com (2603:10a6:208:be:cafe::d2) by AM0PR04CA0096.outlook.office365.com (2603:10a6:208:be::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.21 via Frontend Transport; Mon, 8 Jan 2024 14:20:03 +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 AM4PEPF00027A60.mail.protection.outlook.com (10.167.16.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.13 via Frontend Transport; Mon, 8 Jan 2024 14:20:02 +0000 Received: ("Tessian outbound 9f74e12f0f2b:v239"); Mon, 08 Jan 2024 14:20:02 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 5fa417d28794aca8 X-CR-MTA-TID: 64aa7808 Received: from 3a76d20e8e7e.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id EA5C968D-20AF-4230-A9AD-4CB997095C90.1; Mon, 08 Jan 2024 14:19:55 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 3a76d20e8e7e.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 08 Jan 2024 14:19:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LmDpZ/mdqlHgv9UjfoXHU9C9Lnn+gDqjwnla9RPJEJEo16tQwtpPFHhwgf7Ca1M5hLApN0rCuNYMwQEcP7OhEVLplEtfrGsL0JdcBUmSyBdr++SfpMq2rwb4RzvEGKMBE6W5vLrfwqyxIbuW1hHOYvp2bSsl3lRMlFYs4JSHsq6I6TM4UQAUTr0Ulyv1747s5cJsMGrJ77d5Nfy2sjdI+Ib560SWNRSaCzMGUtvXcK6gpd5JBgWqpzk9OfsMRZYexDbndMqM6sV6CwbYJjUVXQ3WggJl+Ns/6n5EnuBXU0IEhs32CrES0kIZtQHINWmUR8Btc0c1giA4j4hOGAzwUg== 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=kb8bno47VvXZYjo1bKXLuoJWFMqiw5ICAwLCZV2gapU=; b=gTEvCuW1OduCmjqvHMdWa5J03Y2bMbkyWxEVMhV9blIbJpJIHONylaZFj8QM7sdjMGjwrHJY6lmSwhDM25TRAxK2LsNldvZSqB3o7yTYYklfp6lqAVXUB7DT6l5ZvFj/n4i1xhUzl4oWW9n32CsNJPVqA8jG5QwJ02q+5CLsKZteKYdtzZeREIejXIT+SuEd/ZxDSjxb3OzMapXIPyLhwUJ8FC36faPiJavbG80PSCFfU5IlWceYHN5NabEl8yWSHWwC3r/GgVr6mi48Y8zubnj7RMx0aeX6i6POGhqAcTONQv7TYQU3wFGVs5QyKk9zO5/lEJqarzCYbC5L4igIwA== 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=kb8bno47VvXZYjo1bKXLuoJWFMqiw5ICAwLCZV2gapU=; b=KgOJH8fNoLsfLj5HsuGLWcEHDHn4cV7fLJPEg2O9ajX5Qr09KfJ/17nw2j9JcgUOgfAtWYFQCueAlUMGKzt7OInbyN3Gwb5lRRps7vL9twLwOW/Y3vqyGNrUKG3hh2Ec6AsajOnw1BMLAmYEvyTqO+sze1G2SA7e0HSZVGCiz2Q= Received: from VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) by PAXPR08MB7672.eurprd08.prod.outlook.com (2603:10a6:102:246::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.21; Mon, 8 Jan 2024 14:19:52 +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.7159.020; Mon, 8 Jan 2024 14:19:52 +0000 From: Tamar Christina To: Richard Biener CC: "gcc-patches@gcc.gnu.org" , nd , "jlaw@ventanamicro.com" Subject: RE: [PATCH]middle-end: check if target can do extract first for early breaks [PR113199] Thread-Topic: [PATCH]middle-end: check if target can do extract first for early breaks [PR113199] Thread-Index: AQHaPaUibSSEU0sWh0KFm1jT8FPWKrDP5oMAgAAYy3A= Date: Mon, 8 Jan 2024 14:19:52 +0000 Message-ID: References: <472o65so-2n1q-s6pn-0os5-s2o22npso06o@fhfr.qr> In-Reply-To: <472o65so-2n1q-s6pn-0os5-s2o22npso06o@fhfr.qr> 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_|PAXPR08MB7672:EE_|AM4PEPF00027A60:EE_|DB9PR08MB6521:EE_ X-MS-Office365-Filtering-Correlation-Id: cbfea448-ad2f-4c83-7908-08dc1054e7b5 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: BtkHoyYk8Qo1wTeoIt13a5KdJpuIwR+TUIUUi6ktB4mdH7Tjueui0lED3kFMCERotRNxuk24iY8SZYdzgwDIE3YUpqKhhsqQ/71WQ35XSKVI4EWXM8hB3PB6JjGIegNv4TI6m54CNxrtGSAQm03K4f8ja8TLpQlxxxPHQHKXQDxR4+PKxPZkya6xbWduN2xY3PRRazZOEIBpThJBw164dhP8DHk2Ddu0k0t1dLz6BaBLNam7ypI57WppUgho61l3ImrLSjof2fH0seREg+R557b6hYDdaEWGvSVKOz9diEp77vS6MroDCZ3mMazhMNMcFss5HwpCsqHWOayNZgCnLZEDstMURYyYuMZPq97l4ceabn2u4v9eZ8390QtUpk26u33cSEJpTKT+28Q0MP93qFW4Iavi3qBgXoSLoE9JSIWf2Jc2lpYqLRe0myF7JxZWoXyg/IhqWy+67+vpA/1dz8rikDSI/A7wfjGFXp6qSy3eK+4+oHPyv1P+t3GhadTkSSCdxIi805rM3jC9XWg8vrx5aDgyNbT2X0TWYSRr4u/sNSHoDSpPTIk7lsOtWWpDrVsiujtpmm9xnm4IeZ6VLXwoEhHeFvDP0p5KXaigY9k= 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)(136003)(366004)(376002)(39860400002)(346002)(396003)(230922051799003)(451199024)(64100799003)(186009)(1800799012)(478600001)(122000001)(38100700002)(55016003)(84970400001)(83380400001)(6506007)(9686003)(26005)(8936002)(53546011)(7696005)(316002)(54906003)(2906002)(5660300002)(33656002)(38070700009)(86362001)(4326008)(6916009)(66446008)(64756008)(66556008)(66476007)(71200400001)(76116006)(8676002)(66946007)(52536014)(41300700001);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: PAXPR08MB7672 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: AM4PEPF00027A60.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 9fa1d5d8-8419-420b-4717-08dc1054e17b X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: c+RLPK/jG9+ZUzjYJVTyl47m9jRRTdjBbHOKP0HoIPJ5iVbWNui6Kg9tDxA9urogoxACEpsOvjGDKcrghf3EUtuNkEX1bgKHrZ4N/He28hn8QHsBMzLzvvrD6Cioco1BCRPdmZ3481+UMnaQTiMkPKn0XdnHgfg4wqY9wTUNuNX9IwQXOQYqklSXxy4gtrV2vBga+hkjdbTvoSKC2D7gRiVeEHQLONCF/zo/QL3MNzTQZS3nQNBQpyhDhY2Iwb2n/GW5GCg7QbmJD6G7rtGbRsar63yHDhwuzFXXDD9V3ha/v7ftV60MplSDRrcBeBoClGWzgdsfCAlKzVpvilTjRt7AUgLpp41NvKB/nX+xAZABgnO6swUYIpddHdyzWUpeg/Ovm00cVaJesrXv5dDm6UufD+NKdBqShMblKcRMF4ESZup5KRU9F3O4n44Ia1QLvrst4q+azX90N9tqmzwyx6Dg4xiaNFofFwR+xI/uQd+QTGJo8rGeG7SyL88QqEGVjuaxA+kmFUm7SIE2X53tXUCtgNu/2bxFlRvA4FS0ngdRBtaFC7Q33Lkmg31i4f6RbuZANbv4+KtzC/y0F/+IKEP/ONoAhVTDYbK5D80y6A545MEW97Y/wKGbLjOOC5SyFJ+5yXdJw1kKArY4Ifd6hktC+q9aHacY3E2qFWB+jtJg8yA6w8ZwaI7KC4Wnq/ZBkvdvEm2BkcMFp9o4cnAc8XYFxizhatUWU1tTyAPVJ7k= 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)(39860400002)(396003)(136003)(376002)(230922051799003)(186009)(451199024)(1800799012)(82310400011)(64100799003)(36840700001)(46966006)(40470700004)(356005)(41300700001)(86362001)(8676002)(8936002)(81166007)(40460700003)(84970400001)(40480700001)(55016003)(5660300002)(2906002)(82740400003)(26005)(336012)(70586007)(316002)(36860700001)(54906003)(47076005)(70206006)(52536014)(107886003)(478600001)(9686003)(7696005)(33656002)(83380400001)(6506007)(53546011)(4326008)(6862004);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jan 2024 14:20:02.9557 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cbfea448-ad2f-4c83-7908-08dc1054e7b5 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: AM4PEPF00027A60.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6521 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,GIT_PATCH_0,KAM_DMARC_NONE,KAM_SHORT,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 List-Id: > -----Original Message----- > From: Richard Biener > Sent: Monday, January 8, 2024 12:48 PM > To: Tamar Christina > Cc: gcc-patches@gcc.gnu.org; nd ; jlaw@ventanamicro.com > Subject: Re: [PATCH]middle-end: check if target can do extract first for = early breaks > [PR113199] >=20 > On Tue, 2 Jan 2024, Tamar Christina wrote: >=20 > > Hi All, > > > > I was generating the vector reverse mask without checking if the target > > actually supported such an operation. > > > > It also seems like more targets implement VEC_EXTRACT than permute on m= ask > > registers. > > > > So this adds a check for IFN_VEC_EXTRACT support when required and chan= ges > > the select first code to use it. > > > > This is good for now since masks always come from whilelo. But in the = future > > when masks can come from other sources we will need the old code back. > > > > Bootstrapped Regtested on aarch64-none-linux-gnu, x86_64-pc-linux-gnu > > and no issues with --enable-checking=3Drelease --enable-lto > > --with-build-config=3Dbootstrap-O3 --enable-checking=3Dyes,rtl,extra. > > tested on cross cc1 for amdgcn-amdhsa and issue fixed. > > > > Ok for master? > > > > Thanks, > > Tamar > > > > gcc/ChangeLog: > > > > PR tree-optimization/113199 > > * tree-vect-loop.cc (vectorizable_live_operation_1): Use > > IFN_VEC_EXTRACT. > > (vectorizable_live_operation): Check for IFN_VEC_EXTRACT support. > > > > gcc/testsuite/ChangeLog: > > > > PR tree-optimization/113199 > > * gcc.target/gcn/pr113199.c: New test. > > > > --- inline copy of patch -- > > diff --git a/gcc/testsuite/gcc.target/gcn/pr113199.c > b/gcc/testsuite/gcc.target/gcn/pr113199.c > > new file mode 100644 > > index > 0000000000000000000000000000000000000000..8a641e5536e80e207ca01 > 63cac66c0f4f6ca93f7 > > --- /dev/null > > +++ b/gcc/testsuite/gcc.target/gcn/pr113199.c > > @@ -0,0 +1,44 @@ > > +/* { dg-do compile } */ > > +/* { dg-additional-options "-O2" } */ > > + > > +typedef long unsigned int size_t; > > +typedef int wchar_t; > > +struct tm > > +{ > > + int tm_mon; > > + int tm_year; > > +}; > > +int abs (int); > > +struct lc_time_T { const char *month[12]; }; > > +struct __locale_t * __get_current_locale (void) { } > > +const struct lc_time_T * __get_time_locale (struct __locale_t *locale)= { } > > +const wchar_t * __ctloc (wchar_t *buf, const char *elem, size_t *len_r= et) { > return buf; } > > +size_t > > +__strftime (wchar_t *s, size_t maxsize, const wchar_t *format, > > + const struct tm *tim_p, struct __locale_t *locale) > > +{ > > + size_t count =3D 0; > > + const wchar_t *ctloc; > > + wchar_t ctlocbuf[256]; > > + size_t i, ctloclen; > > + const struct lc_time_T *_CurrentTimeLocale =3D __get_time_locale (lo= cale); > > + { > > + switch (*format) > > + { > > + case L'B': > > + (ctloc =3D __ctloc (ctlocbuf, _CurrentTimeLocale->month[tim_p->tm_m= on], > &ctloclen)); > > + for (i =3D 0; i < ctloclen; i++) > > + { > > + if (count < maxsize - 1) > > + s[count++] =3D ctloc[i]; > > + else > > + return 0; > > + { > > + int century =3D tim_p->tm_year >=3D 0 > > + ? tim_p->tm_year / 100 + 1900 / 100 > > + : abs (tim_p->tm_year + 1900) / 100; > > + } > > + } > > + } > > + } > > +} > > diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc > > index > 37f1be1101ffae779214056a0886411e0683e887..5aa92e67444e7aacf458fffa14 > 28f1983c482374 100644 > > --- a/gcc/tree-vect-loop.cc > > +++ b/gcc/tree-vect-loop.cc > > @@ -10648,36 +10648,18 @@ vectorizable_live_operation_1 (loop_vec_info > loop_vinfo, > > &LOOP_VINFO_MASKS (loop_vinfo), > > 1, vectype, 0); > > tree scalar_res; > > + gimple_seq_add_seq (&stmts, tem); > > > > /* For an inverted control flow with early breaks we want EXTRAC= T_FIRST > > - instead of EXTRACT_LAST. Emulate by reversing the vector and mask. = */ > > + instead of EXTRACT_LAST. For now since the mask always comes from a > > + WHILELO we can get the first element ignoring the mask since CLZ of = the > > + mask will always be zero. */ > > if (restart_loop && LOOP_VINFO_EARLY_BREAKS (loop_vinfo)) > > - { > > - /* First create the permuted mask. */ > > - tree perm_mask =3D perm_mask_for_reverse (TREE_TYPE (mask)); > > - tree perm_dest =3D copy_ssa_name (mask); > > - gimple *perm_stmt > > - =3D gimple_build_assign (perm_dest, VEC_PERM_EXPR, mask, > > - mask, perm_mask); > > - vect_finish_stmt_generation (loop_vinfo, stmt_info, perm_stmt, > > - &gsi); > > - mask =3D perm_dest; > > - > > - /* Then permute the vector contents. */ > > - tree perm_elem =3D perm_mask_for_reverse (vectype); > > - perm_dest =3D copy_ssa_name (vec_lhs_phi); > > - perm_stmt > > - =3D gimple_build_assign (perm_dest, VEC_PERM_EXPR, vec_lhs_phi, > > - vec_lhs_phi, perm_elem); > > - vect_finish_stmt_generation (loop_vinfo, stmt_info, perm_stmt, > > - &gsi); > > - vec_lhs_phi =3D perm_dest; > > - } > > - > > - gimple_seq_add_seq (&stmts, tem); > > - > > - scalar_res =3D gimple_build (&stmts, CFN_EXTRACT_LAST, scalar_ty= pe, > > - mask, vec_lhs_phi); > > + scalar_res =3D gimple_build (&stmts, CFN_VEC_EXTRACT, TREE_TYPE > (vectype), > > + vec_lhs_phi, bitstart); >=20 > So bitstart is always zero? I wonder why using CFN_VEC_EXTRACT over > BIT_FIELD_REF here which wouldn't need any additional target support. >=20 Hmm Unless it's recently changed, I believe BIT_FIELD_REF doesn't support VLA types no? I guess maybe it does for index 0? But I was pretty sure it= asserts. > > + else > > + scalar_res =3D gimple_build (&stmts, CFN_EXTRACT_LAST, scalar_type, > > + mask, vec_lhs_phi); > > > > /* Convert the extracted vector element to the scalar type. */ > > new_tree =3D gimple_convert (&stmts, lhs_type, scalar_res); > > @@ -10852,9 +10834,25 @@ vectorizable_live_operation (vec_info *vinfo, > stmt_vec_info stmt_info, > > gcc_assert (ncopies =3D=3D 1 && !slp_node); > > if (direct_internal_fn_supported_p (IFN_EXTRACT_LAST, vectype, > > OPTIMIZE_FOR_SPEED)) > > - vect_record_loop_mask (loop_vinfo, > > - &LOOP_VINFO_MASKS (loop_vinfo), > > - 1, vectype, NULL); > > + { > > + if (LOOP_VINFO_EARLY_BREAKS_VECT_PEELED (loop_vinfo) > > + && LOOP_VINFO_EARLY_BREAKS (loop_vinfo) > > + && !direct_internal_fn_supported_p (IFN_EXTRACT_LAST, > > + vectype, > > + OPTIMIZE_FOR_SPEED)) >=20 > I don't quite understand this part - this is guarded by >=20 > direct_internal_fn_supported_p (IFN_EXTRACT_LAST, vectype, > OPTIMIZE_FOR_SPEED) >=20 > unless I'm mis-matching this means the checked > !direct_internal_fn_supported_p condition is always false? Arg,, sorry should be IFN_ VEC_EXTRACT. I'll fix and see if BIT_FIELD_REF works for 0 index. Thanks, Tamar >=20 > > + { > > + if (dump_enabled_p ()) > > + dump_printf_loc (MSG_MISSED_OPTIMIZATION, > vect_location, > > + "can't operate on partial vectors " > > + "because the target doesn't support extract " > > + "first reduction.\n"); > > + LOOP_VINFO_CAN_USE_PARTIAL_VECTORS_P (loop_vinfo) =3D > false; > > + } > > + else > > + vect_record_loop_mask (loop_vinfo, > > + &LOOP_VINFO_MASKS (loop_vinfo), > > + 1, vectype, NULL); > > + } > > else if (can_vec_extract_var_idx_p ( > > TYPE_MODE (vectype), TYPE_MODE (TREE_TYPE > (vectype)))) > > vect_record_loop_len (loop_vinfo, > > > > > > > > > > >=20 > -- > Richard Biener > SUSE Software Solutions Germany GmbH, > Frankenstrasse 146, 90461 Nuernberg, Germany; > GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg= )