Commit Graph

66789 Commits

Author SHA1 Message Date
Nick Cameron
27b9182d5b review changes 2017-08-01 15:06:22 +12:00
Ralf Jung
584d823bf2 Handle closures. Add some more tests. 2017-07-31 20:00:20 -07:00
Zack M. Davis
2dbfa3995e limit and delimit available fields in note
Also, don't show the note if no fields are available (usually due to
privacy).
2017-07-31 18:45:02 -07:00
Alex Crichton
dd371a2069 rustc: Inline bitwise modification operators
These need to be inlined across crates to avoid showing up as one-instruction
functions in profiles! In the benchmark from #43578 this decreased the
translation item collection step from 30s to 23s, and looks like it also allowed
vectorization elsewhere of the operations!
2017-07-31 18:39:25 -07:00
Ralf Jung
e73d3145f5 fix AddValidation on methods 2017-07-31 18:33:45 -07:00
Josh Stone
881a724660 Gate LLVMRustHasFeature on LLVM_RUSTLLVM
Commit c4710203c0 in #43492 make `LLVMRustHasFeature` "more robust"
by using `getFeatureTable()`.  However, this function is specific to
Rust's own LLVM fork, not upstream LLVM-4.0, so we need to use
`#if LLVM_RUSTLLVM` to guard this call.
2017-07-31 18:10:01 -07:00
bors
ebf74d99b0 Auto merge of #43547 - arielb1:no-borrow-no-check, r=nikomatsakis
borrowck: skip CFG construction when there is nothing to propagate

CFG construction takes a large amount of time and memory, especially for
large constants. If such a constant contains no actions on lvalues, it
can't have borrowck problems and can be ignored by it.

This removes the 4.9GB borrowck peak from #36799. It seems that HIR had
grown by 300MB and MIR had grown by 500MB from the last massif
collection and that remains to be investigated, but this at least shaves
the borrowck peak.

r? @nikomatsakis
2017-07-31 23:21:24 +00:00
Ralf Jung
26ca0d1b3a tidy 2017-07-31 16:15:37 -07:00
Ralf Jung
09cbe588c3 more readable printing of validation operands 2017-07-31 15:59:29 -07:00
Ralf Jung
5e426e1068 optionally only emit basic validation for functions containing unsafe block / unsafe function 2017-07-31 15:46:36 -07:00
Josh Stone
1636a2cf41 Link LLVM tools dynamically
Set `LLVM_LINK_LLVM_DYLIB=ON` -- "If enabled, tools will be linked with
the libLLVM shared library."  Rust doesn't ship any of the LLVM tools,
and only needs a few at all for some test cases, so statically linking
the tools is just a waste of space.  I've also had memory issues on
slower machines with LLVM debuginfo enabled, when several tools start
linking in parallel consuming several GBs each.

With the default configuration, `build/x86_64-unknown-linux-gnu/llvm`
was 1.5GB before, now down to 731MB.  The difference is more drastic
with `--enable-llvm-release-debuginfo`, from 28GB to "only" 13GB.

This does not change the linking behavior of `rustc_llvm`.
2017-07-31 15:34:05 -07:00
Michael Howell
03acea646c Implement RefCell::replace and RefCell::swap 2017-07-31 21:19:09 +00:00
Ariel Ben-Yehuda
5b99523de9 rustc_mir::transform::simplify - remove nops first
Removing nops can allow more basic blocks to be merged, but merging
basic blocks can't allow for more nops to be removed, so we should
remove nops first.

This doesn't matter *that* much, because normally we run SimplifyCfg
several times, but there's no reason not to do it.
2017-08-01 00:12:31 +03:00
Ariel Ben-Yehuda
ca3105cfdf use an iterator when visiting MIR basic blocks
I saw MIR cache invalidation somewhat hot on my profiler when per-BB
indexin was used. That shouldn't matter much, but there is no good
reason not to use an iterator.
2017-08-01 00:12:31 +03:00
Ariel Ben-Yehuda
85c102757a rustc_mir: don't build unused unwind cleanup blocks
The unused blocks are removed by SimplifyCfg, but they can cause a
significant performance slowdown before they are removed.
2017-08-01 00:12:30 +03:00
Ariel Ben-Yehuda
1447daa01d remove the span field from diverge_cleanup 2017-08-01 00:12:30 +03:00
bors
37c7d0ebb3 Auto merge of #43399 - tschottdorf:bndmode-pat-adjustments, r=nikomatsakis
default binding modes: add pat_binding_modes

This PR kicks off the implementation of the [default binding modes RFC][1] by
introducing the `pat_binding_modes` typeck table mentioned in the [mentoring
instructions][2].

It is a WIP because I wasn't able to avoid all uses of the binding modes as
not all call sites are close enough to the typeck tables. I added marker
comments to any line matching `BindByRef|BindByValue` so that reviewers
are aware of all of them.

I will look into changing the HIR (as suggested in [2]) to not carry a
`BindingMode` unless one was explicitly specified, but this PR is good for
a first round of comments.

The actual changes are quite small and CI will fail due to overlong lines
caused by the marker comments.

See #42640.

cc @nikomatsakis

