From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1524B3858C60; Wed, 17 Jan 2024 13:22:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1524B3858C60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705497742; bh=SvBjsx+2LeWB9/nLails0VLsZDfimo3Lii8HA4/Yh74=; h=From:To:Subject:Date:In-Reply-To:References:From; b=dRrmJESp9cz2efvinQBWcgeshvfG2TrMW9G/p5WBYCMUHCRSIOUhOtySJJx9n2fmW LmekYLSrZuMiyzterhUTdYTkD7dZO/ZWQnb9Vm/AB5nx7qDwzQOV2sHX6Lh31C3+qx og5EYWNWwHmURfWWl+n0Zo2nsJNCOG49XRZHLIEg= From: "rguenth at gcc dot gnu.org" 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 13:22:21 +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: 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: 13.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: keywords target_milestone short_desc 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 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization Target Milestone|--- |13.3 Summary|[14 Regression] Fail to |[13/14 Regression] Fail to |fold the last element with |fold the last element with |multiple loop |multiple loop --- Comment #2 from Richard Biener --- It might be t.c:29:22: missed: Data access with gaps requires scalar epilogue loop required when vectorizing the load groups. We end up with 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] step 4 t.c:29:22: note: Detected single element interleaving array1[1][_8] step 4 t.c:29:22: note: Detected single element interleaving array1[2][_8] step 4 t.c:29:22: note: Detected single element interleaving array1[3][_8] step 4 t.c:29:22: note: Detected single element interleaving array1[0][_1] step 4 t.c:29:22: note: Detected single element interleaving array1[1][_1] step 4 t.c:29:22: note: Detected single element interleaving array1[2][_1] step 4 t.c:29:22: note: Detected single element interleaving array1[3][_1] step 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 it's better to use signed 'm' (or uint64_t I guess), then we get 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; and no gap peeling required. I guess you say GCC 13 is bad as well?=