From patchwork Thu Aug 31 10:05:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Dapp X-Patchwork-Id: 137263 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c792:0:b0:3f2:4152:657d with SMTP id b18csp137282vqu; Thu, 31 Aug 2023 03:06:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG1rF/rpUj+3dFYR1tz2pOk46avfg59WQt96pK7irzapa78IRvzrUl46wNg8F3M89qsDEmK X-Received: by 2002:a17:906:7695:b0:9a5:9038:b1e0 with SMTP id o21-20020a170906769500b009a59038b1e0mr4282421ejm.16.1693476379271; Thu, 31 Aug 2023 03:06:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693476379; cv=none; d=google.com; s=arc-20160816; b=StxbRDMiq4uPalzGuX4R34Jti+CMjh+mHF7Akpj52ZLbBEXtUaSTL2LPoGieYbaqK6 rZCUK1rCEnuyfjm6Jj5euI2QFpCPuatsVMPEctgY/7G7v0b+R8AQHwfunpEJ2ezpixjn 3EWTCQPLKjOBJmY9gXIM9QfteDeRwPrPb+qaRMbyluXHmZ4FcAtahlolGIPe0wB6ZE1p KtxOISh39Htnx2SjiyWmr9zvbn10i1LC7DGA+BREqSW4hkmthkDBwhN7nVi5gvHFFgFH nFcujmSej6O8lvNhUWUUGVNiB6mrbtADZgy7v58lwfbcGw54OG0OgMfFC92RUyjVqc/i JC4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:in-reply-to:references:to :content-language:subject:user-agent:mime-version:date:message-id :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=jM9SFbL99MARe6S1jROcVNOkNX+ert0XryoWTe4D840=; fh=Y7WdFiHM5QpiRoPl3dJIPxlL7glbP+W7rz29Jdm2jsc=; b=YKjz8A06SfDg6dGa4R1f1wSqv0/ysmoBNF1fq6hJ7kq7guthQ1JgcZx0UBnkf8SmMb wOP53bXPhJy2Hn+rAfanRds9mWlq1+uoV2G6N8G1mHKW5/cGv98PmJH1ZGwfBmM6/hQy RZ09oMp2qCzY7YOvch5y9hMR0dLrXL43liZWzVih95ce26ldVdyUA91Hv6SZk9zrygVl jkhgf5V3mKsuLKBvRnYMnh6U/kE6SGyTULuQvk4Rz0stAjiEc3xAY0Re64hCnoF1hG9C 0OzfmBu1k7RTYkCFIN5QH0AXanAVWbYim8r4EEYBMoQ6lVZd0M/oZGQBT5UKmLs8e8PQ xhZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Zep0IOQM; 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 (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id k2-20020a17090646c200b00992c243f101si714608ejs.854.2023.08.31.03.06.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Aug 2023 03:06:19 -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=Zep0IOQM; 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 0B09D385840D for ; Thu, 31 Aug 2023 10:06:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0B09D385840D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1693476378; bh=jM9SFbL99MARe6S1jROcVNOkNX+ert0XryoWTe4D840=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=Zep0IOQMQpXT0VxM3YaYYAbtN1fSHFtMGBRDf5bIMb3nr7OQSeRsZp+gPfFzb1dqF +YPzS4i5uYXO6Lo4bjHt614cPzDAFX+YGgewVoh01AoWOf/SF2t+dIfB7iphAaWwij VgNJEj/xSKDYcV72Sa4LglourG9RCNSiAJCdJN70= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by sourceware.org (Postfix) with ESMTPS id 4FC983858C78 for ; Thu, 31 Aug 2023 10:05:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4FC983858C78 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-99bf1f632b8so71192466b.1 for ; Thu, 31 Aug 2023 03:05:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693476331; x=1694081131; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:cc:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jM9SFbL99MARe6S1jROcVNOkNX+ert0XryoWTe4D840=; b=J4dWkUV48Rx1otqs/0AprUGKAnAfD4NdXPM/sjgQD7MKYsFoe5u++oGsocWIkMvLF5 BV07fUuMocH1YjqYP2Dt9BqIjga+uSEoP8hcHs6TPkASwYdY+u4GNyd/Qh7sFIguYRff uHY933XI60cfTLaUfeVn95el2W7cPxNEJEVNqXyfbys4m0NY1n24MRukMivp6hWlUKFi 6mLeVkJV+qkLxeASzyE1iQI8TTqWwOJPOlUXoF9YZefn1JrsvwxUG/nfSwof50+qJHfO vC9qDfFY+sL4dRYsa6yAPSw7tzKg7XGSRXY8d9Ol80v5eCbFcIzrTpz85C0ykCl3M7ep tsFg== X-Gm-Message-State: AOJu0Yx9tlf/VQbTBmVy4rMG9Zd/rMOywwm+eLQYA11hroATpYK5Wa5O Ad9ig5lAqHhnMuI19gPRXFI= X-Received: by 2002:a17:906:30d2:b0:9a2:c5a:6c9d with SMTP id b18-20020a17090630d200b009a20c5a6c9dmr3566220ejb.62.1693476330719; Thu, 31 Aug 2023 03:05:30 -0700 (PDT) Received: from [192.168.1.23] (ip-046-005-130-086.um12.pools.vodafone-ip.de. [46.5.130.86]) by smtp.gmail.com with ESMTPSA id o13-20020a17090637cd00b0098e2969ed44sm571111ejc.45.2023.08.31.03.05.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 31 Aug 2023 03:05:30 -0700 (PDT) Message-ID: Date: Thu, 31 Aug 2023 12:05:29 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: [PATCH] testsuite/vect: Make match patterns more accurate. Content-Language: en-US To: Richard Biener , gcc-patches References: <6de3b340-a5a7-e5a1-aeb1-a4e1d8eac8c8@gmail.com> In-Reply-To: <6de3b340-a5a7-e5a1-aeb1-a4e1d8eac8c8@gmail.com> X-Spam-Status: No, score=-9.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, 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: , X-Patchwork-Original-From: Robin Dapp via Gcc-patches From: Robin Dapp Reply-To: Robin Dapp Cc: "juzhe.zhong@rivai.ai" Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1775738688065737746 X-GMAIL-MSGID: 1775738688065737746 Hi, on some targets we fail to vectorize with the first type the vectorizer tries but succeed with the second. This patch changes several regex patterns to reflect that behavior. Before we would look for a single occurrence of e.g. "vect_recog_dot_prod_pattern" but would possible find two (one for each attempted mode). The new pattern tries to match sequences where we first have a "vect_recog_dot_prod_pattern" and a "succeeded" afterwards while making sure there is no "failed" or "Re-trying" in between. I realized we already only do scan-tree-dump instead of scan-tree-dump-times in some related testcases, probably for the same reason but I didn't touch them for now. Testsuite unchanged on x86, aarch64 and Power10. Regards Robin gcc/testsuite/ChangeLog: * gcc.dg/vect/vect-reduc-dot-s16a.c: Adjust regex pattern. * gcc.dg/vect/vect-reduc-dot-s8a.c: Ditto. * gcc.dg/vect/vect-reduc-dot-s8b.c: Ditto. * gcc.dg/vect/vect-reduc-dot-u16a.c: Ditto. * gcc.dg/vect/vect-reduc-dot-u16b.c: Ditto. * gcc.dg/vect/vect-reduc-dot-u8a.c: Ditto. * gcc.dg/vect/vect-reduc-dot-u8b.c: Ditto. * gcc.dg/vect/vect-reduc-pattern-1a.c: Ditto. * gcc.dg/vect/vect-reduc-pattern-1b-big-array.c: Ditto. * gcc.dg/vect/vect-reduc-pattern-1c-big-array.c: Ditto. * gcc.dg/vect/vect-reduc-pattern-2a.c: Ditto. * gcc.dg/vect/vect-reduc-pattern-2b-big-array.c: Ditto. * gcc.dg/vect/wrapv-vect-reduc-dot-s8b.c: Ditto. --- gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s16a.c | 2 +- gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s8a.c | 4 ++-- gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s8b.c | 4 ++-- gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u16a.c | 5 +++-- gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u16b.c | 2 +- gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u8a.c | 2 +- gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u8b.c | 2 +- gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1a.c | 2 +- gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1b-big-array.c | 2 +- gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1c-big-array.c | 2 +- gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-2a.c | 2 +- gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-2b-big-array.c | 2 +- gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-dot-s8b.c | 4 ++-- 13 files changed, 18 insertions(+), 17 deletions(-) diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s16a.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s16a.c index ffbc9706901..d826828e3d6 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s16a.c +++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s16a.c @@ -51,7 +51,7 @@ main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vect_recog_dot_prod_pattern: detected" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vect_recog_dot_prod_pattern: detected(?:(?!failed)(?!Re-trying).)*succeeded" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_sdot_hi } } } */ /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_mult_hi_to_si } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s8a.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s8a.c index 05e343ad782..4e1e0b234f4 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s8a.c +++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s8a.c @@ -55,8 +55,8 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vect_recog_dot_prod_pattern: detected" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "vect_recog_widen_mult_pattern: detected" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vect_recog_dot_prod_pattern: detected(?:(?!failed)(?!Re-trying).)*succeeded" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vect_recog_widen_mult_pattern: detected(?:(?!failed)(?!Re-trying).)*succeeded" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_sdot_qi } } } */ /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_widen_mult_qi_to_hi && vect_widen_sum_hi_to_si } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s8b.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s8b.c index 82c648cc73c..cb88ad5b639 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s8b.c +++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s8b.c @@ -53,8 +53,8 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vect_recog_dot_prod_pattern: detected" 1 "vect" { xfail *-*-* } } } */ -/* { dg-final { scan-tree-dump-times "vect_recog_widen_mult_pattern: detected" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vect_recog_dot_prod_pattern: detected(?:(?!failed)(?!Re-trying).)*succeeded" 1 "vect" { xfail *-*-* } } } */ +/* { dg-final { scan-tree-dump-times "vect_recog_widen_mult_pattern: detected(?:(?!failed)(?!Re-trying).)*succeeded" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_mult_qi_to_hi } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u16a.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u16a.c index 4bf4a1e3c2c..9adb23a32f6 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u16a.c +++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u16a.c @@ -37,6 +37,7 @@ int main (void) for (i=0; i