From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B712D3835437; Tue, 27 Jul 2021 12:41:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B712D3835437 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/78103] Failure to optimize with __builtin_clzl Date: Tue, 27 Jul 2021 12:41:36 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 6.2.1 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jul 2021 12:41:36 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D78103 --- Comment #18 from Jakub Jelinek --- (In reply to Segher Boessenkool from comment #17) > > Nothing changes for combine though, I think it really would be nice if = it > > could either change newly added pseudos from combine_split_insns by i2d= est > > if possible, >=20 > Is that ever safe to do? Except for debug insns if the mode is the same and i2dest doesn't appear in i2set nor i3set nor anything in between, why not? As for debug insns, as I said earlier, the current code is reusing i2dest f= or the splitting found by find_split_point. > > or better handle new pseudos from both combine_split_insns and > > when > > for find_split_point i2dest can't be resued with creating LOG_LINKS. >=20 > You cannot safely attempt to combine the two insns split to again, neither > alone nor in combination with other insns. Since pretty much by definiti= on > that new reg will be set in the new i2 and used in (only) in the new i3, > no combination with that new reg is valid ever? Sure, combining those 2 insns can't be sucessful, otherwise it would have matched earlier. But they can be combined with other insns, say the first = of those 2 split insns being i0 and second i1 combined into some other i3 and = i2, or perhaps just split insns i1 and i2 combined into some other i3.=