From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 26F163858416; Tue, 7 May 2024 12:13:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 26F163858416 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1715084016; bh=D/FkJ4vvMIdV09APZcgX/Q+50gVOjJG2JvFi24lWUIE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Sl0dFrHI50yiqWO03MhfjhXuGq48/MWAwcQpm+/SEpvHryZz7otnZXXTQZ02Ylfwv GgOMsraLT53+k0CvYvV/0xKed5cbR/v6NCWsQKJlRKSUc5jkQwtjboe7IX7GmJsvPZ yInciIku+7s7QzDl4MhnWpPiudcMHkxNZHW6MbnU= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110490] tree-ssa/clz-* and tree-ssa/ctz-* fail on s390x with arch14 (expression_expensive_p not handling if there is wider clz/ctz/popcount optab) Date: Tue, 07 May 2024 12:13:35 +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: 14.0 X-Bugzilla-Keywords: missed-optimization, testsuite-fail X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit 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: 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=3D110490 --- Comment #5 from GCC Commits --- The master branch has been updated by Stefan Schulze Frielinghaus : https://gcc.gnu.org/g:e1f56c67a82172730c377a96a46e8d75445e6a48 commit r15-274-ge1f56c67a82172730c377a96a46e8d75445e6a48 Author: Stefan Schulze Frielinghaus Date: Tue May 7 14:12:55 2024 +0200 tree-optimization/110490 - bitcount for narrow modes Bitcount operations popcount, clz, and ctz are emulated for narrow modes in case an operation is only supported for wider modes. Beside that ctz may be emulated via clz in expand_ctz. Reflect this in expression_expensive_p. I considered the emulation of ctz via clz as not expensive since this basically reduces to ctz (x) =3D c - (clz (x & ~x)) where c is the mode precision minus 1 which should be faster than a loop. gcc/ChangeLog: PR tree-optimization/110490 * tree-scalar-evolution.cc (expression_expensive_p): Also consider mode widening for popcount, clz, and ctz.=