From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 036B43858025; Wed, 11 Jan 2023 12:14:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 036B43858025 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673439243; bh=ocnX6trtUUPHF7ZqYms6m/zUu5TpL7qxtrr1wMCwhc0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rFYg9Busg5Z2LPNESdWtaXHX7CxWicnrBtIGCSq61FcRN/RFCPuHPwkcIi3rjv5KA jOi6UZtOl7pKrsWE9saWlNL1K9NjdmuRQ13ZRXyWHXdlG1s0e+KnDHGcDki72gEsuJ I9vonHZpLUfnzQndNeH4MNbxgLhi+YMWNpRKNAzg= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/107767] [13 Regression] switch to table conversion happening even though using btq is better Date: Wed, 11 Jan 2023 12:14:00 +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: 13.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 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=3D107767 --- Comment #19 from CVS Commits --- The master branch has been updated by Richard Biener : https://gcc.gnu.org/g:f99d7d669eaa2830eb5878df4da67e77ec791522 commit r13-5106-gf99d7d669eaa2830eb5878df4da67e77ec791522 Author: Richard Biener Date: Mon Jan 9 09:42:22 2023 +0100 tree-optimization/107767 - not profitable switch conversion When the CFG has not merged equal PHI defs in a switch stmt the cost model from switch conversion gets off and we prefer a jump table over branches. The following fixes that by recording cases that will be merged later and more appropriately counting unique values. PR tree-optimization/107767 * tree-cfgcleanup.cc (phi_alternatives_equal): Export. * tree-cfgcleanup.h (phi_alternatives_equal): Declare. * tree-switch-conversion.cc (switch_conversion::collect): Count unique non-default targets accounting for later merging opportunities. * gcc.dg/tree-ssa/pr107767.c: New testcase.=