From patchwork Sat Oct 7 11:45:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "juzhe.zhong@rivai.ai" X-Patchwork-Id: 149557 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp879826vqo; Sat, 7 Oct 2023 04:46:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEZQZd8rs4liFGMOqzOPUHIOu36B0x6kFqQMHk4p5GghfmGcpnGPX3gmTsB7Quzlq/I4Kmd X-Received: by 2002:a17:906:100e:b0:99d:fd27:b38d with SMTP id 14-20020a170906100e00b0099dfd27b38dmr8953117ejm.70.1696679188929; Sat, 07 Oct 2023 04:46:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696679188; cv=none; d=google.com; s=arc-20160816; b=HzCKY4dBYPOMt17fgbwVj8/j+d8gQuPAlVovslGBH5+b4Vp0x/4RD7PTmcx0D1Hwwc uzmlCmt0nNul9pOZGOTV24E7PpE1iD3H1SWWMiNj70SzJZs3u481HRCESFnwmTVkV5N1 b556S4tOUaQjInxkQx3RsdhYaCMqJCTcGTYhsIAiLHTb+X80vsVbCgyVBiO1q8bJ8Ru/ LTP87SeGIDso93o75RVgjBe0KoWm5mPAI2FmdDo9A4a9zBehaYJFw+PUQWccsJRs7tMs 6S6DyPlQ5s6zv4CABTzCeJ4wJfh+l0Alxh0TeyDsfoCQ2cyfC+2sXiv1i1R4siFLC/M5 aT1g== 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=wCtAGH7OzrAf9Wh4GvY1zMhLs6W3Vq1sHy2yjCIdPac=; fh=yBhBYpuPIOgrXC1e/CBrSGTklImhq8otxtMfvESr7dM=; b=Xza7ab18Lxa29RHJjmB+nQUwev7YUU1KtLjW8EQZByoUGADp49I7zp2khIMQxn2Osp r+EYhYzxRlHtI+VORVDRor9WS0T4W5AZtwioJFwhxBaRgiV8JUfwn53UKpCWC/jSRrdd Fzgamp4zkx0R/9yqPYuRrFOG1TqvKpqjxgyPTsoVPn0Z6BNf566IwWVUQ5kII2/f/Cx/ zgaOaQixIT8lVU8SJWVGHRqK3+1p5IPM02j8pRiqEQCGIJZepEn/9oN787xb8XZnTcgB ZHMEsbSRQUBqwtJcWvlrkAUF/l14/ux5pJFVWVdUtZpwF2VRKmp7BrUWJ6eU+2mJlhqS W5NA== 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 y15-20020a1709060a8f00b009930f844671si2587867ejf.963.2023.10.07.04.46.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 04:46:28 -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 C54B23856956 for ; Sat, 7 Oct 2023 11:46:23 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtpbgsg1.qq.com (smtpbgsg1.qq.com [54.254.200.92]) by sourceware.org (Postfix) with ESMTPS id C8A723858D37 for ; Sat, 7 Oct 2023 11:45:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C8A723858D37 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: bizesmtp67t1696679150tm1mi6m1 Received: from rios-cad121.hadoop.rioslab.org ( [58.60.1.9]) by bizesmtp.qq.com (ESMTP) with id ; Sat, 07 Oct 2023 19:45:49 +0800 (CST) X-QQ-SSF: 01400000000000G0V000000A0000000 X-QQ-FEAT: bQ+XnnlIu5Ruoy7FRelJP94FrTodupf2J+Wf4yFlAAnLoB83O1Ic9yntZapEH cJrxQ8N9DGNhI9iVdRncH5muaDO85tQrzDEtG+nU0+dBtPuyKdCeTfO5ltQjYr0BsXTlYAe XFt+eHJL79x4a1eczKDz4t5jiU5+qTWdS1pkermUg0MAoxZA8qN95M9Ie5zlVuDCNoejeoK KxzT8MmeuxvMVO2kFla9fSE0NbuVLDO2SKoKmmwr5D91sYSi5UvzkoiXhNanumgFL1tlUYs zFMlA688kdWZ0bc2TxE39Z93Lqjd1qrakpbK3LkDkDE4Owx2pq9jKKBvLleRCiEP8+lppK9 Gvzg3WJwZC2gqgDj4C84YoHQGgzbIhluu1oIeiPtHI7mDEvDZZnYtkC+tZj0Sj96vAEIiG2 X-QQ-GoodBg: 2 X-BIZMAIL-ID: 3549115260167787942 From: Juzhe-Zhong To: gcc-patches@gcc.gnu.org Cc: rguenther@suse.de, jeffreyalaw@gmail.com, rdapp.gcc@gmail.com, Juzhe-Zhong Subject: [PATCH] TEST: Fix vect_cond_arith_* dump checks for RVV Date: Sat, 7 Oct 2023 19:45:43 +0800 Message-Id: <20231007114543.2455622-1-juzhe.zhong@rivai.ai> X-Mailer: git-send-email 2.36.3 MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:rivai.ai:qybglogicsvrgz:qybglogicsvrgz7a-one-0 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779097077139797817 X-GMAIL-MSGID: 1779097077139797817 This patch fixes the following dumple FAILs: FAIL: gcc.dg/vect/vect-cond-arith-2.c -flto -ffat-lto-objects scan-tree-dump optimized " = \\.COND_SUB" FAIL: gcc.dg/vect/vect-cond-arith-2.c -flto -ffat-lto-objects scan-tree-dump vect " = \\.COND_ADD" FAIL: gcc.dg/vect/vect-cond-arith-2.c scan-tree-dump optimized " = \\.COND_SUB" FAIL: gcc.dg/vect/vect-cond-arith-2.c scan-tree-dump vect " = \\.COND_ADD" FAIL: gcc.dg/vect/vect-cond-arith-4.c -flto -ffat-lto-objects scan-tree-dump optimized " = \\.COND_ADD" FAIL: gcc.dg/vect/vect-cond-arith-4.c -flto -ffat-lto-objects scan-tree-dump optimized " = \\.COND_MUL" FAIL: gcc.dg/vect/vect-cond-arith-4.c -flto -ffat-lto-objects scan-tree-dump optimized " = \\.COND_RDIV" FAIL: gcc.dg/vect/vect-cond-arith-4.c -flto -ffat-lto-objects scan-tree-dump optimized " = \\.COND_SUB" FAIL: gcc.dg/vect/vect-cond-arith-4.c scan-tree-dump optimized " = \\.COND_ADD" FAIL: gcc.dg/vect/vect-cond-arith-4.c scan-tree-dump optimized " = \\.COND_MUL" FAIL: gcc.dg/vect/vect-cond-arith-4.c scan-tree-dump optimized " = \\.COND_RDIV" FAIL: gcc.dg/vect/vect-cond-arith-4.c scan-tree-dump optimized " = \\.COND_SUB" FAIL: gcc.dg/vect/vect-cond-arith-5.c -flto -ffat-lto-objects scan-tree-dump optimized " = \\.COND_ADD" FAIL: gcc.dg/vect/vect-cond-arith-5.c -flto -ffat-lto-objects scan-tree-dump optimized " = \\.COND_MUL" FAIL: gcc.dg/vect/vect-cond-arith-5.c -flto -ffat-lto-objects scan-tree-dump optimized " = \\.COND_RDIV" FAIL: gcc.dg/vect/vect-cond-arith-5.c -flto -ffat-lto-objects scan-tree-dump optimized " = \\.COND_SUB" FAIL: gcc.dg/vect/vect-cond-arith-5.c scan-tree-dump optimized " = \\.COND_ADD" FAIL: gcc.dg/vect/vect-cond-arith-5.c scan-tree-dump optimized " = \\.COND_MUL" FAIL: gcc.dg/vect/vect-cond-arith-5.c scan-tree-dump optimized " = \\.COND_RDIV" FAIL: gcc.dg/vect/vect-cond-arith-5.c scan-tree-dump optimized " = \\.COND_SUB" FAIL: gcc.dg/vect/vect-cond-arith-6.c -flto -ffat-lto-objects scan-tree-dump-times optimized " = \\.COND_ADD" 1 FAIL: gcc.dg/vect/vect-cond-arith-6.c -flto -ffat-lto-objects scan-tree-dump-times optimized " = \\.COND_MUL" 1 FAIL: gcc.dg/vect/vect-cond-arith-6.c -flto -ffat-lto-objects scan-tree-dump-times optimized " = \\.COND_RDIV" 1 FAIL: gcc.dg/vect/vect-cond-arith-6.c -flto -ffat-lto-objects scan-tree-dump-times optimized " = \\.COND_SUB" 1 FAIL: gcc.dg/vect/vect-cond-arith-6.c scan-tree-dump-times optimized " = \\.COND_ADD" 1 FAIL: gcc.dg/vect/vect-cond-arith-6.c scan-tree-dump-times optimized " = \\.COND_MUL" 1 FAIL: gcc.dg/vect/vect-cond-arith-6.c scan-tree-dump-times optimized " = \\.COND_RDIV" 1 FAIL: gcc.dg/vect/vect-cond-arith-6.c scan-tree-dump-times optimized " = \\.COND_SUB" 1 For RVV, the expected dumple IR is COND_LEN_* pattern. Also, we are still failing at this check: FAIL: gcc.dg/vect/vect-cond-arith-2.c scan-tree-dump optimized " = \\.COND_LEN_SUB" FAIL: gcc.dg/vect/vect-cond-arith-2.c -flto -ffat-lto-objects scan-tree-dump optimized " = \\.COND_LEN_SUB" Since we have a known bug in GIMPLE_FOLD that Robin is working on it. @Robin: Plz make sure vect-cond-arith-2.c passes with this patch and your bug fix patch. Ok for trunk ? gcc/testsuite/ChangeLog: * gcc.dg/vect/vect-cond-arith-2.c: Fix dump check for RVV. * gcc.dg/vect/vect-cond-arith-4.c: Ditto. * gcc.dg/vect/vect-cond-arith-5.c: Ditto. * gcc.dg/vect/vect-cond-arith-6.c: Ditto. --- gcc/testsuite/gcc.dg/vect/vect-cond-arith-2.c | 6 ++++-- gcc/testsuite/gcc.dg/vect/vect-cond-arith-4.c | 12 ++++++++---- gcc/testsuite/gcc.dg/vect/vect-cond-arith-5.c | 12 ++++++++---- gcc/testsuite/gcc.dg/vect/vect-cond-arith-6.c | 12 ++++++++---- 4 files changed, 28 insertions(+), 14 deletions(-) diff --git a/gcc/testsuite/gcc.dg/vect/vect-cond-arith-2.c b/gcc/testsuite/gcc.dg/vect/vect-cond-arith-2.c index 38994ea82a5..7bddc122037 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-cond-arith-2.c +++ b/gcc/testsuite/gcc.dg/vect/vect-cond-arith-2.c @@ -41,5 +41,7 @@ neg_xi (double *x) return res_3; } -/* { dg-final { scan-tree-dump { = \.COND_ADD} "vect" { target { vect_double_cond_arith && vect_fully_masked } } } } */ -/* { dg-final { scan-tree-dump { = \.COND_SUB} "optimized" { target { vect_double_cond_arith && vect_fully_masked } } } } */ +/* { dg-final { scan-tree-dump { = \.COND_ADD} "vect" { target { vect_double_cond_arith && { vect_fully_masked && { ! riscv_v } } } } } } */ +/* { dg-final { scan-tree-dump { = \.COND_SUB} "optimized" { target { vect_double_cond_arith && { vect_fully_masked && { ! riscv_v } } } } } } */ +/* { dg-final { scan-tree-dump { = \.COND_LEN_ADD} "vect" { target { vect_double_cond_arith && { vect_fully_masked && riscv_v } } } } } */ +/* { dg-final { scan-tree-dump { = \.COND_LEN_SUB} "optimized" { target { vect_double_cond_arith && { vect_fully_masked && riscv_v } } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-cond-arith-4.c b/gcc/testsuite/gcc.dg/vect/vect-cond-arith-4.c index 1af0fe642a0..b60fa0a2a25 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-cond-arith-4.c +++ b/gcc/testsuite/gcc.dg/vect/vect-cond-arith-4.c @@ -52,8 +52,12 @@ main (void) return 0; } -/* { dg-final { scan-tree-dump { = \.COND_ADD} "optimized" { target vect_double_cond_arith } } } */ -/* { dg-final { scan-tree-dump { = \.COND_SUB} "optimized" { target vect_double_cond_arith } } } */ -/* { dg-final { scan-tree-dump { = \.COND_MUL} "optimized" { target vect_double_cond_arith } } } */ -/* { dg-final { scan-tree-dump { = \.COND_RDIV} "optimized" { target vect_double_cond_arith } } } */ +/* { dg-final { scan-tree-dump { = \.COND_ADD} "optimized" { target { vect_double_cond_arith && { ! riscv_v } } } } } */ +/* { dg-final { scan-tree-dump { = \.COND_SUB} "optimized" { target { vect_double_cond_arith && { ! riscv_v } } } } } */ +/* { dg-final { scan-tree-dump { = \.COND_MUL} "optimized" { target { vect_double_cond_arith && { ! riscv_v } } } } } */ +/* { dg-final { scan-tree-dump { = \.COND_RDIV} "optimized" { target { vect_double_cond_arith && { ! riscv_v } } } } } */ +/* { dg-final { scan-tree-dump { = \.COND_LEN_ADD} "optimized" { target { vect_double_cond_arith && riscv_v } } } } */ +/* { dg-final { scan-tree-dump { = \.COND_LEN_SUB} "optimized" { target { vect_double_cond_arith && riscv_v } } } } */ +/* { dg-final { scan-tree-dump { = \.COND_LEN_MUL} "optimized" { target { vect_double_cond_arith && riscv_v } } } } */ +/* { dg-final { scan-tree-dump { = \.COND_LEN_RDIV} "optimized" { target { vect_double_cond_arith && riscv_v } } } } */ /* { dg-final { scan-tree-dump-not {VEC_COND_EXPR} "optimized" { target vect_double_cond_arith } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-cond-arith-5.c b/gcc/testsuite/gcc.dg/vect/vect-cond-arith-5.c index ec3d9db4202..57647849c44 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-cond-arith-5.c +++ b/gcc/testsuite/gcc.dg/vect/vect-cond-arith-5.c @@ -54,8 +54,12 @@ main (void) return 0; } -/* { dg-final { scan-tree-dump { = \.COND_ADD} "optimized" { target { vect_double_cond_arith && vect_masked_store } } } } */ -/* { dg-final { scan-tree-dump { = \.COND_SUB} "optimized" { target { vect_double_cond_arith && vect_masked_store } } } } */ -/* { dg-final { scan-tree-dump { = \.COND_MUL} "optimized" { target { vect_double_cond_arith && vect_masked_store } } } } */ -/* { dg-final { scan-tree-dump { = \.COND_RDIV} "optimized" { target { vect_double_cond_arith && vect_masked_store } } } } */ +/* { dg-final { scan-tree-dump { = \.COND_ADD} "optimized" { target { vect_double_cond_arith && { vect_masked_store && { ! riscv_v } } } } } } */ +/* { dg-final { scan-tree-dump { = \.COND_SUB} "optimized" { target { vect_double_cond_arith && { vect_masked_store && { ! riscv_v } } } } } } */ +/* { dg-final { scan-tree-dump { = \.COND_MUL} "optimized" { target { vect_double_cond_arith && { vect_masked_store && { ! riscv_v } } } } } } */ +/* { dg-final { scan-tree-dump { = \.COND_RDIV} "optimized" { target { vect_double_cond_arith && { vect_masked_store && { ! riscv_v } } } } } } */ +/* { dg-final { scan-tree-dump { = \.COND_LEN_ADD} "optimized" { target { vect_double_cond_arith && { vect_masked_store && riscv_v } } } } } */ +/* { dg-final { scan-tree-dump { = \.COND_LEN_SUB} "optimized" { target { vect_double_cond_arith && { vect_masked_store && riscv_v } } } } } */ +/* { dg-final { scan-tree-dump { = \.COND_LEN_MUL} "optimized" { target { vect_double_cond_arith && { vect_masked_store && riscv_v } } } } } */ +/* { dg-final { scan-tree-dump { = \.COND_LEN_RDIV} "optimized" { target { vect_double_cond_arith && { vect_masked_store && riscv_v } } } } } */ /* { dg-final { scan-tree-dump-not {VEC_COND_EXPR} "optimized" { target { vect_double_cond_arith && vect_masked_store } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-cond-arith-6.c b/gcc/testsuite/gcc.dg/vect/vect-cond-arith-6.c index 2aeebd44f83..3086efe85fd 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-cond-arith-6.c +++ b/gcc/testsuite/gcc.dg/vect/vect-cond-arith-6.c @@ -56,8 +56,12 @@ main (void) } /* { dg-final { scan-tree-dump-times {vectorizing stmts using SLP} 4 "vect" { target vect_double_cond_arith } } } */ -/* { dg-final { scan-tree-dump-times { = \.COND_ADD} 1 "optimized" { target vect_double_cond_arith } } } */ -/* { dg-final { scan-tree-dump-times { = \.COND_SUB} 1 "optimized" { target vect_double_cond_arith } } } */ -/* { dg-final { scan-tree-dump-times { = \.COND_MUL} 1 "optimized" { target vect_double_cond_arith } } } */ -/* { dg-final { scan-tree-dump-times { = \.COND_RDIV} 1 "optimized" { target vect_double_cond_arith } } } */ +/* { dg-final { scan-tree-dump-times { = \.COND_ADD} 1 "optimized" { target { vect_double_cond_arith && { ! riscv_v } } } } } */ +/* { dg-final { scan-tree-dump-times { = \.COND_SUB} 1 "optimized" { target { vect_double_cond_arith && { ! riscv_v } } } } } */ +/* { dg-final { scan-tree-dump-times { = \.COND_MUL} 1 "optimized" { target { vect_double_cond_arith && { ! riscv_v } } } } } */ +/* { dg-final { scan-tree-dump-times { = \.COND_RDIV} 1 "optimized" { target { vect_double_cond_arith && { ! riscv_v } } } } } */ +/* { dg-final { scan-tree-dump-times { = \.COND_LEN_ADD} 1 "optimized" { target { vect_double_cond_arith && riscv_v } } } } */ +/* { dg-final { scan-tree-dump-times { = \.COND_LEN_SUB} 1 "optimized" { target { vect_double_cond_arith && riscv_v } } } } */ +/* { dg-final { scan-tree-dump-times { = \.COND_LEN_MUL} 1 "optimized" { target { vect_double_cond_arith && riscv_v } } } } */ +/* { dg-final { scan-tree-dump-times { = \.COND_LEN_RDIV} 1 "optimized" { target { vect_double_cond_arith && riscv_v } } } } */ /* { dg-final { scan-tree-dump-not {VEC_COND_EXPR} "optimized" { target vect_double_cond_arith } } } */