rust/compiler
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
..
rustc
rustc_apfloat
rustc_arena Remove unused dep from rustc_arena 2022-02-02 17:37:14 +01:00
rustc_ast Rollup merge of #93634 - matthiaskrgr:clippy_complexity_jan_2022, r=oli-obk 2022-02-18 16:23:33 +01:00
rustc_ast_lowering Rollup merge of #94146 - est31:let_else, r=cjgillot 2022-02-20 00:37:34 +01:00
rustc_ast_passes Rollup merge of #94146 - est31:let_else, r=cjgillot 2022-02-20 00:37:34 +01:00
rustc_ast_pretty Pretty print ItemKind::Use in rustfmt style 2022-02-07 21:51:05 -08:00
rustc_attr Rollup merge of #94146 - est31:let_else, r=cjgillot 2022-02-20 00:37:34 +01:00
rustc_borrowck Introduce ChunkedBitSet and use it for some dataflow analyses. 2022-02-23 10:18:49 +11:00
rustc_builtin_macros Rollup merge of #94146 - est31:let_else, r=cjgillot 2022-02-20 00:37:34 +01:00
rustc_codegen_cranelift Move ty::print methods to Drop-based scope guards 2022-02-16 17:24:23 -05:00
rustc_codegen_gcc Move ty::print methods to Drop-based scope guards 2022-02-16 17:24:23 -05:00
rustc_codegen_llvm Auto merge of #94062 - Mark-Simulacrum:drop-print-cfg, r=oli-obk 2022-02-20 18:12:59 +00:00
rustc_codegen_ssa Auto merge of #94062 - Mark-Simulacrum:drop-print-cfg, r=oli-obk 2022-02-20 18:12:59 +00:00
rustc_const_eval Auto merge of #94062 - Mark-Simulacrum:drop-print-cfg, r=oli-obk 2022-02-20 18:12:59 +00:00
rustc_data_structures Introduce ChunkedBitSet and use it for some dataflow analyses. 2022-02-23 10:18:49 +11:00
rustc_driver Rollup merge of #94146 - est31:let_else, r=cjgillot 2022-02-20 00:37:34 +01:00
rustc_error_codes Revert "Auto merge of #91403 - cjgillot:inherit-async, r=oli-obk" 2022-02-17 16:00:04 +00:00
rustc_errors Adopt let else in more places 2022-02-19 17:27:43 +01:00
rustc_expand Rollup merge of #94146 - est31:let_else, r=cjgillot 2022-02-20 00:37:34 +01:00
rustc_feature Rollup merge of #93658 - cchiw:issue-77443-fix, r=joshtriplett 2022-02-19 06:45:29 +01:00
rustc_fs_util
rustc_graphviz
rustc_hir Adopt let else in more places 2022-02-19 17:27:43 +01:00
rustc_hir_pretty Rollup merge of #93746 - cjgillot:nodefii, r=nikomatsakis 2022-02-09 14:12:22 +09:00
rustc_incremental Adopt let else in more places 2022-02-19 17:27:43 +01:00
rustc_index Introduce ChunkedBitSet and use it for some dataflow analyses. 2022-02-23 10:18:49 +11:00
rustc_infer Rollup merge of #94146 - est31:let_else, r=cjgillot 2022-02-20 00:37:34 +01:00
rustc_interface Rollup merge of #94146 - est31:let_else, r=cjgillot 2022-02-20 00:37:34 +01:00
rustc_lexer
rustc_lint Auto merge of #94062 - Mark-Simulacrum:drop-print-cfg, r=oli-obk 2022-02-20 18:12:59 +00:00
rustc_lint_defs Implement --check-cfg option (RFC 3013) 2022-02-16 13:03:12 +01:00
rustc_llvm Rollup merge of #91675 - ivanloz:memtagsan, r=nagisa 2022-02-18 23:23:03 +01:00
rustc_log
rustc_macros Move ty::print methods to Drop-based scope guards 2022-02-16 17:24:23 -05:00
rustc_metadata Adopt let else in more places 2022-02-19 17:27:43 +01:00
rustc_middle Auto merge of #94062 - Mark-Simulacrum:drop-print-cfg, r=oli-obk 2022-02-20 18:12:59 +00:00
rustc_mir_build Auto merge of #94062 - Mark-Simulacrum:drop-print-cfg, r=oli-obk 2022-02-20 18:12:59 +00:00
rustc_mir_dataflow Introduce ChunkedBitSet and use it for some dataflow analyses. 2022-02-23 10:18:49 +11:00
rustc_mir_transform Introduce ChunkedBitSet and use it for some dataflow analyses. 2022-02-23 10:18:49 +11:00
rustc_monomorphize Auto merge of #94062 - Mark-Simulacrum:drop-print-cfg, r=oli-obk 2022-02-20 18:12:59 +00:00
rustc_parse Rollup merge of #94146 - est31:let_else, r=cjgillot 2022-02-20 00:37:34 +01:00
rustc_parse_format Correctly mark the span of captured arguments in format_args!() 2022-02-16 07:34:06 +00:00
rustc_passes Adopt let else in more places 2022-02-19 17:27:43 +01:00
rustc_plugin_impl
rustc_privacy Overhaul Const. 2022-02-15 16:19:59 +11:00
rustc_query_impl Move ty::print methods to Drop-based scope guards 2022-02-16 17:24:23 -05:00
rustc_query_system Revert "Auto merge of #92007 - oli-obk:lazy_tait2, r=nikomatsakis" 2022-02-11 07:18:06 +00:00
rustc_resolve Rollup merge of #94146 - est31:let_else, r=cjgillot 2022-02-20 00:37:34 +01:00
rustc_save_analysis Auto merge of #94062 - Mark-Simulacrum:drop-print-cfg, r=oli-obk 2022-02-20 18:12:59 +00:00
rustc_serialize Adopt let else in more places 2022-02-19 17:27:43 +01:00
rustc_session Rollup merge of #94146 - est31:let_else, r=cjgillot 2022-02-20 00:37:34 +01:00
rustc_span Rollup merge of #94146 - est31:let_else, r=cjgillot 2022-02-20 00:37:34 +01:00
rustc_symbol_mangling Move ty::print methods to Drop-based scope guards 2022-02-16 17:24:23 -05:00
rustc_target Rollup merge of #94146 - est31:let_else, r=cjgillot 2022-02-20 00:37:34 +01:00
rustc_trait_selection Auto merge of #94062 - Mark-Simulacrum:drop-print-cfg, r=oli-obk 2022-02-20 18:12:59 +00:00
rustc_traits Adopt let else in more places 2022-02-19 17:27:43 +01:00
rustc_ty_utils Adopt let else in more places 2022-02-19 17:27:43 +01:00
rustc_type_ir Inline UnifyKey::index and UnifyKey::from_index 2022-02-15 19:07:06 +01:00
rustc_typeck Auto merge of #94062 - Mark-Simulacrum:drop-print-cfg, r=oli-obk 2022-02-20 18:12:59 +00:00