From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id EC5C63858402 for ; Mon, 22 Apr 2024 08:47:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EC5C63858402 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org EC5C63858402 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713775624; cv=none; b=DSKFpVLAfJmwtpqSYv57sTXSiBhE3UOdSKvAgHCwIPx5aXPiakYenUQxBkegwTej1YqGXkmmrRCfBwE6/lJc43X+Yxhi+j/BoxuLLqjitcd+sZmz+4I+FIxiUTav4hj2ztxlWVe8X/w1FMkLZSGr58AGJeMsPZTeiCt9XyP2Wnw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713775624; c=relaxed/simple; bh=PolL+ePBR0SXGrDYOUovhQD4flD85gAssG23l8FxKN4=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=JD+7Bbm3U2x2PP6PinLOPOx2b1CJ44Q1hMmise/7U9QuDnSW1e06m9qZpjm/Bk5ZCuOF4UlrahHw9f0yw4fxqUR3h5jV0luwJUwc5ApC3ReVScCbSFkfnVyHLuixhjpHxDDm0jHnXz83q7KtjQ7ZGBBR7Lsx+eUHgCuuQe+DnSs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 43M8Hftx005927 for ; Mon, 22 Apr 2024 08:47:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=ZwHpNr/fnlJQU+ni/Clh7WjCeL62Ql3azSgdLyGC4GE=; b=Fe2ay+tHQgQ8kWVTI+KE29GwZ5SwTB/YBGgTjvlZCwFO8PraPgfblZHer6mTq/QPvoP9 s9v+rJmr+tiRwpnJJ8ZxpzTFoSG3nIaKQi1ELMPb9F2GghBh3cELbkYsTTPBY3Oy/XGG Reqtk/iydFnubbgZHIpSJhTCSmj97FgO8Iora6/jBXntbiQuNXmIZRCQ2pDRRNh0xwK0 Gc3Hu+6ia8yYs9TO2PfjsxWwTnGbBtUEf9BDamYogkpFeK6XNmpA+VfT32TwNciMHgkg 6pQpJe37n1eCp6qw3SBKhAFSNNW/eyHEAL5AfVL2jUsS4IHqB4/jx7Pj5a64bXHIBmO8 rg== Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3xnm8gr22g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 22 Apr 2024 08:47:00 +0000 Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 43M7FBdV015430 for ; Mon, 22 Apr 2024 08:46:59 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3xmshkxj5h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 22 Apr 2024 08:46:58 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 43M8krhA29622666 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 Apr 2024 08:46:55 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3638C20043; Mon, 22 Apr 2024 08:46:53 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 070922004F; Mon, 22 Apr 2024 08:46:53 +0000 (GMT) Received: from [9.179.12.43] (unknown [9.179.12.43]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 22 Apr 2024 08:46:52 +0000 (GMT) Message-ID: <85819c77-598f-4973-b325-af79d2b77423@linux.ibm.com> Date: Mon, 22 Apr 2024 10:46:52 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] s390: testsuite: Fix forwprop-4{0,1}.c Content-Language: en-US To: Stefan Schulze Frielinghaus , gcc-patches@gcc.gnu.org References: <20240422062306.2696720-1-stefansf@linux.ibm.com> From: Andreas Krebbel In-Reply-To: <20240422062306.2696720-1-stefansf@linux.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 5NP0mfx9HwAAZlenzGEWWoCiT2SUw2on X-Proofpoint-ORIG-GUID: 5NP0mfx9HwAAZlenzGEWWoCiT2SUw2on X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-22_05,2024-04-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 phishscore=0 adultscore=0 mlxscore=0 bulkscore=0 mlxlogscore=999 spamscore=0 clxscore=1015 suspectscore=0 priorityscore=1501 malwarescore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2404220038 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,GIT_PATCH_0,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 List-Id: Hi Stefan, due to that missed optimization we currently generate silly code for these two tests and should really fix this (after gcc entering stage1). So just skipping it on s390x would definitely be the wrong choice I think. I think our vectorize_vec_perm_const correctly rejects this permute pattern, since it would require a load from literal pool. Question is why we do have to rely on this being turned into a permute first to get rid of the obviously redundant assignments. Shouldn't fwprop be able to handle this without it? I'm ok with your patch, but please also open a BZ for it and perhaps mention it in the comment close to the xfail. Thanks! Andreas On 4/22/24 08:23, Stefan Schulze Frielinghaus wrote: > The tests fail on s390 since can_vec_perm_const_p fails and therefore > the bit insert/ref survive which r14-3381-g27de9aa152141e aims for. > Strictly speaking, the tests only fail in case the target supports > vectors, i.e., for targets prior z13 or in case of -mesa the emulated > vector operations are optimized out. > > Easiest would be to skip the entire test for s390. Another solution > would be to xfail in case of vector support hoping that eventually we > end up with an xpass for a future machine generation or if gcc advances. > That is implemented by this patch. In order to do so I implemented a > new target test s390_mvx which tests whether vector support is available > or not. Maybe this is already over-engineered for a simple test? Any > thoughts? > --- > gcc/testsuite/gcc.dg/tree-ssa/forwprop-40.c | 4 ++-- > gcc/testsuite/gcc.dg/tree-ssa/forwprop-41.c | 4 ++-- > gcc/testsuite/lib/target-supports.exp | 14 ++++++++++++++ > 3 files changed, 18 insertions(+), 4 deletions(-) > > diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-40.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-40.c > index 7513497f552..b67e3e93a7f 100644 > --- a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-40.c > +++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-40.c > @@ -10,5 +10,5 @@ vector int g(vector int a) > return a; > } > > -/* { dg-final { scan-tree-dump-times "BIT_INSERT_EXPR" 0 "optimized" } } */ > -/* { dg-final { scan-tree-dump-times "BIT_FIELD_REF" 0 "optimized" } } */ > +/* { dg-final { scan-tree-dump-times "BIT_INSERT_EXPR" 0 "optimized" { xfail s390_mvx } } } */ > +/* { dg-final { scan-tree-dump-times "BIT_FIELD_REF" 0 "optimized" { xfail s390_mvx } } } */ > diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-41.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-41.c > index b1e75797a90..0f119675207 100644 > --- a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-41.c > +++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-41.c > @@ -11,6 +11,6 @@ vector int g(vector int a, int c) > return a; > } > > -/* { dg-final { scan-tree-dump-times "BIT_INSERT_EXPR" 1 "optimized" } } */ > -/* { dg-final { scan-tree-dump-times "BIT_FIELD_REF" 0 "optimized" } } */ > +/* { dg-final { scan-tree-dump-times "BIT_INSERT_EXPR" 1 "optimized" { xfail s390_mvx } } } */ > +/* { dg-final { scan-tree-dump-times "BIT_FIELD_REF" 0 "optimized" { xfail s390_mvx } } } */ > /* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR" 0 "optimized" } } */ > diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp > index edce672c0e2..5a692baa8ef 100644 > --- a/gcc/testsuite/lib/target-supports.exp > +++ b/gcc/testsuite/lib/target-supports.exp > @@ -12380,6 +12380,20 @@ proc check_effective_target_profile_update_atomic {} { > } "-fprofile-update=atomic -fprofile-generate"] > } > > +# Return 1 if the target has a vector facility. > +proc check_effective_target_s390_mvx { } { > + if ![istarget s390*-*-*] then { > + return 0; > + } > + > + return [check_no_compiler_messages_nocache s390_mvx assembly { > + #if !defined __VX__ > + #error no vector facility. > + #endif > + int dummy; > + } [current_compiler_flags]] > +} > + > # Return 1 if vector (va - vector add) instructions are understood by > # the assembler and can be executed. This also covers checking for > # the VX kernel feature. A kernel without that feature does not