Uh oh!
There was an error while loading. Please reload this page.
Help LLVM better optimize slice::Iter(Mut)::len - #61885
Conversation
This comment has been minimized.
This comment has been minimized.
be3ca63 to
af0e35eComparehanna-kruppe
commented
Jun 16, 2019
Nice! r=me unless you want more eyes on this first. |
RalfJung
commented
Jun 16, 2019
Yes this looks great! Do we have tests in |
RalfJung
commented
Jun 16, 2019
Oh also, should we see if this has any perf influence? |
RalfJung
commented
Jun 16, 2019
Well let's get a try build. @bors try |
bors
commented
Jun 16, 2019
⌛ Trying commit af0e35e with merge 9dd34620937c9854a002172599a6217be05f6520... |
bors
commented
Jun 16, 2019
☀️ Try build successful - checks-travis |
RalfJung
commented
Jun 16, 2019
@rust-timer build 9dd34620937c9854a002172599a6217be05f6520 |
rust-timer
commented
Jun 16, 2019
Success: Queued 9dd34620937c9854a002172599a6217be05f6520 with parent 6865502, comparison URL. |
rust-timer
commented
Jun 16, 2019
Finished benchmarking try commit 9dd34620937c9854a002172599a6217be05f6520, comparison URL. |
Looks like just noise in the perf run, which doesn't surprise me. (Anyone using
Hmm, looks like I get an error[E0080]:Miri evaluation error: unimplemented intrinsic: unchecked_subon the playground. I guess I should make a MIRI PR before this goes in? Edit: I should have looked, seems like you're already on it rust-lang/miri#776 ❤️ |
RalfJung
commented
Jun 17, 2019
I can't find any explicit tests for the slice iterator length method, but running miri-test-libstd on this PR shows that the code path does get hit, e.g. through |
RalfJung
commented
Jun 17, 2019
Ah, and this macro also gets used in @bors r=rkruppe,RalfJung |
bors
commented
Jun 17, 2019
📌 Commit af0e35e has been approved by |
…ppe,RalfJung Help LLVM better optimize slice::Iter(Mut)::len r? @RalfJung I've included a codegen test that fails without this change as a demonstration of usefulness.
Rollup of 5 pull requests Successful merges: - #61702 (test more variants of enum-int-casting) - #61836 (Replace some uses of NodeId with HirId) - #61885 (Help LLVM better optimize slice::Iter(Mut)::len) - #61893 (make `Weak::ptr_eq`s into methods) - #61908 (don't ICE on large files) Failed merges: r? @ghost
Uh oh!
There was an error while loading. Please reload this page.
Simplify manual ptr arithmetic in slice::Iter with ptr_sub The old code was introduced in rust-lang#61885, which predates the ptr_sub method and underlying intrinsic. The codegen test still passes. r? `@scottmcm`
r? @RalfJung
I've included a codegen test that fails without this change as a demonstration of usefulness.