From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B46443858408; Mon, 4 Oct 2021 16:13:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B46443858408 From: "segher at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/85730] complex code for modifying lowest byte in a 4-byte vector Date: Mon, 04 Oct 2021 16:13:24 +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: 9.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: 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: Mon, 04 Oct 2021 16:13:24 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D85730 --- Comment #7 from Segher Boessenkool --- (In reply to Richard Biener from comment #5) > Not sure whether targets should have a special-case pattern here or wheth= er > that's for combine to un-canonicalize it? Is the shift defined anywhere as the canonical form? We already get a shift at expand time, for e.g. long f(long a) { return a+a; } I cannot find the code that does this easily, it is quite a maze :-) There is code for changing a multiplication by a power of two (which we have in Gimple already) into a shift, but then there should be something changing the addition with self into a multiplication, and I cannot find that either. Combine should absolutely not un-canonicalise it. It could try multiple ways of writing this, but is it important enough to allow this, to justify the (potential) combinatorial explosion this causes? If we want combine to try many ways of writing something (not a bad idea an sich btw, I support it), we need ways to battle such an explosion, and esp. to make the amount of garbage RTL created manageable (it is not, currently). Currently combine has to create GC'ed RTL to recog() it. Maybe we could have some "GC stuff created between points X and Y" interface?=