From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A68693858035; Mon, 28 Nov 2022 08:43:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A68693858035 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669625002; bh=ti5niCt7PCpaB9RroU/lxhxEoAcBFizTBdGlqkbS29w=; h=From:To:Subject:Date:In-Reply-To:References:From; b=WPUwbjhvzuO0g8T/AMKpPuue82QMDq2rYNJrfzqs6rxxyVhsHOFbIbaIzm3kOLfAP RCbdQMnpD8QFYh8ysJTisOzCS+DBFkq3FrVmIv6ZzVeosk4+H59E8lq5qeMavQsdsS 44ZjeuZP2VaGnLWPvGQnQkI6ZhfSVuAT01FtfvBA= From: "crazylht at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/107892] Unnecessary move between ymm registers in loop using AVX2 intrinsic Date: Mon, 28 Nov 2022 08:43:22 +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: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: crazylht at gmail dot com 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=3D107892 --- Comment #3 from Hongtao.liu --- > In the bad version, I noticed that the RTL initially has two separate ins= ns > for 'a +=3D *p': one to do the addition and write the result to a new pse= udo > register, and one to convert the value from mode V8SI to V4DI and assign = it Because we're defining __m256i as __v4di, and rtl use subreg to bitcast __v= 8si reg to __v4di one. > to the original pseudo register. These two separate insns never get > combined. (That sort of explains why the bug isn't seen with the __v8si = and > +=3D method; gcc doesn't do a type conversion with that method.) So, I'm Combine failed to combine them because the __v8si reg is also used outside = of the loop. > wondering if the bug is in the instruction combining pass. Or perhaps the > RTL should never have had two separate insns in the first place?=