Skip to content
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

Rollup of 16 pull requests #58669

Merged
merged 65 commits into from
Feb 23, 2019
Merged

Rollup of 16 pull requests #58669

merged 65 commits into from
Feb 23, 2019

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Feb 23, 2019

Successful merges:

Failed merges:

r? @ghost

matthieu-m and others added 30 commits February 3, 2019 16:58
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.
Co-Authored-By: Aaronepower <Aaronepower@users.noreply.github.com>
Co-Authored-By: Aaronepower <Aaronepower@users.noreply.github.com>
Co-Authored-By: Aaronepower <Aaronepower@users.noreply.github.com>
Co-Authored-By: Aaronepower <Aaronepower@users.noreply.github.com>
Co-Authored-By: Aaronepower <Aaronepower@users.noreply.github.com>
Co-Authored-By: Aaronepower <Aaronepower@users.noreply.github.com>
It is currently a method of `Token`, but it only is valid to call if
`self` is a `Token::Interpolated`. This commit eliminates the
possibility of misuse by changing it to an associated function that
takes a `Nonterminal`, which also simplifies the call sites.

This requires splitting out a new function, `nonterminal_to_string`.
It's present within `Token::Interpolated` as an optimization, so that if
a nonterminal is converted to a `TokenStream` multiple times, the
first-computed value is saved and reused.

But in practice it's not needed. `interpolated_to_tokenstream()` is a
cold function: it's only called a few dozen times while compiling rustc
itself, and a few hundred times across the entire `rustc-perf` suite.
Furthermore, when it is called, it is almost always the first
conversion, so no benefit is gained from it.

So this commit removes `LazyTokenStream`, along with the now-unnecessary
`Token::interpolated()`.

As well as a significant simplification, the removal speeds things up
slightly, mostly due to not having to `drop` the `LazyTokenStream`
instances.
The current code (expensively) clones the value within an `Rc`. This
commit changes things so that the `Rc` itself is (cheaply) cloned
instead, avoid some allocations.

This requires converting a few `Rc` instances to `Lrc`.
These are probably leftovers from recent `TokenStream` simplifications.
…-obk

Optimise vec![false; N] to zero-alloc

Nowadays booleans have a well-defined representation, so there is no reason not to optimise their allocation.
…anishearth

Don't generate minification variables if minification disabled

If the minification is disabled, there is no sense having those variables.

r? @QuietMisdreavus
…r=nikomatsakis

Update tests to account for cross-platform testing and miri.

Fix rust-lang#23926
Do not underflow after resetting unmatched braces count

Fix rust-lang#58638.

r? @oli-obk
Add expected/provided byte alignments to validation error message

Fixes rust-lang#58617
…n, r=petrochenkov

Reduce Miri-related Code Repetition `like (n << amt) >> amt`

This Pull Request fixes a part of [rust-lang#49937](rust-lang#49937).
@Centril
Copy link
Contributor Author

Centril commented Feb 23, 2019

@bors r+ p=16

@bors
Copy link
Contributor

bors commented Feb 23, 2019

📌 Commit a36d1b9 has been approved by Centril

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Feb 23, 2019
@bors
Copy link
Contributor

bors commented Feb 23, 2019

⌛ Testing commit a36d1b9 with merge 103db7fe60d53b9a1556ee502480f75ab21f544e...

@bors
Copy link
Contributor

bors commented Feb 23, 2019

💔 Test failed - checks-travis

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 23, 2019
@rust-highfive
Copy link
Collaborator

The job dist-i686-apple of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[00:02:59]       Memory: 8 GB
[00:02:59]       Boot ROM Version: VMW71.00V.7581552.B64.1801142334
[00:02:59]       Apple ROM Info: [MS_VM_CERT/SHA1/27d66596a61c48dd3dc7216fd715126e33f59ae7]Welcome to the Virtual Machine
[00:02:59]       SMC Version (system): 2.8f0
[00:02:59]       Serial Number (system): VM0iJygcoan4
[00:02:59] 
[00:02:59] hw.ncpu: 4
[00:02:59] hw.byteorder: 1234
[00:02:59] hw.memsize: 8589934592
---
[00:09:31] [RUSTC-TIMING] rustc_target test:false 53.261
[00:09:32] [RUSTC-TIMING] rustc_errors test:false 41.763
[00:11:05] [RUSTC-TIMING] syntax test:false 92.866
[00:11:05]    Compiling syntax_ext v0.0.0 (/Users/travis/build/rust-lang/rust/src/libsyntax_ext)
No output has been received in the last 30m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received
The build has been terminated

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@kennytm
Copy link
Member

kennytm commented Feb 23, 2019

@bors retry

#56112 - Compiling stage0-rustc

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 23, 2019
@bors
Copy link
Contributor

bors commented Feb 23, 2019

⌛ Testing commit a36d1b9 with merge 7f19f16...

bors added a commit that referenced this pull request Feb 23, 2019
Rollup of 16 pull requests

Successful merges:

 - #58100 (Transition librustdoc to Rust 2018)
 - #58122 (RangeInclusive internal iteration performance improvement.)
 - #58199 (Add better error message for partial move)
 - #58227 (Updated RELEASES.md for 1.33.0)
 - #58353 (Check the Self-type of inherent associated constants)
 - #58453 (SGX target: fix panic = abort)
 - #58476 (Remove `LazyTokenStream`.)
 - #58526 (Special suggestion for illegal unicode curly quote pairs)
 - #58595 (Turn duration consts into associated consts)
 - #58609 (Allow Self::Module to be mutated.)
 - #58628 (Optimise vec![false; N] to zero-alloc)
 - #58643 (Don't generate minification variables if minification disabled)
 - #58648 (Update tests to account for cross-platform testing and miri.)
 - #58654 (Do not underflow after resetting unmatched braces count)
 - #58658 (Add expected/provided byte alignments to validation error message)
 - #58667 (Reduce Miri-related Code Repetition `like (n << amt) >> amt`)

Failed merges:

r? @ghost
@bors
Copy link
Contributor

bors commented Feb 23, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: Centril
Pushing 7f19f16 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 23, 2019
@bors
Copy link
Contributor

bors commented Feb 23, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: Centril
Pushing 7f19f16 to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.