From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A1A7C383D00D; Mon, 2 Aug 2021 08:12:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A1A7C383D00D From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/101693] Terrible SIMD register allocation with a tight loop operating on 8 registers. Date: Mon, 02 Aug 2021 08:12:35 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 11.2.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth 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: attachments.created 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, 02 Aug 2021 08:12:35 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101693 --- Comment #2 from Richard Biener --- Created attachment 51238 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D51238&action=3Dedit your testcase Attached the testcase for reference. The odd thing is there's nothing apperantly wrong with what we feed to the RA, but eventually we're confused about the UNSPEC way of encoding vpmaddubswaccd so the RA doesn't see it can coalesce the accumulators and its result. (insn 43 42 45 3 (set (reg:V8SI 164) (unspec:V8SI [ (subreg:V8SI (reg:V4DI 89 [ regs__I_lsm.13 ]) 0) (reg:V8SI 116 [ _127 ]) (mem:V8SI (plus:DI (reg:DI 84 [ ivtmp.26 ]) (const_int 6144 [0x1800])) [0 MEM[(const __m256i * {ref-all})_147 + 6144B]+0 S32 A256]) ] UNSPEC_VPMADDUBSWACCD)) "Compiler Explorer C++ Editor #[object Object] Code.cpp":13:11 6082 {vpdpbusd_v8si} (expr_list:REG_DEAD (reg:V4DI 89 [ regs__I_lsm.13 ]) (nil)))=