From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 833373858C83; Tue, 17 Jan 2023 05:42:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 833373858C83 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673934128; bh=uEjqD9FxlWNOykdN8OIGIjEeY7bAppbmwdfykSETZ6M=; h=From:To:Subject:Date:In-Reply-To:References:From; b=RZ36tU02iyIQXrif+yd4ksWSeA05jxmGqvvSH06Aldf1BsiaPxTTOTKwOR0g1GVOA SKnSBn6W/h3nzA7+ZQdjMfHNTdfvVMvJG4Hcz8MxHUqBW9A3kz+52V3YEHJ+H5+qPz DgpUMUeO3/24nCDJAhgbTaPK7JusxicdFPV0Oq70= From: "crazylht at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/108401] gcc defeats vector constant generation with intrinsics Date: Tue, 17 Jan 2023 05:42:07 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 11.3.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: crazylht at gmail dot com 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: 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=3D108401 --- Comment #8 from Hongtao.liu --- > But, if you're going to improve constant generation, please make it so th= at > it can recognize not only the particular pattern described in this bug. M= ore > importantly, it should recognize the all-ones case (as a single pcmpeq) a= s a > starting point. Then it can apply shifts to achieve the final result from > the all-ones vector - shifts of any width, length or direction, including > psrldq/pslldq. This would improve generated code in a wider range of case= s. yes, we will try to do that. Generally fold intrinsic into compiler IR helps performance, and for this case we need to optimize codegen for special immediate broadcast(all-ones + shift)=