Message ID | ZJw5OtpY61bsCZBR@arm.com |
---|---|
State | Not Applicable |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp8938182vqr; Wed, 28 Jun 2023 06:46:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6/lc6O5PmCbG4s8fvixosVG56vKzTe0d1lXqbBmD+dyYNC57UIdlPjEf8tuxc+4w3ioinY X-Received: by 2002:a17:907:77c4:b0:992:3b89:f980 with SMTP id kz4-20020a17090777c400b009923b89f980mr3938838ejc.31.1687959978656; Wed, 28 Jun 2023 06:46:18 -0700 (PDT) Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id c4-20020a170906924400b00991e0192079si3544037ejx.891.2023.06.28.06.46.18 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jun 2023 06:46:18 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=TwCa38T0; arc=fail (signature failed); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D20FA3856DD6 for <ouuuleilei@gmail.com>; Wed, 28 Jun 2023 13:45:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D20FA3856DD6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687959931; bh=uIcU2EX+WHKsAmN0PiO5bfoYVrwKOtEruMW4polfUL4=; h=Date:To:Cc:Subject:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=TwCa38T0iFBbX1oR7fIvnyzNHgHpl3og7xK/p9WpcnECLK0vfl2wUa1ocgAE2xrm+ vY+NuPRLOv7TNsWBY9SJUmMS08BTk8vmSEL97SFhZqebBB0caHxeMH2FsO6srulrdo gKATUn2JYh3FeZmupWIenHVmbxAjNNP/mm6+3d78= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2079.outbound.protection.outlook.com [40.107.249.79]) by sourceware.org (Postfix) with ESMTPS id 4AB92385770C for <gcc-patches@gcc.gnu.org>; Wed, 28 Jun 2023 13:44:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4AB92385770C Received: from DUZPR01CA0097.eurprd01.prod.exchangelabs.com (2603:10a6:10:4bb::10) by DB5PR08MB10311.eurprd08.prod.outlook.com (2603:10a6:10:4a5::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Wed, 28 Jun 2023 13:44:43 +0000 Received: from DBAEUR03FT043.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:4bb:cafe::b8) by DUZPR01CA0097.outlook.office365.com (2603:10a6:10:4bb::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.18 via Frontend Transport; Wed, 28 Jun 2023 13:44:43 +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 DBAEUR03FT043.mail.protection.outlook.com (100.127.143.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.20 via Frontend Transport; Wed, 28 Jun 2023 13:44:43 +0000 Received: ("Tessian outbound 546d04a74417:v142"); Wed, 28 Jun 2023 13:44:43 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: fbfe09bd314495b2 X-CR-MTA-TID: 64aa7808 Received: from 6e1880ce5b65.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 0CE9AD53-70DE-4A82-A377-FC9538419E5F.1; Wed, 28 Jun 2023 13:44:36 +0000 Received: from EUR01-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 6e1880ce5b65.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 28 Jun 2023 13:44:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=exBj9ilO8HIVcXfNXyblqxcln2xV6HWedGe9FFsA9TtnOOvdLf0Q03K73obEVpwj9MLsfMqJg4OQnYVPMUTe+/eEwK3MlFhP2KDJD9y6mg28x6YZSCMGlBmP337pzBMREzBYgfyOuM6fXSfiE2VBZ2PgiYlhlUJxFMYqiaq3SLwG/e64sZUvgvBXyCQu2YW2A3Rocx2Yw6nxjtzlhuRM9ek3s66ReBuSlyNeeWpvRFcLeTFHB4l4kpXG9AEFIPqs/9yKWmbgDcRc6qVsDyAN3prDWpxBVX+Xao2E2uV0sMZRo/g2iQ1GUGwHZuS3SUxquOEHB7GeQeL9dHclFxHezg== 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=uIcU2EX+WHKsAmN0PiO5bfoYVrwKOtEruMW4polfUL4=; b=i7EhTK/7U0ilQXmDHqh7UAYwQZFJWxikVd7dLf+iyh13BVtT0sVqDjqGk+ak2BD7p6guRJKkMUc7E0jHJwHNNP6+VQZXfd7Im5uFSczRbYCKrlT9pQ1ioiPkjpAjl6DH7PKBXBUt3PW9/ilyT0kfva2Jgd53isy+HGN/dN3YcBGq2wFTlr927NYzKm1QZGCXwuG4/4ny8poV/S4huegiOpM1/zU1O+zQ5vjhvd5rDPI5MURk3c6rx9FrfA0TsuPeHnHTlgZZfDCALj8dAeK7psbk8pnfwGbCSviCGOQNvRRNBCGQuTP6KBi8RwAaIMdZ+meJwAKUYh9kUnoqpdk68w== 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 Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) by GV2PR08MB8172.eurprd08.prod.outlook.com (2603:10a6:150:7c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Wed, 28 Jun 2023 13:44:33 +0000 Received: from VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::2301:1cde:cfe7:eaf0]) by VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::2301:1cde:cfe7:eaf0%6]) with mapi id 15.20.6521.026; Wed, 28 Jun 2023 13:44:33 +0000 Date: Wed, 28 Jun 2023 14:44:26 +0100 To: gcc-patches@gcc.gnu.org Cc: nd@arm.com, rguenther@suse.de, jlaw@ventanamicro.com Subject: [PATCH 6/19]middle-end: Don't enter piecewise expansion if VF is not constant. Message-ID: <ZJw5OtpY61bsCZBR@arm.com> Content-Type: multipart/mixed; boundary="BOam8uceUcmk4dCj" Content-Disposition: inline In-Reply-To: <patch-17494-tamar@arm.com> X-ClientProxiedBy: SA9P223CA0022.NAMP223.PROD.OUTLOOK.COM (2603:10b6:806:26::27) To VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB5325:EE_|GV2PR08MB8172:EE_|DBAEUR03FT043:EE_|DB5PR08MB10311:EE_ X-MS-Office365-Filtering-Correlation-Id: 77989f79-3c56-49cc-bd41-08db77ddd41f 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: AZsiF40marAMUTdQOosfidJgfUqJ5FWJfR9C2uxXvzKDxw/Q3/0jRTw5xkoWAEu8DzwbBoJrlT6lsElqGt1WJhB9Rf7TCD2O8olOAijuTuZYBtfF+f5vwMIMkkEJmPxv2z/YbDKCKfTj8KGepbVYoCDkr0YRCeRY+Y9/YgfA8GDaH9HAFLwoqKuDSLeQB+vC+iXie097R0eo+v3Oercnk2kiaJI+/xELkjTJq54BTbezGc8g4PdtepWor4aPg8xNRyDHUaFDi/rCWM1Ot6F7DdOPcmS+HcpToqONW6B3vSwEw++pgE4+5lqfVrQzVHlKOVL9Htb6X1PUFRirdWHxm0Y0Ja+TNYuJoS6PHC7pi/ZB8paMbpl/WGnoRIVViYRedDI8/tL9Zkph0H5kSlV74UqkNrtGYzH1kGg8tmBkswabbtbr4GDHk4Ue6Rd1kVgd9YxAPgQL3m2yBTao8CdVIZwRg0+PLuLYtRl8JjMKhkPBfS3lBW/yVumduFkNFP0CuBD5mABGL9AFu0N7khhlfnMx0yeQ0G9+VprdorUWXOoJW0+7E42T7HnEKf5INdJZan6f0ZCG0UtWkfpi7ZtY8AiJ4koUt2FmHcdGzrWkCDC7kAkiLXiKDafUaONEFmiu 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:(13230028)(4636009)(39860400002)(136003)(346002)(366004)(396003)(376002)(451199021)(2906002)(6486002)(33964004)(2616005)(4743002)(44144004)(6666004)(38100700002)(186003)(6512007)(86362001)(26005)(41300700001)(478600001)(36756003)(66556008)(66946007)(316002)(4326008)(6916009)(66476007)(6506007)(44832011)(5660300002)(235185007)(8936002)(8676002)(2700100001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB8172 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: DBAEUR03FT043.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 5f8f6ac2-b248-4d42-cbe3-08db77ddce49 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EoQEmdSMRkFxsc/0Ti2OCD9PY6YRtAj7mfBtspbuSYoYCt/2XP3JpWqVpE97Zqv+DjnsIRuo1bPkZtcVNLj9llmCMju7AJ95C8AqLdzdGUCA8dS1Q9nTNfI6CfFV3wVuJrGeFnczaJFdtaDKtD5ID+uALP9+Ox/e/QTLP4SmGdbxs93ullEXJhOhI/BeZr1sx8ih6Od7YTsKJB3Pjjs/hUa/uZybe0XBlDzldMbYHdGPoNUb70lsXla6AwewjjhY91S1giulm4b/IoIyGPi77ck7pFu/jVD6OR4URWFTQ13Om2+Mgi7svAcWQbr0uXM1MrVUdVkDZf5K7rf2kLRx1R1Hi+P+xpI/mol7OKxl4pyrv9l37jcD0CcjEq2UXCEFjycZ77r+v9HbCrkkfUPgpd55YOcJ44GaLbKYFn1fs1r3n3Lj6xnNPdjyJI1tT9rA9H5XLqSscuwZ8OGsGIhigoSKUax8/gQWzHVx5AiOp31V08tbQtD98K67AqRkflj97G4k5VWL0UxCAIwG+vtKPGWwplWBV+248alKYsdFnwOq5OMV9w/0+CAQ3Ej3oOCyGuBCFcU+TrXJuZKQZzsvphZKSc3plwq0IrrJQBiMS4T51uixIxOAK0Y2EVyY8F+Wm67EJ2GVJbS8EYs0c9dv5RWU3V9jcolzj5UOpoudg4PrTf8JqPN7hIG+nMXNin7plgr9Hi8vfMIbXeklngj0GRc2pDR/AF7z9VNQFfxECQaxn4qYObDala/qgWAAGLvZjG+N/MNFuX4Jd/4D0peU9w== X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230028)(4636009)(136003)(346002)(396003)(376002)(39860400002)(451199021)(46966006)(40470700004)(36840700001)(316002)(70586007)(6916009)(4326008)(478600001)(70206006)(36756003)(235185007)(8936002)(5660300002)(8676002)(44832011)(40460700003)(36860700001)(86362001)(40480700001)(33964004)(41300700001)(44144004)(82310400005)(6486002)(2906002)(186003)(4743002)(47076005)(6506007)(6512007)(6666004)(336012)(356005)(26005)(82740400003)(81166007)(2616005)(107886003)(2700100001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2023 13:44:43.3228 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 77989f79-3c56-49cc-bd41-08db77ddd41f 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: DBAEUR03FT043.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR08MB10311 X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, 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=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <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>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Tamar Christina via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Tamar Christina <tamar.christina@arm.com> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769954322738036139?= X-GMAIL-MSGID: =?utf-8?q?1769954322738036139?= |
Series |
Support early break/return auto-vectorization
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | fail | Git am fail log |
Commit Message
Tamar Christina
June 28, 2023, 1:44 p.m. UTC
Hi All, expand_vector_piecewise does not support VLA expansion as it has a hard assert on the type not being VLA. Instead of just failing to expand and so the call marked unsupported we ICE. This adjust it so we don't and can gracefully handle the expansion in support checks. Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. Ok for master? Thanks, Tamar gcc/ChangeLog: * tree-vect-generic.cc (expand_vector_comparison): Skip piecewise if not constant. --- inline copy of patch -- diff --git a/gcc/tree-vect-generic.cc b/gcc/tree-vect-generic.cc index df04a0db68da3222f43dd938f8e7adb186cd93c9..da1fd2f40d82a9fa301e6ed0b2f4c3c222d58a8d 100644 -- diff --git a/gcc/tree-vect-generic.cc b/gcc/tree-vect-generic.cc index df04a0db68da3222f43dd938f8e7adb186cd93c9..da1fd2f40d82a9fa301e6ed0b2f4c3c222d58a8d 100644 --- a/gcc/tree-vect-generic.cc +++ b/gcc/tree-vect-generic.cc @@ -481,7 +481,7 @@ expand_vector_comparison (gimple_stmt_iterator *gsi, tree type, tree op0, } t = gimplify_build1 (gsi, VIEW_CONVERT_EXPR, type, t); } - else + else if (TYPE_VECTOR_SUBPARTS (type).is_constant ()) t = expand_vector_piecewise (gsi, do_compare, type, TREE_TYPE (TREE_TYPE (op0)), op0, op1, code, false);
Comments
On Wed, 28 Jun 2023, Tamar Christina wrote: > Hi All, > > expand_vector_piecewise does not support VLA expansion as it has a hard assert > on the type not being VLA. > > Instead of just failing to expand and so the call marked unsupported we ICE. > This adjust it so we don't and can gracefully handle the expansion in support > checks. > > Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. > > Ok for master? Hmm, do we support _any_ VLA "generic" vectors? That is, why do we get here at all? Doesn't that mean the vectorizer creates code that vector lowering thinks is not supported by the target? In any case I'd expect expand_vector_operations_1 at if (compute_type == NULL_TREE) compute_type = get_compute_type (code, op, type); if (compute_type == type) return; <---- here new_rhs = expand_vector_operation (gsi, type, compute_type, stmt, code, dce_ssa_names); to be able to assert that compute_type (or even type) isn't VLA? So, why do we arrive here? Richard. > Thanks, > Tamar > > gcc/ChangeLog: > > * tree-vect-generic.cc (expand_vector_comparison): Skip piecewise if not > constant. > > --- inline copy of patch -- > diff --git a/gcc/tree-vect-generic.cc b/gcc/tree-vect-generic.cc > index df04a0db68da3222f43dd938f8e7adb186cd93c9..da1fd2f40d82a9fa301e6ed0b2f4c3c222d58a8d 100644 > --- a/gcc/tree-vect-generic.cc > +++ b/gcc/tree-vect-generic.cc > @@ -481,7 +481,7 @@ expand_vector_comparison (gimple_stmt_iterator *gsi, tree type, tree op0, > } > t = gimplify_build1 (gsi, VIEW_CONVERT_EXPR, type, t); > } > - else > + else if (TYPE_VECTOR_SUBPARTS (type).is_constant ()) > t = expand_vector_piecewise (gsi, do_compare, type, > TREE_TYPE (TREE_TYPE (op0)), op0, op1, > code, false); > > > > >
> On Wed, 28 Jun 2023, Tamar Christina wrote: > > > Hi All, > > > > expand_vector_piecewise does not support VLA expansion as it has a > > hard assert on the type not being VLA. > > > > Instead of just failing to expand and so the call marked unsupported we ICE. > > This adjust it so we don't and can gracefully handle the expansion in > > support checks. > > > > Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. > > > > Ok for master? > > Hmm, do we support _any_ VLA "generic" vectors? That is, why do we get > here at all? Doesn't that mean the vectorizer creates code that vector lowering > thinks is not supported by the target? > > In any case I'd expect expand_vector_operations_1 at > > if (compute_type == NULL_TREE) > compute_type = get_compute_type (code, op, type); > if (compute_type == type) > return; > > <---- here > > new_rhs = expand_vector_operation (gsi, type, compute_type, stmt, code, > dce_ssa_names); > > to be able to assert that compute_type (or even type) isn't VLA? > > So, why do we arrive here? > I think we used to arrive here because the patch last year didn't properly check the cmp, I don't his it with this new patch so I'll drop it. I thought it was an actual bug hence why I submitted the patch 😊 Thanks, Tamar > Richard. > > > > Thanks, > > Tamar > > > > gcc/ChangeLog: > > > > * tree-vect-generic.cc (expand_vector_comparison): Skip piecewise if > not > > constant. > > > > --- inline copy of patch -- > > diff --git a/gcc/tree-vect-generic.cc b/gcc/tree-vect-generic.cc index > > > df04a0db68da3222f43dd938f8e7adb186cd93c9..da1fd2f40d82a9fa301e6 > ed0b2f4 > > c3c222d58a8d 100644 > > --- a/gcc/tree-vect-generic.cc > > +++ b/gcc/tree-vect-generic.cc > > @@ -481,7 +481,7 @@ expand_vector_comparison (gimple_stmt_iterator > *gsi, tree type, tree op0, > > } > > t = gimplify_build1 (gsi, VIEW_CONVERT_EXPR, type, t); > > } > > - else > > + else if (TYPE_VECTOR_SUBPARTS (type).is_constant ()) > > t = expand_vector_piecewise (gsi, do_compare, type, > > TREE_TYPE (TREE_TYPE (op0)), op0, op1, > > code, false); > > > > > > > > > > > > -- > Richard Biener <rguenther@suse.de> > SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 > Nuernberg, Germany; GF: Ivo Totev, Andrew Myers, Andrew McDonald, > Boudien Moerman; HRB 36809 (AG Nuernberg)
On Thu, 6 Jul 2023, Tamar Christina wrote: > > On Wed, 28 Jun 2023, Tamar Christina wrote: > > > > > Hi All, > > > > > > expand_vector_piecewise does not support VLA expansion as it has a > > > hard assert on the type not being VLA. > > > > > > Instead of just failing to expand and so the call marked unsupported we ICE. > > > This adjust it so we don't and can gracefully handle the expansion in > > > support checks. > > > > > > Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. > > > > > > Ok for master? > > > > Hmm, do we support _any_ VLA "generic" vectors? That is, why do we get > > here at all? Doesn't that mean the vectorizer creates code that vector lowering > > thinks is not supported by the target? > > > > In any case I'd expect expand_vector_operations_1 at > > > > if (compute_type == NULL_TREE) > > compute_type = get_compute_type (code, op, type); > > if (compute_type == type) > > return; > > > > <---- here > > > > new_rhs = expand_vector_operation (gsi, type, compute_type, stmt, code, > > dce_ssa_names); > > > > to be able to assert that compute_type (or even type) isn't VLA? > > > > So, why do we arrive here? > > > > I think we used to arrive here because the patch last year didn't properly check the cmp, > I don't his it with this new patch so I'll drop it. I thought it was an actual bug hence why I > submitted the patch ? If it's a genuine bug then the fix at least looks wrong ;) Anyway, dropping is fine with me of course. Richard.
--- a/gcc/tree-vect-generic.cc +++ b/gcc/tree-vect-generic.cc @@ -481,7 +481,7 @@ expand_vector_comparison (gimple_stmt_iterator *gsi, tree type, tree op0, } t = gimplify_build1 (gsi, VIEW_CONVERT_EXPR, type, t); } - else + else if (TYPE_VECTOR_SUBPARTS (type).is_constant ()) t = expand_vector_piecewise (gsi, do_compare, type, TREE_TYPE (TREE_TYPE (op0)), op0, op1, code, false);