Uh oh!
There was an error while loading. Please reload this page.
std: use ptr.offset where possible in the vec iterator. - #8225
Closed
huonw wants to merge 2 commits into
Closed
Conversation
huonw
commented
Aug 2, 2013
ContributorAuthor
r? @thestinger |
thestinger
commented
Aug 2, 2013
Contributor
\o/ |
bors added a commit
that referenced
this pull request
Aug 2, 2013
Closes#8212. Before: ```llvm %sum.028 = phi i64 [ %23, %match_else ], [ 0, %"normal return" ] %.sroa.0.027 = phi i64* [ %21, %match_else ], [ %12, %"normal return" ] %19 = ptrtoint i64* %.sroa.0.027 to i64 %20 = add i64 %19, 8 %21 = inttoptr i64 %20 to i64* %22 = load i64* %.sroa.0.027, align 8 %23 = add i64 %22, %sum.028 %24 = inttoptr i64 %20 to %"enum.std::libc::types::common::c95::c_void[#1]"* %25 = icmp eq %"enum.std::libc::types::common::c95::c_void[#1]"* %24, %16 %26 = icmp eq i64 %20, 0 %or.cond = or i1 %25, %26 ``` ``` test vec::bench::iterator ... bench: 87 ns/iter (+/- 7) test vec::bench::mut_iterator ... bench: 87 ns/iter (+/- 10) ``` After: ```llvm %sum.028 = phi i64 [ %21, %match_else ], [ 0, %"normal return" ] %.sroa.0.027 = phi i64* [ %19, %match_else ], [ %12, %"normal return" ] %19 = getelementptr i64* %.sroa.0.027, i64 1 %20 = load i64* %.sroa.0.027, align 8 %21 = add i64 %20, %sum.028 %22 = bitcast i64* %19 to %"enum.std::libc::types::common::c95::c_void[#1]"* %23 = icmp eq %"enum.std::libc::types::common::c95::c_void[#1]"* %22, %16 %24 = icmp eq i64* %19, null %or.cond = or i1 %23, %24 ``` ``` test vec::bench::iterator ... bench: 79 ns/iter (+/- 8) test vec::bench::mut_iterator ... bench: 78 ns/iter (+/- 2) ``` (NB. I'm not 100% sure the benchmarks were set-up correctly, so take them with a grain of salt.)
thestinger
commented
Aug 2, 2013
Contributor
@huonw: it's fine if the benchmark doesn't show a statistically significant improvement, because I didn't expect any improvement in iteration speed alone - just when combined with other things (it can now optimize iterators to a memset/memcpy with loop-idiom, vectorize them with loop-vectorize and so on). |
huonw
commented
Aug 3, 2013
ContributorAuthor
@thestinger yes, it was just a warning to anyone that this shouldn't be trumpeted as a 10% speed-up without further investigation. |
thestinger
commented
Aug 3, 2013
Contributor
Landing with #8257. |
flip1995 pushed a commit
to flip1995/rust
that referenced
this pull request
Jan 13, 2022
…5, r=giraffate fix `iter_not_returning_iterator` fixesrust-lang#8225 changelog: Handle type projections in `iter_not_returning_iterator` changelog: Don't lint `iter_not_returning_iterator` in trait implementations changelog: Lint `iter_not_returning_iterator` in trait definitions
matthiaskrgr pushed a commit
to matthiaskrgr/rust
that referenced
this pull request
Feb 11, 2024
…agnostic, r=Veykril feat: Add incorrect case diagnostics for traits and their associated items Updates incorrect case diagnostic to: - Check traits and their associated items - Ignore trait implementations except for patterns in associated function bodies Also cleans up `hir-ty::diagnostics::decl_check` a bit (mostly to make it a bit more DRY and easier to maintain) Also fixes: rust-lang#8675 and fixes: rust-lang#8225
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes#8212.
Before:
After:
(NB. I'm not 100% sure the benchmarks were set-up correctly, so take them with a grain of salt.)