From e39c92e7aa2cd77659d504b05ad59e38388866f7 Mon Sep 17 00:00:00 2001 From: Xavier Denis Date: Thu, 9 Jun 2022 23:16:56 -0700 Subject: [PATCH] Actually fix --- .../rustc_mir_build/src/build/expr/into.rs | 5 +- .../rustc_mir_build/src/build/matches/mod.rs | 37 +++--- .../bool_compare.opt1.InstCombine.diff | 18 +-- .../bool_compare.opt2.InstCombine.diff | 18 +-- .../bool_compare.opt3.InstCombine.diff | 18 +-- .../bool_compare.opt4.InstCombine.diff | 18 +-- .../const_goto.issue_77355_opt.ConstGoto.diff | 24 ++-- ...oto_storage.match_nested_if.ConstGoto.diff | 52 +++++---- ...l_flow_simplification.hello.ConstProp.diff | 16 +-- ...simplification.hello.PreCodegen.before.mir | 2 + .../discriminant.main.ConstProp.64bit.diff | 2 +- .../cycle.cycle.DeadStoreElimination.diff | 60 +++++----- ...egator_test_enum_2.test1.Deaggregator.diff | 22 ++-- .../branch.main.DestinationPropagation.diff | 10 +- ...ness.no_downcast.EarlyOtherwiseBranch.diff | 2 +- .../mir-opt/equal_true.opt.InstCombine.diff | 18 +-- ...float_to_exponential_common.ConstProp.diff | 44 ++++---- ...t_opt_bool.SimplifyComparisonIntegral.diff | 10 +- ...opt_floats.SimplifyComparisonIntegral.diff | 16 +-- ...t.opt_char.SimplifyComparisonIntegral.diff | 26 +++-- ...int.opt_i8.SimplifyComparisonIntegral.diff | 26 +++-- ...ltiple_ifs.SimplifyComparisonIntegral.diff | 52 +++++---- ...t_negative.SimplifyComparisonIntegral.diff | 26 +++-- ...nt.opt_u32.SimplifyComparisonIntegral.diff | 26 +++-- .../inline/inline_diverging.g.Inline.diff | 30 ++--- .../inline/inline_generator.main.Inline.diff | 10 +- ...e_38669.main.SimplifyCfg-initial.after.mir | 10 +- .../issue_41888.main.ElaborateDrops.after.mir | 70 ++++++------ .../issue_73223.main.PreCodegen.64bit.diff | 52 ++++----- ..._73223.main.SimplifyArmIdentity.64bit.diff | 66 +++++------ ...ue_59352.num_to_digit.PreCodegen.after.mir | 106 +++++++++--------- ...e_75439.foo.MatchBranchSimplification.diff | 14 +-- ....main.SimplifyCfg-promote-consts.after.mir | 12 +- ...wer_array_len.array_bound.InstCombine.diff | 60 +++++----- ...ray_len.array_bound.NormalizeArrayLen.diff | 58 +++++----- ..._array_len.array_bound.SimplifyLocals.diff | 62 +++++----- ...array_len.array_bound_mut.InstCombine.diff | 58 +++++----- ...len.array_bound_mut.NormalizeArrayLen.diff | 58 +++++----- ...ay_len.array_bound_mut.SimplifyLocals.diff | 62 +++++----- ...wer_intrinsics.f_u64.PreCodegen.before.mir | 4 +- ...er_intrinsics.f_unit.PreCodegen.before.mir | 10 +- ...er_slice_len.bound.LowerSliceLenCalls.diff | 44 ++++---- ...fg-initial.after-ElaborateDrops.after.diff | 30 ++--- ...s.foo.MatchBranchSimplification.64bit.diff | 16 +-- ...e_branches.foo.PreCodegen.before.64bit.mir | 2 + ...ed_if.MatchBranchSimplification.64bit.diff | 22 ++-- ...nators.test.MultipleReturnTerminators.diff | 2 + ...egion_subtyping_basic.main.nll.0.64bit.mir | 22 ++-- .../not_equal_false.opt.InstCombine.diff | 18 +-- ...asts.SimplifyCfg-elaborate-drops.after.mir | 70 ++++++------ ...mplify_cfg.main.SimplifyCfg-early-opt.diff | 14 ++- ...simplify_cfg.main.SimplifyCfg-initial.diff | 18 +-- ...mplifyConstCondition-after-const-prop.diff | 18 +-- ..._locals_fixedpoint.foo.SimplifyLocals.diff | 14 ++- ...reachable.main.UnreachablePropagation.diff | 22 ++-- ...diverging.main.UnreachablePropagation.diff | 28 ++--- ...oops.change_loop_body.ConstProp.64bit.diff | 6 +- ...le_storage.while_loop.PreCodegen.after.mir | 34 +++--- 58 files changed, 895 insertions(+), 775 deletions(-) diff --git a/compiler/rustc_mir_build/src/build/expr/into.rs b/compiler/rustc_mir_build/src/build/expr/into.rs index ea677d727e01..182a9a5cc5d0 100644 --- a/compiler/rustc_mir_build/src/build/expr/into.rs +++ b/compiler/rustc_mir_build/src/build/expr/into.rs @@ -63,6 +63,9 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { (if_then_scope, then_source_info), LintLevel::Inherited, |this| { + let variable_scope = + this.new_source_scope(then_expr.span, LintLevel::Inherited, None); + this.source_scope = variable_scope; let (then_block, else_block) = this.in_if_then_scope(condition_scope, |this| { let then_blk = unpack!(this.then_else_break( @@ -70,7 +73,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { &this.thir[cond], Some(condition_scope), condition_scope, - then_expr.span + SourceInfo { span: then_expr.span, scope: variable_scope } )); this.expr_into_dest(destination, then_blk, then_expr) diff --git a/compiler/rustc_mir_build/src/build/matches/mod.rs b/compiler/rustc_mir_build/src/build/matches/mod.rs index ce25a89a2749..9d5c262ed302 100644 --- a/compiler/rustc_mir_build/src/build/matches/mod.rs +++ b/compiler/rustc_mir_build/src/build/matches/mod.rs @@ -41,7 +41,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { expr: &Expr<'tcx>, temp_scope_override: Option, break_scope: region::Scope, - variable_span: Span, + variable_source_info: SourceInfo, ) -> BlockAnd<()> { let this = self; let expr_span = expr.span; @@ -53,7 +53,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { &this.thir[lhs], temp_scope_override, break_scope, - variable_span, + variable_source_info, )); let rhs_then_block = unpack!(this.then_else_break( @@ -61,7 +61,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { &this.thir[rhs], temp_scope_override, break_scope, - variable_span, + variable_source_info, )); rhs_then_block.unit() @@ -74,23 +74,18 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { &this.thir[value], temp_scope_override, break_scope, - variable_span, + variable_source_info, ) }) } - ExprKind::Let { expr, ref pat } => { - let variable_scope = - this.new_source_scope(variable_span, LintLevel::Inherited, None); - this.source_scope = variable_scope; - this.lower_let_expr( - block, - &this.thir[expr], - pat, - break_scope, - Some(variable_scope), - variable_span, - ) - } + ExprKind::Let { expr, ref pat } => this.lower_let_expr( + block, + &this.thir[expr], + pat, + break_scope, + Some(variable_source_info.scope), + variable_source_info.span, + ), _ => { let temp_scope = temp_scope_override.unwrap_or_else(|| this.local_scope()); let mutability = Mutability::Mut; @@ -1988,7 +1983,13 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { Guard::If(e) => { let e = &this.thir[e]; guard_span = e.span; - this.then_else_break(block, e, None, match_scope, arm_span) + this.then_else_break( + block, + e, + None, + match_scope, + this.source_info(arm_span), + ) } Guard::IfLet(ref pat, scrutinee) => { let s = &this.thir[scrutinee]; diff --git a/src/test/mir-opt/bool_compare.opt1.InstCombine.diff b/src/test/mir-opt/bool_compare.opt1.InstCombine.diff index 8f57d307abf5..ff608f7f5ceb 100644 --- a/src/test/mir-opt/bool_compare.opt1.InstCombine.diff +++ b/src/test/mir-opt/bool_compare.opt1.InstCombine.diff @@ -6,19 +6,21 @@ let mut _0: u32; // return place in scope 0 at $DIR/bool_compare.rs:2:21: 2:24 let mut _2: bool; // in scope 0 at $DIR/bool_compare.rs:3:8: 3:17 let mut _3: bool; // in scope 0 at $DIR/bool_compare.rs:3:8: 3:9 + scope 1 { + } bb0: { - StorageLive(_2); // scope 0 at $DIR/bool_compare.rs:3:8: 3:17 - StorageLive(_3); // scope 0 at $DIR/bool_compare.rs:3:8: 3:9 - _3 = _1; // scope 0 at $DIR/bool_compare.rs:3:8: 3:9 -- _2 = Ne(move _3, const true); // scope 0 at $DIR/bool_compare.rs:3:8: 3:17 -+ _2 = Not(move _3); // scope 0 at $DIR/bool_compare.rs:3:8: 3:17 - StorageDead(_3); // scope 0 at $DIR/bool_compare.rs:3:16: 3:17 - switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/bool_compare.rs:3:8: 3:17 + StorageLive(_2); // scope 1 at $DIR/bool_compare.rs:3:8: 3:17 + StorageLive(_3); // scope 1 at $DIR/bool_compare.rs:3:8: 3:9 + _3 = _1; // scope 1 at $DIR/bool_compare.rs:3:8: 3:9 +- _2 = Ne(move _3, const true); // scope 1 at $DIR/bool_compare.rs:3:8: 3:17 ++ _2 = Not(move _3); // scope 1 at $DIR/bool_compare.rs:3:8: 3:17 + StorageDead(_3); // scope 1 at $DIR/bool_compare.rs:3:16: 3:17 + switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/bool_compare.rs:3:8: 3:17 } bb1: { - _0 = const 0_u32; // scope 0 at $DIR/bool_compare.rs:3:20: 3:21 + _0 = const 0_u32; // scope 1 at $DIR/bool_compare.rs:3:20: 3:21 goto -> bb3; // scope 0 at $DIR/bool_compare.rs:3:5: 3:34 } diff --git a/src/test/mir-opt/bool_compare.opt2.InstCombine.diff b/src/test/mir-opt/bool_compare.opt2.InstCombine.diff index 1f5738ae7583..8395b22b8e2e 100644 --- a/src/test/mir-opt/bool_compare.opt2.InstCombine.diff +++ b/src/test/mir-opt/bool_compare.opt2.InstCombine.diff @@ -6,19 +6,21 @@ let mut _0: u32; // return place in scope 0 at $DIR/bool_compare.rs:7:21: 7:24 let mut _2: bool; // in scope 0 at $DIR/bool_compare.rs:8:8: 8:17 let mut _3: bool; // in scope 0 at $DIR/bool_compare.rs:8:16: 8:17 + scope 1 { + } bb0: { - StorageLive(_2); // scope 0 at $DIR/bool_compare.rs:8:8: 8:17 - StorageLive(_3); // scope 0 at $DIR/bool_compare.rs:8:16: 8:17 - _3 = _1; // scope 0 at $DIR/bool_compare.rs:8:16: 8:17 -- _2 = Ne(const true, move _3); // scope 0 at $DIR/bool_compare.rs:8:8: 8:17 -+ _2 = Not(move _3); // scope 0 at $DIR/bool_compare.rs:8:8: 8:17 - StorageDead(_3); // scope 0 at $DIR/bool_compare.rs:8:16: 8:17 - switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/bool_compare.rs:8:8: 8:17 + StorageLive(_2); // scope 1 at $DIR/bool_compare.rs:8:8: 8:17 + StorageLive(_3); // scope 1 at $DIR/bool_compare.rs:8:16: 8:17 + _3 = _1; // scope 1 at $DIR/bool_compare.rs:8:16: 8:17 +- _2 = Ne(const true, move _3); // scope 1 at $DIR/bool_compare.rs:8:8: 8:17 ++ _2 = Not(move _3); // scope 1 at $DIR/bool_compare.rs:8:8: 8:17 + StorageDead(_3); // scope 1 at $DIR/bool_compare.rs:8:16: 8:17 + switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/bool_compare.rs:8:8: 8:17 } bb1: { - _0 = const 0_u32; // scope 0 at $DIR/bool_compare.rs:8:20: 8:21 + _0 = const 0_u32; // scope 1 at $DIR/bool_compare.rs:8:20: 8:21 goto -> bb3; // scope 0 at $DIR/bool_compare.rs:8:5: 8:34 } diff --git a/src/test/mir-opt/bool_compare.opt3.InstCombine.diff b/src/test/mir-opt/bool_compare.opt3.InstCombine.diff index 3320509a7b37..413b5fdf2085 100644 --- a/src/test/mir-opt/bool_compare.opt3.InstCombine.diff +++ b/src/test/mir-opt/bool_compare.opt3.InstCombine.diff @@ -6,19 +6,21 @@ let mut _0: u32; // return place in scope 0 at $DIR/bool_compare.rs:12:21: 12:24 let mut _2: bool; // in scope 0 at $DIR/bool_compare.rs:13:8: 13:18 let mut _3: bool; // in scope 0 at $DIR/bool_compare.rs:13:8: 13:9 + scope 1 { + } bb0: { - StorageLive(_2); // scope 0 at $DIR/bool_compare.rs:13:8: 13:18 - StorageLive(_3); // scope 0 at $DIR/bool_compare.rs:13:8: 13:9 - _3 = _1; // scope 0 at $DIR/bool_compare.rs:13:8: 13:9 -- _2 = Eq(move _3, const false); // scope 0 at $DIR/bool_compare.rs:13:8: 13:18 -+ _2 = Not(move _3); // scope 0 at $DIR/bool_compare.rs:13:8: 13:18 - StorageDead(_3); // scope 0 at $DIR/bool_compare.rs:13:17: 13:18 - switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/bool_compare.rs:13:8: 13:18 + StorageLive(_2); // scope 1 at $DIR/bool_compare.rs:13:8: 13:18 + StorageLive(_3); // scope 1 at $DIR/bool_compare.rs:13:8: 13:9 + _3 = _1; // scope 1 at $DIR/bool_compare.rs:13:8: 13:9 +- _2 = Eq(move _3, const false); // scope 1 at $DIR/bool_compare.rs:13:8: 13:18 ++ _2 = Not(move _3); // scope 1 at $DIR/bool_compare.rs:13:8: 13:18 + StorageDead(_3); // scope 1 at $DIR/bool_compare.rs:13:17: 13:18 + switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/bool_compare.rs:13:8: 13:18 } bb1: { - _0 = const 0_u32; // scope 0 at $DIR/bool_compare.rs:13:21: 13:22 + _0 = const 0_u32; // scope 1 at $DIR/bool_compare.rs:13:21: 13:22 goto -> bb3; // scope 0 at $DIR/bool_compare.rs:13:5: 13:35 } diff --git a/src/test/mir-opt/bool_compare.opt4.InstCombine.diff b/src/test/mir-opt/bool_compare.opt4.InstCombine.diff index 02049f4126da..ba4496aa2c9f 100644 --- a/src/test/mir-opt/bool_compare.opt4.InstCombine.diff +++ b/src/test/mir-opt/bool_compare.opt4.InstCombine.diff @@ -6,19 +6,21 @@ let mut _0: u32; // return place in scope 0 at $DIR/bool_compare.rs:17:21: 17:24 let mut _2: bool; // in scope 0 at $DIR/bool_compare.rs:18:8: 18:18 let mut _3: bool; // in scope 0 at $DIR/bool_compare.rs:18:17: 18:18 + scope 1 { + } bb0: { - StorageLive(_2); // scope 0 at $DIR/bool_compare.rs:18:8: 18:18 - StorageLive(_3); // scope 0 at $DIR/bool_compare.rs:18:17: 18:18 - _3 = _1; // scope 0 at $DIR/bool_compare.rs:18:17: 18:18 -- _2 = Eq(const false, move _3); // scope 0 at $DIR/bool_compare.rs:18:8: 18:18 -+ _2 = Not(move _3); // scope 0 at $DIR/bool_compare.rs:18:8: 18:18 - StorageDead(_3); // scope 0 at $DIR/bool_compare.rs:18:17: 18:18 - switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/bool_compare.rs:18:8: 18:18 + StorageLive(_2); // scope 1 at $DIR/bool_compare.rs:18:8: 18:18 + StorageLive(_3); // scope 1 at $DIR/bool_compare.rs:18:17: 18:18 + _3 = _1; // scope 1 at $DIR/bool_compare.rs:18:17: 18:18 +- _2 = Eq(const false, move _3); // scope 1 at $DIR/bool_compare.rs:18:8: 18:18 ++ _2 = Not(move _3); // scope 1 at $DIR/bool_compare.rs:18:8: 18:18 + StorageDead(_3); // scope 1 at $DIR/bool_compare.rs:18:17: 18:18 + switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/bool_compare.rs:18:8: 18:18 } bb1: { - _0 = const 0_u32; // scope 0 at $DIR/bool_compare.rs:18:21: 18:22 + _0 = const 0_u32; // scope 1 at $DIR/bool_compare.rs:18:21: 18:22 goto -> bb3; // scope 0 at $DIR/bool_compare.rs:18:5: 18:35 } diff --git a/src/test/mir-opt/const_goto.issue_77355_opt.ConstGoto.diff b/src/test/mir-opt/const_goto.issue_77355_opt.ConstGoto.diff index 544d16a251a8..3173d09fddc1 100644 --- a/src/test/mir-opt/const_goto.issue_77355_opt.ConstGoto.diff +++ b/src/test/mir-opt/const_goto.issue_77355_opt.ConstGoto.diff @@ -7,33 +7,35 @@ - let mut _2: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _3: isize; // in scope 0 at $DIR/const_goto.rs:12:22: 12:28 + let mut _2: isize; // in scope 0 at $DIR/const_goto.rs:12:22: 12:28 + scope 1 { + } bb0: { -- StorageLive(_2); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL -- _3 = discriminant(_1); // scope 0 at $DIR/const_goto.rs:12:17: 12:20 -- switchInt(move _3) -> [1_isize: bb2, 2_isize: bb2, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL -+ _2 = discriminant(_1); // scope 0 at $DIR/const_goto.rs:12:17: 12:20 -+ switchInt(move _2) -> [1_isize: bb2, 2_isize: bb2, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL +- StorageLive(_2); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL +- _3 = discriminant(_1); // scope 1 at $DIR/const_goto.rs:12:17: 12:20 +- switchInt(move _3) -> [1_isize: bb2, 2_isize: bb2, otherwise: bb1]; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL ++ _2 = discriminant(_1); // scope 1 at $DIR/const_goto.rs:12:17: 12:20 ++ switchInt(move _2) -> [1_isize: bb2, 2_isize: bb2, otherwise: bb1]; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL } bb1: { -- _2 = const false; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL -- goto -> bb3; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL +- _2 = const false; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL +- goto -> bb3; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _0 = const 42_u64; // scope 0 at $DIR/const_goto.rs:12:53: 12:55 + goto -> bb3; // scope 0 at $DIR/const_goto.rs:12:5: 12:57 } bb2: { -- _2 = const true; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL -- goto -> bb3; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL +- _2 = const true; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL +- goto -> bb3; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - } - - bb3: { -- switchInt(move _2) -> [false: bb5, otherwise: bb4]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL +- switchInt(move _2) -> [false: bb5, otherwise: bb4]; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - } - - bb4: { - _0 = const 23_u64; // scope 0 at $DIR/const_goto.rs:12:41: 12:43 + _0 = const 23_u64; // scope 1 at $DIR/const_goto.rs:12:41: 12:43 - goto -> bb6; // scope 0 at $DIR/const_goto.rs:12:5: 12:57 + goto -> bb3; // scope 0 at $DIR/const_goto.rs:12:5: 12:57 } diff --git a/src/test/mir-opt/const_goto_storage.match_nested_if.ConstGoto.diff b/src/test/mir-opt/const_goto_storage.match_nested_if.ConstGoto.diff index 62a681e1c12a..33925e41faa6 100644 --- a/src/test/mir-opt/const_goto_storage.match_nested_if.ConstGoto.diff +++ b/src/test/mir-opt/const_goto_storage.match_nested_if.ConstGoto.diff @@ -13,54 +13,60 @@ scope 1 { debug val => _1; // in scope 1 at $DIR/const_goto_storage.rs:3:9: 3:12 } + scope 2 { + scope 3 { + scope 4 { + } + } + } bb0: { StorageLive(_1); // scope 0 at $DIR/const_goto_storage.rs:3:9: 3:12 - StorageLive(_2); // scope 0 at $DIR/const_goto_storage.rs:3:21: 3:23 - nop; // scope 0 at $DIR/const_goto_storage.rs:3:21: 3:23 - StorageLive(_3); // scope 0 at $DIR/const_goto_storage.rs:4:15: 8:10 -- StorageLive(_4); // scope 0 at $DIR/const_goto_storage.rs:4:18: 4:76 -- StorageLive(_5); // scope 0 at $DIR/const_goto_storage.rs:4:21: 4:52 -- StorageLive(_6); // scope 0 at $DIR/const_goto_storage.rs:4:24: 4:28 -- _6 = const true; // scope 0 at $DIR/const_goto_storage.rs:4:24: 4:28 -- switchInt(move _6) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/const_goto_storage.rs:4:24: 4:28 -+ StorageLive(_2); // scope 0 at $DIR/const_goto_storage.rs:4:24: 4:28 -+ _2 = const true; // scope 0 at $DIR/const_goto_storage.rs:4:24: 4:28 -+ switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/const_goto_storage.rs:4:24: 4:28 +- StorageLive(_4); // scope 2 at $DIR/const_goto_storage.rs:4:18: 4:76 +- StorageLive(_5); // scope 3 at $DIR/const_goto_storage.rs:4:21: 4:52 +- StorageLive(_6); // scope 4 at $DIR/const_goto_storage.rs:4:24: 4:28 +- _6 = const true; // scope 4 at $DIR/const_goto_storage.rs:4:24: 4:28 +- switchInt(move _6) -> [false: bb2, otherwise: bb1]; // scope 4 at $DIR/const_goto_storage.rs:4:24: 4:28 ++ StorageLive(_2); // scope 4 at $DIR/const_goto_storage.rs:4:24: 4:28 ++ _2 = const true; // scope 4 at $DIR/const_goto_storage.rs:4:24: 4:28 ++ switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 4 at $DIR/const_goto_storage.rs:4:24: 4:28 } bb1: { -- _5 = const true; // scope 0 at $DIR/const_goto_storage.rs:4:31: 4:35 -- goto -> bb3; // scope 0 at $DIR/const_goto_storage.rs:4:21: 4:52 +- _5 = const true; // scope 4 at $DIR/const_goto_storage.rs:4:31: 4:35 +- goto -> bb3; // scope 3 at $DIR/const_goto_storage.rs:4:21: 4:52 - } - - bb2: { -- _5 = const false; // scope 0 at $DIR/const_goto_storage.rs:4:45: 4:50 -- goto -> bb3; // scope 0 at $DIR/const_goto_storage.rs:4:21: 4:52 +- _5 = const false; // scope 3 at $DIR/const_goto_storage.rs:4:45: 4:50 +- goto -> bb3; // scope 3 at $DIR/const_goto_storage.rs:4:21: 4:52 - } - - bb3: { -- StorageDead(_6); // scope 0 at $DIR/const_goto_storage.rs:4:51: 4:52 -- switchInt(move _5) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/const_goto_storage.rs:4:21: 4:52 +- StorageDead(_6); // scope 3 at $DIR/const_goto_storage.rs:4:51: 4:52 +- switchInt(move _5) -> [false: bb5, otherwise: bb4]; // scope 3 at $DIR/const_goto_storage.rs:4:21: 4:52 - } - - bb4: { -- _4 = const true; // scope 0 at $DIR/const_goto_storage.rs:4:55: 4:59 -- goto -> bb6; // scope 0 at $DIR/const_goto_storage.rs:4:18: 4:76 +- _4 = const true; // scope 3 at $DIR/const_goto_storage.rs:4:55: 4:59 +- goto -> bb6; // scope 2 at $DIR/const_goto_storage.rs:4:18: 4:76 - } - - bb5: { -- _4 = const false; // scope 0 at $DIR/const_goto_storage.rs:4:69: 4:74 -- goto -> bb6; // scope 0 at $DIR/const_goto_storage.rs:4:18: 4:76 +- _4 = const false; // scope 2 at $DIR/const_goto_storage.rs:4:69: 4:74 +- goto -> bb6; // scope 2 at $DIR/const_goto_storage.rs:4:18: 4:76 - } - - bb6: { -- StorageDead(_5); // scope 0 at $DIR/const_goto_storage.rs:4:75: 4:76 -- switchInt(move _4) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/const_goto_storage.rs:4:18: 4:76 +- StorageDead(_5); // scope 2 at $DIR/const_goto_storage.rs:4:75: 4:76 +- switchInt(move _4) -> [false: bb8, otherwise: bb7]; // scope 2 at $DIR/const_goto_storage.rs:4:18: 4:76 - } - - bb7: { -- _3 = const true; // scope 0 at $DIR/const_goto_storage.rs:5:13: 5:17 +- _3 = const true; // scope 2 at $DIR/const_goto_storage.rs:5:13: 5:17 - goto -> bb9; // scope 0 at $DIR/const_goto_storage.rs:4:15: 8:10 - } - @@ -76,7 +82,7 @@ - bb10: { - StorageDead(_4); // scope 0 at $DIR/const_goto_storage.rs:8:9: 8:10 - StorageDead(_3); // scope 0 at $DIR/const_goto_storage.rs:8:9: 8:10 -+ StorageDead(_2); // scope 0 at $DIR/const_goto_storage.rs:4:51: 4:52 ++ StorageDead(_2); // scope 3 at $DIR/const_goto_storage.rs:4:51: 4:52 _1 = const true; // scope 0 at $DIR/const_goto_storage.rs:10:17: 10:21 - goto -> bb12; // scope 0 at $DIR/const_goto_storage.rs:10:17: 10:21 + goto -> bb3; // scope 0 at $DIR/const_goto_storage.rs:10:17: 10:21 @@ -86,7 +92,7 @@ - StorageDead(_4); // scope 0 at $DIR/const_goto_storage.rs:8:9: 8:10 - StorageDead(_3); // scope 0 at $DIR/const_goto_storage.rs:8:9: 8:10 + bb2: { -+ StorageDead(_2); // scope 0 at $DIR/const_goto_storage.rs:4:51: 4:52 ++ StorageDead(_2); // scope 3 at $DIR/const_goto_storage.rs:4:51: 4:52 _1 = const false; // scope 0 at $DIR/const_goto_storage.rs:12:14: 12:19 - goto -> bb12; // scope 0 at $DIR/const_goto_storage.rs:12:14: 12:19 + goto -> bb3; // scope 0 at $DIR/const_goto_storage.rs:12:14: 12:19 diff --git a/src/test/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff b/src/test/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff index d7636c817099..3d9517fb504c 100644 --- a/src/test/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff +++ b/src/test/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff @@ -5,18 +5,20 @@ let mut _0: (); // return place in scope 0 at $DIR/control-flow-simplification.rs:11:14: 11:14 let mut _1: bool; // in scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21 let mut _2: !; // in scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL + scope 1 { + } bb0: { - StorageLive(_1); // scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21 -- _1 = const ::NEEDS; // scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21 -- switchInt(move _1) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21 -+ _1 = const false; // scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21 -+ switchInt(const false) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21 + StorageLive(_1); // scope 1 at $DIR/control-flow-simplification.rs:12:8: 12:21 +- _1 = const ::NEEDS; // scope 1 at $DIR/control-flow-simplification.rs:12:8: 12:21 +- switchInt(move _1) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/control-flow-simplification.rs:12:8: 12:21 ++ _1 = const false; // scope 1 at $DIR/control-flow-simplification.rs:12:8: 12:21 ++ switchInt(const false) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/control-flow-simplification.rs:12:8: 12:21 } bb1: { - StorageLive(_2); // scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL - _2 = begin_panic::<&str>(const "explicit panic"); // scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL + StorageLive(_2); // scope 1 at $SRC_DIR/std/src/panic.rs:LL:COL + _2 = begin_panic::<&str>(const "explicit panic"); // scope 1 at $SRC_DIR/std/src/panic.rs:LL:COL // mir::Constant // + span: $SRC_DIR/std/src/panic.rs:LL:COL // + literal: Const { ty: fn(&str) -> ! {begin_panic::<&str>}, val: Value(Scalar()) } diff --git a/src/test/mir-opt/const_prop/control_flow_simplification.hello.PreCodegen.before.mir b/src/test/mir-opt/const_prop/control_flow_simplification.hello.PreCodegen.before.mir index 30512d0bbe87..4b11e4ebec6a 100644 --- a/src/test/mir-opt/const_prop/control_flow_simplification.hello.PreCodegen.before.mir +++ b/src/test/mir-opt/const_prop/control_flow_simplification.hello.PreCodegen.before.mir @@ -2,6 +2,8 @@ fn hello() -> () { let mut _0: (); // return place in scope 0 at $DIR/control-flow-simplification.rs:11:14: 11:14 + scope 1 { + } bb0: { return; // scope 0 at $DIR/control-flow-simplification.rs:15:2: 15:2 diff --git a/src/test/mir-opt/const_prop/discriminant.main.ConstProp.64bit.diff b/src/test/mir-opt/const_prop/discriminant.main.ConstProp.64bit.diff index a773ca246dd6..047853696f22 100644 --- a/src/test/mir-opt/const_prop/discriminant.main.ConstProp.64bit.diff +++ b/src/test/mir-opt/const_prop/discriminant.main.ConstProp.64bit.diff @@ -31,7 +31,7 @@ } bb2: { - _2 = const 42_i32; // scope 0 at $DIR/discriminant.rs:11:47: 11:49 + _2 = const 42_i32; // scope 2 at $DIR/discriminant.rs:11:47: 11:49 goto -> bb4; // scope 0 at $DIR/discriminant.rs:11:13: 11:64 } diff --git a/src/test/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination.diff b/src/test/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination.diff index 6037f89086dc..9f2ae1c90cad 100644 --- a/src/test/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination.diff +++ b/src/test/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination.diff @@ -8,7 +8,6 @@ let mut _0: (); // return place in scope 0 at $DIR/cycle.rs:9:46: 9:46 let mut _4: (); // in scope 0 at $DIR/cycle.rs:9:1: 18:2 let mut _5: bool; // in scope 0 at $DIR/cycle.rs:12:11: 12:17 - let _6: i32; // in scope 0 at $DIR/cycle.rs:13:13: 13:17 let mut _7: i32; // in scope 0 at $DIR/cycle.rs:14:13: 14:14 let mut _8: i32; // in scope 0 at $DIR/cycle.rs:15:13: 15:14 let mut _9: i32; // in scope 0 at $DIR/cycle.rs:16:13: 16:17 @@ -16,7 +15,10 @@ let _11: (); // in scope 0 at $DIR/cycle.rs:12:5: 17:6 let mut _12: !; // in scope 0 at $DIR/cycle.rs:12:5: 17:6 scope 1 { - debug temp => _6; // in scope 1 at $DIR/cycle.rs:13:13: 13:17 + let _6: i32; // in scope 1 at $DIR/cycle.rs:13:13: 13:17 + scope 2 { + debug temp => _6; // in scope 2 at $DIR/cycle.rs:13:13: 13:17 + } } bb0: { @@ -24,42 +26,42 @@ } bb1: { - StorageLive(_5); // scope 0 at $DIR/cycle.rs:12:11: 12:17 - _5 = cond() -> bb2; // scope 0 at $DIR/cycle.rs:12:11: 12:17 + StorageLive(_5); // scope 1 at $DIR/cycle.rs:12:11: 12:17 + _5 = cond() -> bb2; // scope 1 at $DIR/cycle.rs:12:11: 12:17 // mir::Constant // + span: $DIR/cycle.rs:12:11: 12:15 // + literal: Const { ty: fn() -> bool {cond}, val: Value(Scalar()) } } bb2: { - switchInt(move _5) -> [false: bb4, otherwise: bb3]; // scope 0 at $DIR/cycle.rs:12:11: 12:17 + switchInt(move _5) -> [false: bb4, otherwise: bb3]; // scope 1 at $DIR/cycle.rs:12:11: 12:17 } bb3: { - StorageLive(_6); // scope 0 at $DIR/cycle.rs:13:13: 13:17 -- _6 = _3; // scope 0 at $DIR/cycle.rs:13:20: 13:21 -+ nop; // scope 0 at $DIR/cycle.rs:13:20: 13:21 - StorageLive(_7); // scope 1 at $DIR/cycle.rs:14:13: 14:14 -- _7 = _2; // scope 1 at $DIR/cycle.rs:14:13: 14:14 -- _3 = move _7; // scope 1 at $DIR/cycle.rs:14:9: 14:14 -+ nop; // scope 1 at $DIR/cycle.rs:14:13: 14:14 -+ nop; // scope 1 at $DIR/cycle.rs:14:9: 14:14 - StorageDead(_7); // scope 1 at $DIR/cycle.rs:14:13: 14:14 - StorageLive(_8); // scope 1 at $DIR/cycle.rs:15:13: 15:14 -- _8 = _1; // scope 1 at $DIR/cycle.rs:15:13: 15:14 -- _2 = move _8; // scope 1 at $DIR/cycle.rs:15:9: 15:14 -+ nop; // scope 1 at $DIR/cycle.rs:15:13: 15:14 -+ nop; // scope 1 at $DIR/cycle.rs:15:9: 15:14 - StorageDead(_8); // scope 1 at $DIR/cycle.rs:15:13: 15:14 - StorageLive(_9); // scope 1 at $DIR/cycle.rs:16:13: 16:17 -- _9 = _6; // scope 1 at $DIR/cycle.rs:16:13: 16:17 -- _1 = move _9; // scope 1 at $DIR/cycle.rs:16:9: 16:17 -+ nop; // scope 1 at $DIR/cycle.rs:16:13: 16:17 -+ nop; // scope 1 at $DIR/cycle.rs:16:9: 16:17 - StorageDead(_9); // scope 1 at $DIR/cycle.rs:16:16: 16:17 -- _4 = const (); // scope 0 at $DIR/cycle.rs:12:18: 17:6 -+ nop; // scope 0 at $DIR/cycle.rs:12:18: 17:6 - StorageDead(_6); // scope 0 at $DIR/cycle.rs:17:5: 17:6 + StorageLive(_6); // scope 1 at $DIR/cycle.rs:13:13: 13:17 +- _6 = _3; // scope 1 at $DIR/cycle.rs:13:20: 13:21 ++ nop; // scope 1 at $DIR/cycle.rs:13:20: 13:21 + StorageLive(_7); // scope 2 at $DIR/cycle.rs:14:13: 14:14 +- _7 = _2; // scope 2 at $DIR/cycle.rs:14:13: 14:14 +- _3 = move _7; // scope 2 at $DIR/cycle.rs:14:9: 14:14 ++ nop; // scope 2 at $DIR/cycle.rs:14:13: 14:14 ++ nop; // scope 2 at $DIR/cycle.rs:14:9: 14:14 + StorageDead(_7); // scope 2 at $DIR/cycle.rs:14:13: 14:14 + StorageLive(_8); // scope 2 at $DIR/cycle.rs:15:13: 15:14 +- _8 = _1; // scope 2 at $DIR/cycle.rs:15:13: 15:14 +- _2 = move _8; // scope 2 at $DIR/cycle.rs:15:9: 15:14 ++ nop; // scope 2 at $DIR/cycle.rs:15:13: 15:14 ++ nop; // scope 2 at $DIR/cycle.rs:15:9: 15:14 + StorageDead(_8); // scope 2 at $DIR/cycle.rs:15:13: 15:14 + StorageLive(_9); // scope 2 at $DIR/cycle.rs:16:13: 16:17 +- _9 = _6; // scope 2 at $DIR/cycle.rs:16:13: 16:17 +- _1 = move _9; // scope 2 at $DIR/cycle.rs:16:9: 16:17 ++ nop; // scope 2 at $DIR/cycle.rs:16:13: 16:17 ++ nop; // scope 2 at $DIR/cycle.rs:16:9: 16:17 + StorageDead(_9); // scope 2 at $DIR/cycle.rs:16:16: 16:17 +- _4 = const (); // scope 1 at $DIR/cycle.rs:12:18: 17:6 ++ nop; // scope 1 at $DIR/cycle.rs:12:18: 17:6 + StorageDead(_6); // scope 1 at $DIR/cycle.rs:17:5: 17:6 StorageDead(_5); // scope 0 at $DIR/cycle.rs:17:5: 17:6 goto -> bb1; // scope 0 at $DIR/cycle.rs:12:5: 17:6 } diff --git a/src/test/mir-opt/deaggregator_test_enum_2.test1.Deaggregator.diff b/src/test/mir-opt/deaggregator_test_enum_2.test1.Deaggregator.diff index 5cfcef849e9d..089f43b5169f 100644 --- a/src/test/mir-opt/deaggregator_test_enum_2.test1.Deaggregator.diff +++ b/src/test/mir-opt/deaggregator_test_enum_2.test1.Deaggregator.diff @@ -8,21 +8,23 @@ let mut _3: bool; // in scope 0 at $DIR/deaggregator_test_enum_2.rs:10:8: 10:9 let mut _4: i32; // in scope 0 at $DIR/deaggregator_test_enum_2.rs:11:16: 11:17 let mut _5: i32; // in scope 0 at $DIR/deaggregator_test_enum_2.rs:13:16: 13:17 + scope 1 { + } bb0: { - StorageLive(_3); // scope 0 at $DIR/deaggregator_test_enum_2.rs:10:8: 10:9 - _3 = _1; // scope 0 at $DIR/deaggregator_test_enum_2.rs:10:8: 10:9 - switchInt(move _3) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/deaggregator_test_enum_2.rs:10:8: 10:9 + StorageLive(_3); // scope 1 at $DIR/deaggregator_test_enum_2.rs:10:8: 10:9 + _3 = _1; // scope 1 at $DIR/deaggregator_test_enum_2.rs:10:8: 10:9 + switchInt(move _3) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/deaggregator_test_enum_2.rs:10:8: 10:9 } bb1: { - StorageLive(_4); // scope 0 at $DIR/deaggregator_test_enum_2.rs:11:16: 11:17 - _4 = _2; // scope 0 at $DIR/deaggregator_test_enum_2.rs:11:16: 11:17 -- _0 = Foo::A(move _4); // scope 0 at $DIR/deaggregator_test_enum_2.rs:11:9: 11:18 -+ Deinit(_0); // scope 0 at $DIR/deaggregator_test_enum_2.rs:11:9: 11:18 -+ ((_0 as A).0: i32) = move _4; // scope 0 at $DIR/deaggregator_test_enum_2.rs:11:9: 11:18 -+ discriminant(_0) = 0; // scope 0 at $DIR/deaggregator_test_enum_2.rs:11:9: 11:18 - StorageDead(_4); // scope 0 at $DIR/deaggregator_test_enum_2.rs:11:17: 11:18 + StorageLive(_4); // scope 1 at $DIR/deaggregator_test_enum_2.rs:11:16: 11:17 + _4 = _2; // scope 1 at $DIR/deaggregator_test_enum_2.rs:11:16: 11:17 +- _0 = Foo::A(move _4); // scope 1 at $DIR/deaggregator_test_enum_2.rs:11:9: 11:18 ++ Deinit(_0); // scope 1 at $DIR/deaggregator_test_enum_2.rs:11:9: 11:18 ++ ((_0 as A).0: i32) = move _4; // scope 1 at $DIR/deaggregator_test_enum_2.rs:11:9: 11:18 ++ discriminant(_0) = 0; // scope 1 at $DIR/deaggregator_test_enum_2.rs:11:9: 11:18 + StorageDead(_4); // scope 1 at $DIR/deaggregator_test_enum_2.rs:11:17: 11:18 goto -> bb3; // scope 0 at $DIR/deaggregator_test_enum_2.rs:10:5: 14:6 } diff --git a/src/test/mir-opt/dest-prop/branch.main.DestinationPropagation.diff b/src/test/mir-opt/dest-prop/branch.main.DestinationPropagation.diff index c3aa19e6c5f8..e33057e81fa1 100644 --- a/src/test/mir-opt/dest-prop/branch.main.DestinationPropagation.diff +++ b/src/test/mir-opt/dest-prop/branch.main.DestinationPropagation.diff @@ -12,6 +12,8 @@ scope 2 { debug y => _2; // in scope 2 at $DIR/branch.rs:15:9: 15:10 } + scope 3 { + } } bb0: { @@ -24,19 +26,19 @@ bb1: { StorageLive(_2); // scope 1 at $DIR/branch.rs:15:9: 15:10 - StorageLive(_3); // scope 1 at $DIR/branch.rs:15:16: 15:22 - _3 = cond() -> bb2; // scope 1 at $DIR/branch.rs:15:16: 15:22 + StorageLive(_3); // scope 3 at $DIR/branch.rs:15:16: 15:22 + _3 = cond() -> bb2; // scope 3 at $DIR/branch.rs:15:16: 15:22 // mir::Constant // + span: $DIR/branch.rs:15:16: 15:20 // + literal: Const { ty: fn() -> bool {cond}, val: Value(Scalar()) } } bb2: { - switchInt(move _3) -> [false: bb4, otherwise: bb3]; // scope 1 at $DIR/branch.rs:15:16: 15:22 + switchInt(move _3) -> [false: bb4, otherwise: bb3]; // scope 3 at $DIR/branch.rs:15:16: 15:22 } bb3: { - nop; // scope 1 at $DIR/branch.rs:16:9: 16:10 + nop; // scope 3 at $DIR/branch.rs:16:9: 16:10 goto -> bb6; // scope 1 at $DIR/branch.rs:15:13: 20:6 } diff --git a/src/test/mir-opt/early_otherwise_branch_soundness.no_downcast.EarlyOtherwiseBranch.diff b/src/test/mir-opt/early_otherwise_branch_soundness.no_downcast.EarlyOtherwiseBranch.diff index d77056e6316f..982dd7a27bc6 100644 --- a/src/test/mir-opt/early_otherwise_branch_soundness.no_downcast.EarlyOtherwiseBranch.diff +++ b/src/test/mir-opt/early_otherwise_branch_soundness.no_downcast.EarlyOtherwiseBranch.diff @@ -24,7 +24,7 @@ } bb2: { - _0 = const 1_u32; // scope 0 at $DIR/early_otherwise_branch_soundness.rs:13:38: 13:39 + _0 = const 1_u32; // scope 1 at $DIR/early_otherwise_branch_soundness.rs:13:38: 13:39 goto -> bb4; // scope 0 at $DIR/early_otherwise_branch_soundness.rs:13:5: 13:52 } diff --git a/src/test/mir-opt/equal_true.opt.InstCombine.diff b/src/test/mir-opt/equal_true.opt.InstCombine.diff index 174095888b48..56f2fede4377 100644 --- a/src/test/mir-opt/equal_true.opt.InstCombine.diff +++ b/src/test/mir-opt/equal_true.opt.InstCombine.diff @@ -6,19 +6,21 @@ let mut _0: i32; // return place in scope 0 at $DIR/equal_true.rs:3:20: 3:23 let mut _2: bool; // in scope 0 at $DIR/equal_true.rs:4:8: 4:17 let mut _3: bool; // in scope 0 at $DIR/equal_true.rs:4:8: 4:9 + scope 1 { + } bb0: { - StorageLive(_2); // scope 0 at $DIR/equal_true.rs:4:8: 4:17 - StorageLive(_3); // scope 0 at $DIR/equal_true.rs:4:8: 4:9 - _3 = _1; // scope 0 at $DIR/equal_true.rs:4:8: 4:9 -- _2 = Eq(move _3, const true); // scope 0 at $DIR/equal_true.rs:4:8: 4:17 -+ _2 = move _3; // scope 0 at $DIR/equal_true.rs:4:8: 4:17 - StorageDead(_3); // scope 0 at $DIR/equal_true.rs:4:16: 4:17 - switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/equal_true.rs:4:8: 4:17 + StorageLive(_2); // scope 1 at $DIR/equal_true.rs:4:8: 4:17 + StorageLive(_3); // scope 1 at $DIR/equal_true.rs:4:8: 4:9 + _3 = _1; // scope 1 at $DIR/equal_true.rs:4:8: 4:9 +- _2 = Eq(move _3, const true); // scope 1 at $DIR/equal_true.rs:4:8: 4:17 ++ _2 = move _3; // scope 1 at $DIR/equal_true.rs:4:8: 4:17 + StorageDead(_3); // scope 1 at $DIR/equal_true.rs:4:16: 4:17 + switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/equal_true.rs:4:8: 4:17 } bb1: { - _0 = const 0_i32; // scope 0 at $DIR/equal_true.rs:4:20: 4:21 + _0 = const 0_i32; // scope 1 at $DIR/equal_true.rs:4:20: 4:21 goto -> bb3; // scope 0 at $DIR/equal_true.rs:4:5: 4:34 } diff --git a/src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff b/src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff index 2e0df0a6ba9f..15409fa0dd23 100644 --- a/src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff +++ b/src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff @@ -81,34 +81,34 @@ bb6: { StorageLive(_10); // scope 3 at $DIR/funky_arms.rs:24:17: 24:26 _10 = ((_7 as Some).0: usize); // scope 3 at $DIR/funky_arms.rs:24:17: 24:26 - StorageLive(_11); // scope 2 at $DIR/funky_arms.rs:26:43: 26:46 - _11 = &mut (*_1); // scope 2 at $DIR/funky_arms.rs:26:43: 26:46 - StorageLive(_12); // scope 2 at $DIR/funky_arms.rs:26:48: 26:51 - _12 = _2; // scope 2 at $DIR/funky_arms.rs:26:48: 26:51 - StorageLive(_13); // scope 2 at $DIR/funky_arms.rs:26:53: 26:57 - _13 = _6; // scope 2 at $DIR/funky_arms.rs:26:53: 26:57 - StorageLive(_14); // scope 2 at $DIR/funky_arms.rs:26:59: 26:79 - StorageLive(_15); // scope 2 at $DIR/funky_arms.rs:26:59: 26:75 - StorageLive(_16); // scope 2 at $DIR/funky_arms.rs:26:59: 26:68 - _16 = _10; // scope 2 at $DIR/funky_arms.rs:26:59: 26:68 - _15 = move _16 as u32 (Misc); // scope 2 at $DIR/funky_arms.rs:26:59: 26:75 - StorageDead(_16); // scope 2 at $DIR/funky_arms.rs:26:74: 26:75 - _14 = Add(move _15, const 1_u32); // scope 2 at $DIR/funky_arms.rs:26:59: 26:79 - StorageDead(_15); // scope 2 at $DIR/funky_arms.rs:26:78: 26:79 - StorageLive(_17); // scope 2 at $DIR/funky_arms.rs:26:81: 26:86 - _17 = _3; // scope 2 at $DIR/funky_arms.rs:26:81: 26:86 - _0 = float_to_exponential_common_exact::(move _11, move _12, move _13, move _14, move _17) -> bb7; // scope 2 at $DIR/funky_arms.rs:26:9: 26:87 + StorageLive(_11); // scope 3 at $DIR/funky_arms.rs:26:43: 26:46 + _11 = &mut (*_1); // scope 3 at $DIR/funky_arms.rs:26:43: 26:46 + StorageLive(_12); // scope 3 at $DIR/funky_arms.rs:26:48: 26:51 + _12 = _2; // scope 3 at $DIR/funky_arms.rs:26:48: 26:51 + StorageLive(_13); // scope 3 at $DIR/funky_arms.rs:26:53: 26:57 + _13 = _6; // scope 3 at $DIR/funky_arms.rs:26:53: 26:57 + StorageLive(_14); // scope 3 at $DIR/funky_arms.rs:26:59: 26:79 + StorageLive(_15); // scope 3 at $DIR/funky_arms.rs:26:59: 26:75 + StorageLive(_16); // scope 3 at $DIR/funky_arms.rs:26:59: 26:68 + _16 = _10; // scope 3 at $DIR/funky_arms.rs:26:59: 26:68 + _15 = move _16 as u32 (Misc); // scope 3 at $DIR/funky_arms.rs:26:59: 26:75 + StorageDead(_16); // scope 3 at $DIR/funky_arms.rs:26:74: 26:75 + _14 = Add(move _15, const 1_u32); // scope 3 at $DIR/funky_arms.rs:26:59: 26:79 + StorageDead(_15); // scope 3 at $DIR/funky_arms.rs:26:78: 26:79 + StorageLive(_17); // scope 3 at $DIR/funky_arms.rs:26:81: 26:86 + _17 = _3; // scope 3 at $DIR/funky_arms.rs:26:81: 26:86 + _0 = float_to_exponential_common_exact::(move _11, move _12, move _13, move _14, move _17) -> bb7; // scope 3 at $DIR/funky_arms.rs:26:9: 26:87 // mir::Constant // + span: $DIR/funky_arms.rs:26:9: 26:42 // + literal: Const { ty: for<'r, 's, 't0> fn(&'r mut Formatter<'s>, &'t0 T, Sign, u32, bool) -> Result<(), std::fmt::Error> {float_to_exponential_common_exact::}, val: Value(Scalar()) } } bb7: { - StorageDead(_17); // scope 2 at $DIR/funky_arms.rs:26:86: 26:87 - StorageDead(_14); // scope 2 at $DIR/funky_arms.rs:26:86: 26:87 - StorageDead(_13); // scope 2 at $DIR/funky_arms.rs:26:86: 26:87 - StorageDead(_12); // scope 2 at $DIR/funky_arms.rs:26:86: 26:87 - StorageDead(_11); // scope 2 at $DIR/funky_arms.rs:26:86: 26:87 + StorageDead(_17); // scope 3 at $DIR/funky_arms.rs:26:86: 26:87 + StorageDead(_14); // scope 3 at $DIR/funky_arms.rs:26:86: 26:87 + StorageDead(_13); // scope 3 at $DIR/funky_arms.rs:26:86: 26:87 + StorageDead(_12); // scope 3 at $DIR/funky_arms.rs:26:86: 26:87 + StorageDead(_11); // scope 3 at $DIR/funky_arms.rs:26:86: 26:87 StorageDead(_10); // scope 2 at $DIR/funky_arms.rs:27:5: 27:6 goto -> bb10; // scope 2 at $DIR/funky_arms.rs:24:5: 29:6 } diff --git a/src/test/mir-opt/if_condition_int.dont_opt_bool.SimplifyComparisonIntegral.diff b/src/test/mir-opt/if_condition_int.dont_opt_bool.SimplifyComparisonIntegral.diff index dddb7acae2b2..1baa7c7677a0 100644 --- a/src/test/mir-opt/if_condition_int.dont_opt_bool.SimplifyComparisonIntegral.diff +++ b/src/test/mir-opt/if_condition_int.dont_opt_bool.SimplifyComparisonIntegral.diff @@ -5,15 +5,17 @@ debug x => _1; // in scope 0 at $DIR/if-condition-int.rs:16:18: 16:19 let mut _0: u32; // return place in scope 0 at $DIR/if-condition-int.rs:16:30: 16:33 let mut _2: bool; // in scope 0 at $DIR/if-condition-int.rs:17:8: 17:9 + scope 1 { + } bb0: { - StorageLive(_2); // scope 0 at $DIR/if-condition-int.rs:17:8: 17:9 - _2 = _1; // scope 0 at $DIR/if-condition-int.rs:17:8: 17:9 - switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:17:8: 17:9 + StorageLive(_2); // scope 1 at $DIR/if-condition-int.rs:17:8: 17:9 + _2 = _1; // scope 1 at $DIR/if-condition-int.rs:17:8: 17:9 + switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/if-condition-int.rs:17:8: 17:9 } bb1: { - _0 = const 0_u32; // scope 0 at $DIR/if-condition-int.rs:17:12: 17:13 + _0 = const 0_u32; // scope 1 at $DIR/if-condition-int.rs:17:12: 17:13 goto -> bb3; // scope 0 at $DIR/if-condition-int.rs:17:5: 17:26 } diff --git a/src/test/mir-opt/if_condition_int.dont_opt_floats.SimplifyComparisonIntegral.diff b/src/test/mir-opt/if_condition_int.dont_opt_floats.SimplifyComparisonIntegral.diff index 2ff8386b205b..13933ea52f70 100644 --- a/src/test/mir-opt/if_condition_int.dont_opt_floats.SimplifyComparisonIntegral.diff +++ b/src/test/mir-opt/if_condition_int.dont_opt_floats.SimplifyComparisonIntegral.diff @@ -6,18 +6,20 @@ let mut _0: i32; // return place in scope 0 at $DIR/if-condition-int.rs:52:31: 52:34 let mut _2: bool; // in scope 0 at $DIR/if-condition-int.rs:53:8: 53:18 let mut _3: f32; // in scope 0 at $DIR/if-condition-int.rs:53:8: 53:9 + scope 1 { + } bb0: { - StorageLive(_2); // scope 0 at $DIR/if-condition-int.rs:53:8: 53:18 - StorageLive(_3); // scope 0 at $DIR/if-condition-int.rs:53:8: 53:9 - _3 = _1; // scope 0 at $DIR/if-condition-int.rs:53:8: 53:9 - _2 = Eq(move _3, const -42f32); // scope 0 at $DIR/if-condition-int.rs:53:8: 53:18 - StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:53:17: 53:18 - switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:53:8: 53:18 + StorageLive(_2); // scope 1 at $DIR/if-condition-int.rs:53:8: 53:18 + StorageLive(_3); // scope 1 at $DIR/if-condition-int.rs:53:8: 53:9 + _3 = _1; // scope 1 at $DIR/if-condition-int.rs:53:8: 53:9 + _2 = Eq(move _3, const -42f32); // scope 1 at $DIR/if-condition-int.rs:53:8: 53:18 + StorageDead(_3); // scope 1 at $DIR/if-condition-int.rs:53:17: 53:18 + switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/if-condition-int.rs:53:8: 53:18 } bb1: { - _0 = const 0_i32; // scope 0 at $DIR/if-condition-int.rs:53:21: 53:22 + _0 = const 0_i32; // scope 1 at $DIR/if-condition-int.rs:53:21: 53:22 goto -> bb3; // scope 0 at $DIR/if-condition-int.rs:53:5: 53:35 } diff --git a/src/test/mir-opt/if_condition_int.opt_char.SimplifyComparisonIntegral.diff b/src/test/mir-opt/if_condition_int.opt_char.SimplifyComparisonIntegral.diff index 40de48385f02..543818fdda0e 100644 --- a/src/test/mir-opt/if_condition_int.opt_char.SimplifyComparisonIntegral.diff +++ b/src/test/mir-opt/if_condition_int.opt_char.SimplifyComparisonIntegral.diff @@ -6,27 +6,29 @@ let mut _0: u32; // return place in scope 0 at $DIR/if-condition-int.rs:20:25: 20:28 let mut _2: bool; // in scope 0 at $DIR/if-condition-int.rs:21:8: 21:16 let mut _3: char; // in scope 0 at $DIR/if-condition-int.rs:21:8: 21:9 + scope 1 { + } bb0: { - StorageLive(_2); // scope 0 at $DIR/if-condition-int.rs:21:8: 21:16 - StorageLive(_3); // scope 0 at $DIR/if-condition-int.rs:21:8: 21:9 - _3 = _1; // scope 0 at $DIR/if-condition-int.rs:21:8: 21:9 -- _2 = Eq(move _3, const 'x'); // scope 0 at $DIR/if-condition-int.rs:21:8: 21:16 -- StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:21:15: 21:16 -- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:21:8: 21:16 -+ nop; // scope 0 at $DIR/if-condition-int.rs:21:8: 21:16 -+ nop; // scope 0 at $DIR/if-condition-int.rs:21:15: 21:16 -+ switchInt(move _3) -> ['x': bb1, otherwise: bb2]; // scope 0 at $DIR/if-condition-int.rs:21:8: 21:16 + StorageLive(_2); // scope 1 at $DIR/if-condition-int.rs:21:8: 21:16 + StorageLive(_3); // scope 1 at $DIR/if-condition-int.rs:21:8: 21:9 + _3 = _1; // scope 1 at $DIR/if-condition-int.rs:21:8: 21:9 +- _2 = Eq(move _3, const 'x'); // scope 1 at $DIR/if-condition-int.rs:21:8: 21:16 +- StorageDead(_3); // scope 1 at $DIR/if-condition-int.rs:21:15: 21:16 +- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/if-condition-int.rs:21:8: 21:16 ++ nop; // scope 1 at $DIR/if-condition-int.rs:21:8: 21:16 ++ nop; // scope 1 at $DIR/if-condition-int.rs:21:15: 21:16 ++ switchInt(move _3) -> ['x': bb1, otherwise: bb2]; // scope 1 at $DIR/if-condition-int.rs:21:8: 21:16 } bb1: { -+ StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:21:8: 21:16 - _0 = const 0_u32; // scope 0 at $DIR/if-condition-int.rs:21:19: 21:20 ++ StorageDead(_3); // scope 1 at $DIR/if-condition-int.rs:21:8: 21:16 + _0 = const 0_u32; // scope 1 at $DIR/if-condition-int.rs:21:19: 21:20 goto -> bb3; // scope 0 at $DIR/if-condition-int.rs:21:5: 21:33 } bb2: { -+ StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:21:8: 21:16 ++ StorageDead(_3); // scope 1 at $DIR/if-condition-int.rs:21:8: 21:16 _0 = const 1_u32; // scope 0 at $DIR/if-condition-int.rs:21:30: 21:31 goto -> bb3; // scope 0 at $DIR/if-condition-int.rs:21:5: 21:33 } diff --git a/src/test/mir-opt/if_condition_int.opt_i8.SimplifyComparisonIntegral.diff b/src/test/mir-opt/if_condition_int.opt_i8.SimplifyComparisonIntegral.diff index 28c36aed84c3..92e770c15e53 100644 --- a/src/test/mir-opt/if_condition_int.opt_i8.SimplifyComparisonIntegral.diff +++ b/src/test/mir-opt/if_condition_int.opt_i8.SimplifyComparisonIntegral.diff @@ -6,27 +6,29 @@ let mut _0: u32; // return place in scope 0 at $DIR/if-condition-int.rs:24:21: 24:24 let mut _2: bool; // in scope 0 at $DIR/if-condition-int.rs:25:8: 25:15 let mut _3: i8; // in scope 0 at $DIR/if-condition-int.rs:25:8: 25:9 + scope 1 { + } bb0: { - StorageLive(_2); // scope 0 at $DIR/if-condition-int.rs:25:8: 25:15 - StorageLive(_3); // scope 0 at $DIR/if-condition-int.rs:25:8: 25:9 - _3 = _1; // scope 0 at $DIR/if-condition-int.rs:25:8: 25:9 -- _2 = Eq(move _3, const 42_i8); // scope 0 at $DIR/if-condition-int.rs:25:8: 25:15 -- StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:25:14: 25:15 -- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:25:8: 25:15 -+ nop; // scope 0 at $DIR/if-condition-int.rs:25:8: 25:15 -+ nop; // scope 0 at $DIR/if-condition-int.rs:25:14: 25:15 -+ switchInt(move _3) -> [42_i8: bb1, otherwise: bb2]; // scope 0 at $DIR/if-condition-int.rs:25:8: 25:15 + StorageLive(_2); // scope 1 at $DIR/if-condition-int.rs:25:8: 25:15 + StorageLive(_3); // scope 1 at $DIR/if-condition-int.rs:25:8: 25:9 + _3 = _1; // scope 1 at $DIR/if-condition-int.rs:25:8: 25:9 +- _2 = Eq(move _3, const 42_i8); // scope 1 at $DIR/if-condition-int.rs:25:8: 25:15 +- StorageDead(_3); // scope 1 at $DIR/if-condition-int.rs:25:14: 25:15 +- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/if-condition-int.rs:25:8: 25:15 ++ nop; // scope 1 at $DIR/if-condition-int.rs:25:8: 25:15 ++ nop; // scope 1 at $DIR/if-condition-int.rs:25:14: 25:15 ++ switchInt(move _3) -> [42_i8: bb1, otherwise: bb2]; // scope 1 at $DIR/if-condition-int.rs:25:8: 25:15 } bb1: { -+ StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:25:8: 25:15 - _0 = const 0_u32; // scope 0 at $DIR/if-condition-int.rs:25:18: 25:19 ++ StorageDead(_3); // scope 1 at $DIR/if-condition-int.rs:25:8: 25:15 + _0 = const 0_u32; // scope 1 at $DIR/if-condition-int.rs:25:18: 25:19 goto -> bb3; // scope 0 at $DIR/if-condition-int.rs:25:5: 25:32 } bb2: { -+ StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:25:8: 25:15 ++ StorageDead(_3); // scope 1 at $DIR/if-condition-int.rs:25:8: 25:15 _0 = const 1_u32; // scope 0 at $DIR/if-condition-int.rs:25:29: 25:30 goto -> bb3; // scope 0 at $DIR/if-condition-int.rs:25:5: 25:32 } diff --git a/src/test/mir-opt/if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff b/src/test/mir-opt/if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff index 55932fee9600..6a3d8a948be1 100644 --- a/src/test/mir-opt/if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff +++ b/src/test/mir-opt/if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff @@ -8,46 +8,50 @@ let mut _3: u32; // in scope 0 at $DIR/if-condition-int.rs:33:8: 33:9 let mut _4: bool; // in scope 0 at $DIR/if-condition-int.rs:35:15: 35:22 let mut _5: u32; // in scope 0 at $DIR/if-condition-int.rs:35:15: 35:16 + scope 1 { + } + scope 2 { + } bb0: { - StorageLive(_2); // scope 0 at $DIR/if-condition-int.rs:33:8: 33:15 - StorageLive(_3); // scope 0 at $DIR/if-condition-int.rs:33:8: 33:9 - _3 = _1; // scope 0 at $DIR/if-condition-int.rs:33:8: 33:9 -- _2 = Eq(move _3, const 42_u32); // scope 0 at $DIR/if-condition-int.rs:33:8: 33:15 -- StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:33:14: 33:15 -- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:33:8: 33:15 -+ nop; // scope 0 at $DIR/if-condition-int.rs:33:8: 33:15 -+ nop; // scope 0 at $DIR/if-condition-int.rs:33:14: 33:15 -+ switchInt(move _3) -> [42_u32: bb1, otherwise: bb2]; // scope 0 at $DIR/if-condition-int.rs:33:8: 33:15 + StorageLive(_2); // scope 1 at $DIR/if-condition-int.rs:33:8: 33:15 + StorageLive(_3); // scope 1 at $DIR/if-condition-int.rs:33:8: 33:9 + _3 = _1; // scope 1 at $DIR/if-condition-int.rs:33:8: 33:9 +- _2 = Eq(move _3, const 42_u32); // scope 1 at $DIR/if-condition-int.rs:33:8: 33:15 +- StorageDead(_3); // scope 1 at $DIR/if-condition-int.rs:33:14: 33:15 +- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/if-condition-int.rs:33:8: 33:15 ++ nop; // scope 1 at $DIR/if-condition-int.rs:33:8: 33:15 ++ nop; // scope 1 at $DIR/if-condition-int.rs:33:14: 33:15 ++ switchInt(move _3) -> [42_u32: bb1, otherwise: bb2]; // scope 1 at $DIR/if-condition-int.rs:33:8: 33:15 } bb1: { -+ StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:33:8: 33:15 - _0 = const 0_u32; // scope 0 at $DIR/if-condition-int.rs:34:9: 34:10 ++ StorageDead(_3); // scope 1 at $DIR/if-condition-int.rs:33:8: 33:15 + _0 = const 0_u32; // scope 1 at $DIR/if-condition-int.rs:34:9: 34:10 goto -> bb6; // scope 0 at $DIR/if-condition-int.rs:33:5: 39:6 } bb2: { -+ StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:33:8: 33:15 - StorageLive(_4); // scope 0 at $DIR/if-condition-int.rs:35:15: 35:22 - StorageLive(_5); // scope 0 at $DIR/if-condition-int.rs:35:15: 35:16 - _5 = _1; // scope 0 at $DIR/if-condition-int.rs:35:15: 35:16 -- _4 = Ne(move _5, const 21_u32); // scope 0 at $DIR/if-condition-int.rs:35:15: 35:22 -- StorageDead(_5); // scope 0 at $DIR/if-condition-int.rs:35:21: 35:22 -- switchInt(move _4) -> [false: bb4, otherwise: bb3]; // scope 0 at $DIR/if-condition-int.rs:35:15: 35:22 -+ nop; // scope 0 at $DIR/if-condition-int.rs:35:15: 35:22 -+ nop; // scope 0 at $DIR/if-condition-int.rs:35:21: 35:22 -+ switchInt(move _5) -> [21_u32: bb4, otherwise: bb3]; // scope 0 at $DIR/if-condition-int.rs:35:15: 35:22 ++ StorageDead(_3); // scope 1 at $DIR/if-condition-int.rs:33:8: 33:15 + StorageLive(_4); // scope 2 at $DIR/if-condition-int.rs:35:15: 35:22 + StorageLive(_5); // scope 2 at $DIR/if-condition-int.rs:35:15: 35:16 + _5 = _1; // scope 2 at $DIR/if-condition-int.rs:35:15: 35:16 +- _4 = Ne(move _5, const 21_u32); // scope 2 at $DIR/if-condition-int.rs:35:15: 35:22 +- StorageDead(_5); // scope 2 at $DIR/if-condition-int.rs:35:21: 35:22 +- switchInt(move _4) -> [false: bb4, otherwise: bb3]; // scope 2 at $DIR/if-condition-int.rs:35:15: 35:22 ++ nop; // scope 2 at $DIR/if-condition-int.rs:35:15: 35:22 ++ nop; // scope 2 at $DIR/if-condition-int.rs:35:21: 35:22 ++ switchInt(move _5) -> [21_u32: bb4, otherwise: bb3]; // scope 2 at $DIR/if-condition-int.rs:35:15: 35:22 } bb3: { -+ StorageDead(_5); // scope 0 at $DIR/if-condition-int.rs:35:15: 35:22 - _0 = const 1_u32; // scope 0 at $DIR/if-condition-int.rs:36:9: 36:10 ++ StorageDead(_5); // scope 2 at $DIR/if-condition-int.rs:35:15: 35:22 + _0 = const 1_u32; // scope 2 at $DIR/if-condition-int.rs:36:9: 36:10 goto -> bb5; // scope 0 at $DIR/if-condition-int.rs:35:12: 39:6 } bb4: { -+ StorageDead(_5); // scope 0 at $DIR/if-condition-int.rs:35:15: 35:22 ++ StorageDead(_5); // scope 2 at $DIR/if-condition-int.rs:35:15: 35:22 _0 = const 2_u32; // scope 0 at $DIR/if-condition-int.rs:38:9: 38:10 goto -> bb5; // scope 0 at $DIR/if-condition-int.rs:35:12: 39:6 } diff --git a/src/test/mir-opt/if_condition_int.opt_negative.SimplifyComparisonIntegral.diff b/src/test/mir-opt/if_condition_int.opt_negative.SimplifyComparisonIntegral.diff index c4574b32a599..fa2ef0c1ec5b 100644 --- a/src/test/mir-opt/if_condition_int.opt_negative.SimplifyComparisonIntegral.diff +++ b/src/test/mir-opt/if_condition_int.opt_negative.SimplifyComparisonIntegral.diff @@ -6,27 +6,29 @@ let mut _0: u32; // return place in scope 0 at $DIR/if-condition-int.rs:28:28: 28:31 let mut _2: bool; // in scope 0 at $DIR/if-condition-int.rs:29:8: 29:16 let mut _3: i32; // in scope 0 at $DIR/if-condition-int.rs:29:8: 29:9 + scope 1 { + } bb0: { - StorageLive(_2); // scope 0 at $DIR/if-condition-int.rs:29:8: 29:16 - StorageLive(_3); // scope 0 at $DIR/if-condition-int.rs:29:8: 29:9 - _3 = _1; // scope 0 at $DIR/if-condition-int.rs:29:8: 29:9 -- _2 = Eq(move _3, const -42_i32); // scope 0 at $DIR/if-condition-int.rs:29:8: 29:16 -- StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:29:15: 29:16 -- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:29:8: 29:16 -+ nop; // scope 0 at $DIR/if-condition-int.rs:29:8: 29:16 -+ nop; // scope 0 at $DIR/if-condition-int.rs:29:15: 29:16 -+ switchInt(move _3) -> [-42_i32: bb1, otherwise: bb2]; // scope 0 at $DIR/if-condition-int.rs:29:8: 29:16 + StorageLive(_2); // scope 1 at $DIR/if-condition-int.rs:29:8: 29:16 + StorageLive(_3); // scope 1 at $DIR/if-condition-int.rs:29:8: 29:9 + _3 = _1; // scope 1 at $DIR/if-condition-int.rs:29:8: 29:9 +- _2 = Eq(move _3, const -42_i32); // scope 1 at $DIR/if-condition-int.rs:29:8: 29:16 +- StorageDead(_3); // scope 1 at $DIR/if-condition-int.rs:29:15: 29:16 +- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/if-condition-int.rs:29:8: 29:16 ++ nop; // scope 1 at $DIR/if-condition-int.rs:29:8: 29:16 ++ nop; // scope 1 at $DIR/if-condition-int.rs:29:15: 29:16 ++ switchInt(move _3) -> [-42_i32: bb1, otherwise: bb2]; // scope 1 at $DIR/if-condition-int.rs:29:8: 29:16 } bb1: { -+ StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:29:8: 29:16 - _0 = const 0_u32; // scope 0 at $DIR/if-condition-int.rs:29:19: 29:20 ++ StorageDead(_3); // scope 1 at $DIR/if-condition-int.rs:29:8: 29:16 + _0 = const 0_u32; // scope 1 at $DIR/if-condition-int.rs:29:19: 29:20 goto -> bb3; // scope 0 at $DIR/if-condition-int.rs:29:5: 29:33 } bb2: { -+ StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:29:8: 29:16 ++ StorageDead(_3); // scope 1 at $DIR/if-condition-int.rs:29:8: 29:16 _0 = const 1_u32; // scope 0 at $DIR/if-condition-int.rs:29:30: 29:31 goto -> bb3; // scope 0 at $DIR/if-condition-int.rs:29:5: 29:33 } diff --git a/src/test/mir-opt/if_condition_int.opt_u32.SimplifyComparisonIntegral.diff b/src/test/mir-opt/if_condition_int.opt_u32.SimplifyComparisonIntegral.diff index 88d9d5622b8e..9549e198060c 100644 --- a/src/test/mir-opt/if_condition_int.opt_u32.SimplifyComparisonIntegral.diff +++ b/src/test/mir-opt/if_condition_int.opt_u32.SimplifyComparisonIntegral.diff @@ -6,27 +6,29 @@ let mut _0: u32; // return place in scope 0 at $DIR/if-condition-int.rs:11:23: 11:26 let mut _2: bool; // in scope 0 at $DIR/if-condition-int.rs:12:8: 12:15 let mut _3: u32; // in scope 0 at $DIR/if-condition-int.rs:12:8: 12:9 + scope 1 { + } bb0: { - StorageLive(_2); // scope 0 at $DIR/if-condition-int.rs:12:8: 12:15 - StorageLive(_3); // scope 0 at $DIR/if-condition-int.rs:12:8: 12:9 - _3 = _1; // scope 0 at $DIR/if-condition-int.rs:12:8: 12:9 -- _2 = Eq(move _3, const 42_u32); // scope 0 at $DIR/if-condition-int.rs:12:8: 12:15 -- StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:12:14: 12:15 -- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:12:8: 12:15 -+ nop; // scope 0 at $DIR/if-condition-int.rs:12:8: 12:15 -+ nop; // scope 0 at $DIR/if-condition-int.rs:12:14: 12:15 -+ switchInt(move _3) -> [42_u32: bb1, otherwise: bb2]; // scope 0 at $DIR/if-condition-int.rs:12:8: 12:15 + StorageLive(_2); // scope 1 at $DIR/if-condition-int.rs:12:8: 12:15 + StorageLive(_3); // scope 1 at $DIR/if-condition-int.rs:12:8: 12:9 + _3 = _1; // scope 1 at $DIR/if-condition-int.rs:12:8: 12:9 +- _2 = Eq(move _3, const 42_u32); // scope 1 at $DIR/if-condition-int.rs:12:8: 12:15 +- StorageDead(_3); // scope 1 at $DIR/if-condition-int.rs:12:14: 12:15 +- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/if-condition-int.rs:12:8: 12:15 ++ nop; // scope 1 at $DIR/if-condition-int.rs:12:8: 12:15 ++ nop; // scope 1 at $DIR/if-condition-int.rs:12:14: 12:15 ++ switchInt(move _3) -> [42_u32: bb1, otherwise: bb2]; // scope 1 at $DIR/if-condition-int.rs:12:8: 12:15 } bb1: { -+ StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:12:8: 12:15 - _0 = const 0_u32; // scope 0 at $DIR/if-condition-int.rs:12:18: 12:19 ++ StorageDead(_3); // scope 1 at $DIR/if-condition-int.rs:12:8: 12:15 + _0 = const 0_u32; // scope 1 at $DIR/if-condition-int.rs:12:18: 12:19 goto -> bb3; // scope 0 at $DIR/if-condition-int.rs:12:5: 12:32 } bb2: { -+ StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:12:8: 12:15 ++ StorageDead(_3); // scope 1 at $DIR/if-condition-int.rs:12:8: 12:15 _0 = const 1_u32; // scope 0 at $DIR/if-condition-int.rs:12:29: 12:30 goto -> bb3; // scope 0 at $DIR/if-condition-int.rs:12:5: 12:32 } diff --git a/src/test/mir-opt/inline/inline_diverging.g.Inline.diff b/src/test/mir-opt/inline/inline_diverging.g.Inline.diff index da55260e284e..9a00bb809c6c 100644 --- a/src/test/mir-opt/inline/inline_diverging.g.Inline.diff +++ b/src/test/mir-opt/inline/inline_diverging.g.Inline.diff @@ -9,24 +9,26 @@ let mut _4: i32; // in scope 0 at $DIR/inline-diverging.rs:14:9: 14:10 let mut _5: !; // in scope 0 at $DIR/inline-diverging.rs:15:12: 17:6 let _6: !; // in scope 0 at $DIR/inline-diverging.rs:16:9: 16:16 -+ scope 1 (inlined panic) { // at $DIR/inline-diverging.rs:16:9: 16:16 -+ let mut _7: !; // in scope 1 at $SRC_DIR/std/src/panic.rs:LL:COL + scope 1 { + } ++ scope 2 (inlined panic) { // at $DIR/inline-diverging.rs:16:9: 16:16 ++ let mut _7: !; // in scope 2 at $SRC_DIR/std/src/panic.rs:LL:COL + } bb0: { - StorageLive(_2); // scope 0 at $DIR/inline-diverging.rs:13:8: 13:13 - StorageLive(_3); // scope 0 at $DIR/inline-diverging.rs:13:8: 13:9 - _3 = _1; // scope 0 at $DIR/inline-diverging.rs:13:8: 13:9 - _2 = Gt(move _3, const 0_i32); // scope 0 at $DIR/inline-diverging.rs:13:8: 13:13 - StorageDead(_3); // scope 0 at $DIR/inline-diverging.rs:13:12: 13:13 - switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/inline-diverging.rs:13:8: 13:13 + StorageLive(_2); // scope 1 at $DIR/inline-diverging.rs:13:8: 13:13 + StorageLive(_3); // scope 1 at $DIR/inline-diverging.rs:13:8: 13:9 + _3 = _1; // scope 1 at $DIR/inline-diverging.rs:13:8: 13:9 + _2 = Gt(move _3, const 0_i32); // scope 1 at $DIR/inline-diverging.rs:13:8: 13:13 + StorageDead(_3); // scope 1 at $DIR/inline-diverging.rs:13:12: 13:13 + switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/inline-diverging.rs:13:8: 13:13 } bb1: { - StorageLive(_4); // scope 0 at $DIR/inline-diverging.rs:14:9: 14:10 - _4 = _1; // scope 0 at $DIR/inline-diverging.rs:14:9: 14:10 - _0 = move _4 as u32 (Misc); // scope 0 at $DIR/inline-diverging.rs:14:9: 14:17 - StorageDead(_4); // scope 0 at $DIR/inline-diverging.rs:14:16: 14:17 + StorageLive(_4); // scope 1 at $DIR/inline-diverging.rs:14:9: 14:10 + _4 = _1; // scope 1 at $DIR/inline-diverging.rs:14:9: 14:10 + _0 = move _4 as u32 (Misc); // scope 1 at $DIR/inline-diverging.rs:14:9: 14:17 + StorageDead(_4); // scope 1 at $DIR/inline-diverging.rs:14:16: 14:17 StorageDead(_2); // scope 0 at $DIR/inline-diverging.rs:17:5: 17:6 return; // scope 0 at $DIR/inline-diverging.rs:18:2: 18:2 } @@ -34,8 +36,8 @@ bb2: { StorageLive(_6); // scope 0 at $DIR/inline-diverging.rs:16:9: 16:16 - _6 = panic(); // scope 0 at $DIR/inline-diverging.rs:16:9: 16:16 -+ StorageLive(_7); // scope 1 at $SRC_DIR/std/src/panic.rs:LL:COL -+ _7 = begin_panic::<&str>(const "explicit panic"); // scope 1 at $SRC_DIR/std/src/panic.rs:LL:COL ++ StorageLive(_7); // scope 2 at $SRC_DIR/std/src/panic.rs:LL:COL ++ _7 = begin_panic::<&str>(const "explicit panic"); // scope 2 at $SRC_DIR/std/src/panic.rs:LL:COL // mir::Constant - // + span: $DIR/inline-diverging.rs:16:9: 16:14 - // + literal: Const { ty: fn() -> ! {panic}, val: Value(Scalar()) } diff --git a/src/test/mir-opt/inline/inline_generator.main.Inline.diff b/src/test/mir-opt/inline/inline_generator.main.Inline.diff index 3e1c4a467014..af32b3158025 100644 --- a/src/test/mir-opt/inline/inline_generator.main.Inline.diff +++ b/src/test/mir-opt/inline/inline_generator.main.Inline.diff @@ -33,6 +33,8 @@ + let mut _13: &mut [generator@$DIR/inline-generator.rs:15:5: 15:41]; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:41 + let mut _14: &mut [generator@$DIR/inline-generator.rs:15:5: 15:41]; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:41 + let mut _15: &mut [generator@$DIR/inline-generator.rs:15:5: 15:41]; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:41 ++ scope 7 { ++ } + } bb0: { @@ -104,13 +106,13 @@ + bb3: { + _11 = move _7; // scope 6 at $DIR/inline-generator.rs:15:5: 15:41 + StorageLive(_8); // scope 6 at $DIR/inline-generator.rs:15:17: 15:39 -+ StorageLive(_9); // scope 6 at $DIR/inline-generator.rs:15:20: 15:21 -+ _9 = _11; // scope 6 at $DIR/inline-generator.rs:15:20: 15:21 -+ switchInt(move _9) -> [false: bb5, otherwise: bb4]; // scope 6 at $DIR/inline-generator.rs:15:20: 15:21 ++ StorageLive(_9); // scope 7 at $DIR/inline-generator.rs:15:20: 15:21 ++ _9 = _11; // scope 7 at $DIR/inline-generator.rs:15:20: 15:21 ++ switchInt(move _9) -> [false: bb5, otherwise: bb4]; // scope 7 at $DIR/inline-generator.rs:15:20: 15:21 + } + + bb4: { -+ _8 = const 7_i32; // scope 6 at $DIR/inline-generator.rs:15:24: 15:25 ++ _8 = const 7_i32; // scope 7 at $DIR/inline-generator.rs:15:24: 15:25 + goto -> bb6; // scope 6 at $DIR/inline-generator.rs:15:17: 15:39 + } + diff --git a/src/test/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir b/src/test/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir index a2471e4308b0..d4fe82cc99f6 100644 --- a/src/test/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir +++ b/src/test/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir @@ -9,6 +9,8 @@ fn main() -> () { let mut _5: !; // in scope 0 at $DIR/issue-38669.rs:7:25: 9:10 scope 1 { debug should_break => _1; // in scope 1 at $DIR/issue-38669.rs:5:9: 5:25 + scope 2 { + } } bb0: { @@ -24,13 +26,13 @@ fn main() -> () { bb2: { StorageLive(_3); // scope 1 at $DIR/issue-38669.rs:7:9: 9:10 - StorageLive(_4); // scope 1 at $DIR/issue-38669.rs:7:12: 7:24 - _4 = _1; // scope 1 at $DIR/issue-38669.rs:7:12: 7:24 - switchInt(move _4) -> [false: bb4, otherwise: bb3]; // scope 1 at $DIR/issue-38669.rs:7:12: 7:24 + StorageLive(_4); // scope 2 at $DIR/issue-38669.rs:7:12: 7:24 + _4 = _1; // scope 2 at $DIR/issue-38669.rs:7:12: 7:24 + switchInt(move _4) -> [false: bb4, otherwise: bb3]; // scope 2 at $DIR/issue-38669.rs:7:12: 7:24 } bb3: { - _0 = const (); // scope 1 at $DIR/issue-38669.rs:8:13: 8:18 + _0 = const (); // scope 2 at $DIR/issue-38669.rs:8:13: 8:18 StorageDead(_4); // scope 1 at $DIR/issue-38669.rs:9:9: 9:10 StorageDead(_3); // scope 1 at $DIR/issue-38669.rs:9:9: 9:10 StorageDead(_1); // scope 0 at $DIR/issue-38669.rs:12:1: 12:2 diff --git a/src/test/mir-opt/issue_41888.main.ElaborateDrops.after.mir b/src/test/mir-opt/issue_41888.main.ElaborateDrops.after.mir index 3c662a868140..7930aa997686 100644 --- a/src/test/mir-opt/issue_41888.main.ElaborateDrops.after.mir +++ b/src/test/mir-opt/issue_41888.main.ElaborateDrops.after.mir @@ -15,8 +15,10 @@ fn main() -> () { scope 1 { debug e => _1; // in scope 1 at $DIR/issue-41888.rs:7:9: 7:10 scope 2 { - debug _k => _6; // in scope 2 at $DIR/issue-41888.rs:10:21: 10:23 - let _6: K; // in scope 2 at $DIR/issue-41888.rs:10:21: 10:23 + scope 3 { + debug _k => _6; // in scope 3 at $DIR/issue-41888.rs:10:21: 10:23 + let _6: K; // in scope 3 at $DIR/issue-41888.rs:10:21: 10:23 + } } } @@ -25,48 +27,48 @@ fn main() -> () { _7 = const false; // scope 0 at $DIR/issue-41888.rs:7:9: 7:10 _8 = const false; // scope 0 at $DIR/issue-41888.rs:7:9: 7:10 StorageLive(_1); // scope 0 at $DIR/issue-41888.rs:7:9: 7:10 - StorageLive(_2); // scope 1 at $DIR/issue-41888.rs:8:8: 8:14 - _2 = cond() -> [return: bb1, unwind: bb11]; // scope 1 at $DIR/issue-41888.rs:8:8: 8:14 + StorageLive(_2); // scope 2 at $DIR/issue-41888.rs:8:8: 8:14 + _2 = cond() -> [return: bb1, unwind: bb11]; // scope 2 at $DIR/issue-41888.rs:8:8: 8:14 // mir::Constant // + span: $DIR/issue-41888.rs:8:8: 8:12 // + literal: Const { ty: fn() -> bool {cond}, val: Value(Scalar()) } } bb1: { - switchInt(move _2) -> [false: bb7, otherwise: bb2]; // scope 1 at $DIR/issue-41888.rs:8:8: 8:14 + switchInt(move _2) -> [false: bb7, otherwise: bb2]; // scope 2 at $DIR/issue-41888.rs:8:8: 8:14 } bb2: { - StorageLive(_3); // scope 1 at $DIR/issue-41888.rs:9:13: 9:20 - StorageLive(_4); // scope 1 at $DIR/issue-41888.rs:9:18: 9:19 - _4 = K; // scope 1 at $DIR/issue-41888.rs:9:18: 9:19 - _3 = E::F(move _4); // scope 1 at $DIR/issue-41888.rs:9:13: 9:20 - StorageDead(_4); // scope 1 at $DIR/issue-41888.rs:9:19: 9:20 - goto -> bb14; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 + StorageLive(_3); // scope 2 at $DIR/issue-41888.rs:9:13: 9:20 + StorageLive(_4); // scope 2 at $DIR/issue-41888.rs:9:18: 9:19 + _4 = K; // scope 2 at $DIR/issue-41888.rs:9:18: 9:19 + _3 = E::F(move _4); // scope 2 at $DIR/issue-41888.rs:9:13: 9:20 + StorageDead(_4); // scope 2 at $DIR/issue-41888.rs:9:19: 9:20 + goto -> bb14; // scope 2 at $DIR/issue-41888.rs:9:9: 9:10 } bb3: { - goto -> bb4; // scope 1 at $DIR/issue-41888.rs:9:19: 9:20 + goto -> bb4; // scope 2 at $DIR/issue-41888.rs:9:19: 9:20 } bb4: { - StorageDead(_3); // scope 1 at $DIR/issue-41888.rs:9:19: 9:20 - _5 = discriminant(_1); // scope 2 at $DIR/issue-41888.rs:10:16: 10:24 - switchInt(move _5) -> [0_isize: bb5, otherwise: bb6]; // scope 2 at $DIR/issue-41888.rs:10:16: 10:24 + StorageDead(_3); // scope 2 at $DIR/issue-41888.rs:9:19: 9:20 + _5 = discriminant(_1); // scope 3 at $DIR/issue-41888.rs:10:16: 10:24 + switchInt(move _5) -> [0_isize: bb5, otherwise: bb6]; // scope 3 at $DIR/issue-41888.rs:10:16: 10:24 } bb5: { - StorageLive(_6); // scope 2 at $DIR/issue-41888.rs:10:21: 10:23 - _9 = const false; // scope 2 at $DIR/issue-41888.rs:10:21: 10:23 - _6 = move ((_1 as F).0: K); // scope 2 at $DIR/issue-41888.rs:10:21: 10:23 - _0 = const (); // scope 1 at $DIR/issue-41888.rs:10:29: 13:10 - StorageDead(_6); // scope 1 at $DIR/issue-41888.rs:13:9: 13:10 - goto -> bb8; // scope 1 at $DIR/issue-41888.rs:10:9: 13:10 + StorageLive(_6); // scope 3 at $DIR/issue-41888.rs:10:21: 10:23 + _9 = const false; // scope 3 at $DIR/issue-41888.rs:10:21: 10:23 + _6 = move ((_1 as F).0: K); // scope 3 at $DIR/issue-41888.rs:10:21: 10:23 + _0 = const (); // scope 3 at $DIR/issue-41888.rs:10:29: 13:10 + StorageDead(_6); // scope 2 at $DIR/issue-41888.rs:13:9: 13:10 + goto -> bb8; // scope 2 at $DIR/issue-41888.rs:10:9: 13:10 } bb6: { - _0 = const (); // scope 1 at $DIR/issue-41888.rs:13:10: 13:10 - goto -> bb8; // scope 1 at $DIR/issue-41888.rs:10:9: 13:10 + _0 = const (); // scope 2 at $DIR/issue-41888.rs:13:10: 13:10 + goto -> bb8; // scope 2 at $DIR/issue-41888.rs:10:9: 13:10 } bb7: { @@ -88,7 +90,7 @@ fn main() -> () { } bb10 (cleanup): { - goto -> bb11; // scope 1 at $DIR/issue-41888.rs:9:19: 9:20 + goto -> bb11; // scope 2 at $DIR/issue-41888.rs:9:19: 9:20 } bb11 (cleanup): { @@ -100,19 +102,19 @@ fn main() -> () { } bb13 (cleanup): { - _7 = const true; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 - _8 = const true; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 - _9 = const true; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 - _1 = move _3; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 - goto -> bb10; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 + _7 = const true; // scope 2 at $DIR/issue-41888.rs:9:9: 9:10 + _8 = const true; // scope 2 at $DIR/issue-41888.rs:9:9: 9:10 + _9 = const true; // scope 2 at $DIR/issue-41888.rs:9:9: 9:10 + _1 = move _3; // scope 2 at $DIR/issue-41888.rs:9:9: 9:10 + goto -> bb10; // scope 2 at $DIR/issue-41888.rs:9:9: 9:10 } bb14: { - _7 = const true; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 - _8 = const true; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 - _9 = const true; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 - _1 = move _3; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 - goto -> bb3; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 + _7 = const true; // scope 2 at $DIR/issue-41888.rs:9:9: 9:10 + _8 = const true; // scope 2 at $DIR/issue-41888.rs:9:9: 9:10 + _9 = const true; // scope 2 at $DIR/issue-41888.rs:9:9: 9:10 + _1 = move _3; // scope 2 at $DIR/issue-41888.rs:9:9: 9:10 + goto -> bb3; // scope 2 at $DIR/issue-41888.rs:9:9: 9:10 } bb15: { diff --git a/src/test/mir-opt/issue_73223.main.PreCodegen.64bit.diff b/src/test/mir-opt/issue_73223.main.PreCodegen.64bit.diff index 8b0a73ec4ba6..52a4cc661a52 100644 --- a/src/test/mir-opt/issue_73223.main.PreCodegen.64bit.diff +++ b/src/test/mir-opt/issue_73223.main.PreCodegen.64bit.diff @@ -29,9 +29,11 @@ scope 4 { debug left_val => _8; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL debug right_val => _9; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let _13: core::panicking::AssertKind; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL scope 5 { - debug kind => _13; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let _13: core::panicking::AssertKind; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + scope 6 { + debug kind => _13; // in scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + } } } } @@ -70,32 +72,32 @@ _8 = (_5.0: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_9); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _9 = (_5.1: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_10); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_11); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_12); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _12 = (*_8); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _11 = Eq(move _12, const 1_i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_12); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _10 = Not(move _11); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_11); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - switchInt(move _10) -> [false: bb2, otherwise: bb1]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_10); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_11); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_12); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _12 = (*_8); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _11 = Eq(move _12, const 1_i32); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_12); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _10 = Not(move _11); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_11); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + switchInt(move _10) -> [false: bb2, otherwise: bb1]; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL } bb1: { - StorageLive(_13); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_14); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_15); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_16); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _16 = _8; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _15 = _16; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_17); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_18); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _18 = _9; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _17 = _18; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_19); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - Deinit(_19); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - discriminant(_19) = 0; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _14 = core::panicking::assert_failed::(const core::panicking::AssertKind::Eq, move _15, move _17, move _19); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_13); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_14); // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_15); // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_16); // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _16 = _8; // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _15 = _16; // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_17); // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_18); // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _18 = _9; // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _17 = _18; // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_19); // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + Deinit(_19); // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + discriminant(_19) = 0; // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _14 = core::panicking::assert_failed::(const core::panicking::AssertKind::Eq, move _15, move _17, move _19); // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + literal: Const { ty: for<'r, 's, 't0> fn(core::panicking::AssertKind, &'r i32, &'s i32, Option>) -> ! {core::panicking::assert_failed::}, val: Value(Scalar()) } diff --git a/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.64bit.diff b/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.64bit.diff index c96a6641bab9..877c03d65cf9 100644 --- a/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.64bit.diff +++ b/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.64bit.diff @@ -37,9 +37,11 @@ scope 4 { debug left_val => _13; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL debug right_val => _14; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let _20: core::panicking::AssertKind; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL scope 5 { - debug kind => _20; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let _20: core::panicking::AssertKind; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + scope 6 { + debug kind => _20; // in scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + } } } } @@ -97,42 +99,42 @@ _13 = (_9.0: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_14); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _14 = (_9.1: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_15); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_17); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _17 = (*_13); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_18); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _18 = const 1_i32; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _16 = Eq(move _17, const 1_i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_18); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_17); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _15 = Not(move _16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - switchInt(move _15) -> [false: bb4, otherwise: bb3]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_15); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_16); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_17); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _17 = (*_13); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_18); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _18 = const 1_i32; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _16 = Eq(move _17, const 1_i32); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_18); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_17); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _15 = Not(move _16); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_16); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + switchInt(move _15) -> [false: bb4, otherwise: bb3]; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL } bb3: { - StorageLive(_20); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - Deinit(_20); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - discriminant(_20) = 0; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_21); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_22); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _22 = const core::panicking::AssertKind::Eq; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_20); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + Deinit(_20); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + discriminant(_20) = 0; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_21); // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_22); // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _22 = const core::panicking::AssertKind::Eq; // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + literal: Const { ty: core::panicking::AssertKind, val: Value(Scalar(0x00)) } - StorageLive(_23); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_24); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _24 = _13; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _23 = _24; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_25); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_26); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _26 = _14; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _25 = _26; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_27); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - Deinit(_27); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - discriminant(_27) = 0; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _21 = core::panicking::assert_failed::(const core::panicking::AssertKind::Eq, move _23, move _25, move _27); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_23); // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_24); // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _24 = _13; // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _23 = _24; // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_25); // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_26); // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _26 = _14; // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _25 = _26; // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_27); // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + Deinit(_27); // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + discriminant(_27) = 0; // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _21 = core::panicking::assert_failed::(const core::panicking::AssertKind::Eq, move _23, move _25, move _27); // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + literal: Const { ty: for<'r, 's, 't0> fn(core::panicking::AssertKind, &'r i32, &'s i32, Option>) -> ! {core::panicking::assert_failed::}, val: Value(Scalar()) } diff --git a/src/test/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.mir b/src/test/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.mir index 40e7b74453a7..1dca68fd7279 100644 --- a/src/test/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.mir +++ b/src/test/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.mir @@ -8,60 +8,62 @@ fn num_to_digit(_1: char) -> u32 { let mut _4: char; // in scope 0 at $DIR/issue-59352.rs:14:26: 14:29 let mut _5: u32; // in scope 0 at $DIR/issue-59352.rs:14:8: 14:23 let mut _12: isize; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - scope 1 (inlined char::methods::::is_digit) { // at $DIR/issue-59352.rs:14:8: 14:23 - debug self => _2; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - debug radix => _5; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - let mut _6: &std::option::Option; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - let _7: std::option::Option; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - let mut _8: char; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - scope 2 (inlined Option::::is_some) { // at $SRC_DIR/core/src/char/methods.rs:LL:COL - debug self => _6; // in scope 2 at $SRC_DIR/core/src/option.rs:LL:COL - let mut _9: isize; // in scope 2 at $SRC_DIR/core/src/option.rs:LL:COL + scope 1 { + scope 2 (inlined char::methods::::is_digit) { // at $DIR/issue-59352.rs:14:8: 14:23 + debug self => _2; // in scope 2 at $SRC_DIR/core/src/char/methods.rs:LL:COL + debug radix => _5; // in scope 2 at $SRC_DIR/core/src/char/methods.rs:LL:COL + let mut _6: &std::option::Option; // in scope 2 at $SRC_DIR/core/src/char/methods.rs:LL:COL + let _7: std::option::Option; // in scope 2 at $SRC_DIR/core/src/char/methods.rs:LL:COL + let mut _8: char; // in scope 2 at $SRC_DIR/core/src/char/methods.rs:LL:COL + scope 3 (inlined Option::::is_some) { // at $SRC_DIR/core/src/char/methods.rs:LL:COL + debug self => _6; // in scope 3 at $SRC_DIR/core/src/option.rs:LL:COL + let mut _9: isize; // in scope 3 at $SRC_DIR/core/src/option.rs:LL:COL + } } - } - scope 3 (inlined #[track_caller] Option::::unwrap) { // at $DIR/issue-59352.rs:14:26: 14:50 - debug self => _3; // in scope 3 at $SRC_DIR/core/src/option.rs:LL:COL - let mut _10: isize; // in scope 3 at $SRC_DIR/core/src/option.rs:LL:COL - let mut _11: !; // in scope 3 at $SRC_DIR/core/src/option.rs:LL:COL - scope 4 { - debug val => _0; // in scope 4 at $SRC_DIR/core/src/option.rs:LL:COL + scope 4 (inlined #[track_caller] Option::::unwrap) { // at $DIR/issue-59352.rs:14:26: 14:50 + debug self => _3; // in scope 4 at $SRC_DIR/core/src/option.rs:LL:COL + let mut _10: isize; // in scope 4 at $SRC_DIR/core/src/option.rs:LL:COL + let mut _11: !; // in scope 4 at $SRC_DIR/core/src/option.rs:LL:COL + scope 5 { + debug val => _0; // in scope 5 at $SRC_DIR/core/src/option.rs:LL:COL + } } } bb0: { - StorageLive(_2); // scope 0 at $DIR/issue-59352.rs:14:8: 14:11 - _2 = _1; // scope 0 at $DIR/issue-59352.rs:14:8: 14:11 - StorageLive(_5); // scope 0 at $DIR/issue-59352.rs:14:8: 14:23 - StorageLive(_6); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - StorageLive(_7); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - StorageLive(_8); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - _8 = _2; // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - _7 = char::methods::::to_digit(move _8, const 8_u32) -> bb5; // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL + StorageLive(_2); // scope 1 at $DIR/issue-59352.rs:14:8: 14:11 + _2 = _1; // scope 1 at $DIR/issue-59352.rs:14:8: 14:11 + StorageLive(_5); // scope 1 at $DIR/issue-59352.rs:14:8: 14:23 + StorageLive(_6); // scope 2 at $SRC_DIR/core/src/char/methods.rs:LL:COL + StorageLive(_7); // scope 2 at $SRC_DIR/core/src/char/methods.rs:LL:COL + StorageLive(_8); // scope 2 at $SRC_DIR/core/src/char/methods.rs:LL:COL + _8 = _2; // scope 2 at $SRC_DIR/core/src/char/methods.rs:LL:COL + _7 = char::methods::::to_digit(move _8, const 8_u32) -> bb5; // scope 2 at $SRC_DIR/core/src/char/methods.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/char/methods.rs:LL:COL // + literal: Const { ty: fn(char, u32) -> Option {char::methods::::to_digit}, val: Value(Scalar()) } } bb1: { - StorageDead(_12); // scope 0 at $DIR/issue-59352.rs:14:8: 14:23 - StorageLive(_3); // scope 0 at $DIR/issue-59352.rs:14:26: 14:41 - StorageLive(_4); // scope 0 at $DIR/issue-59352.rs:14:26: 14:29 - _4 = _1; // scope 0 at $DIR/issue-59352.rs:14:26: 14:29 - _3 = char::methods::::to_digit(move _4, const 8_u32) -> bb2; // scope 0 at $DIR/issue-59352.rs:14:26: 14:41 + StorageDead(_12); // scope 1 at $DIR/issue-59352.rs:14:8: 14:23 + StorageLive(_3); // scope 1 at $DIR/issue-59352.rs:14:26: 14:41 + StorageLive(_4); // scope 1 at $DIR/issue-59352.rs:14:26: 14:29 + _4 = _1; // scope 1 at $DIR/issue-59352.rs:14:26: 14:29 + _3 = char::methods::::to_digit(move _4, const 8_u32) -> bb2; // scope 1 at $DIR/issue-59352.rs:14:26: 14:41 // mir::Constant // + span: $DIR/issue-59352.rs:14:30: 14:38 // + literal: Const { ty: fn(char, u32) -> Option {char::methods::::to_digit}, val: Value(Scalar()) } } bb2: { - StorageDead(_4); // scope 0 at $DIR/issue-59352.rs:14:40: 14:41 - StorageLive(_10); // scope 0 at $DIR/issue-59352.rs:14:26: 14:50 - _10 = discriminant(_3); // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL - switchInt(move _10) -> [0_isize: bb6, 1_isize: bb8, otherwise: bb7]; // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL + StorageDead(_4); // scope 1 at $DIR/issue-59352.rs:14:40: 14:41 + StorageLive(_10); // scope 1 at $DIR/issue-59352.rs:14:26: 14:50 + _10 = discriminant(_3); // scope 4 at $SRC_DIR/core/src/option.rs:LL:COL + switchInt(move _10) -> [0_isize: bb6, 1_isize: bb8, otherwise: bb7]; // scope 4 at $SRC_DIR/core/src/option.rs:LL:COL } bb3: { - StorageDead(_12); // scope 0 at $DIR/issue-59352.rs:14:8: 14:23 + StorageDead(_12); // scope 1 at $DIR/issue-59352.rs:14:8: 14:23 _0 = const 0_u32; // scope 0 at $DIR/issue-59352.rs:14:60: 14:61 goto -> bb4; // scope 0 at $DIR/issue-59352.rs:14:5: 14:63 } @@ -71,23 +73,23 @@ fn num_to_digit(_1: char) -> u32 { } bb5: { - _6 = &_7; // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - StorageDead(_8); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - StorageLive(_9); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - _9 = discriminant((*_6)); // scope 2 at $SRC_DIR/core/src/option.rs:LL:COL - StorageLive(_12); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _12 = move _9; // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_9); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - StorageDead(_6); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - StorageDead(_7); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - StorageDead(_5); // scope 0 at $DIR/issue-59352.rs:14:8: 14:23 - StorageDead(_2); // scope 0 at $DIR/issue-59352.rs:14:22: 14:23 - switchInt(move _12) -> [1_isize: bb1, otherwise: bb3]; // scope 0 at $DIR/issue-59352.rs:14:8: 14:23 + _6 = &_7; // scope 2 at $SRC_DIR/core/src/char/methods.rs:LL:COL + StorageDead(_8); // scope 2 at $SRC_DIR/core/src/char/methods.rs:LL:COL + StorageLive(_9); // scope 2 at $SRC_DIR/core/src/char/methods.rs:LL:COL + _9 = discriminant((*_6)); // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL + StorageLive(_12); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _12 = move _9; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_9); // scope 2 at $SRC_DIR/core/src/char/methods.rs:LL:COL + StorageDead(_6); // scope 2 at $SRC_DIR/core/src/char/methods.rs:LL:COL + StorageDead(_7); // scope 2 at $SRC_DIR/core/src/char/methods.rs:LL:COL + StorageDead(_5); // scope 1 at $DIR/issue-59352.rs:14:8: 14:23 + StorageDead(_2); // scope 1 at $DIR/issue-59352.rs:14:22: 14:23 + switchInt(move _12) -> [1_isize: bb1, otherwise: bb3]; // scope 1 at $DIR/issue-59352.rs:14:8: 14:23 } bb6: { - StorageLive(_11); // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL - _11 = core::panicking::panic(const "called `Option::unwrap()` on a `None` value"); // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL + StorageLive(_11); // scope 4 at $SRC_DIR/core/src/option.rs:LL:COL + _11 = core::panicking::panic(const "called `Option::unwrap()` on a `None` value"); // scope 4 at $SRC_DIR/core/src/option.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/option.rs:LL:COL // + literal: Const { ty: fn(&'static str) -> ! {core::panicking::panic}, val: Value(Scalar()) } @@ -97,13 +99,13 @@ fn num_to_digit(_1: char) -> u32 { } bb7: { - unreachable; // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL + unreachable; // scope 4 at $SRC_DIR/core/src/option.rs:LL:COL } bb8: { - _0 = move ((_3 as Some).0: u32); // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL - StorageDead(_10); // scope 0 at $DIR/issue-59352.rs:14:26: 14:50 - StorageDead(_3); // scope 0 at $DIR/issue-59352.rs:14:49: 14:50 + _0 = move ((_3 as Some).0: u32); // scope 4 at $SRC_DIR/core/src/option.rs:LL:COL + StorageDead(_10); // scope 1 at $DIR/issue-59352.rs:14:26: 14:50 + StorageDead(_3); // scope 1 at $DIR/issue-59352.rs:14:49: 14:50 goto -> bb4; // scope 0 at $DIR/issue-59352.rs:14:5: 14:63 } } diff --git a/src/test/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff b/src/test/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff index a194cddd52a6..b8023a6a8e69 100644 --- a/src/test/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff +++ b/src/test/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff @@ -13,8 +13,8 @@ scope 3 { debug ip => _4; // in scope 3 at $DIR/issue-75439.rs:9:27: 9:29 let _4: u32; // in scope 3 at $DIR/issue-75439.rs:9:27: 9:29 - } - scope 4 { + scope 4 { + } } } scope 2 { @@ -44,7 +44,7 @@ } bb4: { - StorageLive(_5); // scope 1 at $DIR/issue-75439.rs:10:14: 10:38 + StorageLive(_5); // scope 3 at $DIR/issue-75439.rs:10:14: 10:38 StorageLive(_6); // scope 4 at $DIR/issue-75439.rs:10:33: 10:35 _6 = _4; // scope 4 at $DIR/issue-75439.rs:10:33: 10:35 _5 = transmute::(move _6) -> bb7; // scope 4 at $DIR/issue-75439.rs:10:23: 10:36 @@ -67,10 +67,10 @@ bb7: { StorageDead(_6); // scope 4 at $DIR/issue-75439.rs:10:35: 10:36 - Deinit(_0); // scope 1 at $DIR/issue-75439.rs:10:9: 10:39 - ((_0 as Some).0: [u8; 4]) = move _5; // scope 1 at $DIR/issue-75439.rs:10:9: 10:39 - discriminant(_0) = 1; // scope 1 at $DIR/issue-75439.rs:10:9: 10:39 - StorageDead(_5); // scope 1 at $DIR/issue-75439.rs:10:38: 10:39 + Deinit(_0); // scope 3 at $DIR/issue-75439.rs:10:9: 10:39 + ((_0 as Some).0: [u8; 4]) = move _5; // scope 3 at $DIR/issue-75439.rs:10:9: 10:39 + discriminant(_0) = 1; // scope 3 at $DIR/issue-75439.rs:10:9: 10:39 + StorageDead(_5); // scope 3 at $DIR/issue-75439.rs:10:38: 10:39 StorageDead(_4); // scope 1 at $DIR/issue-75439.rs:11:5: 11:6 goto -> bb9; // scope 1 at $DIR/issue-75439.rs:9:5: 13:6 } diff --git a/src/test/mir-opt/loop_test.main.SimplifyCfg-promote-consts.after.mir b/src/test/mir-opt/loop_test.main.SimplifyCfg-promote-consts.after.mir index 9e91603cee94..d39bb419e3ff 100644 --- a/src/test/mir-opt/loop_test.main.SimplifyCfg-promote-consts.after.mir +++ b/src/test/mir-opt/loop_test.main.SimplifyCfg-promote-consts.after.mir @@ -9,18 +9,20 @@ fn main() -> () { let mut _5: (); // in scope 0 at $DIR/loop_test.rs:6:1: 17:2 let _6: i32; // in scope 0 at $DIR/loop_test.rs:14:13: 14:14 scope 1 { - debug x => _6; // in scope 1 at $DIR/loop_test.rs:14:13: 14:14 + } + scope 2 { + debug x => _6; // in scope 2 at $DIR/loop_test.rs:14:13: 14:14 } bb0: { StorageLive(_1); // scope 0 at $DIR/loop_test.rs:10:5: 12:6 - StorageLive(_2); // scope 0 at $DIR/loop_test.rs:10:8: 10:12 - _2 = const true; // scope 0 at $DIR/loop_test.rs:10:8: 10:12 - switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/loop_test.rs:10:8: 10:12 + StorageLive(_2); // scope 1 at $DIR/loop_test.rs:10:8: 10:12 + _2 = const true; // scope 1 at $DIR/loop_test.rs:10:8: 10:12 + switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/loop_test.rs:10:8: 10:12 } bb1: { - _0 = const (); // scope 0 at $DIR/loop_test.rs:11:9: 11:15 + _0 = const (); // scope 1 at $DIR/loop_test.rs:11:9: 11:15 StorageDead(_2); // scope 0 at $DIR/loop_test.rs:12:5: 12:6 StorageDead(_1); // scope 0 at $DIR/loop_test.rs:12:5: 12:6 return; // scope 0 at $DIR/loop_test.rs:17:2: 17:2 diff --git a/src/test/mir-opt/lower_array_len.array_bound.InstCombine.diff b/src/test/mir-opt/lower_array_len.array_bound.InstCombine.diff index c7226573d75c..e2cc076c6d8d 100644 --- a/src/test/mir-opt/lower_array_len.array_bound.InstCombine.diff +++ b/src/test/mir-opt/lower_array_len.array_bound.InstCombine.diff @@ -13,43 +13,45 @@ let _8: usize; // in scope 0 at $DIR/lower_array_len.rs:8:15: 8:20 let mut _9: usize; // in scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 let mut _10: bool; // in scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 - let mut _11: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 + scope 1 { + let mut _11: &[u8; N]; // in scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 + } bb0: { - StorageLive(_3); // scope 0 at $DIR/lower_array_len.rs:7:8: 7:27 - StorageLive(_4); // scope 0 at $DIR/lower_array_len.rs:7:8: 7:13 - _4 = _1; // scope 0 at $DIR/lower_array_len.rs:7:8: 7:13 - StorageLive(_5); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 - StorageLive(_6); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 - StorageLive(_7); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 -- _7 = &(*_2); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 -+ _7 = _2; // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 - StorageLive(_11); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 - _11 = _7; // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 - _6 = move _7 as &[u8] (Pointer(Unsize)); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 - StorageDead(_7); // scope 0 at $DIR/lower_array_len.rs:7:20: 7:21 -- _5 = Len((*_11)); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 -+ _5 = const N; // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 - StorageDead(_11); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 - StorageDead(_6); // scope 0 at $DIR/lower_array_len.rs:7:26: 7:27 - _3 = Lt(move _4, move _5); // scope 0 at $DIR/lower_array_len.rs:7:8: 7:27 - StorageDead(_5); // scope 0 at $DIR/lower_array_len.rs:7:26: 7:27 - StorageDead(_4); // scope 0 at $DIR/lower_array_len.rs:7:26: 7:27 - switchInt(move _3) -> [false: bb3, otherwise: bb1]; // scope 0 at $DIR/lower_array_len.rs:7:8: 7:27 + StorageLive(_3); // scope 1 at $DIR/lower_array_len.rs:7:8: 7:27 + StorageLive(_4); // scope 1 at $DIR/lower_array_len.rs:7:8: 7:13 + _4 = _1; // scope 1 at $DIR/lower_array_len.rs:7:8: 7:13 + StorageLive(_5); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 + StorageLive(_6); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 + StorageLive(_7); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 +- _7 = &(*_2); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 ++ _7 = _2; // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 + StorageLive(_11); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 + _11 = _7; // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 + _6 = move _7 as &[u8] (Pointer(Unsize)); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 + StorageDead(_7); // scope 1 at $DIR/lower_array_len.rs:7:20: 7:21 +- _5 = Len((*_11)); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 ++ _5 = const N; // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 + StorageDead(_11); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 + StorageDead(_6); // scope 1 at $DIR/lower_array_len.rs:7:26: 7:27 + _3 = Lt(move _4, move _5); // scope 1 at $DIR/lower_array_len.rs:7:8: 7:27 + StorageDead(_5); // scope 1 at $DIR/lower_array_len.rs:7:26: 7:27 + StorageDead(_4); // scope 1 at $DIR/lower_array_len.rs:7:26: 7:27 + switchInt(move _3) -> [false: bb3, otherwise: bb1]; // scope 1 at $DIR/lower_array_len.rs:7:8: 7:27 } bb1: { - StorageLive(_8); // scope 0 at $DIR/lower_array_len.rs:8:15: 8:20 - _8 = _1; // scope 0 at $DIR/lower_array_len.rs:8:15: 8:20 -- _9 = Len((*_2)); // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 -+ _9 = const N; // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 - _10 = Lt(_8, _9); // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 - assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> bb2; // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 + StorageLive(_8); // scope 1 at $DIR/lower_array_len.rs:8:15: 8:20 + _8 = _1; // scope 1 at $DIR/lower_array_len.rs:8:15: 8:20 +- _9 = Len((*_2)); // scope 1 at $DIR/lower_array_len.rs:8:9: 8:21 ++ _9 = const N; // scope 1 at $DIR/lower_array_len.rs:8:9: 8:21 + _10 = Lt(_8, _9); // scope 1 at $DIR/lower_array_len.rs:8:9: 8:21 + assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> bb2; // scope 1 at $DIR/lower_array_len.rs:8:9: 8:21 } bb2: { - _0 = (*_2)[_8]; // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 - StorageDead(_8); // scope 0 at $DIR/lower_array_len.rs:9:5: 9:6 + _0 = (*_2)[_8]; // scope 1 at $DIR/lower_array_len.rs:8:9: 8:21 + StorageDead(_8); // scope 1 at $DIR/lower_array_len.rs:9:5: 9:6 goto -> bb4; // scope 0 at $DIR/lower_array_len.rs:7:5: 11:6 } diff --git a/src/test/mir-opt/lower_array_len.array_bound.NormalizeArrayLen.diff b/src/test/mir-opt/lower_array_len.array_bound.NormalizeArrayLen.diff index d6c1c92cd917..d1cd3865da32 100644 --- a/src/test/mir-opt/lower_array_len.array_bound.NormalizeArrayLen.diff +++ b/src/test/mir-opt/lower_array_len.array_bound.NormalizeArrayLen.diff @@ -13,45 +13,47 @@ let _8: usize; // in scope 0 at $DIR/lower_array_len.rs:8:15: 8:20 let mut _9: usize; // in scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 let mut _10: bool; // in scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 -+ let mut _11: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 + scope 1 { ++ let mut _11: &[u8; N]; // in scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 + } bb0: { - StorageLive(_3); // scope 0 at $DIR/lower_array_len.rs:7:8: 7:27 - StorageLive(_4); // scope 0 at $DIR/lower_array_len.rs:7:8: 7:13 - _4 = _1; // scope 0 at $DIR/lower_array_len.rs:7:8: 7:13 - StorageLive(_5); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 - StorageLive(_6); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 - StorageLive(_7); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 - _7 = &(*_2); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 -+ StorageLive(_11); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 -+ _11 = _7; // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 - _6 = move _7 as &[u8] (Pointer(Unsize)); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 - StorageDead(_7); // scope 0 at $DIR/lower_array_len.rs:7:20: 7:21 -- _5 = Len((*_6)); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 -+ _5 = Len((*_11)); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 -+ StorageDead(_11); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 - goto -> bb1; // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 + StorageLive(_3); // scope 1 at $DIR/lower_array_len.rs:7:8: 7:27 + StorageLive(_4); // scope 1 at $DIR/lower_array_len.rs:7:8: 7:13 + _4 = _1; // scope 1 at $DIR/lower_array_len.rs:7:8: 7:13 + StorageLive(_5); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 + StorageLive(_6); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 + StorageLive(_7); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 + _7 = &(*_2); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 ++ StorageLive(_11); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 ++ _11 = _7; // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 + _6 = move _7 as &[u8] (Pointer(Unsize)); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 + StorageDead(_7); // scope 1 at $DIR/lower_array_len.rs:7:20: 7:21 +- _5 = Len((*_6)); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 ++ _5 = Len((*_11)); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 ++ StorageDead(_11); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 + goto -> bb1; // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 } bb1: { - StorageDead(_6); // scope 0 at $DIR/lower_array_len.rs:7:26: 7:27 - _3 = Lt(move _4, move _5); // scope 0 at $DIR/lower_array_len.rs:7:8: 7:27 - StorageDead(_5); // scope 0 at $DIR/lower_array_len.rs:7:26: 7:27 - StorageDead(_4); // scope 0 at $DIR/lower_array_len.rs:7:26: 7:27 - switchInt(move _3) -> [false: bb4, otherwise: bb2]; // scope 0 at $DIR/lower_array_len.rs:7:8: 7:27 + StorageDead(_6); // scope 1 at $DIR/lower_array_len.rs:7:26: 7:27 + _3 = Lt(move _4, move _5); // scope 1 at $DIR/lower_array_len.rs:7:8: 7:27 + StorageDead(_5); // scope 1 at $DIR/lower_array_len.rs:7:26: 7:27 + StorageDead(_4); // scope 1 at $DIR/lower_array_len.rs:7:26: 7:27 + switchInt(move _3) -> [false: bb4, otherwise: bb2]; // scope 1 at $DIR/lower_array_len.rs:7:8: 7:27 } bb2: { - StorageLive(_8); // scope 0 at $DIR/lower_array_len.rs:8:15: 8:20 - _8 = _1; // scope 0 at $DIR/lower_array_len.rs:8:15: 8:20 - _9 = Len((*_2)); // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 - _10 = Lt(_8, _9); // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 - assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> bb3; // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 + StorageLive(_8); // scope 1 at $DIR/lower_array_len.rs:8:15: 8:20 + _8 = _1; // scope 1 at $DIR/lower_array_len.rs:8:15: 8:20 + _9 = Len((*_2)); // scope 1 at $DIR/lower_array_len.rs:8:9: 8:21 + _10 = Lt(_8, _9); // scope 1 at $DIR/lower_array_len.rs:8:9: 8:21 + assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> bb3; // scope 1 at $DIR/lower_array_len.rs:8:9: 8:21 } bb3: { - _0 = (*_2)[_8]; // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 - StorageDead(_8); // scope 0 at $DIR/lower_array_len.rs:9:5: 9:6 + _0 = (*_2)[_8]; // scope 1 at $DIR/lower_array_len.rs:8:9: 8:21 + StorageDead(_8); // scope 1 at $DIR/lower_array_len.rs:9:5: 9:6 goto -> bb5; // scope 0 at $DIR/lower_array_len.rs:7:5: 11:6 } diff --git a/src/test/mir-opt/lower_array_len.array_bound.SimplifyLocals.diff b/src/test/mir-opt/lower_array_len.array_bound.SimplifyLocals.diff index 887c7b01f432..3d7047b71d34 100644 --- a/src/test/mir-opt/lower_array_len.array_bound.SimplifyLocals.diff +++ b/src/test/mir-opt/lower_array_len.array_bound.SimplifyLocals.diff @@ -13,47 +13,49 @@ - let _8: usize; // in scope 0 at $DIR/lower_array_len.rs:8:15: 8:20 - let mut _9: usize; // in scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 - let mut _10: bool; // in scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 -- let mut _11: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 + let _6: usize; // in scope 0 at $DIR/lower_array_len.rs:8:15: 8:20 + let mut _7: usize; // in scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 + let mut _8: bool; // in scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 + scope 1 { +- let mut _11: &[u8; N]; // in scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 + } bb0: { - StorageLive(_3); // scope 0 at $DIR/lower_array_len.rs:7:8: 7:27 - StorageLive(_4); // scope 0 at $DIR/lower_array_len.rs:7:8: 7:13 - _4 = _1; // scope 0 at $DIR/lower_array_len.rs:7:8: 7:13 - StorageLive(_5); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 -- StorageLive(_6); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 -- StorageLive(_7); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 -- StorageLive(_11); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 -- StorageDead(_7); // scope 0 at $DIR/lower_array_len.rs:7:20: 7:21 - _5 = const N; // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 -- StorageDead(_11); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 -- StorageDead(_6); // scope 0 at $DIR/lower_array_len.rs:7:26: 7:27 - _3 = Lt(move _4, move _5); // scope 0 at $DIR/lower_array_len.rs:7:8: 7:27 - StorageDead(_5); // scope 0 at $DIR/lower_array_len.rs:7:26: 7:27 - StorageDead(_4); // scope 0 at $DIR/lower_array_len.rs:7:26: 7:27 - switchInt(move _3) -> [false: bb3, otherwise: bb1]; // scope 0 at $DIR/lower_array_len.rs:7:8: 7:27 + StorageLive(_3); // scope 1 at $DIR/lower_array_len.rs:7:8: 7:27 + StorageLive(_4); // scope 1 at $DIR/lower_array_len.rs:7:8: 7:13 + _4 = _1; // scope 1 at $DIR/lower_array_len.rs:7:8: 7:13 + StorageLive(_5); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 +- StorageLive(_6); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 +- StorageLive(_7); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 +- StorageLive(_11); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 +- StorageDead(_7); // scope 1 at $DIR/lower_array_len.rs:7:20: 7:21 + _5 = const N; // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 +- StorageDead(_11); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 +- StorageDead(_6); // scope 1 at $DIR/lower_array_len.rs:7:26: 7:27 + _3 = Lt(move _4, move _5); // scope 1 at $DIR/lower_array_len.rs:7:8: 7:27 + StorageDead(_5); // scope 1 at $DIR/lower_array_len.rs:7:26: 7:27 + StorageDead(_4); // scope 1 at $DIR/lower_array_len.rs:7:26: 7:27 + switchInt(move _3) -> [false: bb3, otherwise: bb1]; // scope 1 at $DIR/lower_array_len.rs:7:8: 7:27 } bb1: { -- StorageLive(_8); // scope 0 at $DIR/lower_array_len.rs:8:15: 8:20 -- _8 = _1; // scope 0 at $DIR/lower_array_len.rs:8:15: 8:20 -- _9 = const N; // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 -- _10 = Lt(_8, _9); // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 -- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> bb2; // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 -+ StorageLive(_6); // scope 0 at $DIR/lower_array_len.rs:8:15: 8:20 -+ _6 = _1; // scope 0 at $DIR/lower_array_len.rs:8:15: 8:20 -+ _7 = const N; // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 -+ _8 = Lt(_6, _7); // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 -+ assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb2; // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 +- StorageLive(_8); // scope 1 at $DIR/lower_array_len.rs:8:15: 8:20 +- _8 = _1; // scope 1 at $DIR/lower_array_len.rs:8:15: 8:20 +- _9 = const N; // scope 1 at $DIR/lower_array_len.rs:8:9: 8:21 +- _10 = Lt(_8, _9); // scope 1 at $DIR/lower_array_len.rs:8:9: 8:21 +- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> bb2; // scope 1 at $DIR/lower_array_len.rs:8:9: 8:21 ++ StorageLive(_6); // scope 1 at $DIR/lower_array_len.rs:8:15: 8:20 ++ _6 = _1; // scope 1 at $DIR/lower_array_len.rs:8:15: 8:20 ++ _7 = const N; // scope 1 at $DIR/lower_array_len.rs:8:9: 8:21 ++ _8 = Lt(_6, _7); // scope 1 at $DIR/lower_array_len.rs:8:9: 8:21 ++ assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb2; // scope 1 at $DIR/lower_array_len.rs:8:9: 8:21 } bb2: { -- _0 = (*_2)[_8]; // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 -- StorageDead(_8); // scope 0 at $DIR/lower_array_len.rs:9:5: 9:6 -+ _0 = (*_2)[_6]; // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 -+ StorageDead(_6); // scope 0 at $DIR/lower_array_len.rs:9:5: 9:6 +- _0 = (*_2)[_8]; // scope 1 at $DIR/lower_array_len.rs:8:9: 8:21 +- StorageDead(_8); // scope 1 at $DIR/lower_array_len.rs:9:5: 9:6 ++ _0 = (*_2)[_6]; // scope 1 at $DIR/lower_array_len.rs:8:9: 8:21 ++ StorageDead(_6); // scope 1 at $DIR/lower_array_len.rs:9:5: 9:6 goto -> bb4; // scope 0 at $DIR/lower_array_len.rs:7:5: 11:6 } diff --git a/src/test/mir-opt/lower_array_len.array_bound_mut.InstCombine.diff b/src/test/mir-opt/lower_array_len.array_bound_mut.InstCombine.diff index 5622d4845321..ef5641ad3433 100644 --- a/src/test/mir-opt/lower_array_len.array_bound_mut.InstCombine.diff +++ b/src/test/mir-opt/lower_array_len.array_bound_mut.InstCombine.diff @@ -16,42 +16,44 @@ let _11: usize; // in scope 0 at $DIR/lower_array_len.rs:21:15: 21:16 let mut _12: usize; // in scope 0 at $DIR/lower_array_len.rs:21:9: 21:17 let mut _13: bool; // in scope 0 at $DIR/lower_array_len.rs:21:9: 21:17 - let mut _14: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 + scope 1 { + let mut _14: &[u8; N]; // in scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 + } bb0: { - StorageLive(_3); // scope 0 at $DIR/lower_array_len.rs:18:8: 18:27 - StorageLive(_4); // scope 0 at $DIR/lower_array_len.rs:18:8: 18:13 - _4 = _1; // scope 0 at $DIR/lower_array_len.rs:18:8: 18:13 - StorageLive(_5); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 - StorageLive(_6); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 - StorageLive(_7); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 - _7 = &(*_2); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 - StorageLive(_14); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 - _14 = _7; // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 - _6 = move _7 as &[u8] (Pointer(Unsize)); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 - StorageDead(_7); // scope 0 at $DIR/lower_array_len.rs:18:20: 18:21 -- _5 = Len((*_14)); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 -+ _5 = const N; // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 - StorageDead(_14); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 - StorageDead(_6); // scope 0 at $DIR/lower_array_len.rs:18:26: 18:27 - _3 = Lt(move _4, move _5); // scope 0 at $DIR/lower_array_len.rs:18:8: 18:27 - StorageDead(_5); // scope 0 at $DIR/lower_array_len.rs:18:26: 18:27 - StorageDead(_4); // scope 0 at $DIR/lower_array_len.rs:18:26: 18:27 - switchInt(move _3) -> [false: bb3, otherwise: bb1]; // scope 0 at $DIR/lower_array_len.rs:18:8: 18:27 + StorageLive(_3); // scope 1 at $DIR/lower_array_len.rs:18:8: 18:27 + StorageLive(_4); // scope 1 at $DIR/lower_array_len.rs:18:8: 18:13 + _4 = _1; // scope 1 at $DIR/lower_array_len.rs:18:8: 18:13 + StorageLive(_5); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 + StorageLive(_6); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 + StorageLive(_7); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 + _7 = &(*_2); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 + StorageLive(_14); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 + _14 = _7; // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 + _6 = move _7 as &[u8] (Pointer(Unsize)); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 + StorageDead(_7); // scope 1 at $DIR/lower_array_len.rs:18:20: 18:21 +- _5 = Len((*_14)); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 ++ _5 = const N; // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 + StorageDead(_14); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 + StorageDead(_6); // scope 1 at $DIR/lower_array_len.rs:18:26: 18:27 + _3 = Lt(move _4, move _5); // scope 1 at $DIR/lower_array_len.rs:18:8: 18:27 + StorageDead(_5); // scope 1 at $DIR/lower_array_len.rs:18:26: 18:27 + StorageDead(_4); // scope 1 at $DIR/lower_array_len.rs:18:26: 18:27 + switchInt(move _3) -> [false: bb3, otherwise: bb1]; // scope 1 at $DIR/lower_array_len.rs:18:8: 18:27 } bb1: { - StorageLive(_8); // scope 0 at $DIR/lower_array_len.rs:19:15: 19:20 - _8 = _1; // scope 0 at $DIR/lower_array_len.rs:19:15: 19:20 -- _9 = Len((*_2)); // scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 -+ _9 = const N; // scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 - _10 = Lt(_8, _9); // scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 - assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> bb2; // scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 + StorageLive(_8); // scope 1 at $DIR/lower_array_len.rs:19:15: 19:20 + _8 = _1; // scope 1 at $DIR/lower_array_len.rs:19:15: 19:20 +- _9 = Len((*_2)); // scope 1 at $DIR/lower_array_len.rs:19:9: 19:21 ++ _9 = const N; // scope 1 at $DIR/lower_array_len.rs:19:9: 19:21 + _10 = Lt(_8, _9); // scope 1 at $DIR/lower_array_len.rs:19:9: 19:21 + assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> bb2; // scope 1 at $DIR/lower_array_len.rs:19:9: 19:21 } bb2: { - _0 = (*_2)[_8]; // scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 - StorageDead(_8); // scope 0 at $DIR/lower_array_len.rs:20:5: 20:6 + _0 = (*_2)[_8]; // scope 1 at $DIR/lower_array_len.rs:19:9: 19:21 + StorageDead(_8); // scope 1 at $DIR/lower_array_len.rs:20:5: 20:6 goto -> bb5; // scope 0 at $DIR/lower_array_len.rs:18:5: 24:6 } diff --git a/src/test/mir-opt/lower_array_len.array_bound_mut.NormalizeArrayLen.diff b/src/test/mir-opt/lower_array_len.array_bound_mut.NormalizeArrayLen.diff index 11fc20aa693c..c31c9d80a1bf 100644 --- a/src/test/mir-opt/lower_array_len.array_bound_mut.NormalizeArrayLen.diff +++ b/src/test/mir-opt/lower_array_len.array_bound_mut.NormalizeArrayLen.diff @@ -16,45 +16,47 @@ let _11: usize; // in scope 0 at $DIR/lower_array_len.rs:21:15: 21:16 let mut _12: usize; // in scope 0 at $DIR/lower_array_len.rs:21:9: 21:17 let mut _13: bool; // in scope 0 at $DIR/lower_array_len.rs:21:9: 21:17 -+ let mut _14: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 + scope 1 { ++ let mut _14: &[u8; N]; // in scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 + } bb0: { - StorageLive(_3); // scope 0 at $DIR/lower_array_len.rs:18:8: 18:27 - StorageLive(_4); // scope 0 at $DIR/lower_array_len.rs:18:8: 18:13 - _4 = _1; // scope 0 at $DIR/lower_array_len.rs:18:8: 18:13 - StorageLive(_5); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 - StorageLive(_6); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 - StorageLive(_7); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 - _7 = &(*_2); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 -+ StorageLive(_14); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 -+ _14 = _7; // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 - _6 = move _7 as &[u8] (Pointer(Unsize)); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 - StorageDead(_7); // scope 0 at $DIR/lower_array_len.rs:18:20: 18:21 -- _5 = Len((*_6)); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 -+ _5 = Len((*_14)); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 -+ StorageDead(_14); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 - goto -> bb1; // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 + StorageLive(_3); // scope 1 at $DIR/lower_array_len.rs:18:8: 18:27 + StorageLive(_4); // scope 1 at $DIR/lower_array_len.rs:18:8: 18:13 + _4 = _1; // scope 1 at $DIR/lower_array_len.rs:18:8: 18:13 + StorageLive(_5); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 + StorageLive(_6); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 + StorageLive(_7); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 + _7 = &(*_2); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 ++ StorageLive(_14); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 ++ _14 = _7; // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 + _6 = move _7 as &[u8] (Pointer(Unsize)); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 + StorageDead(_7); // scope 1 at $DIR/lower_array_len.rs:18:20: 18:21 +- _5 = Len((*_6)); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 ++ _5 = Len((*_14)); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 ++ StorageDead(_14); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 + goto -> bb1; // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 } bb1: { - StorageDead(_6); // scope 0 at $DIR/lower_array_len.rs:18:26: 18:27 - _3 = Lt(move _4, move _5); // scope 0 at $DIR/lower_array_len.rs:18:8: 18:27 - StorageDead(_5); // scope 0 at $DIR/lower_array_len.rs:18:26: 18:27 - StorageDead(_4); // scope 0 at $DIR/lower_array_len.rs:18:26: 18:27 - switchInt(move _3) -> [false: bb4, otherwise: bb2]; // scope 0 at $DIR/lower_array_len.rs:18:8: 18:27 + StorageDead(_6); // scope 1 at $DIR/lower_array_len.rs:18:26: 18:27 + _3 = Lt(move _4, move _5); // scope 1 at $DIR/lower_array_len.rs:18:8: 18:27 + StorageDead(_5); // scope 1 at $DIR/lower_array_len.rs:18:26: 18:27 + StorageDead(_4); // scope 1 at $DIR/lower_array_len.rs:18:26: 18:27 + switchInt(move _3) -> [false: bb4, otherwise: bb2]; // scope 1 at $DIR/lower_array_len.rs:18:8: 18:27 } bb2: { - StorageLive(_8); // scope 0 at $DIR/lower_array_len.rs:19:15: 19:20 - _8 = _1; // scope 0 at $DIR/lower_array_len.rs:19:15: 19:20 - _9 = Len((*_2)); // scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 - _10 = Lt(_8, _9); // scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 - assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> bb3; // scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 + StorageLive(_8); // scope 1 at $DIR/lower_array_len.rs:19:15: 19:20 + _8 = _1; // scope 1 at $DIR/lower_array_len.rs:19:15: 19:20 + _9 = Len((*_2)); // scope 1 at $DIR/lower_array_len.rs:19:9: 19:21 + _10 = Lt(_8, _9); // scope 1 at $DIR/lower_array_len.rs:19:9: 19:21 + assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> bb3; // scope 1 at $DIR/lower_array_len.rs:19:9: 19:21 } bb3: { - _0 = (*_2)[_8]; // scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 - StorageDead(_8); // scope 0 at $DIR/lower_array_len.rs:20:5: 20:6 + _0 = (*_2)[_8]; // scope 1 at $DIR/lower_array_len.rs:19:9: 19:21 + StorageDead(_8); // scope 1 at $DIR/lower_array_len.rs:20:5: 20:6 goto -> bb6; // scope 0 at $DIR/lower_array_len.rs:18:5: 24:6 } diff --git a/src/test/mir-opt/lower_array_len.array_bound_mut.SimplifyLocals.diff b/src/test/mir-opt/lower_array_len.array_bound_mut.SimplifyLocals.diff index 51d5f1acdab8..a3d794f94b3f 100644 --- a/src/test/mir-opt/lower_array_len.array_bound_mut.SimplifyLocals.diff +++ b/src/test/mir-opt/lower_array_len.array_bound_mut.SimplifyLocals.diff @@ -16,50 +16,52 @@ - let _11: usize; // in scope 0 at $DIR/lower_array_len.rs:21:15: 21:16 - let mut _12: usize; // in scope 0 at $DIR/lower_array_len.rs:21:9: 21:17 - let mut _13: bool; // in scope 0 at $DIR/lower_array_len.rs:21:9: 21:17 -- let mut _14: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 + let _6: usize; // in scope 0 at $DIR/lower_array_len.rs:19:15: 19:20 + let mut _7: usize; // in scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 + let mut _8: bool; // in scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 + let _9: usize; // in scope 0 at $DIR/lower_array_len.rs:21:15: 21:16 + let mut _10: usize; // in scope 0 at $DIR/lower_array_len.rs:21:9: 21:17 + let mut _11: bool; // in scope 0 at $DIR/lower_array_len.rs:21:9: 21:17 + scope 1 { +- let mut _14: &[u8; N]; // in scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 + } bb0: { - StorageLive(_3); // scope 0 at $DIR/lower_array_len.rs:18:8: 18:27 - StorageLive(_4); // scope 0 at $DIR/lower_array_len.rs:18:8: 18:13 - _4 = _1; // scope 0 at $DIR/lower_array_len.rs:18:8: 18:13 - StorageLive(_5); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 -- StorageLive(_6); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 -- StorageLive(_7); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 -- StorageLive(_14); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 -- StorageDead(_7); // scope 0 at $DIR/lower_array_len.rs:18:20: 18:21 - _5 = const N; // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 -- StorageDead(_14); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 -- StorageDead(_6); // scope 0 at $DIR/lower_array_len.rs:18:26: 18:27 - _3 = Lt(move _4, move _5); // scope 0 at $DIR/lower_array_len.rs:18:8: 18:27 - StorageDead(_5); // scope 0 at $DIR/lower_array_len.rs:18:26: 18:27 - StorageDead(_4); // scope 0 at $DIR/lower_array_len.rs:18:26: 18:27 - switchInt(move _3) -> [false: bb3, otherwise: bb1]; // scope 0 at $DIR/lower_array_len.rs:18:8: 18:27 + StorageLive(_3); // scope 1 at $DIR/lower_array_len.rs:18:8: 18:27 + StorageLive(_4); // scope 1 at $DIR/lower_array_len.rs:18:8: 18:13 + _4 = _1; // scope 1 at $DIR/lower_array_len.rs:18:8: 18:13 + StorageLive(_5); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 +- StorageLive(_6); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 +- StorageLive(_7); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 +- StorageLive(_14); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 +- StorageDead(_7); // scope 1 at $DIR/lower_array_len.rs:18:20: 18:21 + _5 = const N; // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 +- StorageDead(_14); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 +- StorageDead(_6); // scope 1 at $DIR/lower_array_len.rs:18:26: 18:27 + _3 = Lt(move _4, move _5); // scope 1 at $DIR/lower_array_len.rs:18:8: 18:27 + StorageDead(_5); // scope 1 at $DIR/lower_array_len.rs:18:26: 18:27 + StorageDead(_4); // scope 1 at $DIR/lower_array_len.rs:18:26: 18:27 + switchInt(move _3) -> [false: bb3, otherwise: bb1]; // scope 1 at $DIR/lower_array_len.rs:18:8: 18:27 } bb1: { -- StorageLive(_8); // scope 0 at $DIR/lower_array_len.rs:19:15: 19:20 -- _8 = _1; // scope 0 at $DIR/lower_array_len.rs:19:15: 19:20 -- _9 = const N; // scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 -- _10 = Lt(_8, _9); // scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 -- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> bb2; // scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 -+ StorageLive(_6); // scope 0 at $DIR/lower_array_len.rs:19:15: 19:20 -+ _6 = _1; // scope 0 at $DIR/lower_array_len.rs:19:15: 19:20 -+ _7 = const N; // scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 -+ _8 = Lt(_6, _7); // scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 -+ assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb2; // scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 +- StorageLive(_8); // scope 1 at $DIR/lower_array_len.rs:19:15: 19:20 +- _8 = _1; // scope 1 at $DIR/lower_array_len.rs:19:15: 19:20 +- _9 = const N; // scope 1 at $DIR/lower_array_len.rs:19:9: 19:21 +- _10 = Lt(_8, _9); // scope 1 at $DIR/lower_array_len.rs:19:9: 19:21 +- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> bb2; // scope 1 at $DIR/lower_array_len.rs:19:9: 19:21 ++ StorageLive(_6); // scope 1 at $DIR/lower_array_len.rs:19:15: 19:20 ++ _6 = _1; // scope 1 at $DIR/lower_array_len.rs:19:15: 19:20 ++ _7 = const N; // scope 1 at $DIR/lower_array_len.rs:19:9: 19:21 ++ _8 = Lt(_6, _7); // scope 1 at $DIR/lower_array_len.rs:19:9: 19:21 ++ assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb2; // scope 1 at $DIR/lower_array_len.rs:19:9: 19:21 } bb2: { -- _0 = (*_2)[_8]; // scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 -- StorageDead(_8); // scope 0 at $DIR/lower_array_len.rs:20:5: 20:6 -+ _0 = (*_2)[_6]; // scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 -+ StorageDead(_6); // scope 0 at $DIR/lower_array_len.rs:20:5: 20:6 +- _0 = (*_2)[_8]; // scope 1 at $DIR/lower_array_len.rs:19:9: 19:21 +- StorageDead(_8); // scope 1 at $DIR/lower_array_len.rs:20:5: 20:6 ++ _0 = (*_2)[_6]; // scope 1 at $DIR/lower_array_len.rs:19:9: 19:21 ++ StorageDead(_6); // scope 1 at $DIR/lower_array_len.rs:20:5: 20:6 goto -> bb5; // scope 0 at $DIR/lower_array_len.rs:18:5: 24:6 } diff --git a/src/test/mir-opt/lower_intrinsics.f_u64.PreCodegen.before.mir b/src/test/mir-opt/lower_intrinsics.f_u64.PreCodegen.before.mir index 7750624db30f..4b77db0707d3 100644 --- a/src/test/mir-opt/lower_intrinsics.f_u64.PreCodegen.before.mir +++ b/src/test/mir-opt/lower_intrinsics.f_u64.PreCodegen.before.mir @@ -7,7 +7,9 @@ fn f_u64() -> () { debug t => _1; // in scope 1 at $DIR/lower_intrinsics.rs:44:22: 44:23 let _2: (); // in scope 1 at $DIR/lower_intrinsics.rs:48:9: 48:21 let mut _3: u64; // in scope 1 at $DIR/lower_intrinsics.rs:48:19: 48:20 - scope 2 (inlined std::mem::size_of::) { // at $DIR/lower_intrinsics.rs:45:8: 45:32 + scope 2 { + scope 3 (inlined std::mem::size_of::) { // at $DIR/lower_intrinsics.rs:45:8: 45:32 + } } } diff --git a/src/test/mir-opt/lower_intrinsics.f_unit.PreCodegen.before.mir b/src/test/mir-opt/lower_intrinsics.f_unit.PreCodegen.before.mir index 4d4e65d31141..1306caf22917 100644 --- a/src/test/mir-opt/lower_intrinsics.f_unit.PreCodegen.before.mir +++ b/src/test/mir-opt/lower_intrinsics.f_unit.PreCodegen.before.mir @@ -6,21 +6,23 @@ fn f_unit() -> () { scope 1 (inlined f_dispatch::<()>) { // at $DIR/lower_intrinsics.rs:34:5: 34:19 debug t => _1; // in scope 1 at $DIR/lower_intrinsics.rs:44:22: 44:23 let _2: (); // in scope 1 at $DIR/lower_intrinsics.rs:46:9: 46:17 - scope 2 (inlined std::mem::size_of::<()>) { // at $DIR/lower_intrinsics.rs:45:8: 45:32 + scope 2 { + scope 3 (inlined std::mem::size_of::<()>) { // at $DIR/lower_intrinsics.rs:45:8: 45:32 + } } } bb0: { StorageLive(_1); // scope 0 at $DIR/lower_intrinsics.rs:34:16: 34:18 - StorageLive(_2); // scope 1 at $DIR/lower_intrinsics.rs:46:9: 46:17 - _2 = f_zst::<()>(const ()) -> bb1; // scope 1 at $DIR/lower_intrinsics.rs:46:9: 46:17 + StorageLive(_2); // scope 2 at $DIR/lower_intrinsics.rs:46:9: 46:17 + _2 = f_zst::<()>(const ()) -> bb1; // scope 2 at $DIR/lower_intrinsics.rs:46:9: 46:17 // mir::Constant // + span: $DIR/lower_intrinsics.rs:46:9: 46:14 // + literal: Const { ty: fn(()) {f_zst::<()>}, val: Value(Scalar()) } } bb1: { - StorageDead(_2); // scope 1 at $DIR/lower_intrinsics.rs:46:17: 46:18 + StorageDead(_2); // scope 2 at $DIR/lower_intrinsics.rs:46:17: 46:18 StorageDead(_1); // scope 0 at $DIR/lower_intrinsics.rs:34:18: 34:19 return; // scope 0 at $DIR/lower_intrinsics.rs:35:2: 35:2 } diff --git a/src/test/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff b/src/test/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff index 13241d882f21..095641a597ba 100644 --- a/src/test/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff +++ b/src/test/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff @@ -12,41 +12,43 @@ let _7: usize; // in scope 0 at $DIR/lower_slice_len.rs:6:15: 6:20 let mut _8: usize; // in scope 0 at $DIR/lower_slice_len.rs:6:9: 6:21 let mut _9: bool; // in scope 0 at $DIR/lower_slice_len.rs:6:9: 6:21 + scope 1 { + } bb0: { - StorageLive(_3); // scope 0 at $DIR/lower_slice_len.rs:5:8: 5:27 - StorageLive(_4); // scope 0 at $DIR/lower_slice_len.rs:5:8: 5:13 - _4 = _1; // scope 0 at $DIR/lower_slice_len.rs:5:8: 5:13 - StorageLive(_5); // scope 0 at $DIR/lower_slice_len.rs:5:16: 5:27 - StorageLive(_6); // scope 0 at $DIR/lower_slice_len.rs:5:16: 5:27 - _6 = &(*_2); // scope 0 at $DIR/lower_slice_len.rs:5:16: 5:27 -- _5 = core::slice::::len(move _6) -> bb1; // scope 0 at $DIR/lower_slice_len.rs:5:16: 5:27 + StorageLive(_3); // scope 1 at $DIR/lower_slice_len.rs:5:8: 5:27 + StorageLive(_4); // scope 1 at $DIR/lower_slice_len.rs:5:8: 5:13 + _4 = _1; // scope 1 at $DIR/lower_slice_len.rs:5:8: 5:13 + StorageLive(_5); // scope 1 at $DIR/lower_slice_len.rs:5:16: 5:27 + StorageLive(_6); // scope 1 at $DIR/lower_slice_len.rs:5:16: 5:27 + _6 = &(*_2); // scope 1 at $DIR/lower_slice_len.rs:5:16: 5:27 +- _5 = core::slice::::len(move _6) -> bb1; // scope 1 at $DIR/lower_slice_len.rs:5:16: 5:27 - // mir::Constant - // + span: $DIR/lower_slice_len.rs:5:22: 5:25 - // + literal: Const { ty: for<'r> fn(&'r [u8]) -> usize {core::slice::::len}, val: Value(Scalar()) } -+ _5 = Len((*_6)); // scope 0 at $DIR/lower_slice_len.rs:5:16: 5:27 -+ goto -> bb1; // scope 0 at $DIR/lower_slice_len.rs:5:16: 5:27 ++ _5 = Len((*_6)); // scope 1 at $DIR/lower_slice_len.rs:5:16: 5:27 ++ goto -> bb1; // scope 1 at $DIR/lower_slice_len.rs:5:16: 5:27 } bb1: { - StorageDead(_6); // scope 0 at $DIR/lower_slice_len.rs:5:26: 5:27 - _3 = Lt(move _4, move _5); // scope 0 at $DIR/lower_slice_len.rs:5:8: 5:27 - StorageDead(_5); // scope 0 at $DIR/lower_slice_len.rs:5:26: 5:27 - StorageDead(_4); // scope 0 at $DIR/lower_slice_len.rs:5:26: 5:27 - switchInt(move _3) -> [false: bb4, otherwise: bb2]; // scope 0 at $DIR/lower_slice_len.rs:5:8: 5:27 + StorageDead(_6); // scope 1 at $DIR/lower_slice_len.rs:5:26: 5:27 + _3 = Lt(move _4, move _5); // scope 1 at $DIR/lower_slice_len.rs:5:8: 5:27 + StorageDead(_5); // scope 1 at $DIR/lower_slice_len.rs:5:26: 5:27 + StorageDead(_4); // scope 1 at $DIR/lower_slice_len.rs:5:26: 5:27 + switchInt(move _3) -> [false: bb4, otherwise: bb2]; // scope 1 at $DIR/lower_slice_len.rs:5:8: 5:27 } bb2: { - StorageLive(_7); // scope 0 at $DIR/lower_slice_len.rs:6:15: 6:20 - _7 = _1; // scope 0 at $DIR/lower_slice_len.rs:6:15: 6:20 - _8 = Len((*_2)); // scope 0 at $DIR/lower_slice_len.rs:6:9: 6:21 - _9 = Lt(_7, _8); // scope 0 at $DIR/lower_slice_len.rs:6:9: 6:21 - assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> bb3; // scope 0 at $DIR/lower_slice_len.rs:6:9: 6:21 + StorageLive(_7); // scope 1 at $DIR/lower_slice_len.rs:6:15: 6:20 + _7 = _1; // scope 1 at $DIR/lower_slice_len.rs:6:15: 6:20 + _8 = Len((*_2)); // scope 1 at $DIR/lower_slice_len.rs:6:9: 6:21 + _9 = Lt(_7, _8); // scope 1 at $DIR/lower_slice_len.rs:6:9: 6:21 + assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> bb3; // scope 1 at $DIR/lower_slice_len.rs:6:9: 6:21 } bb3: { - _0 = (*_2)[_7]; // scope 0 at $DIR/lower_slice_len.rs:6:9: 6:21 - StorageDead(_7); // scope 0 at $DIR/lower_slice_len.rs:7:5: 7:6 + _0 = (*_2)[_7]; // scope 1 at $DIR/lower_slice_len.rs:6:9: 6:21 + StorageDead(_7); // scope 1 at $DIR/lower_slice_len.rs:7:5: 7:6 goto -> bb5; // scope 0 at $DIR/lower_slice_len.rs:5:5: 9:6 } diff --git a/src/test/mir-opt/match_arm_scopes.complicated_match.SimplifyCfg-initial.after-ElaborateDrops.after.diff b/src/test/mir-opt/match_arm_scopes.complicated_match.SimplifyCfg-initial.after-ElaborateDrops.after.diff index c2e422f80025..72fd303d447d 100644 --- a/src/test/mir-opt/match_arm_scopes.complicated_match.SimplifyCfg-initial.after-ElaborateDrops.after.diff +++ b/src/test/mir-opt/match_arm_scopes.complicated_match.SimplifyCfg-initial.after-ElaborateDrops.after.diff @@ -26,8 +26,12 @@ debug s => _8; // in scope 1 at $DIR/match-arm-scopes.rs:15:20: 15:21 } scope 2 { - debug b => _15; // in scope 2 at $DIR/match-arm-scopes.rs:16:16: 16:17 - debug t => _16; // in scope 2 at $DIR/match-arm-scopes.rs:16:19: 16:20 + } + scope 3 { + } + scope 4 { + debug b => _15; // in scope 4 at $DIR/match-arm-scopes.rs:16:16: 16:17 + debug t => _16; // in scope 4 at $DIR/match-arm-scopes.rs:16:19: 16:20 } bb0: { @@ -83,15 +87,15 @@ - _3 = &shallow (_2.0: bool); // scope 0 at $DIR/match-arm-scopes.rs:14:11: 14:16 - _4 = &shallow (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:14:11: 14:16 StorageLive(_9); // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 - StorageLive(_10); // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49 - _10 = _1; // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49 -- switchInt(move _10) -> [false: bb10, otherwise: bb9]; // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49 -+ switchInt(move _10) -> [false: bb7, otherwise: bb6]; // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49 + StorageLive(_10); // scope 2 at $DIR/match-arm-scopes.rs:15:45: 15:49 + _10 = _1; // scope 2 at $DIR/match-arm-scopes.rs:15:45: 15:49 +- switchInt(move _10) -> [false: bb10, otherwise: bb9]; // scope 2 at $DIR/match-arm-scopes.rs:15:45: 15:49 ++ switchInt(move _10) -> [false: bb7, otherwise: bb6]; // scope 2 at $DIR/match-arm-scopes.rs:15:45: 15:49 } - bb9: { + bb6: { - _0 = const 3_i32; // scope 0 at $DIR/match-arm-scopes.rs:15:59: 15:60 + _0 = const 3_i32; // scope 2 at $DIR/match-arm-scopes.rs:15:59: 15:60 StorageDead(_10); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73 StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73 - goto -> bb23; // scope 0 at no-location @@ -140,15 +144,15 @@ - _3 = &shallow (_2.0: bool); // scope 0 at $DIR/match-arm-scopes.rs:14:11: 14:16 - _4 = &shallow (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:14:11: 14:16 StorageLive(_12); // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 - StorageLive(_13); // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49 - _13 = _1; // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49 -- switchInt(move _13) -> [false: bb15, otherwise: bb14]; // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49 -+ switchInt(move _13) -> [false: bb12, otherwise: bb11]; // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49 + StorageLive(_13); // scope 3 at $DIR/match-arm-scopes.rs:15:45: 15:49 + _13 = _1; // scope 3 at $DIR/match-arm-scopes.rs:15:45: 15:49 +- switchInt(move _13) -> [false: bb15, otherwise: bb14]; // scope 3 at $DIR/match-arm-scopes.rs:15:45: 15:49 ++ switchInt(move _13) -> [false: bb12, otherwise: bb11]; // scope 3 at $DIR/match-arm-scopes.rs:15:45: 15:49 } - bb14: { + bb11: { - _0 = const 3_i32; // scope 0 at $DIR/match-arm-scopes.rs:15:59: 15:60 + _0 = const 3_i32; // scope 3 at $DIR/match-arm-scopes.rs:15:59: 15:60 StorageDead(_13); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73 StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73 - goto -> bb23; // scope 0 at no-location @@ -200,7 +204,7 @@ - bb19: { + bb16: { - _0 = const 2_i32; // scope 2 at $DIR/match-arm-scopes.rs:16:41: 16:42 + _0 = const 2_i32; // scope 4 at $DIR/match-arm-scopes.rs:16:41: 16:42 - drop(_16) -> [return: bb21, unwind: bb25]; // scope 0 at $DIR/match-arm-scopes.rs:16:41: 16:42 + drop(_16) -> [return: bb18, unwind: bb22]; // scope 0 at $DIR/match-arm-scopes.rs:16:41: 16:42 } diff --git a/src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.64bit.diff b/src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.64bit.diff index 29f66ceac981..7736342316b5 100644 --- a/src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.64bit.diff +++ b/src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.64bit.diff @@ -6,24 +6,26 @@ let mut _0: (); // return place in scope 0 at $DIR/matches_reduce_branches.rs:7:25: 7:25 let mut _2: isize; // in scope 0 at $DIR/matches_reduce_branches.rs:8:22: 8:26 + let mut _3: isize; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + scope 1 { + } bb0: { - _2 = discriminant(_1); // scope 0 at $DIR/matches_reduce_branches.rs:8:17: 8:20 -- switchInt(move _2) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _2 = discriminant(_1); // scope 1 at $DIR/matches_reduce_branches.rs:8:17: 8:20 +- switchInt(move _2) -> [0_isize: bb2, otherwise: bb1]; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - } - - bb1: { -- goto -> bb3; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL +- goto -> bb3; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - } - - bb2: { -- goto -> bb3; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL +- goto -> bb3; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - } - - bb3: { -+ StorageLive(_3); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL -+ _3 = move _2; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL -+ StorageDead(_3); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL ++ StorageLive(_3); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL ++ _3 = move _2; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL ++ StorageDead(_3); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL return; // scope 0 at $DIR/matches_reduce_branches.rs:11:2: 11:2 } } diff --git a/src/test/mir-opt/matches_reduce_branches.foo.PreCodegen.before.64bit.mir b/src/test/mir-opt/matches_reduce_branches.foo.PreCodegen.before.64bit.mir index e3b318c949fc..4cac6a007f3b 100644 --- a/src/test/mir-opt/matches_reduce_branches.foo.PreCodegen.before.64bit.mir +++ b/src/test/mir-opt/matches_reduce_branches.foo.PreCodegen.before.64bit.mir @@ -3,6 +3,8 @@ fn foo(_1: Option<()>) -> () { debug bar => _1; // in scope 0 at $DIR/matches_reduce_branches.rs:7:8: 7:11 let mut _0: (); // return place in scope 0 at $DIR/matches_reduce_branches.rs:7:25: 7:25 + scope 1 { + } bb0: { return; // scope 0 at $DIR/matches_reduce_branches.rs:11:2: 11:2 diff --git a/src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.64bit.diff b/src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.64bit.diff index 2dfb2e1af0d6..95ce545bbd41 100644 --- a/src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.64bit.diff +++ b/src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.64bit.diff @@ -9,31 +9,37 @@ scope 1 { debug val => _1; // in scope 1 at $DIR/matches_reduce_branches.rs:40:9: 40:12 } + scope 2 { + scope 3 { + scope 4 { + } + } + } bb0: { StorageLive(_1); // scope 0 at $DIR/matches_reduce_branches.rs:40:9: 40:12 - StorageLive(_2); // scope 0 at $DIR/matches_reduce_branches.rs:41:24: 41:28 - _2 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:41:24: 41:28 -- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_reduce_branches.rs:41:24: 41:28 + StorageLive(_2); // scope 4 at $DIR/matches_reduce_branches.rs:41:24: 41:28 + _2 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:41:24: 41:28 +- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 4 at $DIR/matches_reduce_branches.rs:41:24: 41:28 - } - - bb1: { -+ StorageLive(_3); // scope 0 at $DIR/matches_reduce_branches.rs:41:24: 41:28 -+ _3 = move _2; // scope 0 at $DIR/matches_reduce_branches.rs:41:24: 41:28 - StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:41:51: 41:52 ++ StorageLive(_3); // scope 4 at $DIR/matches_reduce_branches.rs:41:24: 41:28 ++ _3 = move _2; // scope 4 at $DIR/matches_reduce_branches.rs:41:24: 41:28 + StorageDead(_2); // scope 3 at $DIR/matches_reduce_branches.rs:41:51: 41:52 - _1 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:47:13: 47:17 - goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:47:13: 47:17 - } - - bb2: { -- StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:41:51: 41:52 +- StorageDead(_2); // scope 3 at $DIR/matches_reduce_branches.rs:41:51: 41:52 - _1 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:49:14: 49:19 - goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:49:14: 49:19 - } - - bb3: { + _1 = Ne(_3, const false); // scope 0 at $DIR/matches_reduce_branches.rs:49:14: 49:19 -+ StorageDead(_3); // scope 0 at $DIR/matches_reduce_branches.rs:41:24: 41:28 ++ StorageDead(_3); // scope 4 at $DIR/matches_reduce_branches.rs:41:24: 41:28 _0 = _1; // scope 1 at $DIR/matches_reduce_branches.rs:51:5: 51:8 StorageDead(_1); // scope 0 at $DIR/matches_reduce_branches.rs:52:1: 52:2 return; // scope 0 at $DIR/matches_reduce_branches.rs:52:2: 52:2 diff --git a/src/test/mir-opt/multiple_return_terminators.test.MultipleReturnTerminators.diff b/src/test/mir-opt/multiple_return_terminators.test.MultipleReturnTerminators.diff index dbcb8813d545..23a388aadde7 100644 --- a/src/test/mir-opt/multiple_return_terminators.test.MultipleReturnTerminators.diff +++ b/src/test/mir-opt/multiple_return_terminators.test.MultipleReturnTerminators.diff @@ -4,6 +4,8 @@ fn test(_1: bool) -> () { debug x => _1; // in scope 0 at $DIR/multiple_return_terminators.rs:4:9: 4:10 let mut _0: (); // return place in scope 0 at $DIR/multiple_return_terminators.rs:4:18: 4:18 + scope 1 { + } bb0: { return; // scope 0 at $DIR/multiple_return_terminators.rs:10:2: 10:2 diff --git a/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir b/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir index 162cacef8a54..4a0a7b24aa3d 100644 --- a/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir +++ b/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir @@ -39,6 +39,8 @@ fn main() -> () { let _6: &'_#5r usize; // in scope 2 at $DIR/region-subtyping-basic.rs:19:9: 19:10 scope 3 { debug q => _6; // in scope 3 at $DIR/region-subtyping-basic.rs:19:9: 19:10 + scope 4 { + } } } } @@ -61,25 +63,25 @@ fn main() -> () { StorageLive(_6); // bb1[2]: scope 2 at $DIR/region-subtyping-basic.rs:19:9: 19:10 _6 = _2; // bb1[3]: scope 2 at $DIR/region-subtyping-basic.rs:19:13: 19:14 FakeRead(ForLet(None), _6); // bb1[4]: scope 2 at $DIR/region-subtyping-basic.rs:19:9: 19:10 - StorageLive(_7); // bb1[5]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12 - _7 = const ConstValue(Scalar(0x01): bool); // bb1[6]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12 - switchInt(move _7) -> [Const(Value(Scalar(0x00)): bool): bb4, otherwise: bb2]; // bb1[7]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12 + StorageLive(_7); // bb1[5]: scope 4 at $DIR/region-subtyping-basic.rs:20:8: 20:12 + _7 = const ConstValue(Scalar(0x01): bool); // bb1[6]: scope 4 at $DIR/region-subtyping-basic.rs:20:8: 20:12 + switchInt(move _7) -> [Const(Value(Scalar(0x00)): bool): bb4, otherwise: bb2]; // bb1[7]: scope 4 at $DIR/region-subtyping-basic.rs:20:8: 20:12 } bb2: { - StorageLive(_8); // bb2[0]: scope 3 at $DIR/region-subtyping-basic.rs:21:9: 21:18 - StorageLive(_9); // bb2[1]: scope 3 at $DIR/region-subtyping-basic.rs:21:15: 21:17 - _9 = (*_6); // bb2[2]: scope 3 at $DIR/region-subtyping-basic.rs:21:15: 21:17 - _8 = ConstValue(Scalar(): fn(usize) -> bool {use_x})(move _9) -> [return: bb3, unwind: bb7]; // bb2[3]: scope 3 at $DIR/region-subtyping-basic.rs:21:9: 21:18 + StorageLive(_8); // bb2[0]: scope 4 at $DIR/region-subtyping-basic.rs:21:9: 21:18 + StorageLive(_9); // bb2[1]: scope 4 at $DIR/region-subtyping-basic.rs:21:15: 21:17 + _9 = (*_6); // bb2[2]: scope 4 at $DIR/region-subtyping-basic.rs:21:15: 21:17 + _8 = ConstValue(Scalar(): fn(usize) -> bool {use_x})(move _9) -> [return: bb3, unwind: bb7]; // bb2[3]: scope 4 at $DIR/region-subtyping-basic.rs:21:9: 21:18 // mir::Constant // + span: $DIR/region-subtyping-basic.rs:21:9: 21:14 // + literal: Const { ty: fn(usize) -> bool {use_x}, val: Value(Scalar()) } } bb3: { - StorageDead(_9); // bb3[0]: scope 3 at $DIR/region-subtyping-basic.rs:21:17: 21:18 - StorageDead(_8); // bb3[1]: scope 3 at $DIR/region-subtyping-basic.rs:21:18: 21:19 - _0 = const ConstValue(Scalar(): ()); // bb3[2]: scope 3 at $DIR/region-subtyping-basic.rs:20:13: 22:6 + StorageDead(_9); // bb3[0]: scope 4 at $DIR/region-subtyping-basic.rs:21:17: 21:18 + StorageDead(_8); // bb3[1]: scope 4 at $DIR/region-subtyping-basic.rs:21:18: 21:19 + _0 = const ConstValue(Scalar(): ()); // bb3[2]: scope 4 at $DIR/region-subtyping-basic.rs:20:13: 22:6 goto -> bb6; // bb3[3]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 } diff --git a/src/test/mir-opt/not_equal_false.opt.InstCombine.diff b/src/test/mir-opt/not_equal_false.opt.InstCombine.diff index 249db1c8a5ab..349dbbb2679d 100644 --- a/src/test/mir-opt/not_equal_false.opt.InstCombine.diff +++ b/src/test/mir-opt/not_equal_false.opt.InstCombine.diff @@ -6,19 +6,21 @@ let mut _0: u32; // return place in scope 0 at $DIR/not_equal_false.rs:3:20: 3:23 let mut _2: bool; // in scope 0 at $DIR/not_equal_false.rs:4:8: 4:18 let mut _3: bool; // in scope 0 at $DIR/not_equal_false.rs:4:8: 4:9 + scope 1 { + } bb0: { - StorageLive(_2); // scope 0 at $DIR/not_equal_false.rs:4:8: 4:18 - StorageLive(_3); // scope 0 at $DIR/not_equal_false.rs:4:8: 4:9 - _3 = _1; // scope 0 at $DIR/not_equal_false.rs:4:8: 4:9 -- _2 = Ne(move _3, const false); // scope 0 at $DIR/not_equal_false.rs:4:8: 4:18 -+ _2 = move _3; // scope 0 at $DIR/not_equal_false.rs:4:8: 4:18 - StorageDead(_3); // scope 0 at $DIR/not_equal_false.rs:4:17: 4:18 - switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/not_equal_false.rs:4:8: 4:18 + StorageLive(_2); // scope 1 at $DIR/not_equal_false.rs:4:8: 4:18 + StorageLive(_3); // scope 1 at $DIR/not_equal_false.rs:4:8: 4:9 + _3 = _1; // scope 1 at $DIR/not_equal_false.rs:4:8: 4:9 +- _2 = Ne(move _3, const false); // scope 1 at $DIR/not_equal_false.rs:4:8: 4:18 ++ _2 = move _3; // scope 1 at $DIR/not_equal_false.rs:4:8: 4:18 + StorageDead(_3); // scope 1 at $DIR/not_equal_false.rs:4:17: 4:18 + switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/not_equal_false.rs:4:8: 4:18 } bb1: { - _0 = const 0_u32; // scope 0 at $DIR/not_equal_false.rs:4:21: 4:22 + _0 = const 0_u32; // scope 1 at $DIR/not_equal_false.rs:4:21: 4:22 goto -> bb3; // scope 0 at $DIR/not_equal_false.rs:4:5: 4:35 } diff --git a/src/test/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir b/src/test/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir index 69742d6bc3b6..c1fe50afff2e 100644 --- a/src/test/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir +++ b/src/test/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir @@ -51,9 +51,11 @@ fn array_casts() -> () { scope 7 { debug left_val => _20; // in scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL debug right_val => _21; // in scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let _27: core::panicking::AssertKind; // in scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL scope 8 { - debug kind => _27; // in scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let _27: core::panicking::AssertKind; // in scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + scope 9 { + debug kind => _27; // in scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + } } } } @@ -137,41 +139,41 @@ fn array_casts() -> () { StorageLive(_21); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _21 = (_13.1: &usize); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL Retag(_21); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_22); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_23); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_24); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _24 = (*_20); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_25); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _25 = (*_21); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _23 = Eq(move _24, move _25); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_25); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_24); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _22 = Not(move _23); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_23); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - switchInt(move _22) -> [false: bb4, otherwise: bb3]; // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_22); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_23); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_24); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _24 = (*_20); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_25); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _25 = (*_21); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _23 = Eq(move _24, move _25); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_25); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_24); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _22 = Not(move _23); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_23); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + switchInt(move _22) -> [false: bb4, otherwise: bb3]; // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL } bb3: { - StorageLive(_27); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _27 = core::panicking::AssertKind::Eq; // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_28); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_29); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _29 = move _27; // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_30); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_31); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _31 = &(*_20); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - Retag(_31); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _30 = &(*_31); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - Retag(_30); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_32); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_33); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _33 = &(*_21); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - Retag(_33); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _32 = &(*_33); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - Retag(_32); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_34); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _34 = Option::::None; // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _28 = core::panicking::assert_failed::(move _29, move _30, move _32, move _34); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_27); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _27 = core::panicking::AssertKind::Eq; // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_28); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_29); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _29 = move _27; // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_30); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_31); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _31 = &(*_20); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + Retag(_31); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _30 = &(*_31); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + Retag(_30); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_32); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_33); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _33 = &(*_21); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + Retag(_33); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _32 = &(*_33); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + Retag(_32); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_34); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _34 = Option::::None; // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _28 = core::panicking::assert_failed::(move _29, move _30, move _32, move _34); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + literal: Const { ty: for<'r, 's, 't0> fn(core::panicking::AssertKind, &'r usize, &'s usize, Option>) -> ! {core::panicking::assert_failed::}, val: Value(Scalar()) } diff --git a/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-early-opt.diff b/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-early-opt.diff index 1c5a89002364..06c4b997c7c3 100644 --- a/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-early-opt.diff +++ b/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-early-opt.diff @@ -6,6 +6,8 @@ let mut _1: (); // in scope 0 at $DIR/simplify_cfg.rs:7:1: 13:2 let mut _2: bool; // in scope 0 at $DIR/simplify_cfg.rs:9:12: 9:17 let mut _3: !; // in scope 0 at $DIR/simplify_cfg.rs:9:18: 11:10 + scope 1 { + } bb0: { goto -> bb1; // scope 0 at $DIR/simplify_cfg.rs:8:5: 12:6 @@ -16,23 +18,23 @@ - } - - bb2: { - StorageLive(_2); // scope 0 at $DIR/simplify_cfg.rs:9:12: 9:17 -- _2 = bar() -> [return: bb3, unwind: bb6]; // scope 0 at $DIR/simplify_cfg.rs:9:12: 9:17 -+ _2 = bar() -> [return: bb2, unwind: bb5]; // scope 0 at $DIR/simplify_cfg.rs:9:12: 9:17 + StorageLive(_2); // scope 1 at $DIR/simplify_cfg.rs:9:12: 9:17 +- _2 = bar() -> [return: bb3, unwind: bb6]; // scope 1 at $DIR/simplify_cfg.rs:9:12: 9:17 ++ _2 = bar() -> [return: bb2, unwind: bb5]; // scope 1 at $DIR/simplify_cfg.rs:9:12: 9:17 // mir::Constant // + span: $DIR/simplify_cfg.rs:9:12: 9:15 // + literal: Const { ty: fn() -> bool {bar}, val: Value(Scalar()) } } - bb3: { -- switchInt(move _2) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/simplify_cfg.rs:9:12: 9:17 +- switchInt(move _2) -> [false: bb5, otherwise: bb4]; // scope 1 at $DIR/simplify_cfg.rs:9:12: 9:17 + bb2: { -+ switchInt(move _2) -> [false: bb4, otherwise: bb3]; // scope 0 at $DIR/simplify_cfg.rs:9:12: 9:17 ++ switchInt(move _2) -> [false: bb4, otherwise: bb3]; // scope 1 at $DIR/simplify_cfg.rs:9:12: 9:17 } - bb4: { + bb3: { - _0 = const (); // scope 0 at $DIR/simplify_cfg.rs:10:13: 10:18 + _0 = const (); // scope 1 at $DIR/simplify_cfg.rs:10:13: 10:18 StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:11:9: 11:10 return; // scope 0 at $DIR/simplify_cfg.rs:13:2: 13:2 } diff --git a/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-initial.diff b/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-initial.diff index b079bd7b57c4..ed2bda1a4749 100644 --- a/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-initial.diff +++ b/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-initial.diff @@ -6,6 +6,8 @@ let mut _1: (); // in scope 0 at $DIR/simplify_cfg.rs:7:1: 13:2 let mut _2: bool; // in scope 0 at $DIR/simplify_cfg.rs:9:12: 9:17 let mut _3: !; // in scope 0 at $DIR/simplify_cfg.rs:9:18: 11:10 + scope 1 { + } bb0: { goto -> bb1; // scope 0 at $DIR/simplify_cfg.rs:8:5: 12:6 @@ -17,31 +19,31 @@ } bb2: { - StorageLive(_2); // scope 0 at $DIR/simplify_cfg.rs:9:12: 9:17 -- _2 = bar() -> [return: bb3, unwind: bb11]; // scope 0 at $DIR/simplify_cfg.rs:9:12: 9:17 -+ _2 = bar() -> [return: bb3, unwind: bb6]; // scope 0 at $DIR/simplify_cfg.rs:9:12: 9:17 + StorageLive(_2); // scope 1 at $DIR/simplify_cfg.rs:9:12: 9:17 +- _2 = bar() -> [return: bb3, unwind: bb11]; // scope 1 at $DIR/simplify_cfg.rs:9:12: 9:17 ++ _2 = bar() -> [return: bb3, unwind: bb6]; // scope 1 at $DIR/simplify_cfg.rs:9:12: 9:17 // mir::Constant // + span: $DIR/simplify_cfg.rs:9:12: 9:15 // + literal: Const { ty: fn() -> bool {bar}, val: Value(Scalar()) } } bb3: { - switchInt(move _2) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/simplify_cfg.rs:9:12: 9:17 + switchInt(move _2) -> [false: bb5, otherwise: bb4]; // scope 1 at $DIR/simplify_cfg.rs:9:12: 9:17 } bb4: { - _0 = const (); // scope 0 at $DIR/simplify_cfg.rs:10:13: 10:18 -- goto -> bb10; // scope 0 at $DIR/simplify_cfg.rs:10:13: 10:18 + _0 = const (); // scope 1 at $DIR/simplify_cfg.rs:10:13: 10:18 +- goto -> bb10; // scope 1 at $DIR/simplify_cfg.rs:10:13: 10:18 + StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:11:9: 11:10 + return; // scope 0 at $DIR/simplify_cfg.rs:13:2: 13:2 } bb5: { -- goto -> bb8; // scope 0 at $DIR/simplify_cfg.rs:9:12: 9:17 +- goto -> bb8; // scope 1 at $DIR/simplify_cfg.rs:9:12: 9:17 - } - - bb6: { -- unreachable; // scope 0 at $DIR/simplify_cfg.rs:9:18: 11:10 +- unreachable; // scope 1 at $DIR/simplify_cfg.rs:9:18: 11:10 - } - - bb7: { diff --git a/src/test/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.diff b/src/test/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.diff index d11c70b1efec..2f9e45279d86 100644 --- a/src/test/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.diff +++ b/src/test/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.diff @@ -5,25 +5,27 @@ let mut _0: (); // return place in scope 0 at $DIR/simplify_if.rs:5:11: 5:11 let mut _1: bool; // in scope 0 at $DIR/simplify_if.rs:6:8: 6:13 let _2: (); // in scope 0 at $DIR/simplify_if.rs:7:9: 7:15 + scope 1 { + } bb0: { - StorageLive(_1); // scope 0 at $DIR/simplify_if.rs:6:8: 6:13 - _1 = const false; // scope 0 at $DIR/simplify_if.rs:6:8: 6:13 -- switchInt(const false) -> [false: bb3, otherwise: bb1]; // scope 0 at $DIR/simplify_if.rs:6:8: 6:13 -+ goto -> bb3; // scope 0 at $DIR/simplify_if.rs:6:8: 6:13 + StorageLive(_1); // scope 1 at $DIR/simplify_if.rs:6:8: 6:13 + _1 = const false; // scope 1 at $DIR/simplify_if.rs:6:8: 6:13 +- switchInt(const false) -> [false: bb3, otherwise: bb1]; // scope 1 at $DIR/simplify_if.rs:6:8: 6:13 ++ goto -> bb3; // scope 1 at $DIR/simplify_if.rs:6:8: 6:13 } bb1: { - StorageLive(_2); // scope 0 at $DIR/simplify_if.rs:7:9: 7:15 - _2 = noop() -> bb2; // scope 0 at $DIR/simplify_if.rs:7:9: 7:15 + StorageLive(_2); // scope 1 at $DIR/simplify_if.rs:7:9: 7:15 + _2 = noop() -> bb2; // scope 1 at $DIR/simplify_if.rs:7:9: 7:15 // mir::Constant // + span: $DIR/simplify_if.rs:7:9: 7:13 // + literal: Const { ty: fn() {noop}, val: Value(Scalar()) } } bb2: { - StorageDead(_2); // scope 0 at $DIR/simplify_if.rs:7:15: 7:16 - nop; // scope 0 at $DIR/simplify_if.rs:6:14: 8:6 + StorageDead(_2); // scope 1 at $DIR/simplify_if.rs:7:15: 7:16 + nop; // scope 1 at $DIR/simplify_if.rs:6:14: 8:6 goto -> bb4; // scope 0 at $DIR/simplify_if.rs:6:5: 8:6 } diff --git a/src/test/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals.diff b/src/test/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals.diff index 7137e01fae3b..d220d9290209 100644 --- a/src/test/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals.diff +++ b/src/test/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals.diff @@ -13,6 +13,8 @@ scope 1 { debug a => _6; // in scope 1 at $DIR/simplify-locals-fixedpoint.rs:4:18: 4:19 let _6: u8; // in scope 1 at $DIR/simplify-locals-fixedpoint.rs:4:18: 4:19 + scope 2 { + } } bb0: { @@ -40,12 +42,12 @@ bb2: { StorageLive(_6); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:4:18: 4:19 _6 = (((_1.0: std::option::Option) as Some).0: u8); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:4:18: 4:19 -- StorageLive(_7); // scope 0 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:20 -- StorageLive(_8); // scope 0 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:13 -- _8 = _6; // scope 0 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:13 -- _7 = Gt(move _8, const 42_u8); // scope 0 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:20 -- StorageDead(_8); // scope 0 at $DIR/simplify-locals-fixedpoint.rs:5:19: 5:20 -- StorageDead(_7); // scope 0 at $DIR/simplify-locals-fixedpoint.rs:7:9: 7:10 +- StorageLive(_7); // scope 2 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:20 +- StorageLive(_8); // scope 2 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:13 +- _8 = _6; // scope 2 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:13 +- _7 = Gt(move _8, const 42_u8); // scope 2 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:20 +- StorageDead(_8); // scope 2 at $DIR/simplify-locals-fixedpoint.rs:5:19: 5:20 +- StorageDead(_7); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:7:9: 7:10 StorageDead(_6); // scope 0 at $DIR/simplify-locals-fixedpoint.rs:8:5: 8:6 goto -> bb3; // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:5: 8:6 } diff --git a/src/test/mir-opt/unreachable.main.UnreachablePropagation.diff b/src/test/mir-opt/unreachable.main.UnreachablePropagation.diff index fa8fd0a3c117..e87c59a4c770 100644 --- a/src/test/mir-opt/unreachable.main.UnreachablePropagation.diff +++ b/src/test/mir-opt/unreachable.main.UnreachablePropagation.diff @@ -5,16 +5,18 @@ let mut _0: (); // return place in scope 0 at $DIR/unreachable.rs:8:11: 8:11 let mut _1: std::option::Option; // in scope 0 at $DIR/unreachable.rs:9:23: 9:30 let mut _2: isize; // in scope 0 at $DIR/unreachable.rs:9:12: 9:20 - let mut _4: i32; // in scope 0 at $DIR/unreachable.rs:10:13: 10:19 let _5: (); // in scope 0 at $DIR/unreachable.rs:12:9: 16:10 let mut _6: bool; // in scope 0 at $DIR/unreachable.rs:12:12: 12:16 let mut _7: !; // in scope 0 at $DIR/unreachable.rs:18:9: 18:21 scope 1 { debug _x => _3; // in scope 1 at $DIR/unreachable.rs:9:17: 9:19 let _3: Empty; // in scope 1 at $DIR/unreachable.rs:9:17: 9:19 - } - scope 2 { - debug _y => _4; // in scope 2 at $DIR/unreachable.rs:10:13: 10:19 + let mut _4: i32; // in scope 1 at $DIR/unreachable.rs:10:13: 10:19 + scope 2 { + debug _y => _4; // in scope 2 at $DIR/unreachable.rs:10:13: 10:19 + scope 3 { + } + } } bb0: { @@ -34,16 +36,16 @@ bb2: { - StorageLive(_3); // scope 1 at $DIR/unreachable.rs:9:17: 9:19 - _3 = move ((_1 as Some).0: Empty); // scope 1 at $DIR/unreachable.rs:9:17: 9:19 -- StorageLive(_4); // scope 0 at $DIR/unreachable.rs:10:13: 10:19 +- StorageLive(_4); // scope 1 at $DIR/unreachable.rs:10:13: 10:19 - StorageLive(_5); // scope 2 at $DIR/unreachable.rs:12:9: 16:10 -- StorageLive(_6); // scope 2 at $DIR/unreachable.rs:12:12: 12:16 -- _6 = const true; // scope 2 at $DIR/unreachable.rs:12:12: 12:16 -- switchInt(move _6) -> [false: bb4, otherwise: bb3]; // scope 2 at $DIR/unreachable.rs:12:12: 12:16 +- StorageLive(_6); // scope 3 at $DIR/unreachable.rs:12:12: 12:16 +- _6 = const true; // scope 3 at $DIR/unreachable.rs:12:12: 12:16 +- switchInt(move _6) -> [false: bb4, otherwise: bb3]; // scope 3 at $DIR/unreachable.rs:12:12: 12:16 - } - - bb3: { -- _4 = const 21_i32; // scope 2 at $DIR/unreachable.rs:13:13: 13:20 -- _5 = const (); // scope 2 at $DIR/unreachable.rs:12:17: 14:10 +- _4 = const 21_i32; // scope 3 at $DIR/unreachable.rs:13:13: 13:20 +- _5 = const (); // scope 3 at $DIR/unreachable.rs:12:17: 14:10 - goto -> bb5; // scope 2 at $DIR/unreachable.rs:12:9: 16:10 - } - diff --git a/src/test/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff b/src/test/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff index 48c9f6bf2715..b63a2f2b0ac4 100644 --- a/src/test/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff +++ b/src/test/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff @@ -14,6 +14,8 @@ scope 2 { debug bomb => _4; // in scope 2 at $DIR/unreachable_diverging.rs:14:17: 14:21 let _4: Empty; // in scope 2 at $DIR/unreachable_diverging.rs:14:17: 14:21 + scope 3 { + } } } @@ -36,31 +38,31 @@ bb2: { StorageLive(_4); // scope 2 at $DIR/unreachable_diverging.rs:14:17: 14:21 _4 = move ((_2 as Some).0: Empty); // scope 2 at $DIR/unreachable_diverging.rs:14:17: 14:21 - StorageLive(_5); // scope 1 at $DIR/unreachable_diverging.rs:15:9: 17:10 - StorageLive(_6); // scope 1 at $DIR/unreachable_diverging.rs:15:12: 15:13 - _6 = _1; // scope 1 at $DIR/unreachable_diverging.rs:15:12: 15:13 -- switchInt(move _6) -> [false: bb4, otherwise: bb3]; // scope 1 at $DIR/unreachable_diverging.rs:15:12: 15:13 -+ goto -> bb3; // scope 1 at $DIR/unreachable_diverging.rs:15:12: 15:13 + StorageLive(_5); // scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10 + StorageLive(_6); // scope 3 at $DIR/unreachable_diverging.rs:15:12: 15:13 + _6 = _1; // scope 3 at $DIR/unreachable_diverging.rs:15:12: 15:13 +- switchInt(move _6) -> [false: bb4, otherwise: bb3]; // scope 3 at $DIR/unreachable_diverging.rs:15:12: 15:13 ++ goto -> bb3; // scope 3 at $DIR/unreachable_diverging.rs:15:12: 15:13 } bb3: { -- _5 = loop_forever() -> bb5; // scope 1 at $DIR/unreachable_diverging.rs:16:13: 16:27 -+ _5 = loop_forever() -> bb4; // scope 1 at $DIR/unreachable_diverging.rs:16:13: 16:27 +- _5 = loop_forever() -> bb5; // scope 3 at $DIR/unreachable_diverging.rs:16:13: 16:27 ++ _5 = loop_forever() -> bb4; // scope 3 at $DIR/unreachable_diverging.rs:16:13: 16:27 // mir::Constant // + span: $DIR/unreachable_diverging.rs:16:13: 16:25 // + literal: Const { ty: fn() {loop_forever}, val: Value(Scalar()) } } bb4: { -- _5 = const (); // scope 1 at $DIR/unreachable_diverging.rs:17:10: 17:10 -- goto -> bb5; // scope 1 at $DIR/unreachable_diverging.rs:15:9: 17:10 +- _5 = const (); // scope 2 at $DIR/unreachable_diverging.rs:17:10: 17:10 +- goto -> bb5; // scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10 - } - - bb5: { - StorageDead(_6); // scope 1 at $DIR/unreachable_diverging.rs:17:9: 17:10 - StorageDead(_5); // scope 1 at $DIR/unreachable_diverging.rs:17:9: 17:10 - StorageLive(_7); // scope 1 at $DIR/unreachable_diverging.rs:18:9: 18:22 - unreachable; // scope 1 at $DIR/unreachable_diverging.rs:18:15: 18:19 + StorageDead(_6); // scope 2 at $DIR/unreachable_diverging.rs:17:9: 17:10 + StorageDead(_5); // scope 2 at $DIR/unreachable_diverging.rs:17:9: 17:10 + StorageLive(_7); // scope 2 at $DIR/unreachable_diverging.rs:18:9: 18:22 + unreachable; // scope 2 at $DIR/unreachable_diverging.rs:18:15: 18:19 } - bb6: { diff --git a/src/test/mir-opt/while_let_loops.change_loop_body.ConstProp.64bit.diff b/src/test/mir-opt/while_let_loops.change_loop_body.ConstProp.64bit.diff index d6156eaaf482..f8b41d7b4c5d 100644 --- a/src/test/mir-opt/while_let_loops.change_loop_body.ConstProp.64bit.diff +++ b/src/test/mir-opt/while_let_loops.change_loop_body.ConstProp.64bit.diff @@ -34,9 +34,9 @@ } bb2: { - _1 = const 1_i32; // scope 1 at $DIR/while_let_loops.rs:8:9: 8:15 - nop; // scope 1 at $DIR/while_let_loops.rs:9:9: 9:14 - goto -> bb4; // scope 1 at $DIR/while_let_loops.rs:9:9: 9:14 + _1 = const 1_i32; // scope 2 at $DIR/while_let_loops.rs:8:9: 8:15 + nop; // scope 2 at $DIR/while_let_loops.rs:9:9: 9:14 + goto -> bb4; // scope 2 at $DIR/while_let_loops.rs:9:9: 9:14 } bb3: { diff --git a/src/test/mir-opt/while_storage.while_loop.PreCodegen.after.mir b/src/test/mir-opt/while_storage.while_loop.PreCodegen.after.mir index ec2d161251b0..df5a3cb31514 100644 --- a/src/test/mir-opt/while_storage.while_loop.PreCodegen.after.mir +++ b/src/test/mir-opt/while_storage.while_loop.PreCodegen.after.mir @@ -7,48 +7,52 @@ fn while_loop(_1: bool) -> () { let mut _3: bool; // in scope 0 at $DIR/while-storage.rs:10:20: 10:21 let mut _4: bool; // in scope 0 at $DIR/while-storage.rs:11:12: 11:23 let mut _5: bool; // in scope 0 at $DIR/while-storage.rs:11:21: 11:22 + scope 1 { + scope 2 { + } + } bb0: { goto -> bb1; // scope 0 at $DIR/while-storage.rs:10:5: 14:6 } bb1: { - StorageLive(_2); // scope 0 at $DIR/while-storage.rs:10:11: 10:22 - StorageLive(_3); // scope 0 at $DIR/while-storage.rs:10:20: 10:21 - _3 = _1; // scope 0 at $DIR/while-storage.rs:10:20: 10:21 - _2 = get_bool(move _3) -> bb2; // scope 0 at $DIR/while-storage.rs:10:11: 10:22 + StorageLive(_2); // scope 1 at $DIR/while-storage.rs:10:11: 10:22 + StorageLive(_3); // scope 1 at $DIR/while-storage.rs:10:20: 10:21 + _3 = _1; // scope 1 at $DIR/while-storage.rs:10:20: 10:21 + _2 = get_bool(move _3) -> bb2; // scope 1 at $DIR/while-storage.rs:10:11: 10:22 // mir::Constant // + span: $DIR/while-storage.rs:10:11: 10:19 // + literal: Const { ty: fn(bool) -> bool {get_bool}, val: Value(Scalar()) } } bb2: { - StorageDead(_3); // scope 0 at $DIR/while-storage.rs:10:21: 10:22 - switchInt(move _2) -> [false: bb7, otherwise: bb3]; // scope 0 at $DIR/while-storage.rs:10:11: 10:22 + StorageDead(_3); // scope 1 at $DIR/while-storage.rs:10:21: 10:22 + switchInt(move _2) -> [false: bb7, otherwise: bb3]; // scope 1 at $DIR/while-storage.rs:10:11: 10:22 } bb3: { - StorageLive(_4); // scope 0 at $DIR/while-storage.rs:11:12: 11:23 - StorageLive(_5); // scope 0 at $DIR/while-storage.rs:11:21: 11:22 - _5 = _1; // scope 0 at $DIR/while-storage.rs:11:21: 11:22 - _4 = get_bool(move _5) -> bb4; // scope 0 at $DIR/while-storage.rs:11:12: 11:23 + StorageLive(_4); // scope 2 at $DIR/while-storage.rs:11:12: 11:23 + StorageLive(_5); // scope 2 at $DIR/while-storage.rs:11:21: 11:22 + _5 = _1; // scope 2 at $DIR/while-storage.rs:11:21: 11:22 + _4 = get_bool(move _5) -> bb4; // scope 2 at $DIR/while-storage.rs:11:12: 11:23 // mir::Constant // + span: $DIR/while-storage.rs:11:12: 11:20 // + literal: Const { ty: fn(bool) -> bool {get_bool}, val: Value(Scalar()) } } bb4: { - StorageDead(_5); // scope 0 at $DIR/while-storage.rs:11:22: 11:23 - switchInt(move _4) -> [false: bb6, otherwise: bb5]; // scope 0 at $DIR/while-storage.rs:11:12: 11:23 + StorageDead(_5); // scope 2 at $DIR/while-storage.rs:11:22: 11:23 + switchInt(move _4) -> [false: bb6, otherwise: bb5]; // scope 2 at $DIR/while-storage.rs:11:12: 11:23 } bb5: { - StorageDead(_4); // scope 0 at $DIR/while-storage.rs:13:9: 13:10 - goto -> bb8; // scope 0 at no-location + StorageDead(_4); // scope 1 at $DIR/while-storage.rs:13:9: 13:10 + goto -> bb8; // scope 1 at no-location } bb6: { - StorageDead(_4); // scope 0 at $DIR/while-storage.rs:13:9: 13:10 + StorageDead(_4); // scope 1 at $DIR/while-storage.rs:13:9: 13:10 StorageDead(_2); // scope 0 at $DIR/while-storage.rs:14:5: 14:6 goto -> bb1; // scope 0 at $DIR/while-storage.rs:10:5: 14:6 }