From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10335 invoked by alias); 9 Mar 2013 14:43:27 -0000 Received: (qmail 10287 invoked by uid 48); 9 Mar 2013 14:43:08 -0000 From: "olegendo at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/51708] SH Target: SHAD / SHLD constant not CSE-ed Date: Sat, 09 Mar 2013 14:43:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: olegendo at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2013-03/txt/msg00741.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51708 --- Comment #3 from Oleg Endo 2013-03-09 14:43:07 UTC --- (In reply to comment #2) > In order to 'force' the constant load to be CSE-ed the constant load and > dynamic shift patterns have to be emitted in the respective expanders, so that > the CSE pass can see the constant load. While implementing other patterns I've noticed that on SH there are quite a few cases, where certain constants can be formed during the combine pass when certain special case code patterns are discovered. One such frequent constant is the '-1' which is used together with the 'negc' insn to store the negated T bit into a register (SH2A 'movrt' insn). Another recent case came up when I was working on PR 55303 to add SH2A clip instructions. There, offset constants can be formed during the combine pass which also would not be CSE'd afterwards. I think it would be better to introduce a lightweight CSE pass for SH that is done after the first insn split pass after the combine pass. This would eliminate the need for complicated 'constant reservation' patterns.