Adrian Vogelsgesang
2a06757a20
[libc++][spaceship] Implement lexicographical_compare_three_way
...
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
2023-02-12 14:51:08 -08:00
..
2022-11-22 16:33:38 +08:00
2022-08-19 15:35:02 +02:00
2022-08-19 15:35:02 +02:00
2022-10-01 22:49:36 +02:00
2022-08-04 02:45:32 -07:00
2023-01-12 18:28:41 +01:00
2022-11-22 16:33:38 +08:00
2023-01-19 20:11:43 +01:00
2022-08-19 15:35:02 +02:00
2023-01-13 16:57:13 -08:00
2022-08-19 15:35:02 +02:00
2023-01-19 20:11:43 +01:00
2022-08-19 15:35:02 +02:00
2022-08-19 15:35:02 +02:00
2022-10-01 22:49:36 +02:00
2022-11-22 16:33:38 +08:00
2022-08-19 15:35:02 +02:00
2022-08-19 15:35:02 +02:00
2022-11-22 16:33:38 +08:00
2022-11-22 16:33:38 +08:00
2022-08-19 15:35:02 +02:00
2022-08-19 15:35:02 +02:00
2022-08-19 15:35:02 +02:00
2022-08-19 15:35:02 +02:00
2022-08-19 15:35:02 +02:00
2022-08-19 15:35:02 +02:00
2022-08-19 15:35:02 +02:00
2022-09-06 19:09:42 +02:00
2022-08-18 16:59:58 -04:00
2022-08-18 16:59:58 -04:00
2022-08-18 16:59:58 -04:00
2022-08-18 16:59:58 -04:00
2022-08-18 16:59:58 -04:00
2022-08-18 16:59:58 -04:00
2022-10-01 22:49:36 +02:00
2022-10-01 22:49:36 +02:00
2022-10-01 22:49:36 +02:00
2022-10-01 22:49:36 +02:00
2022-08-19 15:35:02 +02:00
2022-11-22 16:33:38 +08:00
2022-10-01 22:49:36 +02:00
2022-10-01 22:49:36 +02:00
2023-01-12 18:28:41 +01:00
2022-12-23 02:58:06 +01:00
2023-02-12 14:51:08 -08:00
2022-10-01 22:49:36 +02:00
2022-08-19 15:35:02 +02:00
2022-10-01 22:49:36 +02:00
2022-08-18 16:59:58 -04:00
2022-10-01 22:49:36 +02:00
2023-01-30 18:01:46 +01:00
2022-10-01 22:49:36 +02:00
2022-10-01 22:49:36 +02:00
2022-08-18 16:59:58 -04:00
2023-01-30 18:01:46 +01:00
2022-08-19 15:35:02 +02:00
2023-01-30 18:01:46 +01:00
2022-11-22 16:33:38 +08:00
2023-01-19 20:11:43 +01:00
2023-01-19 20:11:43 +01:00
2022-10-01 22:49:36 +02:00
2022-08-19 15:35:02 +02:00
2022-10-01 22:49:36 +02:00
2022-10-01 22:49:36 +02:00
2023-01-07 17:19:16 +08:00
2022-08-19 15:35:02 +02:00
2022-08-19 15:35:02 +02:00
2022-09-06 19:09:42 +02:00
2022-10-01 22:49:36 +02:00
2022-10-01 22:49:36 +02:00
2022-10-01 22:49:36 +02:00
2022-11-05 16:38:46 +01:00
2022-11-05 16:38:46 +01:00
2022-11-05 16:38:46 +01:00
2022-11-05 16:38:46 +01:00
2022-11-05 16:38:46 +01:00
2023-01-13 16:57:13 -08:00
2022-08-18 16:59:58 -04:00
2023-01-13 16:57:13 -08:00
2023-01-13 16:57:13 -08:00
2022-11-05 16:38:46 +01:00
2022-11-05 16:38:46 +01:00
2022-11-05 16:38:46 +01:00
2022-11-05 16:38:46 +01:00
2022-08-18 16:59:58 -04:00
2022-08-18 16:59:58 -04:00
2022-11-05 16:38:46 +01:00
2022-11-05 16:38:46 +01:00
2022-11-05 16:38:46 +01:00
2022-11-05 16:38:46 +01:00
2022-11-05 16:38:46 +01:00
2022-08-18 16:59:58 -04:00
2022-08-18 16:59:58 -04:00
2022-08-18 16:59:58 -04:00
2022-08-18 16:59:58 -04:00
2022-11-05 16:38:46 +01:00
2022-08-18 16:59:58 -04:00
2022-11-05 16:38:46 +01:00
2022-11-05 16:38:46 +01:00
2022-11-05 16:38:46 +01:00
2022-11-05 16:38:46 +01:00
2022-11-05 16:38:46 +01:00
2022-11-05 16:38:46 +01:00
2022-12-23 02:58:06 +01:00
2022-11-05 16:38:46 +01:00
2022-11-05 16:38:46 +01:00
2022-08-18 16:59:58 -04:00
2022-11-05 16:38:46 +01:00
2023-01-30 18:01:46 +01:00
2022-09-06 19:09:42 +02:00
2022-11-05 16:38:46 +01:00
2023-01-30 18:01:46 +01:00
2022-11-05 16:38:46 +01:00
2023-01-30 18:01:46 +01:00
2022-11-05 16:38:46 +01:00
2023-01-13 16:57:13 -08:00
2023-01-13 16:57:13 -08:00
2022-09-05 12:36:41 +02:00
2022-11-05 16:38:46 +01:00
2022-08-18 16:59:58 -04:00
2022-09-05 12:36:41 +02:00
2022-09-05 12:36:41 +02:00
2022-09-06 19:09:42 +02:00
2022-08-18 16:59:58 -04:00
2022-09-06 19:09:42 +02:00
2022-08-18 16:59:58 -04:00
2022-09-05 12:36:41 +02:00
2022-08-18 16:59:58 -04:00
2022-08-18 16:59:58 -04:00
2022-08-18 16:59:58 -04:00
2022-11-05 16:38:46 +01:00
2022-11-05 16:38:46 +01:00
2022-08-18 16:59:58 -04:00
2022-08-18 16:59:58 -04:00
2022-08-18 16:59:58 -04:00
2022-08-18 16:59:58 -04:00
2022-08-18 16:59:58 -04:00
2022-08-18 16:59:58 -04:00
2022-08-18 16:59:58 -04:00
2022-08-18 16:59:58 -04:00
2022-08-18 16:59:58 -04:00
2022-12-23 15:42:13 +01:00
2022-11-05 16:38:46 +01:00
2023-01-13 16:57:13 -08:00
2022-08-18 16:59:58 -04:00
2023-01-13 16:57:13 -08:00
2023-01-13 16:57:13 -08:00
2022-08-18 16:59:58 -04:00
2022-08-18 16:59:58 -04:00
2022-08-18 16:59:58 -04:00
2022-09-06 19:09:42 +02:00
2022-08-18 16:59:58 -04:00
2022-08-18 16:59:58 -04:00
2022-08-18 16:59:58 -04:00
2022-09-05 12:36:41 +02:00
2022-11-05 16:38:46 +01:00
2022-11-05 16:38:46 +01:00
2022-08-19 15:35:02 +02:00
2022-08-19 15:35:02 +02:00
2022-08-19 15:35:02 +02:00
2022-08-19 15:35:02 +02:00
2022-08-19 15:35:02 +02:00
2022-08-19 15:35:02 +02:00
2022-08-19 15:35:02 +02:00
2022-08-19 15:35:02 +02:00
2022-08-19 15:35:02 +02:00
2022-08-19 15:35:02 +02:00
2022-08-19 15:35:02 +02:00
2023-01-13 16:57:13 -08:00
2022-08-02 22:34:23 -07:00
2022-11-22 16:33:38 +08:00
2022-11-22 16:33:38 +08:00
2023-01-13 16:57:13 -08:00
2022-10-01 22:49:36 +02:00
2023-01-13 16:57:13 -08:00
2023-01-13 16:57:13 -08:00
2022-03-01 08:20:24 -05:00
2022-03-01 08:20:24 -05:00
2022-12-27 02:32:16 +01:00
2022-08-19 15:35:02 +02:00
2022-10-01 22:49:36 +02:00
2023-02-11 20:03:53 +01:00
2022-10-17 17:42:00 +02:00
2022-10-01 22:49:36 +02:00
2022-08-19 15:35:02 +02:00
2023-02-12 14:51:08 -08:00
2022-08-19 15:35:02 +02:00
2022-09-06 19:09:42 +02:00
2022-11-22 16:33:38 +08:00
2022-11-22 16:33:38 +08:00
2022-12-23 02:58:06 +01:00
2022-08-18 16:59:58 -04:00
2022-08-19 15:35:02 +02:00