The implementation makes use of the freedom added by LWG 3410. We have two variants of this algorithm: * a fast path for random access iterators: This fast path computes the maximum number of loop iterations up-front and does not compare the iterators against their limits on every loop iteration. * A basic implementation for all other iterators: This implementation compares the iterators against their limits in every loop iteration. However, it still takes advantage of the freedom added by LWG 3410 to avoid unnecessary additional iterator comparisons, as originally specified by P1614R2. https://godbolt.org/z/7xbMEen5e shows the benefit of the fast path: The hot loop generated of `lexicographical_compare_three_way3` is more tight than for `lexicographical_compare_three_way1`. The added benchmark illustrates how this leads to a 30% - 50% performance improvement on integer vectors. Implements part of P1614R2 "The Mothership has Landed" Fixes LWG 3410 and LWG 3350 Differential Revision: https://reviews.llvm.org/D131395
8.7 KiB
8.7 KiB
| 1 | Section | Description | Dependencies | Assignee | Complete |
|---|---|---|---|---|---|
| 2 | | `[cmp.concept] <https://wg21.link/cmp.concept>`_ | | `three_way_comparable <https://reviews.llvm.org/D103478>`_ | `three_way_comparable_with <https://reviews.llvm.org/D103478>`_ | None | Ruslan Arutyunyan | |Complete| |
| 3 | | `[cmp.result] <https://wg21.link/cmp.result>`_ | | `compare_three_way_result <https://reviews.llvm.org/D103581>`_ | None | Arthur O'Dwyer | |Complete| |
| 4 | | `[expos.only.func] <https://wg21.link/expos.only.func>`_ | | `synth-three-way <https://reviews.llvm.org/D107721>`_ | `synth-three-way-result <https://reviews.llvm.org/D107721>`_ | [cmp.concept] | Kent Ross | |Complete| |
| 5 | | `[comparisons.three.way] <https://wg21.link/comparisons.three.way>`_ | | `compare_three_way <https://reviews.llvm.org/D80899>`_ | [cmp.concept] | Arthur O'Dwyer | |Complete| |
| 6 | | `[cmp.alg] <https://wg21.link/cmp.alg>`_ | | `strong_order <https://reviews.llvm.org/D110738>`_ | `weak_order <https://reviews.llvm.org/D110738>`_ | `partial_order <https://reviews.llvm.org/D110738>`_ | `strong_order_fallback <https://reviews.llvm.org/D111514>`_ | `weak_order_fallback <https://reviews.llvm.org/D111514>`_ | `partial_order_fallback <https://reviews.llvm.org/D111514>`_ | None | Arthur O'Dwyer | |Complete| [#note-strongorder]_ |
| 7 | | `[alg.three.way] <https://wg21.link/alg.three.way>`_ | | `lexicographical_compare_three_way <https://reviews.llvm.org/D131395>`_ | [comparisons.three.way] | Adrian Vogelsgesang | |Complete| |
| 8 | | `[type.info] <https://wg21.link/type.info>`_ | | `typeinfo <https://reviews.llvm.org/D130853>`_ | None | Adrian Vogelsgesang | |Complete| |
| 9 | | `[coroutine.handle.compare] <https://wg21.link/coroutine.handle.compare>`_ | | `coroutine_handle <https://reviews.llvm.org/D109433>`_ | [comparisons.three.way] | Chuanqi Xu | |Complete| |
| 10 | | `[pairs.spec] <https://wg21.link/pairs.spec>`_ | | `pair <https://reviews.llvm.org/D107721>`_ | [expos.only.func] | Kent Ross | |Complete| |
| 11 | | `[syserr.errcat.nonvirtuals] <https://wg21.link/syserr.errcat.nonvirtuals>`_ | | `error_category <https://reviews.llvm.org/D131363>`_ | [comparisons.three.way] | Adrian Vogelsgesang | |Complete| |
| 12 | | `[syserr.compare] <https://wg21.link/syserr.compare>`_ | | `error_code <https://reviews.llvm.org/D131371>`_ | `error_condition <https://reviews.llvm.org/D131371>`_ | None | Adrian Vogelsgesang | |Complete| |
| 13 | | `[tuple.rel] <https://wg21.link/tuple.rel>`_ | | `tuple <https://reviews.llvm.org/D108250>`_ | [expos.only.func] | Kent Ross | |Complete| |
| 14 | | `[optional.relops] <https://wg21.link/optional.relops>`_ | `[optional.nullops] <https://wg21.link/optional.nullops>`_ | `[optional.comp.with.t] <https://wg21.link/optional.comp.with.t>`_ | | optional | nullopt | None | Kent Ross | |In Progress| |
| 15 | | `[variant.relops] <https://wg21.link/variant.relops>`_ | `[variant.monostate.relops] <https://wg21.link/variant.monostate.relops>`_ | | `monostate <https://reviews.llvm.org/D131372>`_ | `variant <https://reviews.llvm.org/D131372>`_ | None | Kent Ross | |Complete| |
| 16 | | `[unique.ptr.special] <https://wg21.link/unique.ptr.special>`_ | | `unique_ptr <https://reviews.llvm.org/D130838>`_ | [comparisons.three.way] | Adrian Vogelsgesang | |Complete| |
| 17 | | `[util.smartptr.shared.cmp] <https://wg21.link/util.smartptr.shared.cmp>`_ | | `shared_ptr <https://reviews.llvm.org/D130852>`_ | [comparisons.three.way] | Adrian Vogelsgesang | |Complete| |
| 18 | | `[type.index.members] <https://wg21.link/type.index.members>`_ | | `type_index <https://reviews.llvm.org/D131357>`_ | None | Adrian Vogelsgesang | |Complete| |
| 19 | | `[charconv.syn] <https://wg21.link/charconv.syn>`_ | | `to_chars_result <https://reviews.llvm.org/D112366>`_ | None | Mark de Wever | |Complete| |
| 20 | | `[charconv.syn] <https://wg21.link/charconv.syn>`_ | | `from_chars_result <https://reviews.llvm.org/D112366>`_ | None | Mark de Wever | |Complete| |
| 21 | | `[stacktrace.entry.cmp] <https://wg21.link/stacktrace.entry.cmp>`_ | | stacktrace_entry | None | Unassigned | |Not Started| |
| 22 | | `[stacktrace.basic.cmp] <https://wg21.link/stacktrace.basic.cmp>`_ | | basic_stacktrace | [alg.three.way] | Unassigned | |Not Started| |
| 23 | | `[string.cmp] <https://wg21.link/string.cmp>`_ | | `basic_string <https://reviews.llvm.org/D131421>`_ | None | Mark de Wever | |Complete| |
| 24 | | `[string.view.comparison] <https://wg21.link/string.view.comparison>`_ | | `basic_string_view <https://reviews.llvm.org/D130295>`_ | None | Mark de Wever | |Complete| |
| 25 | | `[array.syn] <https://wg21.link/array.syn>`_ (`general <https://wg21.link/container.opt.reqmts>`_) | | `array <https://reviews.llvm.org/D132265>`_ | [expos.only.func] | Adrian Vogelsgesang | |In Progress| |
| 26 | | `[deque.syn] <https://wg21.link/deque.syn>`_ (`general <https://wg21.link/container.opt.reqmts>`_) | | deque | [expos.only.func] | Unassigned | |Not Started| |
| 27 | | `[forward.list.syn] <https://wg21.link/forward.list.syn>`_ (`general <https://wg21.link/container.opt.reqmts>`_) | | forward_list | [expos.only.func] | Unassigned | |Not Started| |
| 28 | | `[list.syn] <https://wg21.link/list.syn>`_ (`general <https://wg21.link/container.opt.reqmts>`_) | | list | [expos.only.func] | Unassigned | |Not Started| |
| 29 | | `[vector.syn] <https://wg21.link/vector.syn>`_ (`general <https://wg21.link/container.opt.reqmts>`_) | | `vector <https://reviews.llvm.org/D132268>`_ | [expos.only.func] | Adrian Vogelsgesang | |In Progress| |
| 30 | | `[associative.map.syn] <https://wg21.link/associative.map.syn>`_ (`general <https://wg21.link/container.opt.reqmts>`_) | | map | multimap | [expos.only.func] | Unassigned | |Not Started| |
| 31 | | `[associative.set.syn] <https://wg21.link/associative.set.syn>`_ (`general <https://wg21.link/container.opt.reqmts>`_) | | multiset | set | [expos.only.func] | Unassigned | |Not Started| |
| 32 | | `[queue.ops] <https://wg21.link/queue.ops>`_ | | queue | None | Unassigned | |Not Started| |
| 33 | | `[stack.ops] <https://wg21.link/stack.ops>`_ | | stack | None | Unassigned | |Not Started| |
| 34 | | `[reverse.iter.cmp] <https://wg21.link/reverse.iter.cmp>`_ | | `reverse_iterator <https://reviews.llvm.org/D113695>`_ | None | Mikhail Maltsev | |Complete| |
| 35 | | `[move.iter.op.comp] <https://wg21.link/move.iter.op.comp>`_ | | move_iterator | None | Unassigned | |Not Started| |
| 36 | | `[counted.iter.cmp] <https://wg21.link/counted.iter.cmp>`_ | | counted_iterator | None | Unassigned | |Not Started| |
| 37 | | `[range.iota.iterator] <https://wg21.link/range.iota.iterator>`_ | | `ranges::iota_view::iterator <https://reviews.llvm.org/D110774>`_ | [concepts.cmp] | Arthur O'Dwyer | |Complete| |
| 38 | | `[range.transform.iterator] <https://wg21.link/range.transform.iterator>`_ | | `ranges::transform_view::iterator <https://reviews.llvm.org/D110774>`_ | [concepts.cmp] | Arthur O'Dwyer | |Complete| |
| 39 | | `[range.elements.iterator] <https://wg21.link/range.elements.iterator>`_ | | ranges::elements_view::iterator | [concepts.cmp] | Hui Xie | |Complete| |
| 40 | | `[time.duration.comparisons] <https://wg21.link/time.duration.comparisons>`_ | chrono::duration | None | Mark de Wever | |Not Started| |
| 41 | | `[time.point.comparisons] <https://wg21.link/time.point.comparisons>`_ | chrono::time_point | None | Mark de Wever | |Not Started| |
| 42 | | `[time.cal.day.nonmembers] <https://wg21.link/time.cal.day.nonmembers>`_ | `[time.cal.month.nonmembers] <https://wg21.link/time.cal.month.nonmembers>`_ | `[time.cal.year.nonmembers] <https://wg21.link/time.cal.year.nonmembers>`_ | `[time.cal.md.nonmembers] <https://wg21.link/time.cal.md.nonmembers>`_ | `[time.cal.mdlast] <https://wg21.link/time.cal.mdlast>`_ | `[time.cal.ym.nonmembers] <https://wg21.link/time.cal.ym.nonmembers>`_ | `[time.cal.ymd.nonmembers] <https://wg21.link/time.cal.ymd.nonmembers>`_ | `[time.cal.ymdlast.nonmembers] <https://wg21.link/time.cal.ymdlast.nonmembers>`_ | | `chrono::day <https://reviews.llvm.org/D129887>`_ | `chrono::month <https://reviews.llvm.org/D129887>`_ | `chrono::year <https://reviews.llvm.org/D129887>`_ | `chrono::month_day <https://reviews.llvm.org/D129887>`_ | `chrono::month_day_last <https://reviews.llvm.org/D129887>`_ | `chrono::year_month <https://reviews.llvm.org/D129887>`_ | `chrono::year_month_day <https://reviews.llvm.org/D129887>`_ | `chrono::year_month_day_last <https://reviews.llvm.org/D129887>`_ | None | Mark de Wever | |Complete| |
| 43 | | `[time.zone.nonmembers] <https://wg21.link/time.zone.nonmembers>`_ | `[time.zone.leap.nonmembers] <https://wg21.link/time.zone.leap.nonmembers>`_ | `[time.zone.link.nonmembers] <https://wg21.link/time.zone.link.nonmembers>`_ | | chrono::time_zone | chrono::leap_second | chrono::time_zone_link | A ``<chrono>`` implementation | Unassigned | |Not Started| |
| 44 | | `[fs.filesystem.syn] <https://wg21.link/fs.filesystem.syn>`_ | | `filesystem::space_info <https://reviews.llvm.org/D130861>`_ | None | Adrian Vogelsgesang | |Complete| |
| 45 | | `[fs.path.nonmember] <https://wg21.link/fs.path.nonmember>`_ | | `filesystem::path <https://reviews.llvm.org/D130859>`_ | None | Adrian Vogelsgesang | |Complete| |
| 46 | | `[fs.dir.entry.obs] <https://wg21.link/fs.dir.entry.obs>`_ | | `filesystem::directory_entry <https://reviews.llvm.org/D130860>`_ | None | Adrian Vogelsgesang | |Complete| |
| 47 | | `[re.submatch.op] <https://wg21.link/re.submatch.op>`_ | | sub_match | None | Mark de Wever | |In Progress| |
| 48 | | `[thread.thread.id] <https://wg21.link/thread.thread.id>`_ | | `thread::id <https://reviews.llvm.org/D131362>`_ | None | Adrian Vogelsgesang | |Complete| |