From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3A9313858D28; Tue, 13 Sep 2022 16:25:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3A9313858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663086303; bh=DN6sy6C3qf60ehwXnyBZpGVIJJPuybIqj7fyBIX02Z4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=KDvGlwZd7UhPF2WQgfQ/ysxGAWMy7y1NsR6vqqBNSSj6cfM7WnUkUDOybA1UmAkQs oiuvNN5ykZ9/PRcX5hy2z35B1EyPrIn3f0aeSGfRBJ4ipQ0VTG/KgUcvWnZopJgZ2v S3w8yUTNKIPDg+iAgMF+Nu5axEs08f4JYNaW6Y5s= From: "segher at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/106536] P9: gcc does not detect setb pattern Date: Tue, 13 Sep 2022 16:25:02 +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.2.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: segher 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: everconfirmed cf_reconfirmed_on bug_status 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=3D106536 Segher Boessenkool changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Last reconfirmed| |2022-09-13 Status|UNCONFIRMED |NEW CC| |segher at gcc dot gnu.org --- Comment #1 from Segher Boessenkool --- Confirmed. GCC uses conditional branches here in expand already. It is hard to optimi= se this over that. Using -mcpu=3Dpower10 we don't get conditional branches: cmpld 7,3,4 # 8 [c=3D4 l=3D4] *cmpdi_unsigned li 9,1 # 43 [c=3D4 l=3D4] *movsi_internal1/8 cmpld 0,3,4 # 45 [c=3D4 l=3D4] *cmpdi_unsigned setnbc 10,28 # 44 [c=3D4 l=3D4] *setnbc_unsigned_si isel 3,9,10,1 # 46 [c=3D4 l=3D4] isel_unsigned_si/1 extsw 3,3 # 24 [c=3D4 l=3D4] extendsidi2/1 blr # 51 [c=3D4 l=3D4] simple_return but this of course isn't ideal yet either. The branches aren't fully optim= ised away until ce2, which is *after* combine. ce1 didn't catch this, perhaps because the two conditional assignments are a bit intertwined there?=