[1]: https://github.com/rust-lang/rfcs/pull/2005
[2]: https://github.com/rust-lang/rust/issues/42640#issuecomment-313535089
2017-07-31 20:47:42 +00:00
Ralf Jung
6135461f9a CleanEndRegions: use default impl where possible 2017-07-31 13:21:10 -07:00
Ralf Jung
6ff7c8fa04 more documentation 2017-07-31 13:20:37 -07:00
Michael Woerister
b1e043e9e9 async-llvm(27): Move #[rustc_error] check to an earlier point in order to restore some test expections. 2017-07-31 18:51:39 +02:00
Niko Matsakis
8f67f1efaf add comments from arielb1 2017-07-31 18:13:49 +03:00
Ariel Ben-Yehuda
93db1f9923 trans::mir::constant - fix assignment error recovery
We used to not store anything when the RHS of an assignment returned an
error, which caused ICEs downstream.

Fixes #43197.
2017-07-31 18:09:02 +03:00
Ariel Ben-Yehuda
1057a728f5 fix -Z treat-err-as-bug 2017-07-31 18:09:02 +03:00
Michael Woerister
cacc31f8a3 async-llvm(26): Print error when failing to acquire Jobserver token. 2017-07-31 15:41:41 +02:00
Michael Woerister
a9a0ea921b async-llvm(25): Restore -Ztime-passes output for trans and LLVM. 2017-07-31 15:15:44 +02:00
Michael Woerister
bd36df84a5 async-llvm(24): Improve scheduling and documentation. 2017-07-31 15:15:44 +02:00
Michael Woerister
f5acc392e0 async-llvm(23): Let the main thread also do LLVM work in order to reduce memory pressure. 2017-07-31 15:15:44 +02:00
Michael Woerister
8819278523 async-llvm(22): mw invokes mad html skillz to produce graphical LLVM timing reports. 2017-07-31 15:15:44 +02:00
Michael Woerister
1480be3779 async-llvm(21): Re-use worker-ids in order to simulate persistent worker threads. 2017-07-31 15:15:09 +02:00
Michael Woerister
ab3bc584c0 async-llvm(20): Do some cleanup. 2017-07-31 15:15:09 +02:00
Michael Woerister
81b789fd87 async-llvm(19): Already start LLVM while still translating. 2017-07-31 15:15:09 +02:00
Michael Woerister
7e09d1e170 async-llvm(18): Instantiate OngoingCrateTranslation before starting translation. 2017-07-31 15:15:09 +02:00
Michael Woerister
e7d0fa340f async-llvm(17): Create MSVC __imp_ symbols immediately for each module. 2017-07-31 15:15:09 +02:00
Michael Woerister
0ad9eaa998 async-llvm(16): Inject allocator shim into LLVM module immediately if necessary. 2017-07-31 15:15:09 +02:00
Michael Woerister
943a5bdf35 async-llvm(15): Don't require number of codegen units upfront. 2017-07-31 15:15:09 +02:00
Michael Woerister
a1be65845c async-llvm(14): Move LTO/codegen-unit conflict check to beginning of compilation process. 2017-07-31 15:15:09 +02:00
Michael Woerister
b924ec1484 async-llvm(13): Submit LLVM work packages from base::trans_crate(). 2017-07-31 15:15:09 +02:00
Michael Woerister
397b2a800f async-llvm(12): Hide no_integrated_as logic in write::run_passes. 2017-07-31 15:15:09 +02:00
Michael Woerister
f3ce50558f async-llvm(11): Delay joining ongoing translation until right before linking. 2017-07-31 15:15:09 +02:00
Michael Woerister
28589ec3e4 async-llvm(10): Factor compile output files cleanup into separate functions. 2017-07-31 15:15:09 +02:00
Michael Woerister
ccb970be4c async-llvm(9): Move OngoingCrateTranslation into back::write. 2017-07-31 15:15:09 +02:00
Michael Woerister
645841ea44 async-llvm(8): Clean up resource management and drop LLVM modules ASAP. 2017-07-31 15:15:09 +02:00
Michael Woerister
4282dd87ea async-llvm(7): Clean up error handling a bit. 2017-07-31 15:15:09 +02:00
Michael Woerister
8f6894e177 async-llvm(6): Make the LLVM work coordinator get its work package through a channel instead of upfront. 2017-07-31 15:15:09 +02:00
Michael Woerister
b18a61a15b async-llvm(5): Do continuous error handling on main thread. 2017-07-31 15:15:09 +02:00
Michael Woerister
df6be33d84 async-llvm(4): Move work coordination to separate thread in order to free up the main thread for translation. 2017-07-31 15:15:09 +02:00
Michael Woerister
bac57cf654 async-llvm(3): Make write::CodegenContext Clone and Send. 2017-07-31 15:13:10 +02:00
Michael Woerister
29d4725b31 async-llvm(2): Decouple diagnostics emission from LLVM worker coordination. 2017-07-31 14:55:13 +02:00
Michael Woerister
c4adeceb37 async-llvm(1): Run LLVM already in trans_crate(). 2017-07-31 14:55:13 +02:00
Ariel Ben-Yehuda
83eb264273 borrowck: skip CFG construction when there is nothing to propagate
CFG construction takes a large amount of time and memory, especially for
large constants. If such a constant contains no actions on lvalues, it
can't have borrowck problems and can be ignored by it.

This removes the 4.9GB borrowck peak from #36799. It seems that HIR had
grown by 300MB and MIR had grown by 500MB from the last massif
collection and that remains to be investigated, but this at least shaves
the borrowck peak.
2017-07-31 15:17:30 +03:00