From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 70DA0383A0F1; Fri, 9 Dec 2022 14:51:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 70DA0383A0F1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1670597498; bh=LNtxzCZsv+qkfkpIqztNl8bZt9Trbtn+oe7BKEg5JKU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=JRlEqauXzOorKxVtpIwWWZ4XL2tvoTE3MTtlOME/N6rE6YDcrca77ImvNVLbY7HCR H5JlcgLajOtcNXkm5REmrsCDw4tNSZHemb+WOf9ltyK4T3nV8SuXEVvrpt+9tbBH80 YD9M/q2iy6vl0z26I3+Hox4D+ndjgrEkpy+Wsen8= From: "mkretz at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/108030] `std::experimental::simd` not inlined Date: Fri, 09 Dec 2022 14:51:37 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: mkretz at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: mkretz at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 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=3D108030 --- Comment #3 from Matthias Kretz (Vir) --- (In reply to Jakub Jelinek from comment #2) > I bet by adding too many always_inline functions that call normal inlines > that is what is bound to happen, one runs into inline growth limits. It = is > better to use always_inline on the leaf functions rather than on what cal= ls > them. How is the inline growth limit determined? I mean, in the cases where it re= ally hurts, the resulting function compiles down to a single instruction (plus parameter passing boilerplate). The optimizer cannot know about the number = of instructions, so what is the measure it uses? Especially with the helper functions necessary to work with parameter packs= / index_sequence, it's not enough to use always_inline on the leaf functions. E.g. any simd binary operator basically should be [[gnu::always_inline, gnu::flatten]]. However, simd maybe shouldn't use 'flatten' for functions t= hat call a user-provided callable (e.g. the simd generator constructor).=