From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F19BC3874C1B; Fri, 5 Mar 2021 14:01:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F19BC3874C1B From: "hubicka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/99407] New: s243 benchmark of TSVC is vectorized by clang and not by gcc Date: Fri, 05 Mar 2021 14:01:56 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hubicka at gcc dot gnu.org 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 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 14:01:57 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99407 Bug ID: 99407 Summary: s243 benchmark of TSVC is vectorized by clang and not by gcc Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: hubicka at gcc dot gnu.org Target Milestone: --- This testcase (from TSVC) is about 4 times faster on zen3 when built with clang. typedef float real_t; #define iterations 100000 #define LEN_1D 32000 #define LEN_2D 256 // array definitions real_t flat_2d_array[LEN_2D*LEN_2D]; real_t x[LEN_1D]; real_t a[LEN_1D],b[LEN_1D],c[LEN_1D],d[LEN_1D],e[LEN_1D], bb[LEN_2D][LEN_2D],cc[LEN_2D][LEN_2D],tt[LEN_2D][LEN_2D]; int indx[LEN_1D]; real_t* __restrict__ xx; real_t* yy; real_t s243(void) { // node splitting // false dependence cycle breaking for (int nl =3D 0; nl < iterations; nl++) { for (int i =3D 0; i < LEN_1D-1; i++) { a[i] =3D b[i] + c[i ] * d[i]; b[i] =3D a[i] + d[i ] * e[i]; a[i] =3D b[i] + a[i+1] * d[i]; } } } internal loop from clang is: .LBB0_2: # Parent Loop BB0_1 Depth=3D1 # =3D> This Inner Loop Header: Dep= th=3D2 vmovups c(%rcx), %ymm12 vmovups c+32(%rcx), %ymm14 vmovups d(%rcx), %ymm0 vmovups d+32(%rcx), %ymm7 vfmadd213ps b(%rcx), %ymm0, %ymm12 # ymm12 =3D (ymm0 * ymm12) = + mem vfmadd213ps b+32(%rcx), %ymm7, %ymm14 # ymm14 =3D (ymm7 * ymm14= ) + mem vfmadd231ps e(%rcx), %ymm0, %ymm12 # ymm12 =3D (ymm0 * mem) + = ymm12 vfmadd231ps e+32(%rcx), %ymm7, %ymm14 # ymm14 =3D (ymm7 * mem) + ymm14 vmovups %ymm12, b(%rcx) vmovups %ymm14, b+32(%rcx) vfmadd231ps a+4(%rcx), %ymm0, %ymm12 # ymm12 =3D (ymm0 * mem) += ymm12 vfmadd231ps a+36(%rcx), %ymm7, %ymm14 # ymm14 =3D (ymm7 * mem) + ymm14 vmovups %ymm12, a(%rcx) vmovups %ymm14, a+32(%rcx) addq $64, %rcx cmpq $127936, %rcx # imm =3D 0x1F3C0 jne .LBB0_2=