| Age | Commit message (Collapse) | Author | Lines |
|
nll experiment: compute SCCs instead of iterative region solving
This is an attempt to speed up region solving by replacing the current iterative dataflow with a SCC computation. The idea is to detect cycles (SCCs) amongst region constraints and then compute just one value per cycle. The graph with all cycles removed is of course a DAG, so we can then solve constraints "bottom up" once the liveness values are known.
I kinda ran out of time this morning so the last commit is a bit sloppy but I wanted to get this posted, let travis run on it, and maybe do a perf run, before I clean it up.
|
|
|
|
|
|
This commit upgrades the main LLVM submodule to LLVM's current master branch.
The LLD submodule is updated in tandem as well as compiler-builtins.
Along the way support was also added for LLVM 7's new features. This primarily
includes the support for custom section concatenation natively in LLD so we now
add wasm custom sections in LLVM IR rather than having custom support in rustc
itself for doing so.
Some other miscellaneous changes are:
* We now pass `--gc-sections` to `wasm-ld`
* The optimization level is now passed to `wasm-ld`
* A `--stack-first` option is passed to LLD to have stack overflow always cause
a trap instead of corrupting static data
* The wasm target for LLVM switched to `wasm32-unknown-unknown`.
* The syntax for aligned pointers has changed in LLVM IR and tests are updated
to reflect this.
* The `thumbv6m-none-eabi` target is disabled due to an [LLVM bug][llbug]
Nowadays we've been mostly only upgrading whenever there's a major release of
LLVM but enough changes have been happening on the wasm target that there's been
growing motivation for quite some time now to upgrade out version of LLD. To
upgrade LLD, however, we need to upgrade LLVM to avoid needing to build yet
another version of LLVM on the builders.
The revision of LLVM in use here is arbitrarily chosen. We will likely need to
continue to update it over time if and when we discover bugs. Once LLVM 7 is
fully released we can switch to that channel as well.
[llbug]: https://bugs.llvm.org/show_bug.cgi?id=37382
|
|
This new query returns only the predicates *directly defined* on an
item (in contrast to the more common `predicates_of`, which returns
the predicates that must be proven to reference an item). These two
sets are almost always identical except for traits, where
`predicates_of` includes an artificial `Self: Trait<...>` predicate
(basically saying that you cannot use a trait item without proving
that the trait is implemented for the type parameters).
This new query is only used in chalk lowering, where this artificial
`Self: Trait` predicate is problematic. We encode it in metadata but
only where needed since it is kind of repetitive with existing
information.
Co-authored-by: Tyler Mandry <tmandry@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Remove all reference to DepGraph::work_products
This is an attempt at fixing #50500. It will remove the `work_products` key from `DepGraphData` completely, in favour of just passing the relevant data around. I went in a little blindly; everything appears to work just fine but I'd appreciate any additional advice people.
I didn't want to remove too much of what was already there, so I kept the structure pretty much the same (aside from some naming tweaks) - if anyone has suggestions on how to streamline it a little better, happy to follow up.
r? @michaelwoerister
|
|
|
|
|
|
|
|
Remove unnecessary mutable borrow and resizing in DepGraph::serialize
I might be mistaken, but I noticed this whilst in this file for something else. It appears that this mutable borrow is unnecessary and since it's locking it should be removed. The resizing looks redundant since nothing additional is added to the fingerprints in this function, so that can also be removed.
|
|
Use SmallVec for DepNodeIndex within dep_graph.
This avoids a decent number of allocations, enough to speed up
incremental runs of many rustc-benchmarks, the best by 2%.
Here are the rustc-perf benchmarks that showed an improvement of at least 1% on one run:
```
unused-warnings-check
avg: -1.7% min: -2.4% max: 0.0%
unused-warnings-opt
avg: -1.4% min: -2.0% max: 0.0%
unused-warnings
avg: -1.4% min: -2.0% max: -0.0%
tokio-webpush-simple-check
avg: -1.0% min: -1.7% max: 0.0%
futures-opt
avg: -0.9% min: -1.6% max: 0.0%
encoding
avg: -1.2% min: -1.6% max: -0.6%
encoding-check
avg: -0.9% min: -1.6% max: 0.0%
encoding-opt
avg: -0.8% min: -1.6% max: -0.1%
futures
avg: -0.9% min: -1.5% max: 0.0%
futures-check
avg: -0.9% min: -1.5% max: 0.1%
regression-31157-check
avg: -0.9% min: -1.5% max: 0.0%
regex
avg: -0.6% min: -1.4% max: 0.0%
regression-31157-opt
avg: -0.5% min: -1.4% max: 0.1%
regression-31157
avg: -0.7% min: -1.4% max: 0.2%
regex-opt
avg: -0.6% min: -1.4% max: 0.1%
hyper-check
avg: -0.8% min: -1.4% max: -0.1%
regex-check
avg: -1.0% min: -1.4% max: 0.0%
hyper-opt
avg: -0.7% min: -1.4% max: -0.1%
hyper
avg: -0.7% min: -1.3% max: 0.1%
piston-image-opt
avg: -0.4% min: -1.3% max: 0.0%
tokio-webpush-simple-opt
avg: -0.3% min: -1.3% max: 0.0%
piston-image-check
avg: -0.5% min: -1.3% max: -0.0%
syn-opt
avg: -0.5% min: -1.3% max: 0.0%
clap-rs-check
avg: -0.3% min: -1.3% max: 0.2%
piston-image
avg: -0.5% min: -1.2% max: 0.1%
syn
avg: -0.5% min: -1.2% max: 0.1%
syn-check
avg: -0.6% min: -1.2% max: -0.1%
issue-46449-opt
avg: -0.4% min: -1.2% max: -0.1%
parser-check
avg: -0.7% min: -1.2% max: 0.1%
issue-46449
avg: -0.5% min: -1.2% max: -0.0%
```
|
|
|
|
This avoids a decent number of allocations, enough to speed up
incremental runs of many rustc-benchmarks, the best by 2%.
|
|
Fixes #50501
|
|
|
|
|
|
|
|
|
|
This computes the transitive closure of traits that appear in the
environment and then appends their clauses. It needs some work, but
it's in the right direction.
|
|
Fixes #49690
|
|
Ak 44493 infer predicate
**WIP** Implements #44493
Things to do:
- [x] add feature gate and appropriate tests (see [forge](https://forge.rust-lang.org/feature-guide.html) for some details)
- [x] add a unit testing system similar to `#[rustc_variance]`
- [x] to see how, maybe `rg rustc_variance` and take some notes
- [ ] add more tests:
- [x] we need to decide how to handle `struct Foo<'a, T> { x: &'a T::Item }`
- [x] handle explicit predicates on types
- [ ] handle explicit predicates on `dyn Trait` (this could be put off to a follow-up PR)
- [ ] handle explicit predicates on projections (this could be put off to a follow-up PR)
|
|
union, and projection types. added a feature gate and tests for these scenarios.
|
|
|
|
|
|
|
|
|
|
resolving it as a dependency.
Fixes #46816
|
|
Stabilize the copy_closures and clone_closures features
In addition to the `Fn*` family of traits, closures now implement `Copy` (and similarly `Clone`) if all of the captures do.
Tracking issue: https://github.com/rust-lang/rust/issues/44490
|
|
In addition to the `Fn*` family of traits, closures now implement `Copy` (and similarly `Clone`) if all of the captures do.
|
|
This commit adds a new attribute to the Rust compiler specific to the wasm
target (and no other targets). The `#[wasm_import_module]` attribute is used to
specify the module that a name is imported from, and is used like so:
#[wasm_import_module = "./foo.js"]
extern {
fn some_js_function();
}
Here the import of the symbol `some_js_function` is tagged with the `./foo.js`
module in the wasm output file. Wasm-the-format includes two fields on all
imports, a module and a field. The field is the symbol name (`some_js_function`
above) and the module has historically unconditionally been `"env"`. I'm not
sure if this `"env"` convention has asm.js or LLVM roots, but regardless we'd
like the ability to configure it!
The proposed ES module integration with wasm (aka a wasm module is "just another
ES module") requires that the import module of wasm imports is interpreted as an
ES module import, meaning that you'll need to encode paths, NPM packages, etc.
As a result, we'll need this to be something other than `"env"`!
Unfortunately neither our version of LLVM nor LLD supports custom import modules
(aka anything not `"env"`). My hope is that by the time LLVM 7 is released both
will have support, but in the meantime this commit adds some primitive
encoding/decoding of wasm files to the compiler. This way rustc postprocesses
the wasm module that LLVM emits to ensure it's got all the imports we'd like to
have in it.
Eventually I'd ideally like to unconditionally require this attribute to be
placed on all `extern { ... }` blocks. For now though it seemed prudent to add
it as an unstable attribute, so for now it's not required (as that'd force usage
of a feature gate). Hopefully it doesn't take too long to "stabilize" this!
cc rust-lang-nursery/rust-wasm#29
|
|
This commit is an implementation of adding custom sections to wasm artifacts in
rustc. The intention here is to expose the ability of the wasm binary format to
contain custom sections with arbitrary user-defined data. Currently neither our
version of LLVM nor LLD supports this so the implementation is currently custom
to rustc itself.
The implementation here is to attach a `#[wasm_custom_section = "foo"]`
attribute to any `const` which has a type like `[u8; N]`. Other types of
constants aren't supported yet but may be added one day! This should hopefully
be enough to get off the ground with *some* custom section support.
The current semantics are that any constant tagged with `#[wasm_custom_section]`
section will be *appended* to the corresponding section in the final output wasm
artifact (and this affects dependencies linked in as well, not just the final
crate). This means that whatever is interpreting the contents must be able to
interpret binary-concatenated sections (or each constant needs to be in its own
custom section).
To test this change the existing `run-make` test suite was moved to a
`run-make-fulldeps` folder and a new `run-make` test suite was added which
applies to all targets by default. This test suite currently only has one test
which only runs for the wasm target (using a node.js script to use `WebAssembly`
in JS to parse the wasm output).
|
|
Convert SerializedDepGraph to be a struct-of-arrays
Fixes #47326
I did not try the "`mem::swap()` to avoid copying the arrays" idea because that would leave the DepGraph in an incorrect state and that doesn't seem like a good idea for me.
r? @michaelwoerister
|
|
Querify WF-checking so it can be cached
r? @michaelwoerister
|
|
Fixes #47326
|
|
Replace many of the last references to readmes
In particular, this removes the dep track readme, so it should not be merged before https://github.com/rust-lang-nursery/rustc-guide/pull/92
Fix #47935
cc #48478
r? @nikomatsakis
|
|
MVP for chalkification
r? @nikomatsakis
|
|
|
|
|
|
Fixes #46753
|
|
Fixes #46753
|
|
Fixes #46753
|
|
|