User Details
- User Since
- Dec 17 2020, 4:00 PM (119 w, 1 d)
Oct 30 2022
Author name = James Player
Email = james.w.player@gmail.com
Oct 24 2022
Ping @kazu for commit. If you're not the right person to ask, could you kindly suggest someone else?
Oct 12 2022
Thanks for the review @kazu
Sep 26 2022
Sep 19 2022
I'd be happy to break this down into bite-sized chunks. Is discourse the right place to iterate on the details of such a patch series? I can start with the ability to default construct and copy-assign existing iterators which carry a callable.
Sep 16 2022
I wrote this code for a private target (as well as for a non-LLVM compiler framework), and was wondering if some form of it would be useful upstream (I fully expect some high-level refactoring). It seems strange that there are things defined in STLExtras.h which mimic the behavior of std::ranges elements but are named differently (mapped_iterator vs transform_iterator for example).
Apr 29 2022
Apr 28 2022
[ RUN ] StaticVsSmall/0.TimedStaticVector [ OK ] StaticVsSmall/0.TimedStaticVector (371 ms) [ RUN ] StaticVsSmall/0.TimedSmallVector [ OK ] StaticVsSmall/0.TimedSmallVector (596 ms)Which demonstrates that simple insertions are significantly faster (almost 38%) with the StaticVector compared to a SmallVector which stays within its small buffer limit.
Just to give a concrete example of what I believe to be the benefit behind StaticVector, I ran this contrived test pitting SmallVector<uint64_t,N> vs StaticVector<uint64_t,N> (with a few tweaks to ensure the push_back param is passsed by value like in SmallVector):
TYPED_TEST(StaticVsSmall, TimedStaticVector) { const size_t N = this->NumBuiltinElts(this->TheStaticVector); for (int I = 0; I < OutterLimit; ++I) { this->TheStaticVector.clear(); for (int J = 0; J < N; ++J) { this->TheStaticVector.push_back(I + J); } } }
Call llvm::consumeError() when an Error is returned in the StaticVector unit test.
Apr 27 2022
Resurrecting this review for the following:
Jan 18 2022
My concern would be the variations in the result of std::is_trivially_copyable across different c++ standards. It's possible that you could have a class considered non-trivially copyable in one compiler and trivially copyable in another. This means that it becomes unclear whether you can populate the buffer with std::uninitialized_copy or you should call std::copy (for example).
But is this really a problem? If std::is_trivially_copyable isn't aggressive you get redundant initializations, but it's not a bug. ABI-wise this should also be fine because no struct layout is affected.
Jan 13 2022
Older MSVC has trouble with is_trivially_copyable
we also do not have a LLVM version of that implementation.
Oct 27 2021
Here's another example of a possible StaticVector conversion:
Oct 21 2021
- Define the MSVC visualizer for StaticVector.
- Bind StaticVector a simple yaml sequence.
- Change StaticVector::Capacity to an enum to make it available from the visualizer.
- Substitute some SmallVectors which never grow beyond inline storage.
I don't see too many simple substitutions in target independent code, although this class has a SmallVector which never exceeds the inline storage (drop-in type substitution + with YAML binding works):
Oct 20 2021
Reverse include order of ArrayRef.h and StaticVector.h in unit test code to address pre-merge check failure.
Jan 15 2021
Quick reminder that I don't have commit access, and need someone to commit this patch on my behalf. Thanks!
Jan 14 2021
Added !defined(__clang__) conditions to static_assert preprocessing. Also added large comment describing the mental gymnastics of the OptionalStorage specialization condition.
I just triaged the gcc 5.4 build break. It appears that std::is_trivially_copy_constructible<T> instantiates the copy constructor (which is... strange). So we can't query a compile-time property without the compiler forcing instantiation of the deleted copy constructor in this case.
Taking a look at the gcc 5.4 failure now.
Jan 12 2021
@dblaikie, I don't have commit access. Are you the right person to ask to commit this patch on my behalf?
Jan 11 2021
Properly update the patch to incorporate the separate static_asserts.
Split conditions into individual static_asserts.
Jan 8 2021
With current change, pre-merge checks pass. I think I've resolved all issues / requests.
Added preprocessing around static_asserts added to OptionalTests.cpp to only include them in recent windows builds.
Jan 5 2021
Jan 4 2021
- Expanded the check for the trivial specialization of OptionalStorage
- Formatted the OptionalStorage template list.
- Added a test to ensure that deleting move constructor / assignment will still choose the trivial OptionalStorage specialization.
- Added requests static_asserts to validate class properties in Optional testing code.
Dec 18 2020
Clarified comments above deleted volatile copy constructor / assignment in test classes.
any idea why this only fails for MSVC? It'd be good to understand more why this didn't trip up other builds so we can avoid those sort of divergences in the future, perhaps.
- Use std::is_trivially_copyable instead of llvm::is_trivially_copyable in Optional storage template specialization logic.
- Added test cases to OptionalTest.cpp which will fail compilation (verified on MSVC 16.8.3) if new conditions are absent from Optional storage template specialization logic.
Dec 17 2020
I spent some time root causing an llvm::Optional build error on MSVC 16.8.3 today related to using std::is_trivially_copyable to set llvm::is_trivially_copyable<T>::value. It looks like the same failure mentioned in this review.