From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E6AB43858D37; Fri, 3 Mar 2023 20:21:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E6AB43858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677874908; bh=rXupGQOxshuMaceKhhFH7YgS2tArfNqkS2vl7rtDn1E=; h=From:To:Subject:Date:In-Reply-To:References:From; b=wEbRkefTyFyFI/2Sh/pPYjQbAIc3Zmm/W6oBToYscJvSnfcIBFo78Fr7mBaLNZX59 nPAjjwVLUcLtYSqAZbtJ0Ov8BoV7mixko5wkDuYlnMpiQ60aS/EuaEUpjpN83JkqMf q55OpjoeTdIsa1B91FSDxVQ+bK0hF2OGIeaNFNbc= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/109011] missed optimization in presence of __builtin_ctz Date: Fri, 03 Mar 2023 20:21:48 +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: 12.2.1 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub 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: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109011 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #3 from Jakub Jelinek --- Seems they are vectorizing __builtin_ctz (x) as bitsize - .CLZ ((x - 1) & ~= x) for CLZ_DEFINED_VALUE_AT_ZERO 2 with value bitsize. Perhaps we should pattern match it in tree-vect-patterns.cc that way if clz= is vectorizable (it is with -mavx512cd) and ctz is not.=