From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5D12D3858D38; Mon, 20 May 2024 06:35:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5D12D3858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1716186902; bh=dCE/jB7Qi/Olsx56TTTCi1XzpBW+HkCuKlClyMNLvCI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gIr1BEVHzU0ObI2VudH/2qCLly8gfE3rwEXjNnVJvox7wipnPS0qqp0mzMDDiuBpp kQWD4vDfhDEuWzlCGhU/+6SWdzUOXkQuuo0OXN7IJ7r7KNP0Q9rF8DSBQlMHGgyN75 aa7C8kWOH2HFGArbwr5vsrYnM/DPsEamsz87/pA0= From: "liuhongt at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/115069] [14/15 regression] 8 bit integer vector performance regression, x86, between gcc-14 and gcc-13 using avx2 target clones on skylake platform Date: Mon, 20 May 2024 06:35:01 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: liuhongt at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.2 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D115069 --- Comment #14 from Hongtao Liu --- (In reply to Uro=C5=A1 Bizjak from comment #13) > (In reply to Haochen Jiang from comment #12) > > (In reply to Hongtao Liu from comment #11) > > > (In reply to Haochen Jiang from comment #10) > > > > A patch like Comment 8 could definitely solve the problem. But I ne= ed to > > > > test more benchmarks to see if there is surprise. > > > >=20 > > > > But, yes, as Uros said in Comment 9, maybe there is a chance we cou= ld do it > > > > better. > > >=20 > > > Could you add "arch=3Dskylake-avx512" to target_clones and try disabl= e whole > > > ix86_expand_vecop_qihi2 to see if there's any performance improvement? > > > For x86, cross-lane permutation(truncation) is not very efficient(3-4= cycles > > > for both vpermq and vpmovwb). > >=20 > > When I disable/enable ix86_expand_vecop_qihi2 with arch=3Dskylake-avx51= 2 on > > trunk, there is no performance regression comparing to GCC13 + avx2. > >=20 > > It seems that the regression only happens when GCC14 + avx2. >=20 > This is what the patch in Comment #8 prevents. skylake-avx512 enables > TARGET_AVX512BW, so VPMOVB is emitted instead of problematic VPERMQ. Yes, the patch looks good to me.=