From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 29168385841B; Sat, 10 Jun 2023 16:14:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 29168385841B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686413642; bh=OLB8LyV1xgZaQKKO3XHF3HkOP8+CqM3GdYJj65abCb0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=UfzdGSYFz1ItAcRQwVJMKV9y7eD7rc2A9I4k6ItiFJKXwySo2Ek3SazWf60ofwVP+ ViM4EillsXBmW1pKQ4g+1UEMthc6REAsgTD7vL8GyeyPmHOgKyEZY+47EO/boT7Ono aajfbINLCDSWWfvh/Dlu9F9YfSIoG9sLVHGzWQPY= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/110202] _mm512_ternarylogic_epi64 generates unnecessary operations Date: Sat, 10 Jun 2023 16:14:01 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 13.1.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia 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: component bug_severity 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=3D110202 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Component|target |rtl-optimization Severity|normal |enhancement --- Comment #2 from Andrew Pinski --- Note you get a warning in your negate1 case : In function '__m512i negate1(const __m512i*)': :7:36: warning: 'res' is used uninitialized [-Wuninitialized] 7 | res =3D _mm512_ternarylogic_epi64(res, res, *a, 0x55); | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ :6:13: note: 'res' was declared here 6 | __m512i res; | ^~~ But even doing this: __m512i negate1(const __m512i *a) { __m512i res =3D _mm512_undefined_si512 (); res =3D _mm512_ternarylogic_epi64(res, res, *a, 0x55); return res; } Will cause an extra zeroing.=