rust/src/libcore/tests
Mazdak Farrokhzad f19bec89d7
Rollup merge of #58122 - matthieu-m:range_incl_perf, r=dtolnay
RangeInclusive internal iteration performance improvement.

Specialize `Iterator::try_fold` and `DoubleEndedIterator::try_rfold` to improve code generation in all internal iteration scenarios.

This changes brings the performance of internal iteration with `RangeInclusive` on par with the performance of iteration with `Range`:

 - Single conditional jump in hot loop,
 - Unrolling and vectorization,
 - And even Closed Form substitution.

Unfortunately, it only applies to internal iteration. Despite various attempts at stream-lining the implementation of `next` and `next_back`, LLVM has stubbornly refused to optimize external iteration appropriately, leaving me with a choice between:

 - The current implementation, for which Closed Form substitution is performed, but which uses 2 conditional jumps in the hot loop when optimization fail.
 - An implementation using a `is_done` boolean, which uses 1 conditional jump in the hot loop when optimization fail, allowing unrolling and vectorization, but for which Closed Form substitution fails.

In the absence of any conclusive evidence as to which usecase matters most, and with no assurance that the lack of Closed Form substitution is not indicative of other optimizations being foiled, there is no way
to pick one implementation over the other, and thus I defer to the statu quo as far as `next` and `next_back` are concerned.
2019-02-23 09:25:12 +01:00
..
fmt review failures in btree, string 2019-02-13 18:21:13 +01:00
hash review or fix remaining miri failures in libcore 2019-02-13 18:21:13 +01:00
num review or fix remaining miri failures in libcore 2019-02-13 18:21:13 +01:00
any.rs Remove licenses 2018-12-25 21:08:33 -07:00
array.rs Remove licenses 2018-12-25 21:08:33 -07:00
ascii.rs Remove licenses 2018-12-25 21:08:33 -07:00
atomic.rs Remove licenses 2018-12-25 21:08:33 -07:00
cell.rs review or fix miri failures in iter, slice, cell, time 2019-02-13 17:56:43 +01:00
char.rs Remove licenses 2018-12-25 21:08:33 -07:00
clone.rs Remove licenses 2018-12-25 21:08:33 -07:00
cmp.rs Remove licenses 2018-12-25 21:08:33 -07:00
intrinsics.rs Remove licenses 2018-12-25 21:08:33 -07:00
iter.rs Rollup merge of #58122 - matthieu-m:range_incl_perf, r=dtolnay 2019-02-23 09:25:12 +01:00
lib.rs Stabilize iter::from_fn 2019-02-19 14:10:07 +01:00
manually_drop.rs Remove licenses 2018-12-25 21:08:33 -07:00
mem.rs Remove licenses 2018-12-25 21:08:33 -07:00
nonzero.rs Add signed num::NonZeroI* types 2019-01-17 17:32:55 +01:00
ops.rs Remove licenses 2018-12-25 21:08:33 -07:00
option.rs mark failures expected due to panics 2019-02-13 17:56:43 +01:00
pattern.rs Remove licenses 2018-12-25 21:08:33 -07:00
ptr.rs Remove UB in test_ptr_subtraction test 2019-02-17 13:04:48 +01:00
result.rs mark failures expected due to panics 2019-02-13 17:56:43 +01:00
slice.rs review or fix miri failures in iter, slice, cell, time 2019-02-13 17:56:43 +01:00
str.rs Remove licenses 2018-12-25 21:08:33 -07:00
str_lossy.rs Remove licenses 2018-12-25 21:08:33 -07:00
time.rs the formatting issue got fixed 2019-02-13 18:21:13 +01:00
tuple.rs Remove licenses 2018-12-25 21:08:33 -07:00