From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 519E93858C30; Mon, 5 Jun 2023 00:03:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 519E93858C30 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685923437; bh=kuAE7UOXdfHlDqYGTsBfeKKelm1ANw9giVudH5HOBJg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Hk/hPjzGGEpLhhs/WgUvsS7QRCdgMrf4DsAJPfkYxSDELZ86PwMLLG20OHts39V6P 2W34rgZXD2q32xGdA21R/mUJmlVR1ktdpctoBBisS83Ui3vqOEA2z9OXX7qG86hmcb h65BD+SN8S7FJdNkavwmOzy9RCBvUkAliZ3cJ3ho= From: "olegendo at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/54089] [SH] Refactor shift patterns Date: Mon, 05 Jun 2023 00:03: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: 4.8.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: olegendo at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: olegendo 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=3D54089 --- Comment #59 from Oleg Endo --- (In reply to Alexander Klepikov from comment #58) >=20 > Ouch. That's a real problem. Short loops can become slower on about 10%. = But > is it possible to detect a loop during expand pass? It looks like basic > blocks have loop depth info, but I still don't now how to access a basic > block. There is 'BLOCK_FOR_INSN' But I'm not sure it will be helpful during the initial expand pass. > I would try that. I think loop optimiztion pass should be repeated after > split pass. Do you know how to do it? I don't know if we can simply repeat the loop optimizations. I think I've tried doing something like that before -- repeating some of the RTL passes,= but without any useful results. It could also result in oscillations (pass A d= oes a transformation, pass B undoes it, then pass A would do it again ...). Ma= ybe you can get better results. There are already 2 SH specific passes 'sh_optimize_sett_clrt' and 'sh_treg_combine'. You can look at how they are instantiated and inserted = into the RTL passes chain in 'register_sh_passes'. Maybe it's easier to add some shift specific passes.=