rust/src/test
bors 65b448273d Auto merge of #71006 - ecstatic-morse:dataflow-bidi, r=ecstatic-morse
Use existing framework for backward dataflow analyses

This PR adds support for backward analyses to the dataflow framework and adds a new live variable analysis (based on the existing one in `librustc_mir/util/liveness.rs`). By adding these to the framework instead of having a separate API, all newly implemented backward dataflow analyses get cursors/visitors, `rustc_peek` tests, and graphviz visualizations for free. In the near-term, this makes it much easier to implement global dead-store elimination, and I believe that this will enable even more MIR optimizations in the future.

This PR makes many changes to the dataflow API, since some concepts and terminology only make sense in forward dataflow. Below is a list of the important changes.
- ~~`entry_set` -> `fixpoint` (the fixpoint for backward dataflow problems is after the block's terminator)~~
- `seek_{before,after}` -> `seek_{before,after}_primary_effect` (the unprefixed dataflow effect is now referred to as the "primary" effect instead of the "after" effect. The "before" effect remains the same, although I considered changing it to the "antecedent" effect. In both backward and forward dataflow, the "before" effect is applied prior to the "primary" effect. I feel very strongly that this is the correct choice, as it means consumers don't have to switch between `seek_before` and `seek_after` based on the direction of their analysis.
- `seek_after_assume_call_returns` is now gone. Users can use `ResultsCursor::apply_custom_effect` to emulate it.
- `visit_{statement,terminator}_exit` -> `visit_{statement,terminator}_after_primary_effect`
- `visit_{statement,terminator}` -> `visit_{statement,terminator}_before_primary_effect`

Implementing this also required refactoring the dataflow cursor implementation so it could work in both directions. This is a large percentage of the diff, since the cursor code is rather complex. The fact that the cursor is exhaustively tested in both directions should reassure whomever is unlucky enough to review this 🤣.

In order to avoid computing the reverse CFG for forward dataflow analyses, I've added some hacks to the existing `mir::BodyAndCache` interface. I've requested changes to this interface that would let me implement this more efficiently.

r? @eddyb (feel free to reassign)
cc @rust-lang/wg-mir-opt
2020-05-03 19:46:17 +00:00
..
assembly
auxiliary
codegen Fix codegen and mir-opt tests 2020-04-20 21:18:20 +02:00
codegen-units Keep codegen units unmerged when building compiler builtins 2020-04-06 00:00:00 +00:00
compile-fail Bless tests 2020-04-29 12:18:30 -07:00
debuginfo Update the minimum external LLVM to 8 2020-04-14 12:44:41 -07:00
incremental Moving more build-pass tests to check-pass 2020-04-23 20:21:38 -07:00
mir-opt Rollup merge of #71590 - RalfJung:mir-dump-pointers, r=oli-obk 2020-04-30 15:23:13 -07:00
pretty Update tests to use llvm_asm! 2020-03-26 15:49:22 +00:00
run-fail Auto merge of #70175 - Amanieu:remove_nlp, r=pnkfelix 2020-04-30 07:04:43 +00:00
run-make Use Cell::take in a couple places 2020-04-26 11:50:53 +02:00
run-make-fulldeps Auto merge of #70674 - cjgillot:query-arena-all, r=matthewjasper 2020-05-01 01:38:05 +00:00
run-pass-valgrind
rustdoc Fix show-const-contents rustdoc test 2020-04-20 23:38:07 +02:00
rustdoc-js
rustdoc-js-std Add tests for new of variables 2020-03-16 18:30:26 +01:00
rustdoc-ui Add rustdoc regression test for the unused_braces lint 2020-04-24 19:15:07 +02:00
rustfix
ui Auto merge of #71006 - ecstatic-morse:dataflow-bidi, r=ecstatic-morse 2020-05-03 19:46:17 +00:00
ui-fulldeps Remove support for self-opening 2020-04-25 10:55:20 -04:00
COMPILER_TESTS.md rust-lang.github.io/rustc-dev-guide -> rustc-dev-guide.rust-lang.org 2020-03-10 17:08:18 -03:00