From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 420113844028; Mon, 13 May 2024 13:05:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 420113844028 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1715605557; bh=cU227iR1ajyET/0t0bf87e/AYBvHkEnvBNixk4+oYS0=; h=From:To:Subject:Date:From; b=FTKwrpN+HnKq27PcgYr1+8mTiunlUljcGp1j/Bzjr+bdQcoeCZoq0pRMR3oEIdnOC 3ESaEJFT2QZiXIPS6dknDbodu+gXgSHqVlVQ9b6AW1DdOvSYBWLNclDRY8YcJ83RNE w7c4CIUcsli1wUiyKJVqd1r16a3DQMaqEys5BxHM= From: "colin.king at intel dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/115069] New: 8 bit integer vector performance regression, x86, between gcc-14 and gcc-13 using avx2 target clones on skylake platform Date: Mon, 13 May 2024 13:05:56 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: colin.king at intel dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: 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 Bug ID: 115069 Summary: 8 bit integer vector performance regression, x86, between gcc-14 and gcc-13 using avx2 target clones on skylake platform Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: colin.king at intel dot com Target Milestone: --- Created attachment 58188 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D58188&action=3Dedit reproducer source code I'm seeing a ~12-14% performance regression in gcc-14 compared to gcc-13, u= sing gcc on Ubuntu 24.04: Versions: gcc version 13.2.0 (Ubuntu 13.2.0-23ubuntu4)=20 gcc version 14.0.1 20240412 (experimental) [master r14-9935-g67e1433a94f] (Ubuntu 14-20240412-0ubuntu1)=20 cking@skylake:~$ gcc-13 reproducer-vecmath.c -O2 cking@skylake:~$ ./a.out=20 13540.16 vec8 ops per sec, duration =3D 14.77 secs cking@skylake:~$ gcc-14 reproducer-vecmath.c -O2 cking@skylake:~$ ./a.out=20 11720.25 vec8 ops per sec, duration =3D 17.06 secs The original issue appeared when regression testing stress-ng vecmath stres= sor [1]. I've managed to extract the attached reproducer from the original code (see attached). Salient point to focus on: 1. The issue is also dependant on the TARGET_CLONES macro being defined as __attribute__((target_clones("mmx,avx,avx2,default"))) - the avx2 target clones seems to be an issue in reproducing this problem, remove it for gcc-= 14 and the performance regression is reduced. Attached are the reproducer C source and disassembled object code.=20 References: [1] https://github.com/ColinIanKing/stress-ng/blob/master/stress-vecmath.c=