From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by sourceware.org (Postfix) with ESMTPS id 1E5C73857351 for ; Thu, 20 Apr 2023 13:56:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1E5C73857351 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681999014; x=1713535014; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=JPgjN/1Z/nvDO3gAqPWi5wMPrFYHFepCwW0oCVMFs3Q=; b=FaFXwKdvBZ+ZtacqVTCWuafJ68iYtHlg/a38F7YTUVJvr3S2EPuv/ivh F3QxU/JWFUQvzhDbJJV6I8SNBDcm+eq50vx4E5kE1byDajt0Z7cTvTtyz NA3n1ajR5AXw4DyViTWoQvB4N8Iijg+crhvx452IIlEaFIJz9KyisOONb T753kYqtEJ+MpGo1Aa9B0Nj4M5wH9pgpvN3Vkxn58y4Zn+y4NDpJcdUeP 1U6pfCj0Jt4haj73J+5sNoNsojZ/7euAqygu3NeOw1ft5UdqIdtkuF8Tr ES4CNhFWwEeZQuwemPQtgWnL+XZj6TjJbq/Y8GHlxucBn3WfbQKXcMK51 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10686"; a="408652601" X-IronPort-AV: E=Sophos;i="5.99,212,1677571200"; d="scan'208";a="408652601" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2023 06:56:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10686"; a="722378569" X-IronPort-AV: E=Sophos;i="5.99,212,1677571200"; d="scan'208";a="722378569" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga008.jf.intel.com with ESMTP; 20 Apr 2023 06:56:52 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 20 Apr 2023 06:56:52 -0700 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 20 Apr 2023 06:56:52 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23 via Frontend Transport; Thu, 20 Apr 2023 06:56:52 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.171) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.23; Thu, 20 Apr 2023 06:56:52 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GpiJ0qeUycaaT/irhKXnenZ5DCZHXJHtVmoyMUxS/srqGpSdHfzBs7tzKi7fDTSsb85fp2UTGhUAXi8WM2ZFN47fJWFstQ8OrADmM1oCzB648LDG27yAXoL8wJuDQvWOOFM82Om1mwWAad0fj3TgMo5UlEx2YA/M0k2VnPij0vlaK08dBkG9TfXCN5h3By7KzGGzlx9nGfDzwmNYX5Xl/NG2l9CGq6HDVoSIJG/WVqPd92VPqsCAqkB5EUHuq3dCxznejAYlekr42DMo1uYxyKmoxfB4vGgFHPTZnZKB3dCKU6fq543kYUIOp/pneoaqcZDXlgc9zmQmRs75i/9BlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JM45XrujZEYygbMCqfjglpw3Dbx6crqXMEoZqp7UmTM=; b=NDla8WclLpaogKOsMKvAUiFLXHX5/Vuozni/8C25dgFANPlr8K9ANCpY+zWL/t9Z2yeZSALwghHC16QtX30hEK0bI1uF42y4ROG8xPtmF9QQ/N9OU3exKxt5yVkBX442pj1N1ncTk3+GEG3EGk11O/vzHe5mFbv592q5oGR4wgbzRLw1ElWzphz2WBkBPvFSC+vNzFpT7mltzp5smS5co8LXL/s6t90ca1ptGlrOuJqGjtgH9bdxYjsj295J2mw7Mdfs+muYpg6zJ7V05/fkhyMtPUu3+o0VbAnp9liByKSHOxL+NbSoNSNPnnPE9L//vPjaPkodeke/z9+u046rYg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from MW5PR11MB5908.namprd11.prod.outlook.com (2603:10b6:303:194::10) by CH3PR11MB7762.namprd11.prod.outlook.com (2603:10b6:610:151::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.22; Thu, 20 Apr 2023 13:56:49 +0000 Received: from MW5PR11MB5908.namprd11.prod.outlook.com ([fe80::bbc5:f013:1f53:10a9]) by MW5PR11MB5908.namprd11.prod.outlook.com ([fe80::bbc5:f013:1f53:10a9%6]) with mapi id 15.20.6319.022; Thu, 20 Apr 2023 13:56:49 +0000 From: "Li, Pan2" To: "kito.cheng@sifive.com" CC: gcc-patches , Kito.cheng , "Wang, Yanzhang" , "juzhe.zhong@rivai.ai" Subject: RE: Re: [PATCH v2] RISC-V: Bugfix for RVV vbool*_t vn_reference_equal. Thread-Topic: Re: [PATCH v2] RISC-V: Bugfix for RVV vbool*_t vn_reference_equal. Thread-Index: AQHZYhv3LBPPChL8OkCxTyZOOaPSVq8RfDGAgAAD1iSAABCzYIAiwfHQ Date: Thu, 20 Apr 2023 13:56:49 +0000 Message-ID: References: <20230329075222.2888608-1-pan2.li@intel.com>, <20230329085328.3066061-1-pan2.li@intel.com>, <9B82032EFF1CFE76+2023032917352529640913@rivai.ai> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW5PR11MB5908:EE_|CH3PR11MB7762:EE_ x-ms-office365-filtering-correlation-id: 8618ad31-d3be-4d24-d59c-08db41a71692 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: jxskbZCMfmI25U/RpNeETaBd1kXkpsn/AJDm7WrOovZq8vzasN2U9txvEn+uFK0R79RvS4A5wUHLnPmE3yChj8q1Od3YmzKAPl8nOTnQh2MZy07uojtjvtDPmYs5rgDEv+P5st++qmn58iIeoULes/SCYZvb/6BO8/WVFdbkQcqEdcYIPIOgWq9Qq4yJVI1ICt0EJ1EAxOpC9E2qYrYcPNo6CIgC/s8Wy4dx7tMh4bMIT+U7lUnhJ6C5XD6JpoDBiTOqonmmebCgnCwtBgs3i0s31iVCuApHIfFBQiphO1uA0QfLIdBW3zVlqNXhqNPDFGObpbNKY8qBIr0XkmzKuXt54y8SIYwVM2kpyTi74qpfXK8b4tkO8fmNloxLa3Binde22UJMevrxRUwHcXynN5B3Tu//Gvrq6dEN2Sp4apshLfNy9VFKKz3jrxYRqql/ZHijwa1yxALhvmELUhypWW/Tea8tnJQflfT22C6p9vt1Y4ZdH4ozZxboObJoARYZCmsoM6ru8HwjNgzwoFpQw4EQ9xJjBpjbfndJA16KKezoBlHBneOjHM4wQFJBzwuL04hPSv3X1CugbLgEJkd0fg94ACYnGZ4fIylN3RW0Ycw= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW5PR11MB5908.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(346002)(136003)(376002)(366004)(39860400002)(451199021)(38070700005)(2906002)(8936002)(66899021)(38100700002)(8676002)(5660300002)(52536014)(33656002)(86362001)(9686003)(6506007)(7696005)(55016003)(71200400001)(84970400001)(26005)(54906003)(478600001)(83380400001)(53546011)(186003)(316002)(4326008)(66556008)(82960400001)(6916009)(66446008)(64756008)(76116006)(66476007)(66946007)(122000001)(41300700001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?HEj16CWgFyp8A972JoJj2RfaxPmLYEQwU4Q2cZezabqtVV90iR1u4JhxF3lN?= =?us-ascii?Q?PrLS4A3AAqO309Kb9VEV7l6+GRIVOazJTYcu9KmT556DL5h0f7UhUbVKQOS9?= =?us-ascii?Q?nnDoMDUIXDuC9AS+J0Q1XXm8qDLEj0XQmTNPMVKDN3P8gduZ5DqN8rdkANCI?= =?us-ascii?Q?Mj/IKc/FGcUTzaM6TjwCcLMZ1UKYn7lBXKX/BDJfYfWms7BqHRtWV/Mf9VTv?= =?us-ascii?Q?SWXKsUW1ucy1Mql416lZf1ZMcvx4JsDolhfxIv4ApbJnPu4vQ86qdx7AYZNF?= =?us-ascii?Q?d8Dd5zFKnWlMHhxd0Fn4n457T5u+JRDnoCYCLzrjlX7yKUSe7WvX4U4GFrDo?= =?us-ascii?Q?mdfHF0j+r0vWIGMjLmActcPXqISo0AgL1uMW2GEH6TVBOC7cZWbxNF+A4ZC7?= =?us-ascii?Q?lBQCgcj7kjsDWAxYcKkuPd76hkg97zRU7CgxsYJN8ma5STcgQR0jvOZ+83Vk?= =?us-ascii?Q?8L3mX1OdX6VitOLHHX9PFsvx8gNYgS8e5f21i3Ajk6AESTx4THRK9ruSlNYM?= =?us-ascii?Q?XAgTMrM0oDSunFzxVB1Wx00cn71EK4PEgw9FwGYJmQei5BeJZJqJaYHwvTIT?= =?us-ascii?Q?fCX/sWGTC5p5aH9j2zHcbftM7Za4EJMUJX3gYmWu6YlU0QdGmYrIq5fHByC+?= =?us-ascii?Q?0i6jNc1nFV7kTSvz+XU/+tfKEMZKpf1tRbEKdMheap6vzg0/n4bzv7XJOhK/?= =?us-ascii?Q?IV4nUQzlfnuOsBHef9cqcoLQY4uwgZL5I3wpeBi3UzIbqio/TiRpfNqIKajg?= =?us-ascii?Q?yCZxKXjJpeKIimnLpFsmdnBLQ3408C3oxOA0+1V+wJi1M4l9aFlwdbWtgLJS?= =?us-ascii?Q?CcrQv8A9TbMaZdcpV4z3vSgxyNUcjVBu2l/sF/7KHvTmErvpNUYwvKd63X5d?= =?us-ascii?Q?E3TE+HKBN+MFjyZVW47Rn4iBjCcL0r0BGz1WtuVVwuDxKx3grwltiTCe/Wdl?= =?us-ascii?Q?Lq400gPldAE2g32N2eOBTgb2DsN2Qvi9m97PVw+sO9h3ANSjbRQazmLxa27i?= =?us-ascii?Q?+FtFSqWsqZYmQHvfzKjXUhrUd9vPQDJP3DAWpKqk4ftCCI6kFaJ+AhYYLwJ2?= =?us-ascii?Q?OKlstFFX4motUsJszEWYg0D3Md1p5FT3laYym/NNSqZhIUdIvfgeqbqgp98/?= =?us-ascii?Q?pYJq8Eh6OF2rarg7wmB5Ferg+hCk3itDqDsldPhKxYIC2oufQvlfqYDviMHo?= =?us-ascii?Q?OPIMnO7HDtzHFsTTNvhbhYFZdj3VLW/IKesTtAx4gTbWiDIKyQ4puCmRgK7L?= =?us-ascii?Q?SYB+xoK1biCrtH3su9DVIqeY8uA5eJK/bnkDTozAgHOYrppwbKsVsTUk2DGY?= =?us-ascii?Q?Pa5SWqFqFJqKVaZ9amNXom0sc8PybZPcY9or3H+CtNk1YSgSg80ov6Yp3Jvc?= =?us-ascii?Q?/4Hh+cbp26+JlMzfBwgwnTAmkgUl7o1AJikHuwf1sDXkNwcLcjJS4wyCOTMk?= =?us-ascii?Q?AMBpU6FhRT7RsDRKBiNYLN5dDVqF+LJqjdmb7om8zhw1so7QLy0OYBr/lsV+?= =?us-ascii?Q?5mlp/vhMUQ76PWA5IkawkRQ9ceJAOMrJ5me+8Cc4zikE0hGrLVqsyosgwKwN?= =?us-ascii?Q?xxsGHFT/7exgcH4Z+f8=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW5PR11MB5908.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8618ad31-d3be-4d24-d59c-08db41a71692 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Apr 2023 13:56:49.7083 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: vtX7RP4CJDhuIK3oyL0/lcXJ6gp8l+l6mD8Nq4LPDvPIsaan89A49x8Bcm+dZjCoXa7zOFsFGEDbrQpZzT7qIg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR11MB7762 X-OriginatorOrg: intel.com X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,SCC_5_SHORT_WORD_LINES,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE 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 Kito, There is one patch reviewed already and I suppose it will be ok after GCC 1= 4 open. Could you please help to double check about it? Pann -----Original Message----- From: Gcc-patches On = Behalf Of Li, Pan2 via Gcc-patches Sent: Wednesday, March 29, 2023 6:39 PM To: juzhe.zhong@rivai.ai; rguenther Cc: gcc-patches ; Kito.cheng ; Wang, Yanzhang Subject: RE: Re: [PATCH v2] RISC-V: Bugfix for RVV vbool*_t vn_reference_eq= ual. Cool. Thank you all for this, have a nice day! Pan From: juzhe.zhong@rivai.ai Sent: Wednesday, March 29, 2023 5:35 PM To: rguenther ; Li, Pan2 Cc: gcc-patches ; Kito.cheng ; Wang, Yanzhang Subject: Re: Re: [PATCH v2] RISC-V: Bugfix for RVV vbool*_t vn_reference_eq= ual. Thanks Richard && Pan. Pan has passed the bootstrap and I will merge this patch when GCC 14 is ope= n (I have write access now). ________________________________ juzhe.zhong@rivai.ai From: Richard Biener Date: 2023-03-29 17:24 To: pan2.li CC: gcc-patches; juzhe.zhong; kito.cheng; yanzhang.wang Subject: Re: [PATCH v2] RISC-V: Bugfix for RVV vbool*_t vn_reference_equal. On Wed, 29 Mar 2023, pan2.li@intel.com wrote: > From: Pan Li > > > In most architecture the precision_size of vbool*_t types are=20 > caculated like as the multiple of the type size. For example: > precision_size =3D type_size * 8 (aka, bit count per bytes). > > Unfortunately, some architecture like RISC-V will adjust the=20 > precision_size for the vbool*_t in order to align the ISA. For example as= below. > type_size =3D [1, 1, 1, 1, 2, 4, 8] > precision_size =3D [1, 2, 4, 8, 16, 32, 64] > > Then the precision_size of RISC-V vbool*_t will not be the multiple of=20 > the type_size. This PATCH try to enrich this case when comparing the vn_r= eference. > > Given we have the below code: > void test_vbool8_then_vbool16(int8_t * restrict in, int8_t * restrict out= ) { > vbool8_t v1 =3D *(vbool8_t*)in; > vbool16_t v2 =3D *(vbool16_t*)in; > > *(vbool8_t*)(out + 100) =3D v1; > *(vbool16_t*)(out + 200) =3D v2; > } > > Before this PATCH: > csrr t0,vlenb > slli t1,t0,1 > csrr a3,vlenb > sub sp,sp,t1 > slli a4,a3,1 > add a4,a4,sp > addi a2,a1,100 > vsetvli a5,zero,e8,m1,ta,ma > sub a3,a4,a3 > vlm.v v24,0(a0) > vsm.v v24,0(a2) > vsm.v v24,0(a3) > addi a1,a1,200 > csrr t0,vlenb > vsetvli a4,zero,e8,mf2,ta,ma > slli t1,t0,1 > vlm.v v24,0(a3) > vsm.v v24,0(a1) > add sp,sp,t1 > jr ra > > After this PATCH: > addi a3,a1,100 > vsetvli a4,zero,e8,m1,ta,ma > addi a1,a1,200 > vlm.v v24,0(a0) > vsm.v v24,0(a3) > vsetvli a5,zero,e8,mf2,ta,ma > vlm.v v24,0(a0) > vsm.v v24,0(a1) > ret OK if this passes bootstrap / regtest. Thanks, Richard. > PR 109272 > > gcc/ChangeLog: > > * tree-ssa-sccvn.cc (vn_reference_eq): > > gcc/testsuite/ChangeLog: > > * gcc.target/riscv/rvv/base/pr108185-4.c: > * gcc.target/riscv/rvv/base/pr108185-5.c: > * gcc.target/riscv/rvv/base/pr108185-6.c: > > Signed-off-by: Pan Li > > --- > .../gcc.target/riscv/rvv/base/pr108185-4.c | 2 +- > .../gcc.target/riscv/rvv/base/pr108185-5.c | 2 +- > .../gcc.target/riscv/rvv/base/pr108185-6.c | 2 +- > gcc/tree-ssa-sccvn.cc | 20 +++++++++++++++++++ > 4 files changed, 23 insertions(+), 3 deletions(-) > > diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/pr108185-4.c=20 > b/gcc/testsuite/gcc.target/riscv/rvv/base/pr108185-4.c > index ea3c360d756..e70284fada8 100644 > --- a/gcc/testsuite/gcc.target/riscv/rvv/base/pr108185-4.c > +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/pr108185-4.c > @@ -65,4 +65,4 @@ test_vbool8_then_vbool64(int8_t * restrict in,=20 > int8_t * restrict out) { > /* { dg-final { scan-assembler-times=20 > {vsetvli\s+[a-x][0-9]+,\s*zero,\s*e8,\s*mf4,\s*ta,\s*ma} 1 } } */ > /* { dg-final { scan-assembler-times=20 > {vsetvli\s+[a-x][0-9]+,\s*zero,\s*e8,\s*mf8,\s*ta,\s*ma} 1 } } */ > /* { dg-final { scan-assembler-times=20 > {vlm\.v\s+v[0-9]+,\s*0\([a-x][0-9]+\)} 12 } } */ > -/* { dg-final { scan-assembler-times=20 > {vsm\.v\s+v[0-9]+,\s*0\([a-x][0-9]+\)} 15 } } */ > +/* { dg-final { scan-assembler-times=20 > +{vsm\.v\s+v[0-9]+,\s*0\([a-x][0-9]+\)} 12 } } */ > diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/pr108185-5.c=20 > b/gcc/testsuite/gcc.target/riscv/rvv/base/pr108185-5.c > index 9fc659d2402..575a7842cdf 100644 > --- a/gcc/testsuite/gcc.target/riscv/rvv/base/pr108185-5.c > +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/pr108185-5.c > @@ -65,4 +65,4 @@ test_vbool16_then_vbool64(int8_t * restrict in,=20 > int8_t * restrict out) { > /* { dg-final { scan-assembler-times=20 > {vsetvli\s+[a-x][0-9]+,\s*zero,\s*e8,\s*mf4,\s*ta,\s*ma} 1 } } */ > /* { dg-final { scan-assembler-times=20 > {vsetvli\s+[a-x][0-9]+,\s*zero,\s*e8,\s*mf8,\s*ta,\s*ma} 1 } } */ > /* { dg-final { scan-assembler-times=20 > {vlm\.v\s+v[0-9]+,\s*0\([a-x][0-9]+\)} 12 } } */ > -/* { dg-final { scan-assembler-times=20 > {vsm\.v\s+v[0-9]+,\s*0\([a-x][0-9]+\)} 14 } } */ > +/* { dg-final { scan-assembler-times=20 > +{vsm\.v\s+v[0-9]+,\s*0\([a-x][0-9]+\)} 12 } } */ > diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/pr108185-6.c=20 > b/gcc/testsuite/gcc.target/riscv/rvv/base/pr108185-6.c > index 98275e5267d..95a11d37016 100644 > --- a/gcc/testsuite/gcc.target/riscv/rvv/base/pr108185-6.c > +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/pr108185-6.c > @@ -65,4 +65,4 @@ test_vbool32_then_vbool64(int8_t * restrict in,=20 > int8_t * restrict out) { > /* { dg-final { scan-assembler-times=20 > {vsetvli\s+[a-x][0-9]+,\s*zero,\s*e8,\s*mf2,\s*ta,\s*ma} 1 } } */ > /* { dg-final { scan-assembler-times=20 > {vsetvli\s+[a-x][0-9]+,\s*zero,\s*e8,\s*mf8,\s*ta,\s*ma} 1 } } */ > /* { dg-final { scan-assembler-times=20 > {vlm\.v\s+v[0-9]+,\s*0\([a-x][0-9]+\)} 12 } } */ > -/* { dg-final { scan-assembler-times=20 > {vsm\.v\s+v[0-9]+,\s*0\([a-x][0-9]+\)} 13 } } */ > +/* { dg-final { scan-assembler-times=20 > +{vsm\.v\s+v[0-9]+,\s*0\([a-x][0-9]+\)} 12 } } */ > diff --git a/gcc/tree-ssa-sccvn.cc b/gcc/tree-ssa-sccvn.cc index=20 > 6b8d38b270c..567df3cb2c6 100644 > --- a/gcc/tree-ssa-sccvn.cc > +++ b/gcc/tree-ssa-sccvn.cc > @@ -799,6 +799,26 @@ vn_reference_eq (const_vn_reference_t const vr1, con= st_vn_reference_t const vr2) > && (TYPE_PRECISION (vr2->type) > !=3D TREE_INT_CST_LOW (TYPE_SIZE (vr2->type)))) > return false; > + else if (VECTOR_BOOLEAN_TYPE_P (vr1->type) > + && VECTOR_BOOLEAN_TYPE_P (vr2->type)) > + { > + /* Vector boolean types can have padding, verify we are dealing=20 > + with the same number of elements, aka the precision of the types. > + For example, In most architecture the precision_size of vbool*_t=20 > + types are caculated like below: > + precision_size =3D type_size * 8 > + > + Unfortunately, the RISC-V will adjust the precision_size for the=20 > + vbool*_t in order to align the ISA as below: > + type_size =3D [1, 1, 1, 1, 2, 4, 8] > + precision_size =3D [1, 2, 4, 8, 16, 32, 64] > + > + Then the precision_size of RISC-V vbool*_t will not be the multiple=20 > + of the type_size. We take care of this case consolidated here. */ > + if (maybe_ne (TYPE_VECTOR_SUBPARTS (vr1->type), > + TYPE_VECTOR_SUBPARTS (vr2->type))) return false; > + } > > i =3D 0; > j =3D 0; > -- Richard Biener > SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, = Germany; GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman; HRB= 36809 (AG Nuernberg)