From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9EC2F3858C2F; Wed, 17 Jan 2024 14:07:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9EC2F3858C2F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705500437; bh=4os4ohe4svE9G0uffwpA28IbxBb3oBclezdSbXvkfPM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=yZBkj6k5+Mqk7OFlBps/QKqkKCnA3k3fhcCACm+7XiznTOutnr7Oqwiaj024egwFX l1F8U4PRj1o2EkLugbN7r0AlzEU4XjbrGDsPXZNEplklmfSn5fG3clGOw+Dq7RqDmb FDCqn1cRDI6wEaouEtFKfue+tn8j/9oox5HHtNMc= From: "juzhe.zhong at rivai dot ai" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/113441] [13/14 Regression] Fail to fold the last element with multiple loop Date: Wed, 17 Jan 2024 14:07:17 +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: 14.0 X-Bugzilla-Keywords: missed-optimization, needs-bisection X-Bugzilla-Severity: normal X-Bugzilla-Who: juzhe.zhong at rivai dot ai 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: 13.3 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=3D113441 --- Comment #3 from JuzheZhong --- (In reply to Richard Biener from comment #2) > It might be >=20 > t.c:29:22: missed: Data access with gaps requires scalar epilogue loop >=20 > required when vectorizing the load groups. We end up with >=20 > t.c:29:22: note: =3D=3D=3D vect_analyze_data_ref_accesses =3D=3D=3D > t.c:29:22: note: Detected single element interleaving array1[0][_8] ste= p 4 > t.c:29:22: note: Detected single element interleaving array1[1][_8] ste= p 4 > t.c:29:22: note: Detected single element interleaving array1[2][_8] ste= p 4 > t.c:29:22: note: Detected single element interleaving array1[3][_8] ste= p 4 > t.c:29:22: note: Detected single element interleaving array1[0][_1] ste= p 4 > t.c:29:22: note: Detected single element interleaving array1[1][_1] ste= p 4 > t.c:29:22: note: Detected single element interleaving array1[2][_1] ste= p 4 > t.c:29:22: note: Detected single element interleaving array1[3][_1] ste= p 4 > t.c:29:22: missed: not consecutive access array2[_4][_8] =3D _69; > t.c:29:22: note: using strided accesses > t.c:29:22: missed: not consecutive access array2[_4][_1] =3D _67; > t.c:29:22: note: using strided accesses >=20 > it's better to use signed 'm' (or uint64_t I guess), then we get >=20 > t.c:29:22: note: =3D=3D=3D vect_analyze_data_ref_accesses =3D=3D=3D > t.c:29:22: note: Detected interleaving load array1[0][_1] and array1[0]= [_8] > t.c:29:22: note: Detected interleaving load array1[1][_1] and array1[1]= [_8] > t.c:29:22: note: Detected interleaving load array1[2][_1] and array1[2]= [_8] > t.c:29:22: note: Detected interleaving load array1[3][_1] and array1[3]= [_8] > t.c:29:22: note: Detected interleaving store array2[_4][_1] and > array2[_4][_8] > t.c:29:22: note: Detected interleaving load of size 2=20 > t.c:29:22: note: _2 =3D array1[0][_1]; > t.c:29:22: note: _9 =3D array1[0][_8]; > t.c:29:22: note: Detected interleaving load of size 2 > t.c:29:22: note: _18 =3D array1[1][_1]; > t.c:29:22: note: _23 =3D array1[1][_8]; > t.c:29:22: note: Detected interleaving load of size 2 > t.c:29:22: note: _32 =3D array1[2][_1]; > t.c:29:22: note: _37 =3D array1[2][_8]; > t.c:29:22: note: Detected interleaving load of size 2 > t.c:29:22: note: _46 =3D array1[3][_1]; > t.c:29:22: note: _51 =3D array1[3][_8]; > t.c:29:22: note: Detected interleaving store of size 2 > t.c:29:22: note: array2[_4][_1] =3D _67; > t.c:29:22: note: array2[_4][_8] =3D _69; >=20 > and no gap peeling required. >=20 > I guess you say GCC 13 is bad as well? Sorry, I didn't check GCC13 but after investigation. Now, I confirm GCC 13.2.0 doesn't have the regression: https://godbolt.org/z/ndaWToaxP In GCC 13.2.0, there is no appearance of "requires scalar epilogue loop", wheras, GCC-14 has 72 times "requires scalar epilogue loop".=