rust/src/librustc_data_structures
bors 8aa42ed7c2 Auto merge of #61787 - ecstatic-morse:dataflow-split-block-sets, r=pnkfelix
rustc_mir: Hide initial block state when defining transfer functions

This PR addresses [this FIXME](2887008e0c/src/librustc_mir/dataflow/mod.rs (L594-L596)).

This makes `sets.on_entry` inaccessible in `{before_,}{statement,terminator}_effect`. This field was meant to allow implementors of `BitDenotation` to access the initial state for each block (optionally with the effect of all previous statements applied via `accumulates_intrablock_state`) while defining transfer functions.  However, the ability to set the initial value for the entry set of each basic block (except for START_BLOCK) no longer exists. As a result, this functionality is mostly useless, and when it *was* used it was used erroneously (see #62007).

Since `on_entry` is now useless, we can also remove `BlockSets`, which held the `gen`, `kill`, and `on_entry` bitvectors and replace it with a `GenKill` struct. Variables of this type are called `trans` since they represent a transfer function. `GenKill`s are stored contiguously in `AllSets`, which reduces the number of bounds checks and may improve cache performance: one is almost never accessed without the other.

Replacing `BlockSets` with `GenKill` allows us to define some new helper functions which streamline dataflow iteration and the dataflow-at-location APIs. Notably, `state_for_location` used a subtle side-effect of the `kill`/`kill_all` setters to apply the transfer function, and could be incorrect if a transfer function depended on effects of previous statements in the block on `gen_set`.

Additionally, this PR merges `BitSetOperator` and `InitialFlow` into one trait. Since the value of `InitialFlow` defines the semantics of the `join` operation, there's no reason to have seperate traits for each. We can add a default impl of `join` which branches based on `BOTTOM_VALUE`.  This should get optimized away.
2019-06-24 20:44:18 +00:00
..
graph Kill dead code dominator code. 2019-04-09 11:48:31 +01:00
obligation_forest rustc: doc comments 2019-02-10 23:42:32 +00:00
owning_ref Separate librustc_data_structures module 2019-06-16 14:17:01 +03:00
snapshot_map librustc_data_structures => 2018 2019-02-09 01:36:22 +09:00
sorted_map Separate librustc_data_structures module 2019-06-16 14:17:01 +03:00
base_n.rs rustc: doc comments 2019-02-10 23:42:32 +00:00
bit_set.rs Auto merge of #61787 - ecstatic-morse:dataflow-split-block-sets, r=pnkfelix 2019-06-24 20:44:18 +00:00
box_region.rs Make the rustc driver and interface demand driven 2019-03-10 04:49:45 +01:00
Cargo.toml rustc: use indexmap instead of a plain vector for upvars. 2019-06-01 19:17:22 +03:00
const_cstr.rs Remove licenses 2018-12-25 21:08:33 -07:00
fingerprint.rs librustc_data_structures => 2018 2019-02-09 01:36:22 +09:00
flock.rs Remove bitrig support from rust 2019-05-13 11:09:06 +02:00
fx.rs rustc: use indexmap instead of a plain vector for upvars. 2019-06-01 19:17:22 +03:00
indexed_vec.rs Fix meta-variable binding errors in macros 2019-06-23 01:30:41 +02:00
interner.rs Remove licenses 2018-12-25 21:08:33 -07:00
jobserver.rs Clean up jobserver integration 2019-04-09 07:44:10 +02:00
lib.rs Make the rustc driver and interface demand driven 2019-03-10 04:49:45 +01:00
macros.rs Stabilize underscore_const_names: stage0 -> bootstrap. 2019-06-10 06:17:39 +02:00
ptr_key.rs librustc_data_structures => 2018 2019-02-09 01:36:22 +09:00
sip128.rs rustc: doc comments 2019-02-10 23:42:32 +00:00
small_c_str.rs Remove licenses 2018-12-25 21:08:33 -07:00
sorted_map.rs Separate librustc_data_structures module 2019-06-16 14:17:01 +03:00
stable_hasher.rs Add more functionality to BitMatrix 2019-06-10 14:46:40 -07:00
svh.rs rustc: doc comments 2019-02-10 23:42:32 +00:00
sync.rs Add some comments 2019-03-06 04:47:08 +01:00
thin_vec.rs Allow attributes in formal function parameters 2019-06-09 07:58:40 -03:00
tiny_list.rs librustc_data_structures => 2018 2019-02-09 01:36:22 +09:00
transitive_relation.rs rustc: doc comments 2019-02-10 23:42:32 +00:00
vec_linked_list.rs librustc_data_structures => 2018 2019-02-09 01:36:22 +09:00
work_queue.rs rustc: doc comments 2019-02-10 23:42:32 +00:00