Revision tags: llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3 |
|
#
266154a5 |
| 18-Oct-2024 |
David Blaikie <dblaikie@gmail.com> |
[ADT] Make concat able to handle ranges with iterators that return by value (such as zip) (#112783)
If any iterator in the concatenation returns by value, the result must
return by value otherwise
[ADT] Make concat able to handle ranges with iterators that return by value (such as zip) (#112783)
If any iterator in the concatenation returns by value, the result must
return by value otherwise it'll produce dangling references.
(some context that may or may not be relevant to this part of the code
may be in
https://github.com/llvm/llvm-project/commit/981ce8fa15afa11d083033240edb1daff29081c7
)
An alternative to #112441
show more ...
|
Revision tags: llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4 |
|
#
6b4b8dc4 |
| 28-Aug-2024 |
aws-taylor <57725958+aws-taylor@users.noreply.github.com> |
[ADT] Relax iterator constraints on all_equal (#106400)
The previous `all_equal` implementation contained `Begin + 1`, which
implicitly requires `Begin` to model the
[random_access_iterator](https
[ADT] Relax iterator constraints on all_equal (#106400)
The previous `all_equal` implementation contained `Begin + 1`, which
implicitly requires `Begin` to model the
[random_access_iterator](https://en.cppreference.com/w/cpp/iterator/random_access_iterator)
concept due to the usage of the `+` operator. By swapping this out with
`std::next`, this method can be used with weaker iterator concepts, such
as
[forward_iterator](https://en.cppreference.com/w/cpp/iterator/forward_iterator).
---------
Co-authored-by: Jakub Kuderski <kubakuderski@gmail.com>
show more ...
|
#
7a19194d |
| 21-Aug-2024 |
Rahul Joshi <rjoshi@nvidia.com> |
[NFC][ADT] Add unit test for llvm::mismatch. (#105459)
- Add basic unit test for llvm::mismatch.
|
Revision tags: llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4 |
|
#
c8f3d211 |
| 06-Apr-2024 |
Jakub Kuderski <jakub@nod-labs.com> |
[ADT] Allow reverse to find free rbegin/rend functions (#87840)
Lift the requirement that rbegin/rend must be member functions. Also
allow the rbegin/rend to be found through Argument Dependent Loo
[ADT] Allow reverse to find free rbegin/rend functions (#87840)
Lift the requirement that rbegin/rend must be member functions. Also
allow the rbegin/rend to be found through Argument Dependent Lookup
(ADL) and add `adl_rbegin`/`adl_rend` to STLExtras.
show more ...
|
Revision tags: llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3 |
|
#
19e71726 |
| 20-Feb-2024 |
Caroline Tice <cmtice@google.com> |
[LLVM][unittests] Fix type issue in STLExtrasTest.cpp
Fixes a type error in UniqueNoPred test, that is causing the ppc64le-lld-multistage-test buildbot to fail.
|
#
d7a73c91 |
| 20-Feb-2024 |
cmtice <cmtice@google.com> |
[LLVM][ADT] Put both vesions of 'unique' into STLExtras.h (#82312)
Currently there are two versions of llvm::unique, one that requires a
predicate, and is in STLExtras.h; and one that does not requ
[LLVM][ADT] Put both vesions of 'unique' into STLExtras.h (#82312)
Currently there are two versions of llvm::unique, one that requires a
predicate, and is in STLExtras.h; and one that does not require a
predicate, and is in GenericUniformityImpl.h. This moves the one from
GenericUniformityImp.h to STlExtras.h, so they are both together, and
can both be easily called from other places inside LLVM.
show more ...
|
Revision tags: llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4 |
|
#
4c28e666 |
| 24-Oct-2023 |
Jakub Kuderski <jakub@nod-labs.com> |
[ADT] Support appending multiple values (#69891)
This is so that we can append multiple values at once without having to
create a temporary array or repeatedly call `push_back`.
Use the new func
[ADT] Support appending multiple values (#69891)
This is so that we can append multiple values at once without having to
create a temporary array or repeatedly call `push_back`.
Use the new function `append_values` to clean up the SPIR-V serializer
code. (NFC)
show more ...
|
Revision tags: llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0 |
|
#
2e3d6940 |
| 06-Sep-2023 |
Jakub Kuderski <jakub@nod-labs.com> |
[ADT] Add detection utility for incomplete types (#65495)
This allows us to produce better error messages for types that were only
forward-declared, but where a full definition was expected.
The
[ADT] Add detection utility for incomplete types (#65495)
This allows us to produce better error messages for types that were only
forward-declared, but where a full definition was expected.
The first user will be https://reviews.llvm.org/D159013; this change is
sent to review separately to reduce the scope of the other patch.
show more ...
|
Revision tags: llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1 |
|
#
29818325 |
| 21-Mar-2023 |
Jakub Kuderski <kubakuderski@gmail.com> |
[ADT] Add `llvm::range_size` function for generic ranges
This function follows `std::ranges::size` from C++20. It is intended mainly for generic code that does not know the exact range type. I did n
[ADT] Add `llvm::range_size` function for generic ranges
This function follows `std::ranges::size` from C++20. It is intended mainly for generic code that does not know the exact range type. I did not modify the existing `llvm::size` function because it has a strict guarantee of O(1) running time, and we cannot guarantee that when we delegate size check to user-defined size functions.
Use `range_size` to optimize size checks in `zip`* and `enumerate` functions. Before that, we would have to perform linear scans for ranges without random access iterators.
This is the last change I have planned in the series that overhauls `zip`* and `enumerate`.
Reviewed By: dblaikie, zero9178
Differential Revision: https://reviews.llvm.org/D146231
show more ...
|
Revision tags: llvmorg-16.0.0 |
|
#
a0a76804 |
| 15-Mar-2023 |
Jakub Kuderski <kubak@google.com> |
[ADT] Allow `llvm::enumerate` to enumerate over multiple ranges
This does not work by a mere composition of `enumerate` and `zip_equal`, because C++17 does not allow for recursive expansion of struc
[ADT] Allow `llvm::enumerate` to enumerate over multiple ranges
This does not work by a mere composition of `enumerate` and `zip_equal`, because C++17 does not allow for recursive expansion of structured bindings.
This implementation uses `zippy` to manage the iteratees and adds the stream of indices as the first zipped range. Because we have an upfront assertion that all input ranges are of the same length, we only need to check if the second range has ended during iteration.
As a consequence of using `zippy`, `enumerate` will now follow the reference and lifetime semantics of the `zip*` family of functions. The main difference is that `enumerate` exposes each tuple of references through a new tuple-like type `enumerate_result`, with the familiar `.index()` and `.value()` member functions.
Because the `enumerate_result` returned on dereference is a temporary, enumeration result can no longer be used through an lvalue ref.
Reviewed By: dblaikie, zero9178
Differential Revision: https://reviews.llvm.org/D144503
show more ...
|
#
0eaacc25 |
| 15-Mar-2023 |
Jakub Kuderski <kubak@google.com> |
[ADT] Make llvm::is_contained call member `contains` or `find` when available
This makes it so that calling `llvm::is_contained` no longer degrades performance over member contains, even though both
[ADT] Make llvm::is_contained call member `contains` or `find` when available
This makes it so that calling `llvm::is_contained` no longer degrades performance over member contains, even though both have almost identical names. This would be the case in most set/map classes that can check for an element being present in O(1) or O(log n) time vs. linear scan with `std::find`. For C++17 maps/sets without `.contains`, use `.find` when available, falling back to a linear scan with `std::find`.
I also considered detecting member contains and triggering a `static_assert` instead, but decided against it because it's just as easy to do the right thing and call `.contains`. This would also make some code fail only when compiled in the C++20 mode when more container types come with `.contains` member functions.
This was actually already the case with `CommandLine.h` calling `is_contained` on `SmallPtrSet` and in a recent BOLT patch.
Reviewed By: kazu, dblaikie, MaskRay
Differential Revision: https://reviews.llvm.org/D146061
show more ...
|
Revision tags: llvmorg-16.0.0-rc4 |
|
#
73f2a3b6 |
| 08-Mar-2023 |
Florian Hahn <flo@fhahn.com> |
[STLExtras] Use std::get in less_first,less_second to support more types
Update less_first,less_second to use std::get to access the first and second component. This extends support to any type impl
[STLExtras] Use std::get in less_first,less_second to support more types
Update less_first,less_second to use std::get to access the first and second component. This extends support to any type implementing std::get, like tuples.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D145489
show more ...
|
#
010a9797 |
| 02-Mar-2023 |
Jakub Kuderski <kubak@google.com> |
[ADT] Drop append_range test that doesn't compile with EXPENSIVE_CHECKS
The issue seems to be caused by the definition of `SafeIntIterator` and is otherwise unrelated to the implementation of `appen
[ADT] Drop append_range test that doesn't compile with EXPENSIVE_CHECKS
The issue seems to be caused by the definition of `SafeIntIterator` and is otherwise unrelated to the implementation of `append_range`.
We have a simialr test below, so this does not meaningfully decrease the test coverage of `append_range`.
See the discussion in: https://reviews.llvm.org/D144420#4164373
Issue: https://github.com/llvm/llvm-project/issues/61122
show more ...
|
#
1527a1bf |
| 01-Mar-2023 |
Jakub Kuderski <kubak@google.com> |
[ADT] Use `adl_begin`/`end` in `enumerate`
This allows `enumerate` to work with range types that expose custom `begin`/`end` functions.
This is a cleanup in preparation for future changes in https:
[ADT] Use `adl_begin`/`end` in `enumerate`
This allows `enumerate` to work with range types that expose custom `begin`/`end` functions.
This is a cleanup in preparation for future changes in https://reviews.llvm.org/D144503.
Reviewed By: zero9178
Differential Revision: https://reviews.llvm.org/D145026
show more ...
|
#
da0d8165 |
| 28-Feb-2023 |
Jakub Kuderski <kubak@google.com> |
[ADT] Fix definition of `adl_begin`/`adl_end` and `Iter`/`ValueOfRange`
- Make `IterOfRange` and `ValueOfRange` work with types that require custom `begin`/`end` functions. - Allow for `adl_begin`
[ADT] Fix definition of `adl_begin`/`adl_end` and `Iter`/`ValueOfRange`
- Make `IterOfRange` and `ValueOfRange` work with types that require custom `begin`/`end` functions. - Allow for `adl_begin`/`adl_end` to be used in constant-evaluated contexts. - Use SFINAE-friendly trailing return type deductions `adl_begin`/`adl_end` so that they are useable in template argument deduction. - Add missing documentation comments.
This is required for future work in https://reviews.llvm.org/D144503.
Reviewed By: dblaikie, zero9178
Differential Revision: https://reviews.llvm.org/D144583
show more ...
|
Revision tags: llvmorg-16.0.0-rc3 |
|
#
d9f309c5 |
| 21-Feb-2023 |
Jakub Kuderski <kubak@google.com> |
Reland "[ADT] Relax type requirements for `is_contained`"
|
#
a5aca5b2 |
| 21-Feb-2023 |
Jakub Kuderski <kubak@google.com> |
Revert "[ADT] Relax type requirements for `is_contained`"
This reverts commit 75272d5c1299db93aa619fc9e616832f578726c2.
This fails to compile on the clang-debian-cpp20 buildbot: https://lab.llvm.or
Revert "[ADT] Relax type requirements for `is_contained`"
This reverts commit 75272d5c1299db93aa619fc9e616832f578726c2.
This fails to compile on the clang-debian-cpp20 buildbot: https://lab.llvm.org/buildbot#builders/249/builds/945.
show more ...
|
#
93a971cc |
| 21-Feb-2023 |
Jakub Kuderski <kubak@google.com> |
[STLExtras] Allow for non-member `begin`/`end` in `append_range`
This makes `append_range` useable with, C arrays and types with custom `begin`/`end` functions.
Reviewed By: kazu
Differential Revi
[STLExtras] Allow for non-member `begin`/`end` in `append_range`
This makes `append_range` useable with, C arrays and types with custom `begin`/`end` functions.
Reviewed By: kazu
Differential Revision: https://reviews.llvm.org/D144420
show more ...
|
#
75272d5c |
| 21-Feb-2023 |
Jakub Kuderski <kubak@google.com> |
[ADT] Relax type requirements for `is_contained`
- Do not require both the `Set` and `Element` to be exactly the same type and, instead, only require them to be comparable. - Do not require `Element
[ADT] Relax type requirements for `is_contained`
- Do not require both the `Set` and `Element` to be exactly the same type and, instead, only require them to be comparable. - Do not require `Element` to be copyable. - Add missing documentation comment.
Reviewed By: beanz
Differential Revision: https://reviews.llvm.org/D144416
show more ...
|
Revision tags: llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2, llvmorg-15.0.1 |
|
#
6b49f30f |
| 19-Sep-2022 |
Kazu Hirata <kazu@google.com> |
[llvm] Deprecate llvm::empty (NFC)
This patch deprecates llvm::empty as I've migrated all known uses of llvm::empty(x) to x.empty().
Differential Revision: https://reviews.llvm.org/D134141
|
Revision tags: llvmorg-15.0.0, llvmorg-15.0.0-rc3 |
|
#
6fa87ec1 |
| 23-Aug-2022 |
Jakub Kuderski <kubak@google.com> |
[ADT] Deprecate is_splat and replace all uses with all_equal
See the discussion thread for more details: https://discourse.llvm.org/t/adt-is-splat-and-empty-ranges/64692
Reviewed By: dblaikie
Diff
[ADT] Deprecate is_splat and replace all uses with all_equal
See the discussion thread for more details: https://discourse.llvm.org/t/adt-is-splat-and-empty-ranges/64692
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D132335
show more ...
|
#
c9e52fbe |
| 23-Aug-2022 |
Jakub Kuderski <kubak@google.com> |
[ADT] Add all_equal predicate
`llvm::all_equal` checks if all values in the given range are equal, i.e., there are no two elements that are not equal. Similar to `llvm::all_of`, it returns `true` wh
[ADT] Add all_equal predicate
`llvm::all_equal` checks if all values in the given range are equal, i.e., there are no two elements that are not equal. Similar to `llvm::all_of`, it returns `true` when the range is empty.
`llvm::all_equal` is intended to supersede `llvm::is_splat`, which will be deprecated and removed in future patches. See the discussion thread for more details: https://discourse.llvm.org/t/adt-is-splat-and-empty-ranges/64692.
Reviewed By: dblaikie, shchenz
Differential Revision: https://reviews.llvm.org/D132334
show more ...
|
#
205701fd |
| 09-Aug-2022 |
Markus Böck <markus.boeck02@gmail.com> |
[llvm][ADT] Allow using structured bindings with `llvm::enumerate`
This patch adds the ability to deconstruct the `value_type` returned by `llvm::enumarate` into index and value of the wrapping rang
[llvm][ADT] Allow using structured bindings with `llvm::enumerate`
This patch adds the ability to deconstruct the `value_type` returned by `llvm::enumarate` into index and value of the wrapping range. Main use case is the common occurence of using it during loop iteration. After this patch it'd then be possible to write code such as: ``` for (auto [index, value] : enumerate(container)) { ... } ``` where `index` is the current index and `value` a reference to elements in the given container.
Differential Revision: https://reviews.llvm.org/D131486
show more ...
|
Revision tags: llvmorg-15.0.0-rc2 |
|
#
29602999 |
| 08-Aug-2022 |
Benjamin Kramer <benny.kra@googlemail.com> |
[ADT] Retire llvm::apply_tuple in favor of C++17 std::apply
|
#
ba9dc5f5 |
| 08-Aug-2022 |
Jakub Kuderski <kubak@google.com> |
[ADT] Add is_splat overload accepting initializer_list
Allow for `is_splat` to be used inline, similar to `is_contained`, e.g., ``` if (is_splat({type1, type2, type3, type4})) ... ```
which is mu
[ADT] Add is_splat overload accepting initializer_list
Allow for `is_splat` to be used inline, similar to `is_contained`, e.g., ``` if (is_splat({type1, type2, type3, type4})) ... ```
which is much more concise and less typo-prone than an equivalent chain of equality comparisons.
My immediate motivation is to clean up some code in the SPIR-V dialect that currently needs to either construct a temporary container or use `makeArrayRef` before calling `is_splat`.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D131289
show more ...
|