From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E3A2D3858438; Thu, 15 Jun 2023 11:28:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E3A2D3858438 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686828511; bh=9KI1BQv9LOXN5DJYVAYkrQcOcp0RMyhNMUfCygjg9R4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=MqSKtY/lNtpwb7/xjwyzvoNRbfWy4z56/RuFt4TldC0NISoqtudaKa9X1uW8hvzU6 EllrjXeDIrgaLvhd1k9co69mqeEm1xoRROtES5pv3TnOGadw0uKXbJ+C020JrbMhD0 0viUDKrfA4bX2tuE6g7Q7Hc/Pf5CJoXp/CgmeK+c= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/102989] Implement C2x's n2763 (_BitInt) Date: Thu, 15 Jun 2023 11:28:29 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW 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.isobsolete 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102989 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #55240|0 |1 is obsolete| | Attachment #55244|0 |1 is obsolete| | --- Comment #64 from Jakub Jelinek --- Created attachment 55327 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D55327&action=3Dedit gcc14-bitint-wip.patch Some further progress. I found that out of SSA coalescing coalesces only a very small subset of SSA_NAMEs, for _BitInt we need to coalesce significant= ly more, try to use as few VAR_DECL arrays as possible so that we don't blow a= way stack sizes. So, I'm trying to find the large/huge _BitInt SSA_NAMEs, quickly find out s= ome which won't be needed as they could be handled inside of a single loop (to = be improved later) and then doing aggressive coalesing on those and eventually= map those SSA_NAMEs to VAR_DECLs. On void foo (_BitInt(192) *x, _BitInt(192) *y, _BitInt(135) *z, _BitInt(135) *w) { _BitInt(192) a; if (x[0] =3D=3D y[0]) a =3D 123wb; else if (x[0] =3D=3D y[1]) a =3D y[2]; else if (x[0] =3D=3D y[2]) a =3D y[3]; else a =3D 0wb; x[4] =3D a; x[5] =3D x[0] =3D=3D y[0] ? x[6] : x[0] =3D=3D y[1] ? x[7] : x[0] =3D=3D = y[2] ? x[8] : x[9]; x[0] &=3D y[0]; x[1] |=3D y[1]; x[2] ^=3D y[2]; x[3] =3D ~y[3]; z[0] &=3D w[0]; z[1] |=3D w[1]; z[2] ^=3D w[2]; z[3] =3D ~w[3]; } I'm seeing weird results though, e.g. _1 =3D *x_32(D); _2 =3D *y_33(D); if (_1 =3D=3D _2) but After Coalescing: Partition map Partition 0 (_1 - 1 2 3 4 5 6 7 8 10 11 13 14 16 29 30 34 35 37 38 39 40 ) Partition 1 (_9 - 9 ) Partition 2 (_12 - 12 ) Partition 3 (_15 - 15 ) Partition 4 (_17 - 17 ) Partition 5 (_18 - 18 19 21 22 24 25 27 ) Partition 6 (_20 - 20 ) Partition 7 (_23 - 23 ) Partition 8 (_26 - 26 ) Partition 9 (_28 - 28 ) Partition 10 (x_32(D) - 32 ) Partition 11 (y_33(D) - 33 ) Partition 12 (z_46(D) - 46 ) Partition 13 (w_47(D) - 47 ) Obviously, _1 and _2 need to conflict because they have overlapping live ra= nges (sure, later on loads from memory should be handled in a smarter way, no ne= ed to copy it into another array if at the point of a single use within the sa= me bb (at least) the memory couldn't be clobbered yet).=