rust/compiler/rustc_mir_transform/src
Nicholas Nethercote 36b495f3cf Introduce ChunkedBitSet and use it for some dataflow analyses.
This reduces peak memory usage significantly for some programs with very
large functions, such as:
- `keccak`, `unicode_normalization`, and `match-stress-enum`, from
  the `rustc-perf` benchmark suite;
- `http-0.2.6` from crates.io.

The new type is used in the analyses where the bitsets can get huge
(e.g. 10s of thousands of bits): `MaybeInitializedPlaces`,
`MaybeUninitializedPlaces`, and `EverInitializedPlaces`.

Some refactoring was required in `rustc_mir_dataflow`. All existing
analysis domains are either `BitSet` or a trivial wrapper around
`BitSet`, and access in a few places is done via `Borrow<BitSet>` or
`BorrowMut<BitSet>`. Now that some of these domains are `ClusterBitSet`,
that no longer works. So this commit replaces the `Borrow`/`BorrowMut`
usage with a new trait `BitSetExt` containing the needed bitset
operations. The impls just forward these to the underlying bitset type.
This required fiddling with trait bounds in a few places.

The commit also:
- Moves `static_assert_size` from `rustc_data_structures` to
  `rustc_index` so it can be used in the latter; the former now
  re-exports it so existing users are unaffected.
- Factors out some common "clear excess bits in the final word"
  functionality in `bit_set.rs`.
- Uses `fill` in a few places instead of loops.
2022-02-23 10:18:49 +11:00
..
coverage Rollup merge of #93634 - matthiaskrgr:clippy_complexity_jan_2022, r=oli-obk 2022-02-18 16:23:33 +01:00
inline Adopt let else in more places 2022-02-19 17:27:43 +01:00
abort_unwinding_calls.rs Adopt let else in more places 2022-02-19 17:27:43 +01:00
add_call_guards.rs
add_moves_for_packed_drops.rs Adopt let else in more places 2022-02-19 17:27:43 +01:00
add_retag.rs Remove in_band_lifetimes from rustc_mir_transform 2021-12-07 21:04:40 -08:00
check_const_item_mutation.rs Remove in_band_lifetimes from rustc_mir_transform 2021-12-07 21:04:40 -08:00
check_packed_ref.rs give more help in the unaligned_references lint 2021-12-09 16:48:51 -05:00
check_unsafety.rs Adopt let else in more places 2022-02-19 17:27:43 +01:00
cleanup_post_borrowck.rs
const_debuginfo.rs Remove in_band_lifetimes from rustc_mir_transform 2021-12-07 21:04:40 -08:00
const_goto.rs Remove in_band_lifetimes from rustc_mir_transform 2021-12-07 21:04:40 -08:00
const_prop.rs Overhaul Const. 2022-02-15 16:19:59 +11:00
deaggregator.rs Adopt let else in more places 2022-02-19 17:27:43 +01:00
deduplicate_blocks.rs Remove in_band_lifetimes from rustc_mir_transform 2021-12-07 21:04:40 -08:00
dest_prop.rs Inline UnifyKey::index and UnifyKey::from_index 2022-02-15 19:07:06 +01:00
dump_mir.rs Inline on_mir_pass and add inline to dump_mir 2021-10-14 15:26:59 -05:00
early_otherwise_branch.rs Overhaul TyS and Ty. 2022-02-15 16:03:24 +11:00
elaborate_drops.rs Adopt let else in more places 2022-02-19 17:27:43 +01:00
function_item_references.rs remove TyS::same_type 2022-02-01 11:21:26 +01:00
generator.rs Adopt let else in more places 2022-02-19 17:27:43 +01:00
inline.rs Rollup merge of #94146 - est31:let_else, r=cjgillot 2022-02-20 00:37:34 +01:00
instcombine.rs Remove in_band_lifetimes from rustc_mir_transform 2021-12-07 21:04:40 -08:00
lib.rs add tainted_by_errors to mir::Body 2022-02-11 12:45:51 -08:00
lower_intrinsics.rs Adopt let else in more places 2022-02-19 17:27:43 +01:00
lower_slice_len.rs Adopt let else in more places 2022-02-19 17:27:43 +01:00
marker.rs Add pass for simple phase change 2021-12-02 17:31:38 -08:00
match_branches.rs Update passes with new interface 2021-12-02 17:31:38 -08:00
multiple_return_terminators.rs Update passes with new interface 2021-12-02 17:31:38 -08:00
normalize_array_len.rs Rollup merge of #94011 - est31:let_else, r=lcnr 2022-02-17 23:00:59 +01:00
nrvo.rs Adopt let else in more places 2022-02-19 17:27:43 +01:00
pass_manager.rs Remove in_band_lifetimes from rustc_mir_transform 2021-12-07 21:04:40 -08:00
remove_false_edges.rs Separate RemoveFalseEdges from SimplifyBranches 2021-11-30 17:14:48 -08:00
remove_noop_landing_pads.rs Remove deprecated LLVM-style inline assembly 2022-01-12 18:51:31 +01:00
remove_storage_markers.rs Update passes with new interface 2021-12-02 17:31:38 -08:00
remove_uninit_drops.rs Introduce ChunkedBitSet and use it for some dataflow analyses. 2022-02-23 10:18:49 +11:00
remove_unneeded_drops.rs Add rationale for RemoveUnneededDrops 2021-11-30 17:25:30 -08:00
remove_zsts.rs Adopt let else in more places 2022-02-19 17:27:43 +01:00
required_consts.rs Overhaul Const. 2022-02-15 16:19:59 +11:00
reveal_all.rs Overhaul TyS and Ty. 2022-02-15 16:03:24 +11:00
separate_const_switch.rs Remove deprecated LLVM-style inline assembly 2022-01-12 18:51:31 +01:00
shim.rs Adopt let else in more places 2022-02-19 17:27:43 +01:00
simplify.rs Adopt let else in more places 2022-02-19 17:27:43 +01:00
simplify_branches.rs Auto merge of #91279 - scottmcm:small-refactor, r=nagisa 2021-12-06 13:04:18 +00:00
simplify_comparison_integral.rs Remove in_band_lifetimes from rustc_mir_transform 2021-12-07 21:04:40 -08:00
simplify_try.rs Remove deprecated LLVM-style inline assembly 2022-01-12 18:51:31 +01:00
uninhabited_enum_branching.rs Extend uninhabited match branch optimization to also work on fallthrough. 2022-02-18 09:14:21 -05:00
unreachable_prop.rs Remove deprecated LLVM-style inline assembly 2022-01-12 18:51:31 +01:00