From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CA91D3858C30; Tue, 7 Mar 2023 08:40:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CA91D3858C30 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678178419; bh=rGaZ2g8XCdc9q/C/0wJVMrDE9NcNil4oIb8OTc7DwBQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=KxgRWVgtxGuC05qRf/OrZFRL5uDK8pIRUEXBF/0Z4cYBktGo/G6hcr8p6phXk80yL 3gmVf4yEFoBx174BnsvEKD2bUxmNFmN/2Pc+zLBWC5rIVgL0gPgLZMJSvXJPi4Rc6E goIh3Xi28NhgikWIYFR0TEy0JG4f9VyCQcIoHbT8= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/108938] Missing bswap detection Date: Tue, 07 Mar 2023 08:40:18 +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: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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=3D108938 --- Comment #12 from Jakub Jelinek --- (In reply to Hongtao.liu from comment #11) > (In reply to Jakub Jelinek from comment #9) > > Though, if more than one replacement operation is emitted, one needs to= be > > careful not to emit more expensive replacement than the original sequen= ce > > (especially if some subexpressions aren't single use). >=20 > The patch(support swap + bit_and + rotate) doesn't show much impact on > SPEC2017, is there any other benchmark that I can try to find some > performance regressiones with bswap + bit_and + rotate? > So that I'll restrict the patch to only bswp + rotate/shift. I didn't mean to look at SPEC numbers, I meant count number of statements t= hat could be DCEd. The code currently computes n_ops as it walks the statements that compute the value. So, the idea would be to have another counter next= to it, initialized very similarly, except on a statement that !has_single_use it would be rese= t to zero (essentially not counting that statement or any of its defining statem= ents (transitively)). So it would count solely the statements that could be DCEd.=