[rs6000] Call vector load/store with length expand only on 64-bit Power10 [PR96762]
Message ID | 528dd350-d75e-d0d8-0b91-326151b274e5@linux.ibm.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a7d1:0:b0:3f2:4152:657d with SMTP id p17csp3685362vqm; Mon, 28 Aug 2023 19:51:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH2elSO1IPt8rayOsG/qZjUUQFj0tQoqC5m1PBuUbj1MbKsg5evYDbKuPoyoKi8OAN6T7ij X-Received: by 2002:ac2:4ad1:0:b0:500:7f51:d129 with SMTP id m17-20020ac24ad1000000b005007f51d129mr15220994lfp.34.1693277462359; Mon, 28 Aug 2023 19:51:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693277462; cv=none; d=google.com; s=arc-20160816; b=rBCpDZyWk7WL005TIvWUjK0KpruYCPEKzPvYi9WWo8gJXgSxB82KSkx7XChToTz5Iu Y9IxInxWQ6cYcnGQGAx6PSEdhdVJDZVX+c/ASQ5nIK3l5fMvUXoOe6rEF+jlsmrLyR1h KJ27rhN+ZrXrYWjM96ZjU7mKqLDq7Z7N8hVIT4Jbu9J9G/wbpxrTyU9foHZiepd92JT8 qAYflch5fjLJu+nQR6oCGBbBuqv/6SUvlUhtZ5tcflOosAU4Dg/glhSrL0nhvqLPT7M9 O7OmsBR9QvzQre+i2f0oxYxR/aDMRAlgVernMHhu3EHu/rzK14Dh409XMKRRS2B0Tj4b 846A== 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:subject:to:content-language:user-agent :mime-version:date:message-id:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=UirPaYGPhkgAxrfQ50OCcNkO8452sadvXeuOFqIWhl4=; fh=N5xeAcoHiHemsNOe+rgC7MoBrkuY8gvPzSL77/KkM4I=; b=pT9MRyuiRf8OHmQM9YpByXsvGXgqN1IppXgF4PxS/hZdo+gWKT+EQeaXT0NZibZUtk lpha1JiVDLqTHdRFvXCajUqeHliT1URUs60ojKSCNyrQFIGe1tcLsyTb+DSNKE7mV5Wq 5mdyo16EuPLLzSGiBrX2dkyOTzGVg9cjY0OyH6p7SK5+Gj2INCGp9CICyelwZRcm8LqY 8pcovVjYPkumbt+7J9c62srfIRECBSb9laT2x2ZFS8B89kPhPu501+e+uC8LjLG4HGR/ P161RROP2nb0Ai6ZrJ2OrwgA4NzxHP8IOGnzXfGYzdZnY3O+AdS04AemeYqkbCakOo/+ 2Ndg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=dsF61nbv; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id u12-20020aa7d0cc000000b005255da75263si5242532edo.224.2023.08.28.19.51.02 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 19:51:02 -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=@gcc.gnu.org header.s=default header.b=dsF61nbv; 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"; 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 782D93858415 for <ouuuleilei@gmail.com>; Tue, 29 Aug 2023 02:51:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 782D93858415 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1693277460; bh=UirPaYGPhkgAxrfQ50OCcNkO8452sadvXeuOFqIWhl4=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=dsF61nbvVMjZST4vGFHvGqBMhNVbqaDcfTCqD10llehakCyoLn8xe4KGcrcNQVLHI s5iVwK0YDQUCMCzikzgi2WcGowoDn2/+KqyIUMFsHRpKiMXwQdD2HAU6O6Wm5iiXgl +xQFu4rZgKNrDhf9NjYk3hJ0ABJ87JH0jyVwhaI0= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id A84223858409 for <gcc-patches@gcc.gnu.org>; Tue, 29 Aug 2023 02:50:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A84223858409 Received: from pps.filterd (m0353723.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 37T29Cbq024919; Tue, 29 Aug 2023 02:50:16 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3sr87hg5cj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 29 Aug 2023 02:50:15 +0000 Received: from m0353723.ppops.net (m0353723.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 37T2jbZA026922; Tue, 29 Aug 2023 02:50:15 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3sr87hg5cc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 29 Aug 2023 02:50:15 +0000 Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 37T0Pi5w019188; Tue, 29 Aug 2023 02:50:14 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 3sqxe1fgqu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 29 Aug 2023 02:50:14 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 37T2oBAO36634880 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 29 Aug 2023 02:50:11 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BD32220086; Tue, 29 Aug 2023 02:50:11 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4086420085; Tue, 29 Aug 2023 02:50:10 +0000 (GMT) Received: from [9.200.102.40] (unknown [9.200.102.40]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 29 Aug 2023 02:50:09 +0000 (GMT) Message-ID: <528dd350-d75e-d0d8-0b91-326151b274e5@linux.ibm.com> Date: Tue, 29 Aug 2023 10:50:08 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Content-Language: en-US To: gcc-patches <gcc-patches@gcc.gnu.org> Subject: [PATCH, rs6000] Call vector load/store with length expand only on 64-bit Power10 [PR96762] Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: APIGfafGrCX1hxkKqArtC0SS4lpcWm35 X-Proofpoint-GUID: rhFaQvC9sXIgjGWY-jUvIG-N28OT0jWb X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-08-28_20,2023-08-28_04,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 priorityscore=1501 clxscore=1015 impostorscore=0 suspectscore=0 adultscore=0 mlxscore=0 malwarescore=0 phishscore=0 bulkscore=0 lowpriorityscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2308290021 X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, 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 <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: HAO CHEN GUI via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: HAO CHEN GUI <guihaoc@linux.ibm.com> Cc: Peter Bergner <bergner@linux.ibm.com>, David <dje.gcc@gmail.com>, Segher Boessenkool <segher@kernel.crashing.org> 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: INBOX X-GMAIL-THRID: 1775530108043209106 X-GMAIL-MSGID: 1775530108043209106 |
Series |
[rs6000] Call vector load/store with length expand only on 64-bit Power10 [PR96762]
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
HAO CHEN GUI
Aug. 29, 2023, 2:50 a.m. UTC
Hi, This patch adds "TARGET_64BIT" check when calling vector load/store with length expand in expand_block_move. It matches the expand condition of "lxvl" and "stxvl" defined in vsx.md. This patch fixes the ICE occurred with the test case on 32-bit Power10. Bootstrapped and tested on powerpc64-linux BE and LE with no regressions. Thanks Gui Haochen ChangeLog rs6000: call vector load/store with length expand only on 64-bit Power10 gcc/ PR target/96762 * config/rs6000/rs6000-string.cc (expand_block_move): Call vector load/store with length expand only on 64-bit Power10. gcc/testsuite/ PR target/96762 * gcc.target/powerpc/pr96762.c: New. patch.diff
Comments
Hi Haochen, on 2023/8/29 10:50, HAO CHEN GUI wrote: > Hi, > This patch adds "TARGET_64BIT" check when calling vector load/store > with length expand in expand_block_move. It matches the expand condition > of "lxvl" and "stxvl" defined in vsx.md. > > This patch fixes the ICE occurred with the test case on 32-bit Power10. > > Bootstrapped and tested on powerpc64-linux BE and LE with no regressions. > > Thanks > Gui Haochen > > > ChangeLog > rs6000: call vector load/store with length expand only on 64-bit Power10 > > gcc/ > PR target/96762 > * config/rs6000/rs6000-string.cc (expand_block_move): Call vector > load/store with length expand only on 64-bit Power10. > > gcc/testsuite/ > PR target/96762 > * gcc.target/powerpc/pr96762.c: New. > > > patch.diff > diff --git a/gcc/config/rs6000/rs6000-string.cc b/gcc/config/rs6000/rs6000-string.cc > index cd8ee8c..d1b48c2 100644 > --- a/gcc/config/rs6000/rs6000-string.cc > +++ b/gcc/config/rs6000/rs6000-string.cc > @@ -2811,8 +2811,9 @@ expand_block_move (rtx operands[], bool might_overlap) > gen_func.mov = gen_vsx_movv2di_64bit; > } > else if (TARGET_BLOCK_OPS_UNALIGNED_VSX > - && TARGET_POWER10 && bytes < 16 > - && orig_bytes > 16 > + /* Only use lxvl/stxvl on 64bit POWER10. */ > + && TARGET_POWER10 && TARGET_64BIT > + && bytes < 16 && orig_bytes > 16 > && !(bytes == 1 || bytes == 2 > || bytes == 4 || bytes == 8) > && (align >= 128 || !STRICT_ALIGNMENT)) Nit: Since you touched this part of code, could you format it better as well, like: else if (TARGET_BLOCK_OPS_UNALIGNED_VSX /* Only use lxvl/stxvl on 64bit POWER10. */ && TARGET_POWER10 && TARGET_64BIT && bytes < 16 && orig_bytes > 16 && !(bytes == 1 || bytes == 2 || bytes == 4 || bytes == 8) && (align >= 128 || !STRICT_ALIGNMENT)) > diff --git a/gcc/testsuite/gcc.target/powerpc/pr96762.c b/gcc/testsuite/gcc.target/powerpc/pr96762.c > new file mode 100644 > index 0000000..1145dd1 > --- /dev/null > +++ b/gcc/testsuite/gcc.target/powerpc/pr96762.c > @@ -0,0 +1,11 @@ > +/* { dg-do compile { target ilp32 } } */ Nit: we can compile this on lp64, so you can remove the ilp32 restriction, ... > +/* { dg-options "-O2 -mdejagnu-cpu=power10" } */ > + ... but add one comment line to note the initial purpose, like: /* Verify there is no ICE on ilp32 env. */ or similar. Okay for trunk with these nits fixed, thanks! BR, Kewen > +extern void foo (char *); > + > +void > +bar (void) > +{ > + char zj[] = "XXXXXXXXXXXXXXXX"; > + foo (zj); > +}
Kewen, I refined the patch according to your comments and it passed bootstrap and regression test. I committed it as https://gcc.gnu.org/g:946b8967b905257ac9f140225db744c9a6ab91be Thanks Gui Haochen 在 2023/8/29 16:55, Kewen.Lin 写道: > Hi Haochen, > > on 2023/8/29 10:50, HAO CHEN GUI wrote: >> Hi, >> This patch adds "TARGET_64BIT" check when calling vector load/store >> with length expand in expand_block_move. It matches the expand condition >> of "lxvl" and "stxvl" defined in vsx.md. >> >> This patch fixes the ICE occurred with the test case on 32-bit Power10. >> >> Bootstrapped and tested on powerpc64-linux BE and LE with no regressions. >> >> Thanks >> Gui Haochen >> >> >> ChangeLog >> rs6000: call vector load/store with length expand only on 64-bit Power10 >> >> gcc/ >> PR target/96762 >> * config/rs6000/rs6000-string.cc (expand_block_move): Call vector >> load/store with length expand only on 64-bit Power10. >> >> gcc/testsuite/ >> PR target/96762 >> * gcc.target/powerpc/pr96762.c: New. >> >> >> patch.diff >> diff --git a/gcc/config/rs6000/rs6000-string.cc b/gcc/config/rs6000/rs6000-string.cc >> index cd8ee8c..d1b48c2 100644 >> --- a/gcc/config/rs6000/rs6000-string.cc >> +++ b/gcc/config/rs6000/rs6000-string.cc >> @@ -2811,8 +2811,9 @@ expand_block_move (rtx operands[], bool might_overlap) >> gen_func.mov = gen_vsx_movv2di_64bit; >> } >> else if (TARGET_BLOCK_OPS_UNALIGNED_VSX >> - && TARGET_POWER10 && bytes < 16 >> - && orig_bytes > 16 >> + /* Only use lxvl/stxvl on 64bit POWER10. */ >> + && TARGET_POWER10 && TARGET_64BIT >> + && bytes < 16 && orig_bytes > 16 >> && !(bytes == 1 || bytes == 2 >> || bytes == 4 || bytes == 8) >> && (align >= 128 || !STRICT_ALIGNMENT)) > > Nit: Since you touched this part of code, could you format it better as well, like: > > else if (TARGET_BLOCK_OPS_UNALIGNED_VSX > /* Only use lxvl/stxvl on 64bit POWER10. */ > && TARGET_POWER10 > && TARGET_64BIT > && bytes < 16 > && orig_bytes > 16 > && !(bytes == 1 > || bytes == 2 > || bytes == 4 > || bytes == 8) > && (align >= 128 > || !STRICT_ALIGNMENT)) > > >> diff --git a/gcc/testsuite/gcc.target/powerpc/pr96762.c b/gcc/testsuite/gcc.target/powerpc/pr96762.c >> new file mode 100644 >> index 0000000..1145dd1 >> --- /dev/null >> +++ b/gcc/testsuite/gcc.target/powerpc/pr96762.c >> @@ -0,0 +1,11 @@ >> +/* { dg-do compile { target ilp32 } } */ > > Nit: we can compile this on lp64, so you can remove the ilp32 restriction, > ... > >> +/* { dg-options "-O2 -mdejagnu-cpu=power10" } */ >> + > > ... but add one comment line to note the initial purpose, like: > > /* Verify there is no ICE on ilp32 env. */ > > or similar. > > Okay for trunk with these nits fixed, thanks! > > BR, > Kewen > >> +extern void foo (char *); >> + >> +void >> +bar (void) >> +{ >> + char zj[] = "XXXXXXXXXXXXXXXX"; >> + foo (zj); >> +}
on 2023/8/31 13:47, HAO CHEN GUI wrote: > Kewen, > I refined the patch according to your comments and it passed bootstrap > and regression test. > > I committed it as > https://gcc.gnu.org/g:946b8967b905257ac9f140225db744c9a6ab91be Thanks! We want this to be backported, so it's also ok for backporting to all affected branch releases after a week or so. BR, Kewen
diff --git a/gcc/config/rs6000/rs6000-string.cc b/gcc/config/rs6000/rs6000-string.cc index cd8ee8c..d1b48c2 100644 --- a/gcc/config/rs6000/rs6000-string.cc +++ b/gcc/config/rs6000/rs6000-string.cc @@ -2811,8 +2811,9 @@ expand_block_move (rtx operands[], bool might_overlap) gen_func.mov = gen_vsx_movv2di_64bit; } else if (TARGET_BLOCK_OPS_UNALIGNED_VSX - && TARGET_POWER10 && bytes < 16 - && orig_bytes > 16 + /* Only use lxvl/stxvl on 64bit POWER10. */ + && TARGET_POWER10 && TARGET_64BIT + && bytes < 16 && orig_bytes > 16 && !(bytes == 1 || bytes == 2 || bytes == 4 || bytes == 8) && (align >= 128 || !STRICT_ALIGNMENT)) diff --git a/gcc/testsuite/gcc.target/powerpc/pr96762.c b/gcc/testsuite/gcc.target/powerpc/pr96762.c new file mode 100644 index 0000000..1145dd1 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr96762.c @@ -0,0 +1,11 @@ +/* { dg-do compile { target ilp32 } } */ +/* { dg-options "-O2 -mdejagnu-cpu=power10" } */ + +extern void foo (char *); + +void +bar (void) +{ + char zj[] = "XXXXXXXXXXXXXXXX"; + foo (zj); +}