From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 800F23861025; Thu, 11 Jan 2024 07:56:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 800F23861025 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1704959810; bh=Hg/82cd1sF5UTFZyEtaGi+z1B1w2hYAsweR92WUYiUs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=MI+J4vUf5xZOPF67ir3KgHsfV+uiYjQkUFGl68hGZe+p/765ForFgsryKvUQfijM/ FDmAzYjJx023OBBRSuNpKHk5R743xEFTnGMppvb2V9gWj6+2YiXOju7F4+7xk8HXZu IiwNVS3Lg9SgMsIFMy7ALSDojQ4L/VCLLbVVWOfg= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/113326] Optimize vector shift with constant delta on shifting-count operand Date: Thu, 11 Jan 2024 07:56:50 +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: unknown X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113326 --- Comment #4 from Andrew Pinski --- (In reply to Feng Xue from comment #3) > (In reply to Andrew Pinski from comment #1) > > Note on aarch64 with SVE, you should be able to generate those constants > > without a load, using the index instruction. > Ok. Thanks for the note. This still requires an extra instruction, while = the > constant delta could be nested in shift instruction as IMM operand. >=20 > > Basically this requires an "un-shift" pass and most likely should be do= ne at > > the RTL level though that might be too late. > > Maybe isel? > I'm thinking of adding the processing in pass_lower_vector_ssa, which also > contains other peephole vector ssa optimizations, not just lowering. It should be in isel like other vector instruction selection that goes on. pass_lower_vector_ssa is only for lowing generic vectors.=