From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BE83F393D036; Wed, 6 Jan 2021 03:29:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BE83F393D036 From: "linkw at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/98138] BB vect fail to SLP one case Date: Wed, 06 Jan 2021 03:29:46 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: linkw 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 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: Wed, 06 Jan 2021 03:29:46 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98138 --- Comment #5 from Kewen Lin --- (In reply to Kewen Lin from comment #4) > One rough idea seems: > 1) Relax this condition all_uniform_p somehow to get SLP instance build= ing > to go deeper and get those p1/p2 loads as SLP nodes. > 2) Introduce one more vect_pattern recognizer to catch this kind of > pattern, transform the slp instance as we expect. I assume we can know the > whole slp instance then we can transform it as we want here. Probably need > some costing condition to gate this pattern matching. > 3) If 2) fail, trim the slp instance from those nodes which satisfy > all_uniform_p condition to ensure it's same as before. >=20 For 2), instead of vect_pattern with IFN, the appropriate place seems to be vect_optimize_slp. But after more thinking, building SLP instance starting from group loads instead of group stores looks more straightforward.=20 a0 =3D (p1[0] - p2[0]); a1 =3D (p1[1] - p2[1]); a2 =3D (p1[2] - p2[2]); a3 =3D (p1[3] - p2[3]); Building the vector looks more natural and then check the = uses of its all lanes and special patterns to have vector and repeat similarly. Hi Richi, Is this a good example to request SLP instance build starting group loads?=