granite-rust/compiler
bors f34cc658eb Auto merge of #106612 - JakobDegen:cleanup-wf, r=tmiasko
Document wf constraints on control flow in cleanup blocks

Was recently made aware of [this code](a377893da2/compiler/rustc_codegen_ssa/src/mir/analyze.rs (L247-L368)), which has this potential ICE: a377893da2/compiler/rustc_codegen_ssa/src/mir/analyze.rs (L308-L314)

Roughly speaking, the code there is attempting to partition the cleanup blocks into funclets that satisfy a "unique successor" property, and the ICE is set off if that's not possible. This PR documents the well-formedness constraints that MIR must satisfy to avoid setting off that ICE.

The constraints documented are slightly stronger than the cases in which the ICE would have been set off in that code. This is necessary though, since whether or not that ICE gets set off can depend on iteration order in some graphs.

This sort of constraint is kind of ugly, but I don't know a better alternative at the moment. It's worth knowing that two important optimizations are still correct:
 - Removing edges in the cfg: Fewer edges => fewer paths => stronger dominance relations => more contractions, and more contractions can't turn a forest into not-a-forest.
 - Contracting an edge u -> v when u only has one successor and v only has one predecessor: u already dominated v, so this contraction was going to happen anyway.

There is definitely a MIR opt somewhere that can run afoul of this, but I don't know where it is. `@saethlin` was able to set it off though, so maybe he'll be able to shed some light on it.

