get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2195031/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2195031,
    "url": "http://patchwork.ozlabs.org/api/patches/2195031/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20260210113104.60335-10-chris.bazley@arm.com/",
    "project": {
        "id": 17,
        "url": "http://patchwork.ozlabs.org/api/projects/17/?format=api",
        "name": "GNU Compiler Collection",
        "link_name": "gcc",
        "list_id": "gcc-patches.gcc.gnu.org",
        "list_email": "gcc-patches@gcc.gnu.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260210113104.60335-10-chris.bazley@arm.com>",
    "list_archive_url": null,
    "date": "2026-02-10T11:31:02",
    "name": "[v9,09/11] Extend BB SLP vectorization to use predicated tails",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "383c3da613a001fb5585f3a76491c0a2c96fa6e5",
    "submitter": {
        "id": 89471,
        "url": "http://patchwork.ozlabs.org/api/people/89471/?format=api",
        "name": "Christopher Bazley",
        "email": "Chris.Bazley@arm.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/20260210113104.60335-10-chris.bazley@arm.com/mbox/",
    "series": [
        {
            "id": 491659,
            "url": "http://patchwork.ozlabs.org/api/series/491659/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=491659",
            "date": "2026-02-10T11:30:56",
            "name": "Extend BB SLP vectorization to use predicated tails",
            "version": 9,
            "mbox": "http://patchwork.ozlabs.org/series/491659/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2195031/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2195031/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "gcc-patches@gcc.gnu.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@legolas.ozlabs.org",
            "gcc-patches@gcc.gnu.org"
        ],
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256\n header.s=selector1 header.b=oX0yhVOo;\n\tdkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com\n header.a=rsa-sha256 header.s=selector1 header.b=oX0yhVOo;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)",
            "sourceware.org;\n\tdkim=pass (1024-bit key,\n unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256\n header.s=selector1 header.b=oX0yhVOo;\n\tdkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com\n header.a=rsa-sha256 header.s=selector1 header.b=oX0yhVOo",
            "sourceware.org;\n dmarc=pass (p=none dis=none) header.from=arm.com",
            "sourceware.org; spf=pass smtp.mailfrom=arm.com",
            "server2.sourceware.org;\n arc=pass smtp.remote-ip=52.101.66.51"
        ],
        "Received": [
            "from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4f9KXN5h0wz1xvb\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 10 Feb 2026 22:46:28 +1100 (AEDT)",
            "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 5C9234BA2E3D\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 10 Feb 2026 11:46:25 +0000 (GMT)",
            "from DUZPR83CU001.outbound.protection.outlook.com\n (mail-northeuropeazon11012051.outbound.protection.outlook.com [52.101.66.51])\n by sourceware.org (Postfix) with ESMTPS id 6A0294CF305A\n for <gcc-patches@gcc.gnu.org>; Tue, 10 Feb 2026 11:33:34 +0000 (GMT)",
            "from DU2P251CA0005.EURP251.PROD.OUTLOOK.COM (2603:10a6:10:230::34)\n by AM7PR08MB5365.eurprd08.prod.outlook.com (2603:10a6:20b:109::9) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9587.19; Tue, 10 Feb\n 2026 11:33:25 +0000",
            "from DB5PEPF00014B92.eurprd02.prod.outlook.com\n (2603:10a6:10:230:cafe::5c) by DU2P251CA0005.outlook.office365.com\n (2603:10a6:10:230::34) with Microsoft SMTP Server (version=TLS1_3,\n cipher=TLS_AES_256_GCM_SHA384) id 15.20.9611.8 via Frontend Transport; Tue,\n 10 Feb 2026 11:33:23 +0000",
            "from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by\n DB5PEPF00014B92.mail.protection.outlook.com (10.167.8.230) with Microsoft\n SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9611.8\n via Frontend Transport; Tue, 10 Feb 2026 11:33:25 +0000",
            "from DUZPR01CA0029.eurprd01.prod.exchangelabs.com\n (2603:10a6:10:46b::18) by VI0PR08MB11082.eurprd08.prod.outlook.com\n (2603:10a6:800:258::12) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9587.19; Tue, 10 Feb\n 2026 11:32:13 +0000",
            "from DB1PEPF000509F4.eurprd02.prod.outlook.com\n (2603:10a6:10:46b:cafe::9d) by DUZPR01CA0029.outlook.office365.com\n (2603:10a6:10:46b::18) with Microsoft SMTP Server (version=TLS1_3,\n cipher=TLS_AES_256_GCM_SHA384) id 15.20.9611.8 via Frontend Transport; Tue,\n 10 Feb 2026 11:32:11 +0000",
            "from nebula.arm.com (172.205.89.229) by\n DB1PEPF000509F4.mail.protection.outlook.com (10.167.242.150) with Microsoft\n SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.20.9611.8 via Frontend Transport; Tue, 10 Feb 2026 11:32:11 +0000",
            "from AZ-NEU-EX04.Arm.com (10.240.25.138) by AZ-NEU-EX03.Arm.com\n (10.240.25.137) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29; Tue, 10 Feb\n 2026 11:31:54 +0000",
            "from ip-10-248-139-165.eu-west-1.compute.internal (10.248.139.165)\n by mail.arm.com (10.240.25.138) with Microsoft SMTP Server id 15.2.2562.29\n via Frontend Transport; Tue, 10 Feb 2026 11:31:54 +0000"
        ],
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 sourceware.org 5C9234BA2E3D",
            "OpenDKIM Filter v2.11.0 sourceware.org 6A0294CF305A"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 6A0294CF305A",
        "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 6A0294CF305A",
        "ARC-Seal": [
            "i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1770723219; cv=pass;\n b=WMmNxgzieXl9h8KdKcRTBeqquHo0TGtEGhS1ZyCB72j9ipYHiOvZ+KpjiL3IKlegdF2QXGy+32QzZ5UAv8VomWouiG4qdYs9m1wX2Rd4EXQyB6b00xLy0vG9mBGifvOcC01v1Oa/0Ds72go73jpqu/ztvOdRTKAtCnq3XKqaPus=",
            "i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass;\n b=KNN5AoKfR+oNLodsi/E7uKKpAWXHGcWnrCnyMGxsPPWZQ8Glk+ti2hMbwLgGho/mNQC11KFz9ezh9VHkjjNbHHOAfhiemt2FnxiTg8YToVuE7CUJ56sDsK9aGZrSqmFrRO88VQpYkUPU/ItKJA6cNoEUFrDwjDIhvHJczyckrJ4tSLyUcYJ5DrNQCRavBbwOgv1YGiVWfS7ObHewhMF1MdjJ0gMPQaiSA8DxATlkvvgyqOJoX0dAYMa36FJ+btlKcpa8A8Q0ZgxiEVXargvAzO2of2Qvhj9H6qFrHjpAJWRBUNpQNH7iJ08AlWEYcT/DBu8m03S7b2zJfX5v2QrhoQ==",
            "i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n b=duesJWQrGYdhBPwnq6O6wubHitL8GOskGfUH/rGJGwyGp1DByelfrcR2YY2FyGqVwm2oQRyaxxAMhUkCugUH9oQWZ0wcNH9QWNtXPYMsn22l0OZVQ9uvIlDPFtIPA6jFD0W/3NpGBTo74GZHhFpHoC1er7rvnvHcAdfOIdNlhNGIcLZTcCnK49QjqzkLsQEhcnAr+lrZqDZUd16VnLSfbPDbpPj9KP7teTp/kw2TTiqWh6BsjF3dBLuOSU3vvc0BFkavBvHe2R2/mQWvL37PkuQz7QgrPsETJoE6lijWaH4lOYOCKl7MaQB0mQzuIVr2z8+RXf9HwyzBE4UVfTo3Rg=="
        ],
        "ARC-Message-Signature": [
            "i=3; a=rsa-sha256; d=sourceware.org; s=key;\n t=1770723219; c=relaxed/simple;\n bh=9YwwI1M1V9siNiXwMA5dJ3D3evw59+uhZ7vJCI9HcVo=;\n h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID:\n MIME-Version;\n b=mmRuCQoVRFVAAPTtETSp502lNhzPkfLmJz0fHQr5/4OahLWiphRz+rKJLwoQqf3cgeGFDefcUyHqutfTZBw27/73baLwWCGPMvSsIAnlC8gCPlEs2EGYFp4dd/tg/BlYO4j43NRV9dLi6UxTNXDZj9SAuEdb53OkQCA//iuCt08=",
            "i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector10001;\n 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;\n bh=xkvUUqQJG44cWKv55kIzD5TiOXmlisEbpVvs9tphQj0=;\n b=rOEYdNfIXt1xdRMZkAnIWpAlyKomKz3RhHou0eLx9giNGiadpDZdwXfZnSkxBfWLeaDEeT0IQuOEMyojrFe/Zd5HGtinjuNro4ai4+a3JHbrDoyX3qO1e6HO3xy+i5g38N3kjcUcdByrMHCd4DXEVvq5yCZhBGqZfsB+KvgkoyNi8R224j3ulmhCa3uQbo+Dqhh2sz7tV4sezT5SsTSB2UrwbtoyDOhul9DyPDdkW5HQ/I4j7QILsfH7SbHMhgjFFUd4YGr6ax55vvogGEOHPNTxpQj4zQ5ePLZEZromtG9mT8l5eQpOasTvmklzgJ6tu9GyH1HYvd1v2Ys/gFWrpw==",
            "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector10001;\n 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;\n bh=xkvUUqQJG44cWKv55kIzD5TiOXmlisEbpVvs9tphQj0=;\n b=D6zX6ADJmto5kNXXZKCVJoX6hBRpTI+0EfLveSTA8GnErQ76f6NFy8Evm8LRhKzVoQaiuBvq2qk0RluDvrZIZLI+E/m2EIYTiYlQZyRNGNUUYU9htRTeGie0N8JBJ4HtQcdGx4r47BOo/fcUkz0pyFyaT8t2CTrCtUcGqshP73CPT8xcE/cju8dlB35ZKAsNw/kC7dKyQFtZJ7vjDFrGFtW59okS+Ip2fvjaqZzzB/xXjrOMO+M6HPJ4+kIz3nHJmEx5R6EHT8UEPX2d/yhvRklELV6Q0ZWv+OMpz3N04u7K9rUpkS5j7uOOkWotBdUUFJnLLT2F5m9vEJGRutfETw=="
        ],
        "ARC-Authentication-Results": [
            "i=3; server2.sourceware.org",
            "i=2; mx.microsoft.com 1; spf=pass (sender ip is\n 4.158.2.129) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass\n (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass\n (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1\n spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com])",
            "i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 172.205.89.229) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com;\n dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com;\n dkim=none (message not signed); arc=none (0)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=xkvUUqQJG44cWKv55kIzD5TiOXmlisEbpVvs9tphQj0=;\n b=oX0yhVOonIf/VizMaq7yRB9OEdLycGdIA8wiiFaf+5fKhGUpBUwdy/v8Ll4fwUIhkfBrqJThPn2OQvbhzw7TpvuKmKy1Crap6VrcG5/mhwxc87fj+bd41aUIfPWJvduN7nBcIqKRMV+bBEilwVXjemUb5KxW+QaCWjL1Q5wr+Qc=",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=xkvUUqQJG44cWKv55kIzD5TiOXmlisEbpVvs9tphQj0=;\n b=oX0yhVOonIf/VizMaq7yRB9OEdLycGdIA8wiiFaf+5fKhGUpBUwdy/v8Ll4fwUIhkfBrqJThPn2OQvbhzw7TpvuKmKy1Crap6VrcG5/mhwxc87fj+bd41aUIfPWJvduN7nBcIqKRMV+bBEilwVXjemUb5KxW+QaCWjL1Q5wr+Qc="
        ],
        "X-MS-Exchange-Authentication-Results": [
            "spf=pass (sender IP is 4.158.2.129)\n smtp.mailfrom=arm.com; dkim=pass (signature was verified)\n header.d=arm.com;dmarc=pass action=none header.from=arm.com;",
            "spf=pass (sender IP is 172.205.89.229)\n smtp.mailfrom=arm.com; dkim=none (message not signed)\n header.d=none;dmarc=pass action=none header.from=arm.com;"
        ],
        "Received-SPF": [
            "Pass (protection.outlook.com: domain of arm.com designates\n 4.158.2.129 as permitted sender) receiver=protection.outlook.com;\n client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C",
            "Pass (protection.outlook.com: domain of arm.com designates\n 172.205.89.229 as permitted sender) receiver=protection.outlook.com;\n client-ip=172.205.89.229; helo=nebula.arm.com; pr=C"
        ],
        "From": "Christopher Bazley <chris.bazley@arm.com>",
        "To": "<gcc-patches@gcc.gnu.org>",
        "CC": "<rguenther@suse.de>, <Tamar.Christina@arm.com>,\n <rdsandiford@googlemail.com>, Christopher Bazley <chris.bazley@arm.com>",
        "Subject": "[PATCH v9 09/11] Extend BB SLP vectorization to use predicated tails",
        "Date": "Tue, 10 Feb 2026 11:31:02 +0000",
        "Message-ID": "<20260210113104.60335-10-chris.bazley@arm.com>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20260210113104.60335-1-chris.bazley@arm.com>",
        "References": "<20260210113104.60335-1-chris.bazley@arm.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-EOPAttributedMessage": "1",
        "X-MS-TrafficTypeDiagnostic": "\n DB1PEPF000509F4:EE_|VI0PR08MB11082:EE_|DB5PEPF00014B92:EE_|AM7PR08MB5365:EE_",
        "X-MS-Office365-Filtering-Correlation-Id": "307c71ab-2e2d-44a6-6ec1-08de68983472",
        "x-checkrecipientrouted": "true",
        "NoDisclaimer": "true",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam-Untrusted": "BCL:0;\n ARA:13230040|1800799024|82310400026|376014|36860700013|13003099007;",
        "X-Microsoft-Antispam-Message-Info-Original": "\n a7wl2Uak7ADGw+a2kMBVXsm0PNyNwusU3bbJsWbCA4UyElDn62a/ojNDH+YP+iJbRim+9KgwwnQMrwUfXCQAah/XMhhq+kbTNDiFYrHaB2bbOMVd6Dh0MmAg/ZDH5YVQ4FttSS82chgjHanc973lSC3GNa/9SxkCT6xpwyCWyELlLs9tae0CRWnkou5nYU5hLFnAtMs0OwoyAPgnFcIp5KPtSpnQyIFr6zX4hxq+P1VVLEEixcU2DKAG4yzXnsLgfwbo+Yd2pUxfdy20KF54B+YfYOO/A9NISipe2xldTtWAy+qdvokmyv29kFBifGXwlradxW4EKv7UrWwMqvMlzKF1of6qbi3grBa7aK+hQetjftM55pVFVSXoclPoPKWJHCfo8DySRwi1yGEVJWOrtv28k3GruuTXVp+q0bNh2XeUe333SNPeOIHVbY6i0/048QBiWWwwwgd8UqtbTZ6zF+8annuee1BzMmMal5jfHwAD+JxlbwHxEsg5eq8vTJl8VZmabh5YKVw5JZGInihBytsDJql7NJFjw+M2Sko13//7O/C4mPLWyQk5F3t60G0apw4WkWlqiIdEadiIO9BiVCMLAege12Dt7bozRmLo0qgGWWTOnPbpUSYdjBdS+DIKTW2gg5G3sUVy/tDNCEmpjMPfC3XAYY3cmxaSbPz1ZgtIFdZmo5fHEckMjQlPKLHnIxu6lT6KIb4DoF26pY59ZeO34g7i1MCKw6HI881t/VOOsmV4Qk6rhiPJfgd2wP9FdSrxN/QvOHn1he7oUEfFQgzWbRKNkcJ4MULNTKpX7Xf3yj0VCcwODQX57rGeJqyDL7FeVdxP9nKCdreoTxabuAo3gRDOMYZAnJtiDMCJOiKCyv2ANOdfLBT2OrNSD8aalhMD7Tj8e0sAD0GZ6fnL7WR/U59Lx+/vPGVxxH71anfV+lfGgnWlwB0ULRcgFJKp0gdQyiu/PTZVAzJu7Z106EYGC8AFkt6mNPDFppSrG1Ehupb8f17OmDl/WWpMWjx/xqyaYOkQFNHBbuZtViO2H7qy4nwtxkAVafEVvHsr3towpSCnEmJPFO78f6Sjjlig+ANkSSkdYDGcYzQtd7im8KB9fPJyPlcPRqA2QoeyENGRLcI9XZtEsUIhTlj6P4sfPAI+1WiupcDfCQTPx04KIN+X1MdkNSiZDkKoUo4bDQLLXgnz08eI9uk/6CADu46JIMkJtN1xSDo5IwH7xXlROzVsXLhiwQlzRR2NDXF/dYb++XUSFRGvG3twdLBkJLo7TLXjHmV/MP+03Fj00LOo9F5rHlYHBC1fN8g0a06QJLVA6+6uvwq5KZLQI/15fylWWAqB1I3dy7Kq38B99LMGDo3WzyH2aSk1/sVKyAhEZwc3TXOB/bKFrQzzx9mCOzL57OXBt0mmFH/gpYoUUQ5RJv6Om4Kzzi+QcUkennX3rC1RI6dxXYvFSAUUKqVKjR9wVDcWCQRQc8NozNsxEVL+5XwgS3Z+Kbo1xAOsbSOonXW3mpA2Cts2Po88LTxhU+7phygPunN5AwBxvgbXzl50cr863pG/GrB7kEmFtZKkWSJsSoxxrksc1oORxVhJHGhV1ma4NiwhQB6agcDczKSra/bpH4PX/WDyl+zfiEOTVDs=",
        "X-Forefront-Antispam-Report-Untrusted": "CIP:172.205.89.229; CTRY:IE; LANG:en;\n SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent;\n CAT:NONE;\n SFS:(13230040)(1800799024)(82310400026)(376014)(36860700013)(13003099007);\n DIR:OUT; SFP:1101;",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": [
            "VI0PR08MB11082",
            "AM7PR08MB5365"
        ],
        "X-MS-Exchange-Transport-CrossTenantHeadersStripped": "\n DB5PEPF00014B92.eurprd02.prod.outlook.com",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-Office365-Filtering-Correlation-Id-Prvs": "\n 789770e6-5bb0-4721-902d-08de6898087c",
        "X-Microsoft-Antispam": "BCL:0;\n ARA:13230040|376014|35042699022|82310400026|36860700013|14060799003|1800799024|13003099007;",
        "X-Microsoft-Antispam-Message-Info": "\n GbuOZ38t/LPZ2CpvIZmd5EnptMs80/RZWyxfm7bDIVcLqjbx5tCw1eHKC21Xg/h1/ZrCi1mZ0JmSV2+4zPXv5ZOYV1+zUV/HnBPQ8aU73wb4HFV7ghtkmaaytb1rAwyUVA1aB/qIDVlOJC3rrPLOZY84zAUCO3CNF6cV2ofbXa4mT4W44BJVXW3zBMj8qFSCDJhoH1JVYYiM165mjPZYJzRlPs+HmvKKZU19eFmXDbRfsUYJY00mbKR2QDzpny1exRJJrlXlMqGNSQ911xMGUEzJPrkuVH0Z7jIGG35FCPULMX+UYF5OPX5I8b5wU355vB5yVubMczNfxRnZQlZQXII7zFeduim4Vgt5J2cZ+n6jtSmXos3kowYlC6FbLEFdOnD2CmwaoWXxuFNYTgdHlwCjT0iF2//j+FoSykTO9peiME0kT0DRhWLHTAn8jMQAVeAuYBF9uBYi/j1crBXCQe6mkc/e1N8xCqxvaL5SoPsqIKLiG8EpLiKptKDYxe5L5owc/g9W8YVB2Thhw3mwPhjxleqdNOsWpqm3LZl/LcLuRCidRNdsdYY+rmeXArvHSx4eeDnCtdb+JHamRMdSDwbd8UOrIqgohNqEeVbDH8HmygBZts6CWFgX4iRoDrVk0Bh+fK2F3PUo75Es/cVhV/26mUQ+tXLRkxeY625vt08kDdPuNuvFhGUoJL8Uf63WAm6E6T4R8JBJlXUWG3xm0fPJwbPC/I53nzu4cY/WdcF43KRVPhwclQpzdNvuas8sLS1xgnc9N12eYJsJaUguHNP8jOO7MIL86DJJssf7qZMsdBnDr8On9qKRX+3bGIjg/hwFnGwmNVaLinUjXTLPbAcg4CvLR1Twq7d5u2DdWSp0RSeYT38aH2h9CX0zMilAOFzzKY6LsSGdIcBZQwEVt1trngVvE1hcVEFmhpYX067VTCfdiIAcK7tqHyhKD/DeJQN36VPdKD3kWeYIeftWrm6Iego86UN8EH+z4mP7Krf6xzAhnYJYEvoOu9UeoEXJExFWPvTqLA8trG94Av1iII7VC4bhfvHnHu+SB7xC7DEv21tvULM8MomzUR4C+iXHp1Sij53VFeTMthk/ekJXxPk8rwWzl5e8M3JuwV4zykol9Mt8w8zmzV5tNh6YMjg8rUlrJdupJTdH2h9YrJuknTyWc+UTpgXFe900Hcql1UQ9oh2sLrhF8KqalPycUs8SiZEOd46nzgve+FU1JMcwVhBGZEMX42KpedrCGxgFdzQKFNbL1oJFJzRcTAFFPB7OpgmBAry1XVlcDUXbWxGlBcwhaGofpa5Z9j8LzG0XT8xREGAQCwQdlHrbCUdneTVkLoR+Jv4gkKqFACsZWpykvOL9qoqDuZ5z+RjSQgzYJ5o0BsuuYqxPbl4uUAdeAJcqmeOQx6NRF/Rrq876h49OrjQUQrSJjS1l6GlxKR/lNzaQkLJTBQynzBWzH9PJX9HLSdadgtuT9I+cWL36L7rfFW5FvERuNOpE3DPPTLpVVhObv4TyMFxzS0zUEHJ5DyfzvqsviiLOtwkNSa9IvuwiE08mYY5T1MyfBk8zOCRjY6hXTxHl/z8VcZQ7msYP0Yy3Up5ZIULtMmMwTvhy/E2/DVQf7y8LNK4xjkMm+YOUkck=",
        "X-Forefront-Antispam-Report": "CIP:4.158.2.129; CTRY:GB; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:outbound-uk1.az.dlp.m.darktrace.com;\n PTR:InfoDomainNonexistent; CAT:NONE;\n SFS:(13230040)(376014)(35042699022)(82310400026)(36860700013)(14060799003)(1800799024)(13003099007);\n DIR:OUT; SFP:1101;",
        "X-MS-Exchange-AntiSpam-MessageData-ChunkCount": "1",
        "X-MS-Exchange-AntiSpam-MessageData-0": "\n aN3eXtYrv9ryhcRQiLQ7DGD7vcIt1ShafCr6XyZRfYcv0ankVtvhpZlEmMHji1XhRI0Qaza0FI4KZgbQe4IaxBUolt4Wa2c5b1p0CV+Jop7sy/jfk1kX0SO2dR0g5jADPODYkEuqVwPQs+MP3mU3VUFohV0XjaBPJZ1w5/uWRvv/vUMo17/+OUKGasp6TLb1QsVzFbawaE/Ytm8LwORsI8GgUi9x00jze1t24D8YYuYmtk1zsQ1kvD/ADpcOcjuNqa8rfrhBSJ4PjSSgHqLY+D//uvHuEYa3Qhv9Fek7UTD9erY3eV78rdnkFmvrfF3N5f3fD0PZaIttO5iDigsCMmzFXUFlHBQLyNt1jwa87zgJ27n6CH5zzm68SKtG7ndpZgerX/FSwWJzZnP8njX8hUMmWt0LkjMZ1Nsmj/wME7IDppL1HDMERcVWdwBHSGqW",
        "X-OriginatorOrg": "arm.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "10 Feb 2026 11:33:25.6292 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 307c71ab-2e2d-44a6-6ec1-08de68983472",
        "X-MS-Exchange-CrossTenant-Id": "f34e5979-57d9-4aaa-ad4d-b122a662184d",
        "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "\n TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[4.158.2.129];\n Helo=[outbound-uk1.az.dlp.m.darktrace.com]",
        "X-MS-Exchange-CrossTenant-AuthSource": "\n DB5PEPF00014B92.eurprd02.prod.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-BeenThere": "gcc-patches@gcc.gnu.org",
        "X-Mailman-Version": "2.1.30",
        "Precedence": "list",
        "List-Id": "Gcc-patches mailing list <gcc-patches.gcc.gnu.org>",
        "List-Unsubscribe": "<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>",
        "List-Archive": "<https://gcc.gnu.org/pipermail/gcc-patches/>",
        "List-Post": "<mailto:gcc-patches@gcc.gnu.org>",
        "List-Help": "<mailto:gcc-patches-request@gcc.gnu.org?subject=help>",
        "List-Subscribe": "<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>",
        "Errors-To": "gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"
    },
    "content": "This enables use of a predicate mask or length limit for\nvectorization of basic blocks in cases where previously only the\nequivalent rolled (i.e. loop) form of some source code would have\nbeen vectorized. Predication is used for groups whose size\nis not neatly divisible into vectors of lengths that can be\nsupported directly by the target.\n\nThe initial vector mode for an SLP region is \"autodetected\" by calling\naarch64_preferred_simd_mode, which prefers SVE modes if supported and\nunless configured otherwise (e.g. VNx4SI for int). If at least one\nprofitable subgraph can be scheduled then GCC does not try to vectorise\nthe region using any other modes, even though their estimated costs\nmight otherwise have been lower.\n\nFor example, if analysis of a 24-byte group succeeds with vector mode\nV16QI (using types vector(16) and vector(8) char) then the estimated\ncost of the vectorised code is 11+11=22. If analysis of the same group\nsucceeds with vector mode VNx16QI (using type vector([16,16]) char for\nboth subtrees) then the estimated cost is 15+15=30. In both cases, the\nestimated vectorised cost would beat the estimated scalar cost of\n96+48=144, so vector([16,16]) wins because VNx16QI is tried first.\n\nThis is mitigated by the fact that a sequence of GIMPLE stmts such as:\n\n  vectp.14_86 = x_50(D) + 16;\n  slp_mask_87 = .WHILE_ULT (0, 8, { 0, ... });\n  .MASK_STORE (vectp.14_86, 8B, slp_mask_87, vect__34.12_85);\n\nare lowered to a fixed-length vector store (e.g., str d30, [x0, 16]) if\npossible, instead of a more literal interpretation such as:\n\n  add\tx0, x0, 16\n  ptrue\tp7.b, vl7\n  st1b\tz30.b, p7, [x0]\n\nThe vect_record_nunits function used during building of an SLP\ntree is updated to prevent it returning failure for BB SLP if the\ngroup size is not an integral multiple of the number of lanes in the\nvector type; it now allows such cases if the vector type might be more\nthan long enough.\n\nInstead of giving up if vect_get_vector_types_for_stmt\nfails for the specified group size, vect_build_slp_tree_1\nnow calls vect_get_vector_types_for_stmt again without\na group size (which defaults to 0) as a fallback.\nIf this succeeds then the initial failure is treated as a\n'soft' failure that results in the group being split.\nConsequently, assertions that \"For BB vectorization, we\nshould always have a group size once we've constructed the\nSLP tree\" were deleted in get_vectype_for_scalar_type and\nvect_get_vector_types_for_stmt.\n\nFor BB SLP, vect_analyze_slp_instance previously gave up after\nbuilding an SLP tree if it could not prove that the group size was\nat least the maximum lane count across all of the vector types in\nthe SLP tree (which is unprovable for scalable vector types), or\nattempted to split the group if it could prove that the group size\nwas greater than this maximum but not exactly divisible by it\n(which is also unprovable for scalable vector types).\n\nThis function will now provisionally create a new SLP instance if the\ngroup size definitely does not exceed the minimum number of lanes,\neven if the group size otherwise satisfies conditions that would\nrequire a loop to be unrolled (e.g., a group of size 3 that uses a\nmixture of V4SI and V8HI types). If the group size lies between the\nminimum and maximum number of lanes then vectorization is still\nabandoned (e.g., a group of size 3 that uses a mixture of\nV2DI and V4SI types).\n\nWith BB SLP, there is no need for agreement between different SLP\nnodes about whether to use masks or lengths to support partial vectors.\nInstead, that decision is made early and per individual SLP node, by\nvect_analyze_stmt. If a partial vector is required (i.e. if the number\nof subparts in the vector type may be greater than the number of active\nlanes for the node) then vect_analyze_stmt now requires\nSLP_TREE_CAN_USE_PARTIAL_VECTORS_P to be true; otherwise it clears any\nSLP_TREE_PARTIAL_VECTORS_STYLE that could have been set.\n\nThe vect_get_num_copies function used during statement analysis\nis updated to return early with 1 if a vector type is long enough for\nthe specified SLP tree node. This avoids an ICE in vect_get_num_vectors,\nwhich cannot cope with SVE vector types.\n\nWhen checking whether a value that is used outside the vectorized\nregion can be supported, the vectorizable_live_operation function\ncalculates which vector contains the result, and which lane of that\nvector we need. Previously, this calculation gave the wrong answer\nfor BB SLP with a variable-length vector type (eventually generating\ninvalid offsets such as BIT_FIELD_REF <_251, 32, POLY_INT_CST\n[96, 128]> to access the third element of a group using type VNx4SI)\nbecause it reused logic intended for loop vectorization, which selects\nthe 'last' occurrence of a scalar index relative to the group size\n(which is a multiple of the vector length). For BB SLP with a\npredicate mask, only the first SLP_TREE_LANES elements are well\ndefined.\n\nvect_create_vectorized_promotion_stmts no longer pushes\nmore stmts than implied by vect_get_num_copies because it could\npreviously overrun the number of slots allocated for an SLP node\n(based on its number of lanes and type). e.g., four defs were\npushed for a promotion of V8HI to V2DI (8/2=4) even if only two\nlanes of the V8HI were active. Allowing it later caused ICE in\nvectorizable_operation for a parent node, because binary ops\nrequire both operands to be the same length.\n\nSince promotion no longer produces redundant definitions,\nvectorizable_conversion also had to be modified so that demotion no\nlonger relies on an even number of defs being produced. If\nnecessary, it now pushes a single constant zero def.\n\nThe whole change is enabled by wiring the wrapper function\nvect_can_use_partial_vectors_p to SLP_TREE_CAN_USE_PARTIAL_VECTORS_P\nwhen invoked for BB SLP vectorization.\n\nUpdate test expectations for gcc.dg/vect/vect-over-widen-*.c and\ngcc.target/aarch64/sve/slp_6.c.\n\ngcc/ChangeLog:\n\n\t* tree-vect-loop.cc (vectorizable_live_operation): Simplify the\n\tcalculation of the index of the final result to avoid\n\tgenerating invalid polynomial offsets relative to the end of\n\tvariable-length vector types, which is what happens if the code\n\tfor loop vectorization is reused for for basic block SLP.\n\t* tree-vect-slp.cc (vect_record_nunits): Allow group sizes that\n\tare indivisible by the vector length.\n\t(vect_build_slp_tree_1): In case of failure of\n\tvect_get_vector_types_for_stmt, try to get fallback vector\n\ttypes and continue analysis to allow splitting of groups.\n\t(vect_build_slp_tree_2): Don't call\n\tcan_duplicate_and_interleave_p when doing basic block SLP\n\tvectorization.\n\t(vect_update_slp_min_nunits_for_node): New recursive function.\n\tUpdate min_nunits to reflect the minimum number of subparts for\n\tall of the vector types used by an SLP subgraph.\n\t(vect_slp_tree_min_nunits): New function. Initialize min_nunits\n\tthen call vect_update_slp_min_nunits_for_node.\n\t(vect_analyze_slp_instance): For BB SLP vectorization, create\n\ta new SLP instance if the group size definitely does not exceed\n\tthe minimum number of subparts for all of the vector types used\n\tin the SLP tree, even if the group size otherwise satisfies\n\tconditions that would require a loop to be unrolled.\n\t(vectorizable_slp_permutation_1): Instead of asserting that an\n\tSLP tree node's number of lanes is compatible with the chosen\n\tvector width, return a failure indication if incompatible.\n\t* tree-vect-stmts.cc (check_load_store_for_partial_vectors):\n\tWhen calculating the number of vectors, get the group size from\n\tSLP_TREE_LANES instead of a parameter (e.g., DR_GROUP_SIZE) if\n\tdoing BB SLP vectorization. Don't assume it can be divided by\n\tthe number of subparts in the vector type to get a compile-time\n\tconstant.\n\t(vect_get_data_ptr_increment): Require a parameter of type\n\tloop_vec_info instead of vec_info *.\n\t(vect_create_vectorized_promotion_stmts): Require an SLP tree\n\tnode to be passed by the caller, for use by\n\tvect_get_num_copies.\n\tStop pushing more stmts than implied by vect_get_num_copies.\n\t(vectorizable_conversion): Pass SLP tree node to\n\tvect_create_vectorized_promotion_stmts.\n\tDemotion no longer relies on an even number of definitions\n\tbeing produced by promotion. If necessary, push a single constant\n\tzero definition.\n\t(vectorizable_load): Pass loop_vec_info instead of vec_info *\n\twhen calling vect_get_data_ptr_increment.\n\t(vect_analyze_stmt): For BB SLP vectorization, check whether\n\tthe group needs partial vectors. If it does then return a\n\tfailure indication if SLP_TREE_CAN_USE_PARTIAL_VECTORS_P was\n\tcleared by a callee of this function; if it doesn't need\n\tpartial vectors then clear any partial vectors style that might\n\thave been chosen by callees of this function.\n\t(get_vectype_for_scalar_type): For BB SLP vectorization, allow\n\tinvocation of this function with a group size of zero even if\n\tone or more SLP instances have been created.\n\tIf the number of subparts in the natural choice of vector type\n\tcould be greater than the group size then pick a shorter vector\n\ttype only if the target does not support partial vectors.\n\t(vect_maybe_update_slp_op_vectype): Reject external definitions\n\tthat have a number of lanes not divisible by the number of\n\tsubparts in a vector type naively inferred from the scalar\n\ttype.\n\t(vect_get_vector_types_for_stmt): Add a new output parameter of\n\tBoolean type. Set it to true if the statement can't be\n\tvectorized because it uses a data type that the target doesn't\n\tsupport in vector form for a group of the given size, otherwise\n\tfalse.\n\t* tree-vectorizer.h (vect_get_num_copies): Return early with 1\n\tif a vector type is long enough for the specified SLP tree\n\tnode to avoid an ICE in vect_get_num_vectors.\n\t(vect_get_vector_types_for_stmt): Update function declaration.\n\t(vect_can_use_partial_vectors_p): Handle the BB SLP use-case by\n\treturning the result of SLP_TREE_CAN_USE_PARTIAL_VECTORS_P.\n\ngcc/testsuite/ChangeLog:\n\n\t* gcc.dg/vect/vect-over-widen-10.c: Update test expectations to\n\tavoid spurious matching of scan-tree-dump-not pattern.\n\t* gcc.dg/vect/vect-over-widen-13.c: As above.\n\t* gcc.dg/vect/vect-over-widen-14.c: As above.\n\t* gcc.dg/vect/vect-over-widen-17.c: As above.\n\t* gcc.dg/vect/vect-over-widen-18.c: As above.\n\t* gcc.dg/vect/vect-over-widen-5.c: As above.\n\t* gcc.dg/vect/vect-over-widen-6.c: As above.\n\t* gcc.dg/vect/vect-over-widen-7.c: As above.\n\t* gcc.dg/vect/vect-over-widen-8.c: As above.\n\t* gcc.dg/vect/vect-over-widen-9.c: As above.\n\n---\n .../gcc.dg/vect/vect-over-widen-10.c          |   2 +-\n .../gcc.dg/vect/vect-over-widen-13.c          |   2 +-\n .../gcc.dg/vect/vect-over-widen-14.c          |   2 +-\n .../gcc.dg/vect/vect-over-widen-17.c          |   2 +-\n .../gcc.dg/vect/vect-over-widen-18.c          |   2 +-\n gcc/testsuite/gcc.dg/vect/vect-over-widen-5.c |   2 +-\n gcc/testsuite/gcc.dg/vect/vect-over-widen-6.c |   2 +-\n gcc/testsuite/gcc.dg/vect/vect-over-widen-7.c |   2 +-\n gcc/testsuite/gcc.dg/vect/vect-over-widen-8.c |   2 +-\n gcc/testsuite/gcc.dg/vect/vect-over-widen-9.c |   2 +-\n gcc/testsuite/gcc.target/aarch64/sve/slp_6.c  |   3 -\n gcc/tree-vect-loop.cc                         |  14 +-\n gcc/tree-vect-slp.cc                          | 141 ++++++++++--\n gcc/tree-vect-stmts.cc                        | 202 +++++++++++++-----\n gcc/tree-vectorizer.h                         |  13 +-\n 15 files changed, 291 insertions(+), 102 deletions(-)",
    "diff": "diff --git a/gcc/testsuite/gcc.dg/vect/vect-over-widen-10.c b/gcc/testsuite/gcc.dg/vect/vect-over-widen-10.c\nindex f0140e4ef6d..6efcf739db9 100644\n--- a/gcc/testsuite/gcc.dg/vect/vect-over-widen-10.c\n+++ b/gcc/testsuite/gcc.dg/vect/vect-over-widen-10.c\n@@ -16,5 +16,5 @@\n /* { dg-final { scan-tree-dump {vect_recog_over_widening_pattern: detected:[^\\n]* >> 1} \"vect\" } } */\n /* { dg-final { scan-tree-dump {vect_recog_over_widening_pattern: detected:[^\\n]* >> 2} \"vect\" } } */\n /* { dg-final { scan-tree-dump {vect_recog_cast_forwprop_pattern: detected:[^\\n]* \\(unsigned char\\)} \"vect\" } } */\n-/* { dg-final { scan-tree-dump-not {vector[^ ]* int} \"vect\" } } */\n+/* { dg-final { scan-tree-dump-not {vector[^ ]* int vect__} \"vect\" } } */\n /* { dg-final { scan-tree-dump-times \"vectorized 1 loop\" 1 \"vect\" } } */\ndiff --git a/gcc/testsuite/gcc.dg/vect/vect-over-widen-13.c b/gcc/testsuite/gcc.dg/vect/vect-over-widen-13.c\nindex 08a65ea5518..720353716cf 100644\n--- a/gcc/testsuite/gcc.dg/vect/vect-over-widen-13.c\n+++ b/gcc/testsuite/gcc.dg/vect/vect-over-widen-13.c\n@@ -48,5 +48,5 @@ main (void)\n /* { dg-final { scan-tree-dump {vect_recog_over_widening_pattern: detected:[^\\n]* \\+} \"vect\" } } */\n /* { dg-final { scan-tree-dump {vect_recog_over_widening_pattern: detected:[^\\n]* / 2} \"vect\" } } */\n /* { dg-final { scan-tree-dump {vect_recog_cast_forwprop_pattern: detected:[^\\n]* = \\(signed char\\)} \"vect\" } } */\n-/* { dg-final { scan-tree-dump-not {vector[^ ]* int} \"vect\" } } */\n+/* { dg-final { scan-tree-dump-not {vector[^ ]* int vect__} \"vect\" } } */\n /* { dg-final { scan-tree-dump-times \"vectorized 1 loop\" 1 \"vect\" } } */\ndiff --git a/gcc/testsuite/gcc.dg/vect/vect-over-widen-14.c b/gcc/testsuite/gcc.dg/vect/vect-over-widen-14.c\nindex dfa09f5d2ca..f1d5f95c543 100644\n--- a/gcc/testsuite/gcc.dg/vect/vect-over-widen-14.c\n+++ b/gcc/testsuite/gcc.dg/vect/vect-over-widen-14.c\n@@ -15,5 +15,5 @@\n /* { dg-final { scan-tree-dump {vect_recog_over_widening_pattern: detected:[^\\n]* \\+} \"vect\" } } */\n /* { dg-final { scan-tree-dump {vect_recog_over_widening_pattern: detected:[^\\n]* >> 1} \"vect\" } } */\n /* { dg-final { scan-tree-dump {vect_recog_cast_forwprop_pattern: detected:[^\\n]* = \\(unsigned char\\)} \"vect\" } } */\n-/* { dg-final { scan-tree-dump-not {vector[^ ]* int} \"vect\" } } */\n+/* { dg-final { scan-tree-dump-not {vector[^ ]* int vect__} \"vect\" } } */\n /* { dg-final { scan-tree-dump-times \"vectorized 1 loop\" 1 \"vect\" } } */\ndiff --git a/gcc/testsuite/gcc.dg/vect/vect-over-widen-17.c b/gcc/testsuite/gcc.dg/vect/vect-over-widen-17.c\nindex 53fcfd0c06c..ac1a0f86727 100644\n--- a/gcc/testsuite/gcc.dg/vect/vect-over-widen-17.c\n+++ b/gcc/testsuite/gcc.dg/vect/vect-over-widen-17.c\n@@ -46,5 +46,5 @@ main (void)\n    adopts realign_load scheme.  It requires rs6000_builtin_mask_for_load to\n    generate mask whose return type is vector char.  */\n /* { dg-final { scan-tree-dump-not {vector[^\\n]*char} \"vect\" { target vect_hw_misalign } } } */\n-/* { dg-final { scan-tree-dump-not {vector[^ ]* int} \"vect\" } } */\n+/* { dg-final { scan-tree-dump-not {vector[^ ]* int vect__} \"vect\" } } */\n /* { dg-final { scan-tree-dump-times \"vectorized 1 loop\" 1 \"vect\" } } */\ndiff --git a/gcc/testsuite/gcc.dg/vect/vect-over-widen-18.c b/gcc/testsuite/gcc.dg/vect/vect-over-widen-18.c\nindex aa58cd1c957..3ebfaa78270 100644\n--- a/gcc/testsuite/gcc.dg/vect/vect-over-widen-18.c\n+++ b/gcc/testsuite/gcc.dg/vect/vect-over-widen-18.c\n@@ -47,5 +47,5 @@ main (void)\n /* { dg-final { scan-tree-dump {vect_recog_over_widening_pattern: detected:[^\\n]* |} \"vect\" } } */\n /* { dg-final { scan-tree-dump {vect_recog_over_widening_pattern: detected:[^\\n]* <<} \"vect\" } } */\n /* { dg-final { scan-tree-dump {vector[^\\n]*char} \"vect\" } } */\n-/* { dg-final { scan-tree-dump-not {vector[^ ]* int} \"vect\" } } */\n+/* { dg-final { scan-tree-dump-not {vector[^ ]* int vect__} \"vect\" } } */\n /* { dg-final { scan-tree-dump-times \"vectorized 1 loop\" 1 \"vect\" } } */\ndiff --git a/gcc/testsuite/gcc.dg/vect/vect-over-widen-5.c b/gcc/testsuite/gcc.dg/vect/vect-over-widen-5.c\nindex c2ab11a9d32..1d89789a86d 100644\n--- a/gcc/testsuite/gcc.dg/vect/vect-over-widen-5.c\n+++ b/gcc/testsuite/gcc.dg/vect/vect-over-widen-5.c\n@@ -49,5 +49,5 @@ main (void)\n /* { dg-final { scan-tree-dump {vect_recog_over_widening_pattern: detected:[^\\n]* \\+ } \"vect\" } } */\n /* { dg-final { scan-tree-dump {vect_recog_over_widening_pattern: detected:[^\\n]* >> 1} \"vect\" } } */\n /* { dg-final { scan-tree-dump {vect_recog_cast_forwprop_pattern: detected:[^\\n]* \\(signed char\\)} \"vect\" } } */\n-/* { dg-final { scan-tree-dump-not {vector[^ ]* int} \"vect\" } } */\n+/* { dg-final { scan-tree-dump-not {vector[^ ]* int vect__} \"vect\" } } */\n /* { dg-final { scan-tree-dump-times \"vectorized 1 loop\" 1 \"vect\" } } */\ndiff --git a/gcc/testsuite/gcc.dg/vect/vect-over-widen-6.c b/gcc/testsuite/gcc.dg/vect/vect-over-widen-6.c\nindex bda92c965e0..62d5a52587e 100644\n--- a/gcc/testsuite/gcc.dg/vect/vect-over-widen-6.c\n+++ b/gcc/testsuite/gcc.dg/vect/vect-over-widen-6.c\n@@ -13,5 +13,5 @@\n /* { dg-final { scan-tree-dump {vect_recog_over_widening_pattern: detected:[^\\n]* \\+ } \"vect\" } } */\n /* { dg-final { scan-tree-dump {vect_recog_over_widening_pattern: detected:[^\\n]* >> 1} \"vect\" } } */\n /* { dg-final { scan-tree-dump {vect_recog_cast_forwprop_pattern: detected:[^\\n]* \\(unsigned char\\)} \"vect\" } } */\n-/* { dg-final { scan-tree-dump-not {vector[^ ]* int} \"vect\" } } */\n+/* { dg-final { scan-tree-dump-not {vector[^ ]* int vect__} \"vect\" } } */\n /* { dg-final { scan-tree-dump-times \"vectorized 1 loop\" 1 \"vect\" } } */\ndiff --git a/gcc/testsuite/gcc.dg/vect/vect-over-widen-7.c b/gcc/testsuite/gcc.dg/vect/vect-over-widen-7.c\nindex 1d55e13fb1f..6e09631009a 100644\n--- a/gcc/testsuite/gcc.dg/vect/vect-over-widen-7.c\n+++ b/gcc/testsuite/gcc.dg/vect/vect-over-widen-7.c\n@@ -51,5 +51,5 @@ main (void)\n /* { dg-final { scan-tree-dump {vect_recog_over_widening_pattern: detected:[^\\n]* \\+ } \"vect\" } } */\n /* { dg-final { scan-tree-dump {vect_recog_over_widening_pattern: detected:[^\\n]* >> 2} \"vect\" } } */\n /* { dg-final { scan-tree-dump {vect_recog_cast_forwprop_pattern: detected:[^\\n]* \\(signed char\\)} \"vect\" } } */\n-/* { dg-final { scan-tree-dump-not {vector[^ ]* int} \"vect\" } } */\n+/* { dg-final { scan-tree-dump-not {vector[^ ]* int vect__} \"vect\" } } */\n /* { dg-final { scan-tree-dump-times \"vectorized 1 loop\" 1 \"vect\" } } */\ndiff --git a/gcc/testsuite/gcc.dg/vect/vect-over-widen-8.c b/gcc/testsuite/gcc.dg/vect/vect-over-widen-8.c\nindex 553c0712a79..b6d650beab4 100644\n--- a/gcc/testsuite/gcc.dg/vect/vect-over-widen-8.c\n+++ b/gcc/testsuite/gcc.dg/vect/vect-over-widen-8.c\n@@ -16,5 +16,5 @@\n /* { dg-final { scan-tree-dump {vect_recog_over_widening_pattern: detected:[^\\n]* \\+ } \"vect\" } } */\n /* { dg-final { scan-tree-dump {vect_recog_over_widening_pattern: detected:[^\\n]* >> 2} \"vect\" } } */\n /* { dg-final { scan-tree-dump {vect_recog_cast_forwprop_pattern: detected:[^\\n]* \\(unsigned char\\)} \"vect\" } } */\n-/* { dg-final { scan-tree-dump-not {vector[^ ]* int} \"vect\" } } */\n+/* { dg-final { scan-tree-dump-not {vector[^ ]* int vect__} \"vect\" } } */\n /* { dg-final { scan-tree-dump-times \"vectorized 1 loop\" 1 \"vect\" } } */\ndiff --git a/gcc/testsuite/gcc.dg/vect/vect-over-widen-9.c b/gcc/testsuite/gcc.dg/vect/vect-over-widen-9.c\nindex 36bfc68e053..e82f8a571da 100644\n--- a/gcc/testsuite/gcc.dg/vect/vect-over-widen-9.c\n+++ b/gcc/testsuite/gcc.dg/vect/vect-over-widen-9.c\n@@ -56,5 +56,5 @@ main (void)\n /* { dg-final { scan-tree-dump {vect_recog_over_widening_pattern: detected:[^\\n]* >> 1} \"vect\" } } */\n /* { dg-final { scan-tree-dump {vect_recog_over_widening_pattern: detected:[^\\n]* >> 2} \"vect\" } } */\n /* { dg-final { scan-tree-dump {vect_recog_cast_forwprop_pattern: detected:[^\\n]* \\(signed char\\)} \"vect\" } } */\n-/* { dg-final { scan-tree-dump-not {vector[^ ]* int} \"vect\" } } */\n+/* { dg-final { scan-tree-dump-not {vector[^ ]* int vect__} \"vect\" } } */\n /* { dg-final { scan-tree-dump-times \"vectorized 1 loop\" 1 \"vect\" } } */\ndiff --git a/gcc/testsuite/gcc.target/aarch64/sve/slp_6.c b/gcc/testsuite/gcc.target/aarch64/sve/slp_6.c\nindex 44d128477d2..1c9ac15a699 100644\n--- a/gcc/testsuite/gcc.target/aarch64/sve/slp_6.c\n+++ b/gcc/testsuite/gcc.target/aarch64/sve/slp_6.c\n@@ -37,9 +37,6 @@ vec_slp_##TYPE (TYPE *restrict a, TYPE *restrict b, int n)\t\\\n TEST_ALL (VEC_PERM)\n \n /* These loops can't use SLP.  */\n-/* { dg-final { scan-assembler-not {\\tld1b\\t} } } */\n-/* { dg-final { scan-assembler-not {\\tld1h\\t} } } */\n-/* { dg-final { scan-assembler-not {\\tld1w\\t} } } */\n /* { dg-final { scan-assembler-not {\\tld1d\\t} } } */\n /* { dg-final { scan-assembler {\\tld3b\\t} } } */\n /* { dg-final { scan-assembler {\\tld3h\\t} } } */\ndiff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc\nindex ba0f0b53b2a..5d92a6ff34c 100644\n--- a/gcc/tree-vect-loop.cc\n+++ b/gcc/tree-vect-loop.cc\n@@ -10232,12 +10232,16 @@ vectorizable_live_operation (vec_info *vinfo, stmt_vec_info stmt_info,\n \n   gcc_assert (slp_index >= 0);\n \n-  /* Get the last occurrence of the scalar index from the concatenation of\n-     all the slp vectors. Calculate which slp vector it is and the index\n-     within.  */\n-  int num_scalar = SLP_TREE_LANES (slp_node);\n   int num_vec = vect_get_num_copies (vinfo, slp_node);\n-  poly_uint64 pos = (num_vec * nunits) - num_scalar + slp_index;\n+  poly_uint64 pos = slp_index;\n+  if (loop_vinfo)\n+    {\n+      /* Get the last occurrence of the scalar index from the concatenation of\n+\t all the slp vectors. Calculate which slp vector it is and the index\n+\t within.  */\n+      int num_scalar = SLP_TREE_LANES (slp_node);\n+      pos += (num_vec * nunits) - num_scalar;\n+    }\n \n   /* Calculate which vector contains the result, and which lane of\n      that vector we need.  */\ndiff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc\nindex 71f1a7e53ed..f18f13d3942 100644\n--- a/gcc/tree-vect-slp.cc\n+++ b/gcc/tree-vect-slp.cc\n@@ -1074,8 +1074,12 @@ vect_record_max_nunits (vec_info *vinfo, stmt_vec_info stmt_info,\n     }\n \n   /* If populating the vector type requires unrolling then fail\n-     before adjusting *max_nunits for basic-block vectorization.  */\n+     before adjusting *max_nunits for basic-block vectorization.\n+     Allow group sizes that are indivisible by the vector length only if they\n+     are known not to exceed the vector length.  We may be able to support such\n+     cases by generating constant masks.  */\n   if (is_a <bb_vec_info> (vinfo)\n+      && maybe_gt (group_size, TYPE_VECTOR_SUBPARTS (vectype))\n       && !multiple_p (group_size, TYPE_VECTOR_SUBPARTS (vectype)))\n     {\n       if (dump_enabled_p ())\n@@ -1127,12 +1131,29 @@ vect_build_slp_tree_1 (vec_info *vinfo, unsigned char *swap,\n   tree soft_fail_nunits_vectype = NULL_TREE;\n \n   tree vectype, nunits_vectype;\n+  bool unsupported_datatype = false;\n   if (!vect_get_vector_types_for_stmt (vinfo, first_stmt_info, &vectype,\n-\t\t\t\t       &nunits_vectype, group_size))\n+\t\t\t\t       &nunits_vectype, &unsupported_datatype,\n+\t\t\t\t       group_size))\n     {\n-      /* Fatal mismatch.  */\n-      matches[0] = false;\n-      return false;\n+      /* Try to get fallback vector types and continue analysis, producing\n+\t matches[] as if vectype was not an issue.  This allows splitting of\n+\t groups to happen.  */\n+      if (unsupported_datatype\n+\t  && vect_get_vector_types_for_stmt (vinfo, first_stmt_info, &vectype,\n+\t\t\t\t\t     &nunits_vectype,\n+\t\t\t\t\t     &unsupported_datatype))\n+\t{\n+\t  gcc_assert (is_a<bb_vec_info> (vinfo));\n+\t  maybe_soft_fail = true;\n+\t  soft_fail_nunits_vectype = nunits_vectype;\n+\t}\n+      else\n+\t{\n+\t  /* Fatal mismatch.  */\n+\t  matches[0] = false;\n+\t  return false;\n+\t}\n     }\n   if (is_a <bb_vec_info> (vinfo)\n       && known_le (TYPE_VECTOR_SUBPARTS (vectype), 1U))\n@@ -1660,16 +1681,22 @@ vect_build_slp_tree_1 (vec_info *vinfo, unsigned char *swap,\n \n   if (maybe_soft_fail)\n     {\n-      unsigned HOST_WIDE_INT const_nunits;\n-      if (!TYPE_VECTOR_SUBPARTS\n-\t    (soft_fail_nunits_vectype).is_constant (&const_nunits)\n-\t  || const_nunits > group_size)\n+      /* Use the known minimum number of subparts for VLA because we still need\n+\t to choose a splitting point although the choice is more arbitrary.  */\n+      unsigned HOST_WIDE_INT const_nunits = constant_lower_bound (\n+\t  TYPE_VECTOR_SUBPARTS (soft_fail_nunits_vectype));\n+\n+      if (const_nunits > group_size)\n \tmatches[0] = false;\n       else\n \t{\n \t  /* With constant vector elements simulate a mismatch at the\n \t     point we need to split.  */\n+\t  gcc_assert ((const_nunits & (const_nunits - 1)) == 0);\n \t  unsigned tail = group_size & (const_nunits - 1);\n+\t  if (tail == 0)\n+\t    tail = const_nunits;\n+\t  gcc_assert (group_size >= tail);\n \t  memset (&matches[group_size - tail], 0, sizeof (bool) * tail);\n \t}\n       return false;\n@@ -2400,13 +2427,21 @@ vect_build_slp_tree_2 (vec_info *vinfo, slp_tree node,\n \t\t  /* Check whether we can build the invariant.  If we can't\n \t\t     we never will be able to.  */\n \t\t  tree type = TREE_TYPE (chains[0][n].op);\n-\t\t  if (!GET_MODE_SIZE (vinfo->vector_mode).is_constant ()\n-\t\t      && (TREE_CODE (type) == BOOLEAN_TYPE\n-\t\t\t  || !can_duplicate_and_interleave_p (vinfo, group_size,\n-\t\t\t\t\t\t\t      type)))\n+\t\t  if (!GET_MODE_SIZE (vinfo->vector_mode).is_constant ())\n \t\t    {\n-\t\t      matches[0] = false;\n-\t\t      goto out;\n+\t\t      if (TREE_CODE (type) == BOOLEAN_TYPE)\n+\t\t\t{\n+\t\t\t  matches[0] = false;\n+\t\t\t  goto out;\n+\t\t\t}\n+\n+\t\t      if (!is_a<bb_vec_info> (vinfo)\n+\t\t\t  && !can_duplicate_and_interleave_p (vinfo, group_size,\n+\t\t\t\t\t\t\t      type))\n+\t\t\t{\n+\t\t\t  matches[0] = false;\n+\t\t\t  goto out;\n+\t\t\t}\n \t\t    }\n \t\t}\n \t      else if (dt != vect_internal_def)\n@@ -2835,7 +2870,7 @@ out:\n \t\t    uniform_val = NULL_TREE;\n \t\t    break;\n \t\t  }\n-\t      if (!uniform_val\n+\t      if (!uniform_val && !is_a<bb_vec_info> (vinfo)\n \t\t  && !can_duplicate_and_interleave_p (vinfo,\n \t\t\t\t\t\t      oprnd_info->ops.length (),\n \t\t\t\t\t\t      TREE_TYPE (op0)))\n@@ -4911,6 +4946,53 @@ vect_analyze_slp_reductions (loop_vec_info loop_vinfo,\n   return true;\n }\n \n+/* Update MIN_NUNITS to reflect the minimum number of subparts for all of the\n+   vector types used by the SLP subgraph rooted at NODE.  VISITED is used to\n+   avoid reevaluating any node in the subgraph; it thereby prevents infinite\n+   recursion should a cycle be encountered. The value of MIN_NUNITS will only be\n+   updated if any node in the subgraph has a vector type with a number of\n+   subparts that is smaller than the passed-in value of MIN_NUNITS. Before\n+   calling this function for the first time, initialize MIN_NUNITS to\n+   UINT64_MAX.  */\n+\n+static void\n+vect_update_slp_min_nunits_for_node (slp_tree node, poly_uint64 &min_nunits,\n+\t\t\t\t     hash_set<slp_tree> &visited)\n+{\n+  if (!node || SLP_TREE_DEF_TYPE (node) != vect_internal_def)\n+    return;\n+\n+  if (visited.add (node))\n+    return;\n+\n+  for (slp_tree child : SLP_TREE_CHILDREN (node))\n+    vect_update_slp_min_nunits_for_node (child, min_nunits, visited);\n+\n+  tree vectype = SLP_TREE_VECTYPE (node);\n+  if (!vectype)\n+    return;\n+\n+  /* All unit counts have the form vec_info::vector_size * X for some\n+     rational X, therefore we know the values are ordered.  */\n+  poly_uint64 nunits = TYPE_VECTOR_SUBPARTS (vectype);\n+  min_nunits = known_eq (min_nunits, UINT64_MAX)\n+\t\t ? nunits\n+\t\t : ordered_min (min_nunits, nunits);\n+}\n+\n+/* For NODE, return the minimum number of subparts for all of the vector\n+   types used in the given SLP graph.  */\n+\n+static poly_uint64\n+vect_slp_tree_min_nunits (slp_tree node)\n+{\n+  poly_uint64 min_nunits = UINT64_MAX;\n+  hash_set<slp_tree> visited;\n+  vect_update_slp_min_nunits_for_node (node, min_nunits, visited);\n+  gcc_checking_assert (known_ne (min_nunits, UINT64_MAX));\n+  return min_nunits;\n+}\n+\n /* Analyze an SLP instance starting from a group of grouped stores.  Call\n    vect_build_slp_tree to build a tree of packed stmts if possible.\n    Return FALSE if it's impossible to SLP any stmt in the group.  */\n@@ -4980,8 +5062,8 @@ vect_analyze_slp_instance (vec_info *vinfo,\n       poly_uint64 unrolling_factor\n \t= calculate_unrolling_factor (max_nunits, group_size);\n \n-      if (maybe_ne (unrolling_factor, 1U)\n-\t  && is_a <bb_vec_info> (vinfo))\n+      if (maybe_ne (unrolling_factor, 1U) && is_a<bb_vec_info> (vinfo)\n+\t  && !known_ge (vect_slp_tree_min_nunits (node), group_size))\n \t{\n \t  unsigned HOST_WIDE_INT const_max_nunits;\n \t  if (!max_nunits.is_constant (&const_max_nunits)\n@@ -5066,9 +5148,10 @@ vect_analyze_slp_instance (vec_info *vinfo,\n \t    = TREE_TYPE (DR_REF (STMT_VINFO_DATA_REF (stmt_info)));\n \t  tree vectype = get_vectype_for_scalar_type (vinfo, scalar_type,\n \t\t\t\t\t\t      1 << floor_log2 (i));\n-\t  unsigned HOST_WIDE_INT const_nunits;\n-\t  if (vectype\n-\t      && TYPE_VECTOR_SUBPARTS (vectype).is_constant (&const_nunits))\n+\t  unsigned HOST_WIDE_INT const_nunits\n+\t    = vectype ? constant_lower_bound (TYPE_VECTOR_SUBPARTS (vectype))\n+\t\t      : 0;\n+\t  if (const_nunits > 1 && (i % const_nunits) == 0)\n \t    {\n \t      /* Split into two groups at the first vector boundary.  */\n \t      gcc_assert ((const_nunits & (const_nunits - 1)) == 0);\n@@ -11702,7 +11785,21 @@ vectorizable_slp_permutation_1 (vec_info *vinfo, gimple_stmt_iterator *gsi,\n       unpack_factor = 1;\n     }\n   unsigned olanes = unpack_factor * ncopies * SLP_TREE_LANES (node);\n-  gcc_assert (repeating_p || multiple_p (olanes, nunits));\n+\n+  /* With fully-predicated BB-SLP, an external node's number of lanes can be\n+     incompatible with the chosen vector width (e.g., lane packs of 3 with a\n+     natural 2-lane vector type).  */\n+  if (!repeating_p && !multiple_p (olanes, nunits))\n+    {\n+      if (dump_p)\n+\tdump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,\n+\t\t\t \"unsupported permutation %p: vector type %T,\"\n+\t\t\t \" nunits=\" HOST_WIDE_INT_PRINT_UNSIGNED\n+\t\t\t \" ncopies=%\" PRIu64 \", lanes=%u and unpack=%u\\n\",\n+\t\t\t (void *) node, vectype, estimated_poly_value (nunits),\n+\t\t\t ncopies, SLP_TREE_LANES (node), unpack_factor);\n+      return -1;\n+    }\n \n   /* Compute the { { SLP operand, vector index}, lane } permutation sequence\n      from the { SLP operand, scalar lane } permutation as recorded in the\ndiff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc\nindex 98ddaf71183..0c4c932f7a8 100644\n--- a/gcc/tree-vect-stmts.cc\n+++ b/gcc/tree-vect-stmts.cc\n@@ -1672,23 +1672,27 @@ check_load_store_for_partial_vectors (vec_info *vinfo, tree vectype,\n     unsigned int nvectors;\n     if (can_div_away_from_zero_p (size, nunits, &nvectors))\n       return nvectors;\n-    gcc_unreachable ();\n+\n+    gcc_assert (known_le (size, nunits));\n+    return 1u;\n   };\n \n   poly_uint64 nunits = TYPE_VECTOR_SUBPARTS (vectype);\n-  poly_uint64 vf = loop_vinfo ? LOOP_VINFO_VECT_FACTOR (loop_vinfo) : 1;\n+  poly_uint64 size = loop_vinfo\n+\t\t       ? group_size * LOOP_VINFO_VECT_FACTOR (loop_vinfo)\n+\t\t       : SLP_TREE_LANES (slp_node);\n   unsigned factor;\n   vect_partial_vector_style partial_vector_style\n     = vect_get_partial_vector_style (vectype, is_load, &factor, elsvals);\n \n   if (partial_vector_style == vect_partial_vectors_len)\n     {\n-      nvectors = group_memory_nvectors (group_size * vf, nunits);\n+      nvectors = group_memory_nvectors (size, nunits);\n       vect_record_len (vinfo, slp_node, nvectors, vectype, factor);\n     }\n   else if (partial_vector_style == vect_partial_vectors_while_ult)\n     {\n-      nvectors = group_memory_nvectors (group_size * vf, nunits);\n+      nvectors = group_memory_nvectors (size, nunits);\n       vect_record_mask (vinfo, slp_node, nvectors, vectype, scalar_mask);\n     }\n   else\n@@ -3353,12 +3357,11 @@ vect_get_strided_load_store_ops (stmt_vec_info stmt_info, slp_tree node,\n \n static tree\n vect_get_loop_variant_data_ptr_increment (\n-  vec_info *vinfo, tree aggr_type, gimple_stmt_iterator *gsi,\n+  loop_vec_info loop_vinfo, tree aggr_type, gimple_stmt_iterator *gsi,\n   vec_loop_lens *loop_lens, dr_vec_info *dr_info,\n   vect_memory_access_type memory_access_type)\n {\n-  loop_vec_info loop_vinfo = dyn_cast<loop_vec_info> (vinfo);\n-  tree step = vect_dr_behavior (vinfo, dr_info)->step;\n+  tree step = vect_dr_behavior (loop_vinfo, dr_info)->step;\n \n   /* gather/scatter never reach here.  */\n   gcc_assert (!mat_gather_scatter_p (memory_access_type));\n@@ -3402,7 +3405,7 @@ vect_get_data_ptr_increment (vec_info *vinfo, gimple_stmt_iterator *gsi,\n \n   loop_vec_info loop_vinfo = dyn_cast<loop_vec_info> (vinfo);\n   if (loop_vinfo && LOOP_VINFO_USING_SELECT_VL_P (loop_vinfo))\n-    return vect_get_loop_variant_data_ptr_increment (vinfo, aggr_type, gsi,\n+    return vect_get_loop_variant_data_ptr_increment (loop_vinfo, aggr_type, gsi,\n \t\t\t\t\t\t     loop_lens, dr_info,\n \t\t\t\t\t\t     memory_access_type);\n \n@@ -5292,7 +5295,7 @@ vect_create_vectorized_demotion_stmts (vec_info *vinfo, vec<tree> *vec_oprnds,\n    call the function recursively.  */\n \n static void\n-vect_create_vectorized_promotion_stmts (vec_info *vinfo,\n+vect_create_vectorized_promotion_stmts (vec_info *vinfo, slp_tree slp_node,\n \t\t\t\t\tvec<tree> *vec_oprnds0,\n \t\t\t\t\tvec<tree> *vec_oprnds1,\n \t\t\t\t\tstmt_vec_info stmt_info, tree vec_dest,\n@@ -5305,37 +5308,39 @@ vect_create_vectorized_promotion_stmts (vec_info *vinfo,\n   gimple *new_stmt1, *new_stmt2;\n   vec<tree> vec_tmp = vNULL;\n \n-  vec_tmp.create (vec_oprnds0->length () * 2);\n+  const unsigned ncopies = vect_get_num_copies (vinfo, slp_node);\n+  vec_tmp.create (ncopies);\n+  gcc_assert (vec_oprnds0->length () <= ncopies);\n   FOR_EACH_VEC_ELT (*vec_oprnds0, i, vop0)\n     {\n+      if (vec_tmp.length () >= ncopies)\n+\tbreak;\n+\n       if (op_type == binary_op)\n \tvop1 = (*vec_oprnds1)[i];\n       else\n \tvop1 = NULL_TREE;\n \n       /* Generate the two halves of promotion operation.  */\n-      new_stmt1 = vect_gen_widened_results_half (vinfo, ch1, vop0, vop1,\n-\t\t\t\t\t\t op_type, vec_dest, gsi,\n-\t\t\t\t\t\t stmt_info);\n-      new_stmt2 = vect_gen_widened_results_half (vinfo, ch2, vop0, vop1,\n-\t\t\t\t\t\t op_type, vec_dest, gsi,\n-\t\t\t\t\t\t stmt_info);\n-      if (is_gimple_call (new_stmt1))\n-\t{\n-\t  new_tmp1 = gimple_call_lhs (new_stmt1);\n-\t  new_tmp2 = gimple_call_lhs (new_stmt2);\n-\t}\n-      else\n+      new_stmt1\n+\t= vect_gen_widened_results_half (vinfo, ch1, vop0, vop1, op_type,\n+\t\t\t\t\t vec_dest, gsi, stmt_info);\n+      new_tmp1 = is_gimple_call (new_stmt1) ? gimple_call_lhs (new_stmt1)\n+\t\t\t\t\t    : gimple_assign_lhs (new_stmt1);\n+      vec_tmp.quick_push (new_tmp1);\n+\n+      if (vec_tmp.length () < ncopies)\n \t{\n-\t  new_tmp1 = gimple_assign_lhs (new_stmt1);\n-\t  new_tmp2 = gimple_assign_lhs (new_stmt2);\n+\t  new_stmt2\n+\t    = vect_gen_widened_results_half (vinfo, ch2, vop0, vop1, op_type,\n+\t\t\t\t\t     vec_dest, gsi, stmt_info);\n+\t  new_tmp2 = is_gimple_call (new_stmt2) ? gimple_call_lhs (new_stmt2)\n+\t\t\t\t\t\t: gimple_assign_lhs (new_stmt2);\n+\t  vec_tmp.quick_push (new_tmp2);\n \t}\n-\n-      /* Store the results for the next step.  */\n-      vec_tmp.quick_push (new_tmp1);\n-      vec_tmp.quick_push (new_tmp2);\n     }\n \n+  gcc_assert (vec_tmp.length () <= ncopies);\n   vec_oprnds0->release ();\n   *vec_oprnds0 = vec_tmp;\n }\n@@ -5548,6 +5553,7 @@ vectorizable_conversion (vec_info *vinfo,\n      from the scalar type.  */\n   if (!vectype_in)\n     vectype_in = get_vectype_for_scalar_type (vinfo, rhs_type, slp_node);\n+\n   if (!cost_vec)\n     gcc_assert (vectype_in);\n   if (!vectype_in)\n@@ -5956,12 +5962,15 @@ vectorizable_conversion (vec_info *vinfo,\n \t\t\t\t\t     stmt_info, this_dest, gsi, c1,\n \t\t\t\t\t     op_type);\n \t  else\n-\t    vect_create_vectorized_promotion_stmts (vinfo, &vec_oprnds0,\n-\t\t\t\t\t\t    &vec_oprnds1, stmt_info,\n-\t\t\t\t\t\t    this_dest, gsi,\n+\t    vect_create_vectorized_promotion_stmts (vinfo, slp_node,\n+\t\t\t\t\t\t    &vec_oprnds0, &vec_oprnds1,\n+\t\t\t\t\t\t    stmt_info, this_dest, gsi,\n \t\t\t\t\t\t    c1, c2, op_type);\n \t}\n \n+      gcc_assert (vec_oprnds0.length ()\n+\t\t  == vect_get_num_copies (vinfo, slp_node));\n+\n       FOR_EACH_VEC_ELT (vec_oprnds0, i, vop0)\n \t{\n \t  gimple *new_stmt;\n@@ -5985,6 +5994,16 @@ vectorizable_conversion (vec_info *vinfo,\n \t generate more than one vector stmt - i.e - we need to \"unroll\"\n \t the vector stmt by a factor VF/nunits.  */\n       vect_get_vec_defs (vinfo, slp_node, op0, &vec_oprnds0);\n+\n+      /* Promotion no longer produces redundant defs (since support was\n+\tadded for length/mask-predicated BB SLP of awkward-sized groups),\n+\ttherefore demotion now has to handle that case too.  */\n+      if (vec_oprnds0.length () % 2 != 0)\n+\t{\n+\t  tree vectype = TREE_TYPE (vec_oprnds0[0]);\n+\t  vec_oprnds0.safe_push (build_zero_cst (vectype));\n+\t}\n+\n       /* Arguments are ready.  Create the new vector stmts.  */\n       if (cvt_type && modifier == NARROW_DST)\n \tFOR_EACH_VEC_ELT (vec_oprnds0, i, vop0)\n@@ -10774,7 +10793,7 @@ vectorizable_load (vec_info *vinfo,\n \n       aggr_type = build_array_type_nelts (elem_type, group_size * nunits);\n       if (!costing_p)\n-\tbump = vect_get_data_ptr_increment (vinfo, gsi, dr_info, aggr_type,\n+\tbump = vect_get_data_ptr_increment (loop_vinfo, gsi, dr_info, aggr_type,\n \t\t\t\t\t    memory_access_type, loop_lens);\n \n       unsigned int inside_cost = 0, prologue_cost = 0;\n@@ -13421,6 +13440,38 @@ vect_analyze_stmt (vec_info *vinfo,\n \t\t\t\t   \" live stmt not supported: %G\",\n \t\t\t\t   stmt_info->stmt);\n \n+  if (bb_vinfo)\n+    {\n+      unsigned int group_size = SLP_TREE_LANES (node);\n+      tree vectype = SLP_TREE_VECTYPE (node);\n+      poly_uint64 nunits = TYPE_VECTOR_SUBPARTS (vectype);\n+      bool needs_partial = maybe_lt (group_size, nunits);\n+      if (needs_partial)\n+\t{\n+\t  /* If partial vectors are required then they must be supported by the\n+\t     target; however, don't assume that a partial vectors style has\n+\t     been set because a mask or length may not be required for the\n+\t     statement.  */\n+\t  if (!SLP_TREE_CAN_USE_PARTIAL_VECTORS_P (node))\n+\t    return opt_result::failure_at (stmt_info->stmt,\n+\t\t\t\t\t   \"not vectorized: SLP node needs but \"\n+\t\t\t\t\t   \"cannot use partial vectors: %G\",\n+\t\t\t\t\t   stmt_info->stmt);\n+\t}\n+      else\n+\t{\n+\t  /* If we don't need partial vectors then we don't care about whether\n+\t     they are supported or not; however, we need to clear any partial\n+\t     vectors style that might have been chosen because it will be used\n+\t     to control generation of lengths or masks.  */\n+\t  SLP_TREE_PARTIAL_VECTORS_STYLE (node) = vect_partial_vectors_none;\n+\t  SLP_TREE_NUM_PARTIAL_VECTORS (node) = 0;\n+\t}\n+\n+      if (maybe_gt (group_size, nunits))\n+\tgcc_assert (multiple_p (group_size, nunits));\n+    }\n+\n   return opt_result::success ();\n }\n \n@@ -13723,13 +13774,7 @@ tree\n get_vectype_for_scalar_type (vec_info *vinfo, tree scalar_type,\n \t\t\t     unsigned int group_size)\n {\n-  /* For BB vectorization, we should always have a group size once we've\n-     constructed the SLP tree; the only valid uses of zero GROUP_SIZEs\n-     are tentative requests during things like early data reference\n-     analysis and pattern recognition.  */\n-  if (is_a <bb_vec_info> (vinfo))\n-    gcc_assert (vinfo->slp_instances.is_empty () || group_size != 0);\n-  else\n+  if (!is_a <bb_vec_info> (vinfo))\n     group_size = 0;\n \n   tree vectype = get_related_vectype_for_scalar_type (vinfo->vector_mode,\n@@ -13743,10 +13788,18 @@ get_vectype_for_scalar_type (vec_info *vinfo, tree scalar_type,\n     vinfo->used_vector_modes.add (TYPE_MODE (vectype));\n \n   /* If the natural choice of vector type doesn't satisfy GROUP_SIZE,\n-     try again with an explicit number of elements.  */\n-  if (vectype\n-      && group_size\n-      && maybe_ge (TYPE_VECTOR_SUBPARTS (vectype), group_size))\n+     try again with an explicit number of elements.  A vector type satisfies\n+     GROUP_SIZE if it is definitely not too long to store the whole group,\n+     or we are able to generate masks to handle the unknown number of excess\n+     lanes that might exist.  Otherwise, we must substitute a vector type that\n+     can be used to carve up the group.\n+   */\n+  if (vectype && group_size\n+      && maybe_gt (TYPE_VECTOR_SUBPARTS (vectype), group_size)\n+      && (vect_get_partial_vector_style (vectype, true)\n+\t    == vect_partial_vectors_none\n+\t  || vect_get_partial_vector_style (vectype, false)\n+\t       == vect_partial_vectors_none))\n     {\n       /* Start with the biggest number of units that fits within\n \t GROUP_SIZE and halve it until we find a valid vector type.\n@@ -14062,7 +14115,36 @@ vect_maybe_update_slp_op_vectype (vec_info *vinfo, slp_tree op, tree vectype)\n       && SLP_TREE_DEF_TYPE (op) == vect_external_def\n       && SLP_TREE_LANES (op) > 1)\n     return false;\n-  (void) vinfo; /* FORNOW */\n+\n+  /* When the vectorizer falls back to building vector operands from scalars,\n+     it can create SLP trees with external defs that have a number of lanes not\n+     divisible by the number of subparts in a vector type naively inferred from\n+     the scalar type.  Reject such types to avoid ICE when later computing the\n+     prologue cost for invariant operands.  */\n+  if (SLP_TREE_DEF_TYPE (op) == vect_external_def)\n+    {\n+      poly_uint64 vf = 1;\n+\n+      if (loop_vec_info loop_vinfo = dyn_cast<loop_vec_info> (vinfo))\n+\tvf = LOOP_VINFO_VECT_FACTOR (loop_vinfo);\n+\n+      vf *= SLP_TREE_LANES (op);\n+\n+      if (maybe_lt (TYPE_VECTOR_SUBPARTS (vectype), vf)\n+\t  && !multiple_p (vf, TYPE_VECTOR_SUBPARTS (vectype)))\n+\t{\n+\t  if (dump_enabled_p ())\n+\t    dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,\n+\t\t\t     \"lanes=\" HOST_WIDE_INT_PRINT_UNSIGNED\n+\t\t\t     \" is not divisible by \"\n+\t\t\t     \"subparts=\" HOST_WIDE_INT_PRINT_UNSIGNED \".\\n\",\n+\t\t\t     estimated_poly_value (vf),\n+\t\t\t     estimated_poly_value (\n+\t\t\t       TYPE_VECTOR_SUBPARTS (vectype)));\n+\t  return false;\n+\t}\n+    }\n+\n   SLP_TREE_VECTYPE (op) = vectype;\n   return true;\n }\n@@ -14770,27 +14852,32 @@ vect_gen_while_not (gimple_seq *seq, tree mask_type, tree start_index,\n \n    - Set *NUNITS_VECTYPE_OUT to the vector type that contains the maximum\n      number of units needed to vectorize STMT_INFO, or NULL_TREE if the\n-     statement does not help to determine the overall number of units.  */\n+     statement does not help to determine the overall number of units.\n+\n+   - Set *UNSUPPORTED_DATATYPE to false.\n+\n+   On failure:\n+\n+   - Set *UNSUPPORTED_DATATYPE to true if the statement can't be vectorized\n+     because it uses a data type that the target doesn't support in vector form\n+     for a group of the given GROUP_SIZE.\n+ */\n \n opt_result\n vect_get_vector_types_for_stmt (vec_info *vinfo, stmt_vec_info stmt_info,\n \t\t\t\ttree *stmt_vectype_out,\n \t\t\t\ttree *nunits_vectype_out,\n+\t\t\t\tbool *unsupported_datatype,\n \t\t\t\tunsigned int group_size)\n {\n   gimple *stmt = stmt_info->stmt;\n \n-  /* For BB vectorization, we should always have a group size once we've\n-     constructed the SLP tree; the only valid uses of zero GROUP_SIZEs\n-     are tentative requests during things like early data reference\n-     analysis and pattern recognition.  */\n-  if (is_a <bb_vec_info> (vinfo))\n-    gcc_assert (vinfo->slp_instances.is_empty () || group_size != 0);\n-  else\n+  if (!is_a<bb_vec_info> (vinfo))\n     group_size = 0;\n \n   *stmt_vectype_out = NULL_TREE;\n   *nunits_vectype_out = NULL_TREE;\n+  *unsupported_datatype = false;\n \n   if (gimple_get_lhs (stmt) == NULL_TREE\n       /* Allow vector conditionals through here.  */\n@@ -14863,10 +14950,13 @@ vect_get_vector_types_for_stmt (vec_info *vinfo, stmt_vec_info stmt_info,\n \t}\n       vectype = get_vectype_for_scalar_type (vinfo, scalar_type, group_size);\n       if (!vectype)\n-\treturn opt_result::failure_at (stmt,\n-\t\t\t\t       \"not vectorized:\"\n-\t\t\t\t       \" unsupported data-type %T\\n\",\n-\t\t\t\t       scalar_type);\n+\t{\n+\t  *unsupported_datatype = true;\n+\t  return opt_result::failure_at (stmt,\n+\t\t\t\t\t \"not vectorized:\"\n+\t\t\t\t\t \" unsupported data-type %T\\n\",\n+\t\t\t\t\t scalar_type);\n+\t}\n \n       if (dump_enabled_p ())\n \tdump_printf_loc (MSG_NOTE, vect_location, \"vectype: %T\\n\", vectype);\ndiff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h\nindex 476cbbeecd6..96233ba57f6 100644\n--- a/gcc/tree-vectorizer.h\n+++ b/gcc/tree-vectorizer.h\n@@ -2340,6 +2340,8 @@ vect_get_num_copies (vec_info *vinfo, slp_tree node)\n \n   vf *= SLP_TREE_LANES (node);\n   tree vectype = SLP_TREE_VECTYPE (node);\n+  if (known_ge (TYPE_VECTOR_SUBPARTS (vectype), vf))\n+    return 1;\n \n   return vect_get_num_vectors (vf, vectype);\n }\n@@ -2607,9 +2609,9 @@ extern tree vect_gen_while (gimple_seq *, tree, tree, tree,\n \t\t\t    const char * = nullptr);\n extern void vect_gen_while_ssa_name (gimple_seq *, tree, tree, tree, tree);\n extern tree vect_gen_while_not (gimple_seq *, tree, tree, tree);\n-extern opt_result vect_get_vector_types_for_stmt (vec_info *,\n-\t\t\t\t\t\t  stmt_vec_info, tree *,\n-\t\t\t\t\t\t  tree *, unsigned int = 0);\n+extern opt_result vect_get_vector_types_for_stmt (vec_info *, stmt_vec_info,\n+\t\t\t\t\t\t  tree *, tree *,\n+\t\t\t\t\t\t  bool *, unsigned int = 0);\n extern opt_tree vect_get_mask_type_for_stmt (stmt_vec_info, unsigned int = 0);\n \n /* In tree-if-conv.cc.  */\n@@ -2945,9 +2947,8 @@ vect_can_use_partial_vectors_p (vec_info *vinfo, slp_tree slp_node)\n   loop_vec_info loop_vinfo = dyn_cast<loop_vec_info> (vinfo);\n   if (loop_vinfo)\n     return LOOP_VINFO_CAN_USE_PARTIAL_VECTORS_P (loop_vinfo);\n-\n-  (void) slp_node; /* FORNOW */\n-  return false;\n+  else\n+    return SLP_TREE_CAN_USE_PARTIAL_VECTORS_P (slp_node);\n }\n \n /* If VINFO is vectorizer state for loop vectorization then record that we no\n",
    "prefixes": [
        "v9",
        "09/11"
    ]
}