rust/compiler
Guillaume Gomez ab7623e93c
Rollup merge of #140115 - dianqk:gvn-matchbr, r=oli-obk
mir-opt: execute MatchBranchSimplification after GVN

This can provide more opportunities for MatchBranchSimplification.

Currently, rustc does not optimize the following code into a single statement at mir-opt, and this PR fixes the first case.

```rust
pub fn match1(c: bool, v1: i32, v2: i32) -> i32 {
    if c { v1 - v2 } else { v1 - v2 }
}

pub fn match2(c: bool, v1: i32) -> i32 {
    if c { v1 - 1 } else { v1 - 1 }
}
```

https://rust.godbolt.org/z/Y8xPMjrfM

r? mir-opt
2025-05-05 21:32:30 +02:00
..
rustc Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_abi Initial UnsafePinned/UnsafeUnpin impl [Part 1: Libs] 2025-04-13 01:11:04 -04:00
rustc_arena Introduce Arena::try_alloc_from_iter. 2025-04-19 01:13:18 +00:00
rustc_ast Add useful comments on ExprKind::If variants. 2025-05-02 15:53:39 +10:00
rustc_ast_ir Use -Wunused_crate_dependencies for compiler crates. 2025-03-20 08:59:43 +11:00
rustc_ast_lowering Auto merge of #140453 - Zoxc:next-disambiguator, r=oli-obk 2025-05-05 11:50:43 +00:00
rustc_ast_passes Initial support for dynamically linked crates 2025-05-04 22:03:15 +03:00
rustc_ast_pretty Initial support for dynamically linked crates 2025-05-04 22:03:15 +03:00
rustc_attr_data_structures Make #![feature(let_chains)] bootstrap conditional in compiler/ 2025-04-23 16:40:30 +02:00
rustc_attr_parsing Simplify LazyAttrTokenStream. 2025-04-30 07:10:56 +10:00
rustc_baked_icu_data Add unreachable_pub to RUSTC_LINT_FLAGS for compiler/ crates. 2025-03-11 13:14:21 +11:00
rustc_borrowck Auto merge of #140580 - jdonszelmann:variables-external-macros, r=m-ou-se 2025-05-04 15:16:06 +00:00
rustc_builtin_macros Rollup merge of #140312 - nnethercote:DelimArgs-spacing, r=petrochenkov 2025-04-30 10:18:26 +02:00
rustc_codegen_cranelift Rollup merge of #134232 - bjorn3:naked_asm_improvements, r=wesleywiser 2025-04-30 17:27:57 +02:00
rustc_codegen_gcc Initial support for dynamically linked crates 2025-05-04 22:03:15 +03:00
rustc_codegen_llvm Initial support for dynamically linked crates 2025-05-04 22:03:15 +03:00
rustc_codegen_ssa Initial support for dynamically linked crates 2025-05-04 22:03:15 +03:00
rustc_const_eval Auto merge of #140453 - Zoxc:next-disambiguator, r=oli-obk 2025-05-05 11:50:43 +00:00
rustc_data_structures Auto merge of #139965 - amandasystems:marginally-improved-scc-annotations, r=lcnr 2025-05-01 16:04:19 +00:00
rustc_driver Remove recursion_limit increases. 2025-04-02 16:25:27 +11:00
rustc_driver_impl Initial support for dynamically linked crates 2025-05-04 22:03:15 +03:00
rustc_error_codes resolve: Support imports of associated types and glob imports from traits 2025-05-02 15:59:38 +03:00
rustc_error_messages update cfgs 2025-04-09 12:29:59 +01:00
rustc_errors Make #![feature(let_chains)] bootstrap conditional in compiler/ 2025-04-23 16:40:30 +02:00
rustc_expand Make attribute safety validation logic more obvious 2025-05-04 21:44:50 +08:00
rustc_feature Initial support for dynamically linked crates 2025-05-04 22:03:15 +03:00
rustc_fluent_macro Replace proc_macro::SourceFile by Span::{file, local_file}. 2025-04-11 15:07:08 +02:00
rustc_fs_util Retry if creating temp fails with access denied 2025-04-25 11:28:36 +00:00
rustc_graphviz Remove #![warn(unreachable_pub)] from all compiler/ crates. 2025-03-11 13:14:21 +11:00
rustc_hashes Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_hir Auto merge of #140453 - Zoxc:next-disambiguator, r=oli-obk 2025-05-05 11:50:43 +00:00
rustc_hir_analysis Auto merge of #140453 - Zoxc:next-disambiguator, r=oli-obk 2025-05-05 11:50:43 +00:00
rustc_hir_pretty Avoid an indent for labelled loops. 2025-05-03 12:46:51 +10:00
rustc_hir_typeck Rollup merge of #140468 - BoxyUwU:normalization_confusings2, r=lcnr 2025-04-30 22:36:41 +02:00
rustc_incremental Replace infallible name_or_empty methods with fallible name methods. 2025-04-17 09:50:52 +10:00
rustc_index Add copy_within to IndexSlice 2025-04-15 10:44:28 -04:00
rustc_index_macros In rustc_mir_tranform, iterate over index newtypes instead of ints 2025-04-12 11:53:07 +00:00
rustc_infer Set groundwork for proper const normalization 2025-05-01 20:05:02 +01:00
rustc_interface Initial support for dynamically linked crates 2025-05-04 22:03:15 +03:00
rustc_lexer Replace rustc_lexer/unescape with rustc-literal-escaper crate 2025-04-04 14:44:45 +02:00
rustc_lint Auto merge of #140406 - Urgau:autorefs-perf, r=nnethercote 2025-05-02 17:35:50 +00:00
rustc_lint_defs Update lint-docs to default to Rust 2024 2025-04-26 14:08:58 -07:00
rustc_llvm PassWrapper: adapt for llvm/llvm-project@f137c3d592 2025-05-01 17:59:00 +00:00
rustc_log Allow linking rustc and rustdoc against the same single tracing crate 2025-05-03 10:18:50 -07:00
rustc_macros Rename rustc_query_append! to rustc_with_all_queries! 2025-04-29 20:48:51 +10:00
rustc_metadata Initial support for dynamically linked crates 2025-05-04 22:03:15 +03:00
rustc_middle Auto merge of #140453 - Zoxc:next-disambiguator, r=oli-obk 2025-05-05 11:50:43 +00:00
rustc_mir_build Initial support for dynamically linked crates 2025-05-04 22:03:15 +03:00
rustc_mir_dataflow AsyncDrop implementation using shim codegen of async_drop_in_place::{closure}, scoped async drop added. 2025-04-28 16:23:13 +07:00
rustc_mir_transform Rollup merge of #140115 - dianqk:gvn-matchbr, r=oli-obk 2025-05-05 21:32:30 +02:00
rustc_monomorphize mono collector: Reduce \# of locking while walking the graph 2025-04-29 11:47:37 +02:00
rustc_next_trait_solver Set groundwork for proper const normalization 2025-05-01 20:05:02 +01:00
rustc_parse Make attribute safety validation logic more obvious 2025-05-04 21:44:50 +08:00
rustc_parse_format Just suggest positional arg and adjust issue0139104 ui test 2025-05-03 22:39:43 +08:00
rustc_passes Initial support for dynamically linked crates 2025-05-04 22:03:15 +03:00
rustc_pattern_analysis Make #![feature(let_chains)] bootstrap conditional in compiler/ 2025-04-23 16:40:30 +02:00
rustc_privacy Rollup merge of #140249 - BoxyUwU:remove_weak_alias_terminology, r=oli-obk 2025-04-28 13:30:45 +02:00
rustc_query_impl Auto merge of #140145 - Zoxc:job-server-proxy, r=SparrowLii 2025-05-01 04:11:52 +00:00
rustc_query_system Add some comments 2025-04-29 12:04:33 +02:00
rustc_resolve Auto merge of #140453 - Zoxc:next-disambiguator, r=oli-obk 2025-05-05 11:50:43 +00:00
rustc_sanitizers Add DefPathData::NestedStatic instead of reusing DefPathData::AnonConst 2025-05-02 13:36:55 +02:00
rustc_serialize Zero the buffer passed from write_with 2025-04-25 07:14:27 +02:00
rustc_session Initial support for dynamically linked crates 2025-05-04 22:03:15 +03:00
rustc_smir Rollup merge of #139909 - oli-obk:or-patterns, r=BoxyUwU 2025-04-29 12:28:22 -04:00
rustc_span Initial support for dynamically linked crates 2025-05-04 22:03:15 +03:00
rustc_symbol_mangling Auto merge of #140453 - Zoxc:next-disambiguator, r=oli-obk 2025-05-05 11:50:43 +00:00
rustc_target Rollup merge of #139675 - sayantn:avx10, r=Amanieu 2025-05-04 13:21:07 +10:00
rustc_trait_selection Rollup merge of #140307 - mejrs:condition_parser, r=nnethercote 2025-05-05 00:20:57 -04:00
rustc_traits Set groundwork for proper const normalization 2025-05-01 20:05:02 +01:00
rustc_transmute Rollup merge of #140509 - tmiasko:merge-contiguous-ranges, r=jswrenn 2025-05-02 19:37:56 +02:00
rustc_ty_utils Auto merge of #140453 - Zoxc:next-disambiguator, r=oli-obk 2025-05-05 11:50:43 +00:00
rustc_type_ir Set groundwork for proper const normalization 2025-05-01 20:05:02 +01:00
rustc_type_ir_macros Split TypeFolder and FallibleTypeFolder 2025-04-15 18:30:35 +00:00
stable_mir let rustc_smir host stable_mir for refactoring 2025-04-05 18:23:07 +08:00