[v3] vect: Verify that GET_MODE_UNITS is greater than one for vect_grouped_store_supported
Message ID | 20230417163856.2253309-1-kevinl@rivosinc.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2257283vqo; Mon, 17 Apr 2023 09:40:46 -0700 (PDT) X-Google-Smtp-Source: AKy350ajsdjr/QEb5dgEaCvq2OVD0PdrDJW5qs73vafl+QmfIY/Nkc6v8BkcMsVT9IP29W6ghzGV X-Received: by 2002:a05:6402:b2e:b0:506:6008:995f with SMTP id bo14-20020a0564020b2e00b005066008995fmr12829801edb.39.1681749646218; Mon, 17 Apr 2023 09:40:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681749646; cv=none; d=google.com; s=arc-20160816; b=kvMw80qNfFsI/7srqCQF2qRRX2t7hYb8tciF2vbAQb6E5YxApzrg1WMBgmabOqRBnA TLKfjGSdk8QcBM5WI2RvjYgE8sl88nMyFzwFGnqcjfjJTxLI95gvjJY98hE+qL6KUbfO x7CJI+D2tK+qJwCT+W+nvd5OQg+ZXZuoDM4QEoY0yJXxcvPEohEEGjtiaTIki1kt+6Ll afjs3Fv/AantTCKnwFgqNWLRbkYzMamnWRB4loUnJCGaAa/ftsf+NvM3ECp6UrcMngOE vzSd5tdwCVEvJbeWI+sXgjFRjy1fsTkg1biBmL1D6L/E6YsxgUQOlL4mLUJ49gsYRKu+ bRog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dmarc-filter:delivered-to; bh=4NZRdtcV1pViC7rMSpwzycvDnZswPItAC+QT1BztVXE=; b=FmtuZ4d9Ok5z5MjGWwW4zqKXLE0YoreylyxvzS7NisbrcNcfKIhimWjXoccN7YumYh 99hi8TFe7dCqTttZyr34ZlLKceeNoV1iSmHHkkPE+w2uZqD1y3M3GWFx9eAPVS+ksFvL XHWJKvedEiL03Ta0x9qzZwcYJjiJJfC0HKG3PX4uWs//Ztcm/eWDMaPlCIadKd1UsFsp E0FzdeMfXZup8T0mmpldeY9YD/I/VcwY8ES/p56AqcMWC+14H6Q1DuCej5eZuy1XUodb Gex7ynUgOy4cTF9y8WWRdjg+ww5Bl8P/FjW5xl6Pry3wKkAdEbSq1JawzwLYM+W55e2U 7E8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=JCe1VXT6; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id k24-20020a056402049800b00501c32ce664si8874792edv.325.2023.04.17.09.40.45 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 09:40:46 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=JCe1VXT6; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 239C33857739 for <ouuuleilei@gmail.com>; Mon, 17 Apr 2023 16:40:39 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by sourceware.org (Postfix) with ESMTPS id 9F2B03858428 for <gcc-patches@gcc.gnu.org>; Mon, 17 Apr 2023 16:39:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9F2B03858428 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-pl1-x636.google.com with SMTP id l21so8374084pla.5 for <gcc-patches@gcc.gnu.org>; Mon, 17 Apr 2023 09:39:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1681749593; x=1684341593; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4NZRdtcV1pViC7rMSpwzycvDnZswPItAC+QT1BztVXE=; b=JCe1VXT6KgtVgAsq0UfWpgyfDpyL8BmOIEXzZUDINZy8JxSauv15ePDD0x2gIBqrFm C/wtyrNj2SpQwDJ+U/ZAK/QXhKUO0YQdQ4rj+QiJfg9T2isdyleRSRUGYJQruXGnniHW Uf/H1XVPNebgwvTERAbEccDgAHDjgsHTpUMFGIBddwfImfP9TGmFb3ClO8e+zQOjLHpD mMJZhXAEgybU5aohSeQ58tv3KpBIp8GjpTprD5feYRjeSIANmTmGeKo4bXjL/UdyyJSM tdxjqoJIl4M8dHIgw9M0pKHBHq8tzjiqSXP6lm2cpv2WXbXh7mEDH1ylU0HN0L9iKJ4R +50Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681749593; x=1684341593; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4NZRdtcV1pViC7rMSpwzycvDnZswPItAC+QT1BztVXE=; b=MsfTGqcXg+Bcm2ia/JJ7019kJWEds7aHoGi1kpavIWml4NvPETd4wQ+VJ1HoZ5Pb4f QGXl1xxAK+b5nE0qe+PY7wkLjV3X9yDmQBim7pRL1VjKhHWnCtM+mmn831EwjSfSOyE9 ljQhn/D+7hU0Bf+nV3zX407HlQKdfvQwYcxx//s2NegGAE/w7qJwmE68i77VPWDwkZhY N4MLdJBDJuusxnapifFRuVDWsC72OjDyZjtloSWAd/myVt/t/bFkSAqOlumndVR5Iy3x 4yFyYAfvYQh9F/V1P4HCqigEZ6uUz8B8r7Txg0bPKELE0glUvwDi0lLOV74Qdl+iI4EF 7Uww== X-Gm-Message-State: AAQBX9d4HBg+LF4OxK4Ipskak5jRRgp4XnhJ1eUwrI2kPMhklJ8Uswy0 qRtd913iypt6qYotvStUDHQ9c/vfpNRbBeKm5ps= X-Received: by 2002:a17:902:d50f:b0:1a1:cefd:aa1f with SMTP id b15-20020a170902d50f00b001a1cefdaa1fmr14271711plg.52.1681749593422; Mon, 17 Apr 2023 09:39:53 -0700 (PDT) Received: from kevinl.ba.rivosinc.com ([66.220.2.162]) by smtp.gmail.com with ESMTPSA id d22-20020a170902b71600b001a67759f9f8sm1637577pls.106.2023.04.17.09.39.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 09:39:52 -0700 (PDT) From: Kevin Lee <kevinl@rivosinc.com> To: gcc-patches@gcc.gnu.org Cc: Kevin Lee <kevinl@rivosinc.com> Subject: [PATCH v3] vect: Verify that GET_MODE_UNITS is greater than one for vect_grouped_store_supported Date: Mon, 17 Apr 2023 09:38:56 -0700 Message-Id: <20230417163856.2253309-1-kevinl@rivosinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <CALkvSf_bvuaFZG63kNQMTGvFx+ki6ih1h56=uUuVxP0hcL8_ow@mail.gmail.com> References: <CALkvSf_bvuaFZG63kNQMTGvFx+ki6ih1h56=uUuVxP0hcL8_ow@mail.gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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> 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?1763442316849735213?= X-GMAIL-MSGID: =?utf-8?q?1763442316849735213?= |
Series |
[v3] vect: Verify that GET_MODE_UNITS is greater than one for vect_grouped_store_supported
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Kevin Lee
April 17, 2023, 4:38 p.m. UTC
This patch properly guards gcc_assert (multiple_p (m_full_nelts, m_npatterns)) in vec_perm_indices indices (sel, 2, nelt) for VNx1 vectors. Based on the feedback from Richard Biener and Richard Sandiford, multiple_p has been used instead of maybe_lt to compare nelt with the minimum size 2. Bootstrap and testing done on x86_64-pc-linux-gnu. Would this be ok for trunk? Patch V1: https://gcc.gnu.org/pipermail/gcc-patches/2023-March/614463.html Patch V2: https://gcc.gnu.org/pipermail/gcc-patches/2023-March/614700.html Kevin Lee <kevinl@rivosinc.com> gcc/ChangeLog: * tree-vect-data-refs.cc (vect_grouped_store_supported): Add new condition --- gcc/tree-vect-data-refs.cc | 2 ++ 1 file changed, 2 insertions(+)
Comments
On Mon, Apr 17, 2023 at 6:40 PM Kevin Lee <kevinl@rivosinc.com> wrote: > > This patch properly guards gcc_assert (multiple_p (m_full_nelts, > m_npatterns)) in vec_perm_indices indices (sel, 2, nelt) for VNx1 vectors. > > Based on the feedback from Richard Biener and Richard Sandiford, > multiple_p has been used instead of maybe_lt to compare nelt with the > minimum size 2. > > Bootstrap and testing done on x86_64-pc-linux-gnu. Would this be ok for trunk? Yes, this is OK. Thanks, Richard. > Patch V1: https://gcc.gnu.org/pipermail/gcc-patches/2023-March/614463.html > Patch V2: https://gcc.gnu.org/pipermail/gcc-patches/2023-March/614700.html > > Kevin Lee <kevinl@rivosinc.com> > gcc/ChangeLog: > > * tree-vect-data-refs.cc (vect_grouped_store_supported): Add new > condition > --- > gcc/tree-vect-data-refs.cc | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/gcc/tree-vect-data-refs.cc b/gcc/tree-vect-data-refs.cc > index 8daf7bd7dd3..df393ba723d 100644 > --- a/gcc/tree-vect-data-refs.cc > +++ b/gcc/tree-vect-data-refs.cc > @@ -5399,6 +5399,8 @@ vect_grouped_store_supported (tree vectype, unsigned HOST_WIDE_INT count) > poly_uint64 nelt = GET_MODE_NUNITS (mode); > > /* The encoding has 2 interleaved stepped patterns. */ > + if(!multiple_p (nelt, 2)) > + return false; > vec_perm_builder sel (nelt, 2, 3); > sel.quick_grow (6); > for (i = 0; i < 3; i++) > -- > 2.25.1 >
On 4/17/23 10:38, Kevin Lee wrote: > This patch properly guards gcc_assert (multiple_p (m_full_nelts, > m_npatterns)) in vec_perm_indices indices (sel, 2, nelt) for VNx1 vectors. > > Based on the feedback from Richard Biener and Richard Sandiford, > multiple_p has been used instead of maybe_lt to compare nelt with the > minimum size 2. > > Bootstrap and testing done on x86_64-pc-linux-gnu. Would this be ok for trunk? > > Patch V1: https://gcc.gnu.org/pipermail/gcc-patches/2023-March/614463.html > Patch V2: https://gcc.gnu.org/pipermail/gcc-patches/2023-March/614700.html > > Kevin Lee <kevinl@rivosinc.com> > gcc/ChangeLog: > > * tree-vect-data-refs.cc (vect_grouped_store_supported): Add new > condition. I fixed up the indentation and pushed this to the trunk. jeff
diff --git a/gcc/tree-vect-data-refs.cc b/gcc/tree-vect-data-refs.cc index 8daf7bd7dd3..df393ba723d 100644 --- a/gcc/tree-vect-data-refs.cc +++ b/gcc/tree-vect-data-refs.cc @@ -5399,6 +5399,8 @@ vect_grouped_store_supported (tree vectype, unsigned HOST_WIDE_INT count) poly_uint64 nelt = GET_MODE_NUNITS (mode); /* The encoding has 2 interleaved stepped patterns. */ + if(!multiple_p (nelt, 2)) + return false; vec_perm_builder sel (nelt, 2, 3); sel.quick_grow (6); for (i = 0; i < 3; i++)