r? `@RalfJung` I suppose, and cc `@tmiasko` who might have insight/opinions on this
2023-01-17 11:34:35 +00:00
..
rustc rustc: Use unix_sigpipe instead of rustc_driver::set_sigpipe_handler 2022-10-02 17:49:36 +02:00
rustc_abi Removed various double spaces in compiler source comments. 2023-01-14 17:34:59 +01:00
rustc_apfloat compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
rustc_arena compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
rustc_ast make error emitted on impl &Trait nicer 2023-01-15 12:23:46 +13:00
rustc_ast_lowering Auto merge of #106776 - oli-obk:om_nom_nom_nom_nom, r=cjgillot 2023-01-13 13:57:21 +00:00
rustc_ast_passes gate const closures 2023-01-12 02:28:37 +00:00
rustc_ast_pretty parse const closures 2023-01-12 02:28:37 +00:00
rustc_attr Fix uninlined_format_args for some compiler crates 2023-01-05 19:01:12 +01:00
rustc_baked_icu_data Update crate documentation of rustc_baked_icu_data crate 2022-11-18 14:46:36 -08:00
rustc_borrowck Rollup merge of #106829 - compiler-errors:more-alias-combine, r=spastorino 2023-01-17 05:25:22 +01:00
rustc_builtin_macros Update format.rs 2023-01-02 15:51:54 +05:30
rustc_codegen_cranelift Change src/test to tests in source files, fix tidy and tests 2023-01-11 09:32:13 +00:00
rustc_codegen_gcc Change src/test to tests in source files, fix tidy and tests 2023-01-11 09:32:13 +00:00
rustc_codegen_llvm Auto merge of #106646 - Amanieu:ilp32-object, r=Mark-Simulacrum 2023-01-14 08:33:09 +00:00
rustc_codegen_ssa Auto merge of #106646 - Amanieu:ilp32-object, r=Mark-Simulacrum 2023-01-14 08:33:09 +00:00
rustc_const_eval Avoid trivial checks on cleanup control flow in MIR validator 2023-01-16 15:01:16 -08:00
rustc_data_structures Document wf constraints on control flow in cleanup blocks 2023-01-16 14:51:33 -08:00
rustc_driver Rollup merge of #104645 - yukiomoto:log-backtrace-option, r=oli-obk 2023-01-13 19:16:41 +01:00
rustc_error_codes Improve a TAIT error and add an error code plus documentation 2023-01-16 16:54:14 +00:00
rustc_error_messages Rollup merge of #106949 - compiler-errors:is-poly, r=BoxyUwU 2023-01-17 05:25:23 +01:00
rustc_errors Rollup merge of #106427 - mejrs:translation_errors, r=davidtwco 2023-01-11 17:30:54 +01:00
rustc_expand Update rental hack to work with remapped paths. 2023-01-13 20:36:03 +00:00
rustc_feature Auto merge of #106004 - fee1-dead-contrib:const-closures, r=oli-obk 2023-01-13 05:04:48 +00:00
rustc_fs_util Remove useless borrows and derefs 2022-12-01 17:34:43 +00:00
rustc_graphviz Fix uninlined_format_args for some compiler crates 2023-01-05 19:01:12 +01:00
rustc_hir parse const closures 2023-01-12 02:28:37 +00:00
rustc_hir_analysis Rollup merge of #106829 - compiler-errors:more-alias-combine, r=spastorino 2023-01-17 05:25:22 +01:00
rustc_hir_pretty parse const closures 2023-01-12 02:28:37 +00:00
rustc_hir_typeck Auto merge of #106395 - compiler-errors:rework-predicates, r=eholk 2023-01-16 05:55:59 +00:00
rustc_incremental rustc: Remove needless lifetimes 2022-12-20 22:10:40 +01:00
rustc_index Fix uninlined_format_args for some compiler crates 2023-01-05 19:01:12 +01:00
rustc_infer Rollup merge of #106829 - compiler-errors:more-alias-combine, r=spastorino 2023-01-17 05:25:22 +01:00
rustc_interface Rollup merge of #106678 - Veykril:proc-macro-panic-abort, r=eholk 2023-01-13 19:16:43 +01:00
rustc_lexer Recover fn keyword as Fn trait in bounds 2022-12-27 06:14:46 +00:00
rustc_lint Rollup merge of #106906 - matthiaskrgr:clone, r=Nilstrieb 2023-01-15 21:17:35 +01:00
rustc_lint_defs Bump IMPLIED_BOUNDS_ENTAILMENT to Deny + ReportNow 2023-01-12 20:44:54 +00:00
rustc_llvm rustc_llvm: replace llvm::makeArrayRef with ArrayRef constructors. 2023-01-11 11:25:15 -05:00
rustc_log Add log-backtrace option to show backtraces along with logging 2023-01-12 00:17:48 +09:00
rustc_macros Support eager subdiagnostics again 2023-01-11 14:20:34 -08:00
rustc_metadata fix various subst_identity vs skip_binder 2023-01-14 00:30:03 -07:00
rustc_middle Auto merge of #106612 - JakobDegen:cleanup-wf, r=tmiasko 2023-01-17 11:34:35 +00:00
rustc_mir_build suggest fix for attempted integer identifier in patterns 2023-01-14 12:51:20 +13:00
rustc_mir_dataflow Fix uninlined_format_args for some compiler crates 2023-01-05 19:01:12 +01:00
rustc_mir_transform Remove visit_place. 2023-01-14 17:04:02 +00:00
rustc_monomorphize fix various subst_identity vs skip_binder 2023-01-14 00:30:03 -07:00
rustc_parse Rollup merge of #106712 - Ezrashaw:impl-ref-trait, r=estebank 2023-01-17 05:25:21 +01:00
rustc_parse_format Fix uninlined_format_args for some compiler crates 2023-01-05 19:01:12 +01:00
rustc_passes Auto merge of #106627 - Ezrashaw:no-e0711-without-staged-api, r=Mark-Simulacrum 2023-01-17 07:20:32 +00:00
rustc_plugin_impl Migrate all diagnostics 2022-10-23 10:09:44 +02:00
rustc_privacy change impl_trait_ref query to return EarlyBinder; remove bound_impl_trait_ref query; add EarlyBinder to impl_trait_ref in metadata 2023-01-14 00:29:56 -07:00
rustc_query_impl Fix uninlined_format_args for some compiler crates 2023-01-05 19:01:12 +01:00
rustc_query_system Fix uninlined_format_args for some compiler crates 2023-01-05 19:01:12 +01:00
rustc_resolve Only suggest adding type param if path being resolved was a type 2023-01-15 16:33:08 +00:00
rustc_save_analysis rename get_parent_node to parent_id 2023-01-04 00:43:13 +00:00
rustc_serialize compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
rustc_session check -Z query-dep-graph is enabled if -Z dump-dep-graph (#106736) 2023-01-16 11:09:53 +01:00
rustc_smir Only keep one version of ImplicitSelfKind. 2022-09-13 19:18:23 +02:00
rustc_span Heuristically undo path prefix mappings. 2023-01-14 12:49:37 +00:00
rustc_symbol_mangling Add type flags support for Ty and Const late-bound regions 2023-01-08 03:37:20 +00:00
rustc_target Fix some missed double spaces. 2023-01-14 18:23:40 +01:00
rustc_trait_selection Rollup merge of #106835 - compiler-errors:new-solver-gat-rebase-oops, r=lcnr 2023-01-16 20:29:38 +01:00
rustc_traits Rollup merge of #106829 - compiler-errors:more-alias-combine, r=spastorino 2023-01-17 05:25:22 +01:00
rustc_transmute Fix uninlined_format_args for some compiler crates 2023-01-05 19:01:12 +01:00
rustc_ty_utils ConstBlocks are poly if their substs are poly 2023-01-16 20:09:31 +00:00
rustc_type_ir Add type flags support for Ty and Const late-bound regions 2023-01-08 03:37:20 +00:00