From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C498A395C05F; Wed, 16 Nov 2022 18:47:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C498A395C05F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668624476; bh=jtWmOe/UzFFE3g4Q64sSywisdNfSNxUMMPI3Vv47lj0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=as1GQxLnkjN0aHBIJj6cHiu3ZiPGzethH4suXmHuUScyyXIPQhtazOiNhP20XDOj3 CYzk5oeEbS5qbN+t/vYVG0E0S6I+KYOx+gY4z4h0G6I9FF7k2mwnaEtdxg2Q8Un/NN h3KaU7aagVdiM1GGdPhyp5VshhjCNopSo625be3A= From: "law at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/106602] riscv: suboptimal codegen for zero_extendsidi2_shifted w/o bitmanip Date: Wed, 16 Nov 2022 18:47:56 +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: 13.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: law 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=3D106602 --- Comment #25 from Jeffrey A. Law --- To outline what we were thinking. Yes, it's possible that 4->3 combinations aren't supported. I'd have to sit down with the combine sources to be sure. So the alternate approach we came up with was to mimick ZBS's ability to lo= ad up single bit constants with a define_insn_and_split, obviously splitting it into a constant load + shift unconditionally if it's still around post-comb= ine. That's going to lead into a bigger question about constant loads. Right no= w we tend to break them down during expansion. The advantage of that is the components become CSE candidates. The downside is it will tend to inhibit instruction combination as we've seen in this case. I don't have a good an= swer on the best approach.=