about summary refs log tree commit diff
path: root/src/librustc/dep_graph
AgeCommit message (Collapse)AuthorLines
2018-07-13Auto merge of #51987 - nikomatsakis:nll-region-infer-scc, r=pnkfelixbors-1/+3
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.
2018-07-12rename `control_flow_graph` to `graph`Niko Matsakis-1/+1
2018-07-12rename `graph` to `control_flow_graph::implementation`Niko Matsakis-1/+3
2018-07-10Upgrade to LLVM's master branch (LLVM 7)Alex Crichton-2/+0
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
2018-07-02introduce `predicates_defined_on` for traitsNiko Matsakis-0/+1
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>
2018-06-28Merge `ConstVal` and `ConstValue`Oliver Schneider-3/+3
2018-06-26introduce `Normalizable` trait for things directly normalizableNiko Matsakis-2/+7
2018-06-26convert `prove_predicate` into a queryNiko Matsakis-1/+2
2018-06-26make `Subtype` a true queryNiko Matsakis-1/+3
2018-06-26make `Eq` a true queryNiko Matsakis-2/+4
2018-06-14rustc: rename ty::maps to ty::query.Eduard-Mihai Burtescu-3/+3
2018-06-10create separate dep-nodes for predicates_of and explicit_predicates_oftoidiu-0/+1
2018-05-17Rename trans to codegen everywhere.Irina Popa-5/+5
2018-05-12Rollup merge of #50558 - whitfin:issue-50500, r=michaelwoeristerMark Simulacrum-24/+1
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
2018-05-11Remove shared access to DepGraph::work_productsIsaac Whitfield-24/+1
2018-05-11Add a query to convert from ConstValue to AllocationJohn Kåre Alsaker-5/+6
2018-05-11Introduce ConstValue and use it instead of miri's Value for constant valuesJohn Kåre Alsaker-1/+1
2018-05-10Rollup merge of #50598 - whitfin:unnecessary-mut-borrow, r=michaelwoeristerAlex Crichton-7/+1
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.
2018-05-10Rollup merge of #50565 - nnethercote:try_mark_green, r=michaelwoeristerAlex Crichton-10/+11
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% ```
2018-05-09Remove unnecessary mutable borrow and resizingIsaac Whitfield-7/+1
2018-05-09Use SmallVec for DepNodeIndex within dep_graph.Nicholas Nethercote-10/+11
This avoids a decent number of allocations, enough to speed up incremental runs of many rustc-benchmarks, the best by 2%.
2018-05-07Make DepGraph::previous_work_products immutableWesley Wiser-19/+7
Fixes #50501
2018-04-26Create a canonical trait query for `evaluate_obligation`Aravind Gollakota-1/+3
2018-04-25Move the Lock into OpenTaskJohn Kåre Alsaker-54/+49
2018-04-25Address commentsJohn Kåre Alsaker-16/+18
2018-04-25Make DepGraph thread-safeJohn Kåre Alsaker-167/+189
2018-04-23first draft of `program_clauses_for_env`Niko Matsakis-0/+1
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.
2018-04-19Remove HIR inliningWesley Wiser-2/+1
Fixes #49690
2018-04-12Auto merge of #45298 - toidiu:ak-44493-infer-predicate, r=nikomatsakisbors-0/+1
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)
2018-04-12Implement inferring outlives requirements for references, structs, enum, ↵toidiu-0/+1
union, and projection types. added a feature gate and tests for these scenarios.
2018-04-10Querify all_traitsJohn Kåre Alsaker-0/+1
2018-04-06Allow for internalizing monomorphizations that cannot be shared.Michael Woerister-0/+1
2018-04-06Remove the (inaccurate) symbol_export_level query.Michael Woerister-2/+0
2018-04-06Allow for re-using monomorphizations from upstream crates.Michael Woerister-0/+3
2018-03-28Take the original extra-filename passed to a crate into account whenChris Manchester-0/+1
resolving it as a dependency. Fixes #46816
2018-03-25Rollup merge of #49299 - SimonSapin:ubiquity, r=nikomatsakiskennytm-2/+0
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
2018-03-23Stabilize the copy_closures and clone_closures featuresSimon Sapin-2/+0
In addition to the `Fn*` family of traits, closures now implement `Copy` (and similarly `Clone`) if all of the captures do.
2018-03-22rustc: Add a `#[wasm_import_module]` attributeAlex Crichton-0/+3
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
2018-03-22rustc: Add a `#[wasm_custom_section]` attributeAlex Crichton-0/+2
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).
2018-03-22Rollup merge of #49069 - wesleywiser:incr_soa, r=michaelwoeristerkennytm-9/+12
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
2018-03-22Rollup merge of #48939 - wesleywiser:incr_query_wf_checking, r=michaelwoeristerkennytm-0/+3
Querify WF-checking so it can be cached r? @michaelwoerister
2018-03-19Convert SerializedDepGraph to be a struct-of-arraysWesley Wiser-9/+12
Fixes #47326
2018-03-20Rollup merge of #49092 - mark-i-m:deptrack_readme, r=nikomatsakiskennytm-294/+3
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
2018-03-18Auto merge of #48985 - scalexm:lowering, r=nikomatsakisbors-0/+2
MVP for chalkification r? @nikomatsakis
2018-03-16Replace many of the last references to readmesMark Mansi-294/+3
2018-03-16incr.comp.: Make sanity check in try_mark_green() aware of error conditions.Michael Woerister-2/+9
2018-03-15Queryify check_impl_item_well_formedWesley Wiser-0/+1
Fixes #46753
2018-03-15Queryify check_trait_item_well_formedWesley Wiser-0/+1
Fixes #46753
2018-03-15Queryify check_item_well_formedWesley Wiser-0/+1
Fixes #46753
2018-03-14Add MVP for chalkificationscalexm-0/+2