diff options
author | Luc Grosheintz <luc.grosheintz@gmail.com> | 2025-08-03 22:57:23 +0200 |
---|---|---|
committer | Tomasz Kamiński <tkaminsk@redhat.com> | 2025-08-21 10:11:36 +0200 |
commit | 997cd37809002840379488857291da9a8c650e3a (patch) | |
tree | e5c10a9408ddfe9b52ea93d255bd13f0811ae7ec /contrib/gcc-changelog/git_email.py | |
parent | bf864b450e8eff4e0fab30da2e6b69ee42d04e6f (diff) | |
download | gcc-997cd37809002840379488857291da9a8c650e3a.zip gcc-997cd37809002840379488857291da9a8c650e3a.tar.gz gcc-997cd37809002840379488857291da9a8c650e3a.tar.bz2 |
libstdc++: Reduce template instantiations in <mdspan>.
In mdspan related code involving static extents, often the IndexType is
part of the template parameters, even though it's not needed.
This commit extracts the parts of _ExtentsStorage not related to
IndexType into a separate class _StaticExtents.
It also prefers passing the array of static extents, instead of the
whole extents object where possible.
The size of an object file compiled with -O2 that instantiates
Layout::mapping<extents<IndexType, Indices...>::stride
Layout::mapping<extents<IndexType, Indices...>::required_span_size
for the product of
- eight IndexTypes
- three Layouts,
- nine choices of Indices...
decreases by 19% from 69.2kB to 55.8kB.
libstdc++-v3/ChangeLog:
* include/std/mdspan (__mdspan::_StaticExtents): Extract non IndexType
related code from _ExtentsStorage.
(__mdspan::_ExtentsStorage): Use _StaticExtents.
(__mdspan::__static_extents): Return reference to NTTP of _StaticExtents.
(__mdspan::__contains_zero): New overload.
(__mdspan::__exts_prod, __mdspan::__static_quotient): Use span to avoid
copying __sta_exts.
Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
Diffstat (limited to 'contrib/gcc-changelog/git_email.py')
0 files changed, 0 insertions, 0 deletions