Message ID | 20231009122451.8478-1-juzhe.zhong@rivai.ai |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1829900vqo; Mon, 9 Oct 2023 05:25:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFh3ttwBWVoHh2UOrY5Jc4N7JXolbS8VRaz96Fo+oxK42HSEyJyiKJSUpQpfwxyOp+VzcHt X-Received: by 2002:a17:907:780d:b0:9b6:4df9:e5b5 with SMTP id la13-20020a170907780d00b009b64df9e5b5mr13774111ejc.61.1696854334921; Mon, 09 Oct 2023 05:25:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696854334; cv=none; d=google.com; s=arc-20160816; b=OBb7P3qihtqhJtK3GvjRL/t1Bkr5UeRv8oWp5+IJ+Hdb7V5+TYok28fOndIkg6Hjcp ivZSZU3kix/cN1ZCFq1j8NdsKm1l+8pBlQnJhti0Wn5QvStK/+3f2uGfP8rx1akxFKLZ ixPDAahnu1CNuCogyH/DeQVXuhz3d5CKA3SS1z5r34dWS13iw7PlTffOQ1xC5m/p7zvh Y3XtXt8K7Tb5TQlNdcHbi9T1c2Xqc2HGACBrz5Wxz+3c159/oiuMxQMPeZWM6Q6igdWW o9W81wFDXUmx7aXgXlGVeo5HZYAFAPsqJEbJZieGFeJZx4Cg9tebnRbSZuGpUB5A88M7 oxfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:feedback-id :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dmarc-filter:delivered-to; bh=6egJDu+HEC6VqMNhIXVVONS5ymZnMwJraLk0pIIPigY=; fh=Ytz0BgUryGxSKnlvo5iIYZYov/AuWMbdn9WUJJDE2rE=; b=QzVRj1PaAgZGB2Dg8+ArU5SpWIwWPDJSSExR2bE1flsQbGO0QoCdboGP7X8vO9jvez LByDnbC/eq7ynH4Ludv5HGwRs/EF04Elpu7WwBDIbKP9s/m3hGFTLCkZK4Zfhellsy1C RwAZuYeGtAIprWQzlkPg2yCnRmxzyZiyxZvi70AQnUnxZYMSrfWLSXu7zvXndfgTdM5p 8MSK2Ozuba4cTAc5zB+67T45RB53WkgqCLY1Vy69bBqrqHfn75FE7rEjfGpmuAoWNCED YDJgLafdIbgA2nXrF+1yo+8vGz2uiSGsvOuY/vG8g5py/xcvHnFFcbVOYd1PUGRqbctI HxuA== ARC-Authentication-Results: i=1; mx.google.com; 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" Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id rn11-20020a170906d92b00b009b654a32c1csi4451310ejb.804.2023.10.09.05.25.34 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 05:25:34 -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; 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" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A410B3856DEA for <ouuuleilei@gmail.com>; Mon, 9 Oct 2023 12:25:29 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtpbg151.qq.com (smtpbg151.qq.com [18.169.211.239]) by sourceware.org (Postfix) with ESMTPS id 78D453858D37 for <gcc-patches@gcc.gnu.org>; Mon, 9 Oct 2023 12:25:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 78D453858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivai.ai Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivai.ai X-QQ-mid: bizesmtp91t1696854293ta9ph3mn Received: from rios-cad122.hadoop.rioslab.org ( [58.60.1.26]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 09 Oct 2023 20:24:52 +0800 (CST) X-QQ-SSF: 01400000000000G0V000000A0000000 X-QQ-FEAT: LrCnY+iDm+M6DKUPBy+WnDm2zptlpjHMuBwoDeTJlkRQ2+X9SSKk2qhAXNBWG HE7tPHTZS4dxw4FQ9L/oZMFNuSYQEq8IWLz1YdQoDihSx69uusJUx4CR9J68td+IWBhJKmT DYHp6Hme1IZxiqz2uUiyBOipq0t7R36ZYvLuuzyx6MlO69eu4pw+IiIs2ZvfswR3LrvCGS9 VekqwGaS2GodMGAuKnm+y6NHCaCa6Y9p+tmpXD9Wzff2owuv8mDj/k/9P9SAygyckDFsfjJ 9XxdipSUu7useAi9lgHMxPUacH/K4fFwhAX7NdaPHpwC/0SRWG1JXx41GrDYiCQ2CkEbV3x KlkJ9g3ZoLQMgjHJDgA6D/TV6sRdW1lwZbavvDo6XSaz2F9O3RKHo11jSEETrWlHCBSjoXx k7H6d0Wzvc0= X-QQ-GoodBg: 2 X-BIZMAIL-ID: 494195842526723056 From: Juzhe-Zhong <juzhe.zhong@rivai.ai> To: gcc-patches@gcc.gnu.org Cc: rguenther@suse.de, jeffreyalaw@gmail.com, Juzhe-Zhong <juzhe.zhong@rivai.ai> Subject: [PATCH] RISC-V Regression test: Fix FAIL of fast-math-slp-38.c for RVV Date: Mon, 9 Oct 2023 20:24:51 +0800 Message-Id: <20231009122451.8478-1-juzhe.zhong@rivai.ai> X-Mailer: git-send-email 2.36.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:rivai.ai:qybglogicsvrgz:qybglogicsvrgz7a-one-0 X-Spam-Status: No, score=-10.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP 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.30 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779280731100205194 X-GMAIL-MSGID: 1779280731100205194 |
Series |
RISC-V Regression test: Fix FAIL of fast-math-slp-38.c for RVV
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
juzhe.zhong@rivai.ai
Oct. 9, 2023, 12:24 p.m. UTC
Reference: https://godbolt.org/z/G9jzf5Grh RVV is able to vectorize this case using SLP. However, with -fno-vect-cost-model, RVV vectorize it by vec_load_lanes with stride 6. gcc/testsuite/ChangeLog: * gcc.dg/vect/fast-math-slp-38.c: Add ! vect_strided6. --- gcc/testsuite/gcc.dg/vect/fast-math-slp-38.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Mon, 9 Oct 2023, Juzhe-Zhong wrote: > Reference: https://godbolt.org/z/G9jzf5Grh > > RVV is able to vectorize this case using SLP. However, with > -fno-vect-cost-model, RVV vectorize it by vec_load_lanes with stride 6. OK. Note load/store-lanes is specifically pre-empting SLP if all loads/stores of a SLP intance can support that. Not sure if this heuristic is good for load/store lanes with high stride? > gcc/testsuite/ChangeLog: > > * gcc.dg/vect/fast-math-slp-38.c: Add ! vect_strided6. > > --- > gcc/testsuite/gcc.dg/vect/fast-math-slp-38.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gcc/testsuite/gcc.dg/vect/fast-math-slp-38.c b/gcc/testsuite/gcc.dg/vect/fast-math-slp-38.c > index 7c7acd5bab6..96751faae7f 100644 > --- a/gcc/testsuite/gcc.dg/vect/fast-math-slp-38.c > +++ b/gcc/testsuite/gcc.dg/vect/fast-math-slp-38.c > @@ -18,4 +18,4 @@ foo (void) > } > > /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ > -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */ > +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { ! vect_strided6 } } } } */ >
>> OK. Thanks. Committed. >> Note load/store-lanes is specifically pre-empting SLP if all >> loads/stores of a SLP intance can support that. Not sure if this >> heuristic is good for load/store lanes with high stride? Yeah, I understand your concern. Emmmmm, I am sure too. But RVV ISA define lanes load/store from 2 to 8 and LLVM already supported. I think we can fully support them, then let RISC-V COST model decide it whether it is profitable or not. Also, I found RVV can vectorize a TSVC case with stride = 5 lane_load/lane_store: tsvc-s353.c: -/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" { xfail *-*-* } } } */ +/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" { xfail { ! riscv_v } } } } */ https://gcc.gnu.org/pipermail/gcc-patches/2023-October/632213.html So, I think overall it is beneficial we support high stride lane load/store which can help us vectorize more cases. juzhe.zhong@rivai.ai From: Richard Biener Date: 2023-10-09 20:41 To: Juzhe-Zhong CC: gcc-patches; jeffreyalaw Subject: Re: [PATCH] RISC-V Regression test: Fix FAIL of fast-math-slp-38.c for RVV On Mon, 9 Oct 2023, Juzhe-Zhong wrote: > Reference: https://godbolt.org/z/G9jzf5Grh > > RVV is able to vectorize this case using SLP. However, with > -fno-vect-cost-model, RVV vectorize it by vec_load_lanes with stride 6. OK. Note load/store-lanes is specifically pre-empting SLP if all loads/stores of a SLP intance can support that. Not sure if this heuristic is good for load/store lanes with high stride? > gcc/testsuite/ChangeLog: > > * gcc.dg/vect/fast-math-slp-38.c: Add ! vect_strided6. > > --- > gcc/testsuite/gcc.dg/vect/fast-math-slp-38.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gcc/testsuite/gcc.dg/vect/fast-math-slp-38.c b/gcc/testsuite/gcc.dg/vect/fast-math-slp-38.c > index 7c7acd5bab6..96751faae7f 100644 > --- a/gcc/testsuite/gcc.dg/vect/fast-math-slp-38.c > +++ b/gcc/testsuite/gcc.dg/vect/fast-math-slp-38.c > @@ -18,4 +18,4 @@ foo (void) > } > > /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ > -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */ > +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { ! vect_strided6 } } } } */ > -- Richard Biener <rguenther@suse.de> SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)
diff --git a/gcc/testsuite/gcc.dg/vect/fast-math-slp-38.c b/gcc/testsuite/gcc.dg/vect/fast-math-slp-38.c index 7c7acd5bab6..96751faae7f 100644 --- a/gcc/testsuite/gcc.dg/vect/fast-math-slp-38.c +++ b/gcc/testsuite/gcc.dg/vect/fast-math-slp-38.c @@ -18,4 +18,4 @@ foo (void) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { ! vect_strided6 } } } } */