-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
optimize Range[Inclusive].count() #48024
Conversation
r? @KodrAus (rust_highfive has picked a reviewer for you, use r? to override) |
The
|
Apparently last time this was tried, it hit type inference weirdness: #39975 (comment) Maybe that's what's causing the travis failure? Also, is this even needed? There's |
☔ The latest upstream changes (presumably #48040) made this pull request unmergeable. Please resolve the merge conflicts. |
Sorry, I should have said that with #48012 (part of the conflicting merge commit above), LLVM will also unloop the (Now, llvm is being a bit dumb here, since it's explicitly branching to return If we do want to do this, I think it can be done for everything, not just built-ins, by just returning |
@llogiq Ping from triage; is this ready for re-review? |
I'm going to close this for now, now that #48012 has landed, the wins are negligible. |
This special-cases count() for ranges to reduce them to simple arithmetic.
Open questions: