From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E68F73858025; Fri, 5 Mar 2021 14:54:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E68F73858025 From: "hubicka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/99412] New: s352 benchmark of TSVC is vectorized by clang and not by gcc Date: Fri, 05 Mar 2021 14:54:32 +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:54:33 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99412 Bug ID: 99412 Summary: s352 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: --- typedef float real_t; #define iterations 100000 #define LEN_1D 32000 #define LEN_2D 256 real_t a[LEN_1D],b[LEN_1D]; int main () { // loop rerolling // unrolled dot product real_t dot; for (int nl =3D 0; nl < 8*iterations; nl++) { dot =3D (real_t)0.; for (int i =3D 0; i < LEN_1D; i +=3D 5) { dot =3D dot + a[i] * b[i] + a[i + 1] * b[i + 1] + a[i + 2] * b[i + 2] + a[i + 3] * b[i + 3] + a[i + 4] * b[i + 4]; } } return dot; } clang does: main: # @main .cfi_startproc # %bb.0: xorl %eax, %eax .p2align 4, 0x90 .LBB0_1: # =3D>This Loop Header: Depth=3D1 # Child Loop BB0_2 Depth 2 vxorps %xmm0, %xmm0, %xmm0 movq $-5, %rcx .p2align 4, 0x90 .LBB0_2: # Parent Loop BB0_1 Depth=3D1 # =3D> This Inner Loop Header: Dep= th=3D2 vmovups b+20(,%rcx,4), %xmm1 vmovss b+36(,%rcx,4), %xmm2 # xmm2 =3D mem[0],zero,zero= ,zero vmulps a+20(,%rcx,4), %xmm1, %xmm1 vpermilpd $1, %xmm1, %xmm3 # xmm3 =3D xmm1[1,0] vaddps %xmm3, %xmm1, %xmm1 vmovshdup %xmm1, %xmm3 # xmm3 =3D xmm1[1,1,3,3] vaddss %xmm3, %xmm1, %xmm1 vfmadd231ss a+36(,%rcx,4), %xmm2, %xmm1 # xmm1 =3D (xmm2 * mem)= + xmm1 addq $5, %rcx vaddss %xmm0, %xmm1, %xmm0 cmpq $31995, %rcx # imm =3D 0x7CFB jb .LBB0_2 # %bb.3: # in Loop: Header=3DBB0_1 Depth= =3D1 incl %eax cmpl $800000, %eax # imm =3D 0xC3500 jne .LBB0_1 # %bb.4: vcvttss2si %xmm0, %eax retq=