From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D096D38708A0; Tue, 22 Sep 2020 09:03:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D096D38708A0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1600765424; bh=Bm/3gZxyqZPXwMojFyS03LjgnwmCaBEYtVatn4XWIME=; h=From:To:Subject:Date:In-Reply-To:References:From; b=yqBVot8LZ4Y8jx4qn9PbltVZ19tn5mJtyG1Wii8fRypVDEtsnl4qZ/1Tj+9AeIEWK g9SS9nNGWJk8EdD53jXbSMsviSSeFoHg9aakB5fd5/pgy4jgqRf8qnLNs3XApFlf/m nfoGFT2m7+/GsbLUQL7bX3pxpVKZrY6AFJEbI+Y0= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/40770] Vectorization of complex types, vectorization of sincos missing Date: Tue, 22 Sep 2020 09:03:44 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 4.5.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: jakub 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: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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 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: Tue, 22 Sep 2020 09:03:44 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D40770 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fweimer at redhat dot com, | |jakub at gcc dot gnu.org --- Comment #15 from Jakub Jelinek --- OpenMP has a way to express this, #pragma omp declare simd notinbranch linear(y,z) double sincos (double x, double *y, double *z); As can be seen on -O2 -fopenmp-simd: #pragma omp declare simd notinbranch linear(y, z) double foo (double x, double *y, double *z); double a[1024], b[1024], c[1024]; void bar (void) { #pragma omp simd for (int i =3D 0; i < 1024; i++) foo (a[i], &b[i], &c[i]); } it works fine with that. But if #pragma omp simd is commented out, it is n= ot, because the compiler has no assurance on what the function call behavior wi= ll be e.g. for data reference analysis (it could e.g. modify the global vars). Now, for sincos proper, the compiler knows what the function does if not -fno-builtin-sincos. Unfortunately, I think glibc currently defines sincos in math-vector.h the unuseful way with just simd ("notinbranch") attribute, which effectively me= ans that the caller is supposed to pass vectors of pointers (well integers with those sizes) and so needs scatter under the hood. So the best thing would be to change glibc first.=