-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use TrustedRandomAccess for loop desugaring #93243
Commits on Apr 19, 2022
-
Configuration menu - View commit details
-
Copy full SHA for c7e60e7 - Browse repository at this point
Copy the full SHA c7e60e7View commit details -
This aligns the inline attributes of existing `__iterator_get_uncheck…
…ed` with those of `next()` on adapters that have both. It improves the performance of iterators using unchecked access when building in incremental mode (due to the larger CGU count?). It might negatively affect incremental compile times for better runtime results, but considering that the equivalent `next()` implementations also are `#[inline]` and usually are more complex this should be ok. ``` ./x.py bench library/core -i --stage 0 --test-args bench_trusted_random_access OLD: 119,172 ns/iter NEW: 17,714 ns/iter ```
Configuration menu - View commit details
-
Copy full SHA for f6dea97 - Browse repository at this point
Copy the full SHA f6dea97View commit details -
Configuration menu - View commit details
-
Copy full SHA for f1b9b12 - Browse repository at this point
Copy the full SHA f1b9b12View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0eacaab - Browse repository at this point
Copy the full SHA 0eacaabView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7d10caf - Browse repository at this point
Copy the full SHA 7d10cafView commit details -
Remove fake IntoIterator trait, invoke ForLoopDesugar directly and ru…
…n cleanup on drop The on-drop cleanup will enable using TRA in try_fold(&mut self) and implementing TRA for &mut Iterator
Configuration menu - View commit details
-
Copy full SHA for 0b534b3 - Browse repository at this point
Copy the full SHA 0b534b3View commit details -
This removes all TrustedRandomAccess specialization from Zip, which means Zip::next no longer gets optimized as well. But since for loop desugaring uses TRA we retain most of the benefits. We're still losing optimizations on fold, try_fold and reverse iteration. But those can be re-specialized more easily.
Configuration menu - View commit details
-
Copy full SHA for a56524a - Browse repository at this point
Copy the full SHA a56524aView commit details -
Reimplement TrustedRandomAccess specializations for Zip::fold and Zip…
…::try_fold Previously these optimizations automatically fell out of the default implementation for `fold` and `try_fold` because `next()` was specialized. Since that is gone we now need to implement it explicitly.
Configuration menu - View commit details
-
Copy full SHA for e6d6e5c - Browse repository at this point
Copy the full SHA e6d6e5cView commit details -
Configuration menu - View commit details
-
Copy full SHA for a66cd5b - Browse repository at this point
Copy the full SHA a66cd5bView commit details -
remove TrustedRandomAccess vs. TrustedRandomAccessNoCoerce distinction
TRA is no longer used for single-step (`next()`) specializations, only loops and after each loop we bring the iterator back into a safe state, meaning coercions are now safe because the user code will not have access to an iterator instance that would be unsafe to coerce.
Configuration menu - View commit details
-
Copy full SHA for aec6846 - Browse repository at this point
Copy the full SHA aec6846View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9686822 - Browse repository at this point
Copy the full SHA 9686822View commit details
Commits on Apr 20, 2022
-
Use marker/specialization traits instead of associated consts to sign…
…al the need for pre/post loop calls The loop setup and cleanup functions are only required for some specific iterators. To avoid emitting IR when they're not needed even in debug mode we need to use the type system instead of const-DCE because the constants would only be known after monomorphization.
Configuration menu - View commit details
-
Copy full SHA for 14f829a - Browse repository at this point
Copy the full SHA 14f829aView commit details -
use separate methods for forward and backward cleanup
This reduces the amount of IR generated when post-loop cleanup is needed
Configuration menu - View commit details
-
Copy full SHA for ffff194 - Browse repository at this point
Copy the full SHA ffff194View commit details