Message ID | 20211011021047.66652-1-hongtao.liu@intel.com |
---|---|
State | New |
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8F0C1385841F for <patchwork@sourceware.org>; Mon, 11 Oct 2021 02:11:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8F0C1385841F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1633918282; bh=56N4oNocEW6cWC0yedczS5oep43bGzmWuEQDdcaFOtY=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=KpvL/6JH2xGb9kHxb8ljPofn7eXYLlu1/4v47RQCYWQ4VyT5PdixBbvvN2QyD4sND I5zyt8FR/E1kzjRkETxQX2lkVnoIJ+GILjdcVgVfVWi6RcqKQcphw03hPRYQGz/rlm 3P0R0a7+UckFSftJh4tWdWB0ljgVV2A2M6Zn6fJU= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by sourceware.org (Postfix) with ESMTPS id C830B3858D28 for <gcc-patches@gcc.gnu.org>; Mon, 11 Oct 2021 02:10:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C830B3858D28 X-IronPort-AV: E=McAfee;i="6200,9189,10133"; a="312982427" X-IronPort-AV: E=Sophos;i="5.85,363,1624345200"; d="scan'208";a="312982427" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2021 19:10:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,363,1624345200"; d="scan'208";a="479660483" Received: from scymds01.sc.intel.com ([10.148.94.138]) by orsmga007.jf.intel.com with ESMTP; 10 Oct 2021 19:10:49 -0700 Received: from shliclel320.sh.intel.com (shliclel320.sh.intel.com [10.239.236.50]) by scymds01.sc.intel.com with ESMTP id 19B2AlvJ029858; Sun, 10 Oct 2021 19:10:48 -0700 To: gcc-patches@gcc.gnu.org Subject: [PATCH] Adjust testcase for O2 vectorization enabling Date: Mon, 11 Oct 2021 10:10:47 +0800 Message-Id: <20211011021047.66652-1-hongtao.liu@intel.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <CAMe9rOodeqm3rnyEHFs5XrTC-hiJApGsBSpzmxnm+Led6vyoAQ@mail.gmail.com> References: <CAMe9rOodeqm3rnyEHFs5XrTC-hiJApGsBSpzmxnm+Led6vyoAQ@mail.gmail.com> X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: liuhongt via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: liuhongt <hongtao.liu@intel.com> Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Series |
Adjust testcase for O2 vectorization enabling
|
|
Commit Message
liuhongt
Oct. 11, 2021, 2:10 a.m. UTC
libgomp/ChangeLog: * testsuite/libgomp.graphite/force-parallel-8.c: Add -fno-tree-vectorize. --- libgomp/testsuite/libgomp.graphite/force-parallel-8.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Hi Hongtao, on 2021/10/11 上午10:10, liuhongt via Gcc-patches wrote: > libgomp/ChangeLog: > > * testsuite/libgomp.graphite/force-parallel-8.c: Add -fno-tree-vectorize. > --- > libgomp/testsuite/libgomp.graphite/force-parallel-8.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libgomp/testsuite/libgomp.graphite/force-parallel-8.c b/libgomp/testsuite/libgomp.graphite/force-parallel-8.c > index f9e07039172..0f3d138cebd 100644 > --- a/libgomp/testsuite/libgomp.graphite/force-parallel-8.c > +++ b/libgomp/testsuite/libgomp.graphite/force-parallel-8.c > @@ -1,4 +1,4 @@ > -/* { dg-additional-options "-fdisable-tree-thread1 -fdisable-tree-vrp-thread1" } */ > +/* { dg-additional-options "-fdisable-tree-thread1 -fdisable-tree-vrp-thread1 -fno-tree-vectorize" } */ > > #define N 1500 > > Thanks for doing this! This issue was observed in rs6000 specific PR102658 as well. I've looked into it a bit, it's caused by the "conditional store replacement" which is originally disabled without vectorization as below code. /* If either vectorization or if-conversion is disabled then do not sink any stores. */ if (param_max_stores_to_sink == 0 || (!flag_tree_loop_vectorize && !flag_tree_slp_vectorize) || !flag_tree_loop_if_convert) return false; The new change makes the innermost loop look like for (int c1 = 0; c1 <= 1499; c1 += 1) { if (c1 <= 500) { S_10(c0, c1); } else { S_9(c0, c1); } S_11(c0, c1); } and can not be splitted as: for (int c1 = 0; c1 <= 500; c1 += 1) S_10(c0, c1); for (int c1 = 501; c1 <= 1499; c1 += 1) S_9(c0, c1); So instead of disabling vectorization, could we just disable this cs replacement with parameter "--param max-stores-to-sink=0"? I tested this proposal on ppc64le, it should work as well. What do you think of it? BR, Kewen
On Mon, Oct 11, 2021 at 10:23 AM Kewen.Lin via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: > > Hi Hongtao, > > on 2021/10/11 上午10:10, liuhongt via Gcc-patches wrote: > > libgomp/ChangeLog: > > > > * testsuite/libgomp.graphite/force-parallel-8.c: Add -fno-tree-vectorize. > > --- > > libgomp/testsuite/libgomp.graphite/force-parallel-8.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/libgomp/testsuite/libgomp.graphite/force-parallel-8.c b/libgomp/testsuite/libgomp.graphite/force-parallel-8.c > > index f9e07039172..0f3d138cebd 100644 > > --- a/libgomp/testsuite/libgomp.graphite/force-parallel-8.c > > +++ b/libgomp/testsuite/libgomp.graphite/force-parallel-8.c > > @@ -1,4 +1,4 @@ > > -/* { dg-additional-options "-fdisable-tree-thread1 -fdisable-tree-vrp-thread1" } */ > > +/* { dg-additional-options "-fdisable-tree-thread1 -fdisable-tree-vrp-thread1 -fno-tree-vectorize" } */ > > > > #define N 1500 > > > > > > Thanks for doing this! > > This issue was observed in rs6000 specific PR102658 as well. > > I've looked into it a bit, it's caused by the "conditional store replacement" which > is originally disabled without vectorization as below code. > > /* If either vectorization or if-conversion is disabled then do > not sink any stores. */ > if (param_max_stores_to_sink == 0 > || (!flag_tree_loop_vectorize && !flag_tree_slp_vectorize) > || !flag_tree_loop_if_convert) > return false; > > The new change makes the innermost loop look like > > for (int c1 = 0; c1 <= 1499; c1 += 1) { > if (c1 <= 500) { > S_10(c0, c1); > } else { > S_9(c0, c1); > } > S_11(c0, c1); > } > > and can not be splitted as: > > for (int c1 = 0; c1 <= 500; c1 += 1) > S_10(c0, c1); > > for (int c1 = 501; c1 <= 1499; c1 += 1) > S_9(c0, c1); > > So instead of disabling vectorization, could we just disable this cs replacement > with parameter "--param max-stores-to-sink=0"? > > I tested this proposal on ppc64le, it should work as well. > > What do you think of it? I can confirm it also works for x86, I'll adjust the patch. Thank you for the analysis. > > BR, > Kewen
diff --git a/libgomp/testsuite/libgomp.graphite/force-parallel-8.c b/libgomp/testsuite/libgomp.graphite/force-parallel-8.c index f9e07039172..0f3d138cebd 100644 --- a/libgomp/testsuite/libgomp.graphite/force-parallel-8.c +++ b/libgomp/testsuite/libgomp.graphite/force-parallel-8.c @@ -1,4 +1,4 @@ -/* { dg-additional-options "-fdisable-tree-thread1 -fdisable-tree-vrp-thread1" } */ +/* { dg-additional-options "-fdisable-tree-thread1 -fdisable-tree-vrp-thread1 -fno-tree-vectorize" } */ #define N 1500