From 27068cbfdc15445cefc6a650355ff5c6bfe992c3 Mon Sep 17 00:00:00 2001 From: Simon Vandel Sillesen Date: Sun, 20 Sep 2020 01:18:05 +0200 Subject: [PATCH] add cleanup of cfg --- .../src/transform/early_otherwise_branch.rs | 10 +++ ...wise_branch.opt1.EarlyOtherwiseBranch.diff | 29 +++---- ...wise_branch.opt2.EarlyOtherwiseBranch.diff | 48 ++++++----- ...ement_tuple.opt1.EarlyOtherwiseBranch.diff | 44 ++++------ ...ch_68867.try_sum.EarlyOtherwiseBranch.diff | 86 ++++++++++--------- 5 files changed, 113 insertions(+), 104 deletions(-) diff --git a/compiler/rustc_mir/src/transform/early_otherwise_branch.rs b/compiler/rustc_mir/src/transform/early_otherwise_branch.rs index b0b9d5a8895..bb77dd38f22 100644 --- a/compiler/rustc_mir/src/transform/early_otherwise_branch.rs +++ b/compiler/rustc_mir/src/transform/early_otherwise_branch.rs @@ -6,6 +6,8 @@ use rustc_middle::mir::*; use rustc_middle::ty::{Ty, TyCtxt}; use std::{borrow::Cow, fmt::Debug}; +use super::simplify::simplify_cfg; + /// This pass optimizes something like /// ```text /// let x: Option<()>; @@ -44,6 +46,8 @@ impl<'tcx> MirPass<'tcx> for EarlyOtherwiseBranch { }) .collect(); + let should_cleanup = !opts_to_apply.is_empty(); + for opt_to_apply in opts_to_apply { trace!("SUCCESS: found optimization possibility to apply: {:?}", &opt_to_apply); @@ -147,6 +151,12 @@ impl<'tcx> MirPass<'tcx> for EarlyOtherwiseBranch { patch.apply(body); } + + // Since this optimization adds new basic blocks and invalidates others, + // clean up the cfg to make it nicer for other passes + if should_cleanup { + simplify_cfg(body); + } } } diff --git a/src/test/mir-opt/early_otherwise_branch.opt1.EarlyOtherwiseBranch.diff b/src/test/mir-opt/early_otherwise_branch.opt1.EarlyOtherwiseBranch.diff index ce0f0cf0a30..386726bfddc 100644 --- a/src/test/mir-opt/early_otherwise_branch.opt1.EarlyOtherwiseBranch.diff +++ b/src/test/mir-opt/early_otherwise_branch.opt1.EarlyOtherwiseBranch.diff @@ -36,21 +36,22 @@ + StorageLive(_11); // scope 0 at $DIR/early_otherwise_branch.rs:5:10: 5:17 + _11 = Ne(_10, _7); // scope 0 at $DIR/early_otherwise_branch.rs:5:10: 5:17 + StorageDead(_10); // scope 0 at $DIR/early_otherwise_branch.rs:5:10: 5:17 -+ switchInt(move _11) -> [false: bb6, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:5:10: 5:17 ++ switchInt(move _11) -> [false: bb4, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:5:10: 5:17 } bb1: { + StorageDead(_11); // scope 0 at $DIR/early_otherwise_branch.rs:6:14: 6:15 _0 = const 1_u32; // scope 0 at $DIR/early_otherwise_branch.rs:6:14: 6:15 - goto -> bb4; // scope 0 at $DIR/early_otherwise_branch.rs:4:5: 7:6 +- goto -> bb4; // scope 0 at $DIR/early_otherwise_branch.rs:4:5: 7:6 ++ goto -> bb3; // scope 0 at $DIR/early_otherwise_branch.rs:4:5: 7:6 } bb2: { - _6 = discriminant((_3.1: std::option::Option)); // scope 0 at $DIR/early_otherwise_branch.rs:5:19: 5:26 - switchInt(move _6) -> [1_isize: bb3, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:5:19: 5:26 - } - - bb3: { +- _6 = discriminant((_3.1: std::option::Option)); // scope 0 at $DIR/early_otherwise_branch.rs:5:19: 5:26 +- switchInt(move _6) -> [1_isize: bb3, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:5:19: 5:26 +- } +- +- bb3: { StorageLive(_8); // scope 0 at $DIR/early_otherwise_branch.rs:5:15: 5:16 _8 = (((_3.0: std::option::Option) as Some).0: u32); // scope 0 at $DIR/early_otherwise_branch.rs:5:15: 5:16 StorageLive(_9); // scope 0 at $DIR/early_otherwise_branch.rs:5:24: 5:25 @@ -58,21 +59,19 @@ _0 = const 0_u32; // scope 1 at $DIR/early_otherwise_branch.rs:5:31: 5:32 StorageDead(_9); // scope 0 at $DIR/early_otherwise_branch.rs:5:31: 5:32 StorageDead(_8); // scope 0 at $DIR/early_otherwise_branch.rs:5:31: 5:32 - goto -> bb4; // scope 0 at $DIR/early_otherwise_branch.rs:4:5: 7:6 +- goto -> bb4; // scope 0 at $DIR/early_otherwise_branch.rs:4:5: 7:6 ++ goto -> bb3; // scope 0 at $DIR/early_otherwise_branch.rs:4:5: 7:6 } - bb4: { +- bb4: { ++ bb3: { StorageDead(_3); // scope 0 at $DIR/early_otherwise_branch.rs:8:1: 8:2 return; // scope 0 at $DIR/early_otherwise_branch.rs:8:2: 8:2 + } + -+ bb5 (cleanup): { -+ resume; // scope 0 at $DIR/early_otherwise_branch.rs:3:1: 8:2 -+ } -+ -+ bb6: { ++ bb4: { + StorageDead(_11); // scope 0 at $DIR/early_otherwise_branch.rs:5:19: 5:26 -+ switchInt(_7) -> [1_isize: bb3, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:5:19: 5:26 ++ switchInt(_7) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:5:19: 5:26 } } diff --git a/src/test/mir-opt/early_otherwise_branch.opt2.EarlyOtherwiseBranch.diff b/src/test/mir-opt/early_otherwise_branch.opt2.EarlyOtherwiseBranch.diff index e9361f895bf..bc5934dec84 100644 --- a/src/test/mir-opt/early_otherwise_branch.opt2.EarlyOtherwiseBranch.diff +++ b/src/test/mir-opt/early_otherwise_branch.opt2.EarlyOtherwiseBranch.diff @@ -37,26 +37,28 @@ + StorageLive(_12); // scope 0 at $DIR/early_otherwise_branch.rs:13:10: 13:17 + _12 = Ne(_11, _8); // scope 0 at $DIR/early_otherwise_branch.rs:13:10: 13:17 + StorageDead(_11); // scope 0 at $DIR/early_otherwise_branch.rs:13:10: 13:17 -+ switchInt(move _12) -> [false: bb8, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch.rs:13:10: 13:17 ++ switchInt(move _12) -> [false: bb5, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:13:10: 13:17 } bb1: { - _6 = discriminant((_3.1: std::option::Option)); // scope 0 at $DIR/early_otherwise_branch.rs:14:16: 14:20 - switchInt(move _6) -> [0_isize: bb5, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch.rs:14:16: 14:20 - } - - bb2: { +- _6 = discriminant((_3.1: std::option::Option)); // scope 0 at $DIR/early_otherwise_branch.rs:14:16: 14:20 +- switchInt(move _6) -> [0_isize: bb5, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch.rs:14:16: 14:20 +- } +- +- bb2: { + StorageDead(_12); // scope 0 at $DIR/early_otherwise_branch.rs:15:14: 15:15 _0 = const 1_u32; // scope 0 at $DIR/early_otherwise_branch.rs:15:14: 15:15 - goto -> bb6; // scope 0 at $DIR/early_otherwise_branch.rs:12:5: 16:6 +- goto -> bb6; // scope 0 at $DIR/early_otherwise_branch.rs:12:5: 16:6 ++ goto -> bb4; // scope 0 at $DIR/early_otherwise_branch.rs:12:5: 16:6 } - bb3: { - _7 = discriminant((_3.1: std::option::Option)); // scope 0 at $DIR/early_otherwise_branch.rs:13:19: 13:26 - switchInt(move _7) -> [1_isize: bb4, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch.rs:13:19: 13:26 - } - - bb4: { +- bb3: { +- _7 = discriminant((_3.1: std::option::Option)); // scope 0 at $DIR/early_otherwise_branch.rs:13:19: 13:26 +- switchInt(move _7) -> [1_isize: bb4, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch.rs:13:19: 13:26 +- } +- +- bb4: { ++ bb2: { StorageLive(_9); // scope 0 at $DIR/early_otherwise_branch.rs:13:15: 13:16 _9 = (((_3.0: std::option::Option) as Some).0: u32); // scope 0 at $DIR/early_otherwise_branch.rs:13:15: 13:16 StorageLive(_10); // scope 0 at $DIR/early_otherwise_branch.rs:13:24: 13:25 @@ -64,26 +66,26 @@ _0 = const 0_u32; // scope 1 at $DIR/early_otherwise_branch.rs:13:31: 13:32 StorageDead(_10); // scope 0 at $DIR/early_otherwise_branch.rs:13:31: 13:32 StorageDead(_9); // scope 0 at $DIR/early_otherwise_branch.rs:13:31: 13:32 - goto -> bb6; // scope 0 at $DIR/early_otherwise_branch.rs:12:5: 16:6 +- goto -> bb6; // scope 0 at $DIR/early_otherwise_branch.rs:12:5: 16:6 ++ goto -> bb4; // scope 0 at $DIR/early_otherwise_branch.rs:12:5: 16:6 } - bb5: { +- bb5: { ++ bb3: { _0 = const 0_u32; // scope 0 at $DIR/early_otherwise_branch.rs:14:25: 14:26 - goto -> bb6; // scope 0 at $DIR/early_otherwise_branch.rs:12:5: 16:6 +- goto -> bb6; // scope 0 at $DIR/early_otherwise_branch.rs:12:5: 16:6 ++ goto -> bb4; // scope 0 at $DIR/early_otherwise_branch.rs:12:5: 16:6 } - bb6: { +- bb6: { ++ bb4: { StorageDead(_3); // scope 0 at $DIR/early_otherwise_branch.rs:17:1: 17:2 return; // scope 0 at $DIR/early_otherwise_branch.rs:17:2: 17:2 + } + -+ bb7 (cleanup): { -+ resume; // scope 0 at $DIR/early_otherwise_branch.rs:11:1: 17:2 -+ } -+ -+ bb8: { ++ bb5: { + StorageDead(_12); // scope 0 at $DIR/early_otherwise_branch.rs:14:16: 14:20 -+ switchInt(_8) -> [0_isize: bb5, 1_isize: bb4, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch.rs:14:16: 14:20 ++ switchInt(_8) -> [0_isize: bb3, 1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:14:16: 14:20 } } diff --git a/src/test/mir-opt/early_otherwise_branch_3_element_tuple.opt1.EarlyOtherwiseBranch.diff b/src/test/mir-opt/early_otherwise_branch_3_element_tuple.opt1.EarlyOtherwiseBranch.diff index 80bbc30124d..b0357f1aecd 100644 --- a/src/test/mir-opt/early_otherwise_branch_3_element_tuple.opt1.EarlyOtherwiseBranch.diff +++ b/src/test/mir-opt/early_otherwise_branch_3_element_tuple.opt1.EarlyOtherwiseBranch.diff @@ -47,33 +47,30 @@ + StorageLive(_15); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:6:10: 6:17 + _15 = Ne(_14, _10); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:6:10: 6:17 + StorageDead(_14); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:6:10: 6:17 -+ switchInt(move _15) -> [false: bb7, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:6:10: 6:17 ++ switchInt(move _15) -> [false: bb5, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:6:10: 6:17 } bb1: { + StorageDead(_17); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:7:14: 7:15 + StorageDead(_15); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:7:14: 7:15 _0 = const 1_u32; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:7:14: 7:15 - goto -> bb5; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:5:5: 8:6 +- goto -> bb5; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:5:5: 8:6 ++ goto -> bb4; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:5:5: 8:6 } bb2: { - _9 = discriminant((_4.1: std::option::Option)); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:6:19: 6:26 +- _9 = discriminant((_4.1: std::option::Option)); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:6:19: 6:26 - switchInt(move _9) -> [1_isize: bb3, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:6:19: 6:26 -+ StorageLive(_16); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:6:19: 6:26 -+ _16 = discriminant((_4.2: std::option::Option)); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:6:19: 6:26 -+ StorageLive(_17); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:6:19: 6:26 -+ _17 = Ne(_16, _9); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:6:19: 6:26 -+ StorageDead(_16); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:6:19: 6:26 -+ switchInt(move _17) -> [false: bb8, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:6:19: 6:26 - } - - bb3: { +- } +- +- bb3: { _8 = discriminant((_4.2: std::option::Option)); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:6:28: 6:35 - switchInt(move _8) -> [1_isize: bb4, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:6:28: 6:35 +- switchInt(move _8) -> [1_isize: bb4, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:6:28: 6:35 ++ switchInt(move _8) -> [1_isize: bb3, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:6:28: 6:35 } - bb4: { +- bb4: { ++ bb3: { StorageLive(_11); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:6:15: 6:16 _11 = (((_4.0: std::option::Option) as Some).0: u32); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:6:15: 6:16 StorageLive(_12); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:6:24: 6:25 @@ -84,26 +81,19 @@ StorageDead(_13); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:6:40: 6:41 StorageDead(_12); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:6:40: 6:41 StorageDead(_11); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:6:40: 6:41 - goto -> bb5; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:5:5: 8:6 +- goto -> bb5; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:5:5: 8:6 ++ goto -> bb4; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:5:5: 8:6 } - bb5: { +- bb5: { ++ bb4: { StorageDead(_4); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:9:1: 9:2 return; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:9:2: 9:2 + } + -+ bb6 (cleanup): { -+ resume; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:4:1: 9:2 -+ } -+ -+ bb7: { ++ bb5: { + StorageDead(_15); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:6:19: 6:26 -+ switchInt(_10) -> [1_isize: bb3, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:6:19: 6:26 -+ } -+ -+ bb8: { -+ StorageDead(_17); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:6:28: 6:35 -+ switchInt(_9) -> [1_isize: bb4, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:6:28: 6:35 ++ switchInt(_10) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:6:19: 6:26 } } diff --git a/src/test/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff b/src/test/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff index 9abbe767cae..57f9b1dd3ca 100644 --- a/src/test/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff +++ b/src/test/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff @@ -73,15 +73,15 @@ + StorageLive(_35); // scope 0 at $DIR/early_otherwise_branch_68867.rs:20:11: 20:18 + _35 = Ne(_34, _11); // scope 0 at $DIR/early_otherwise_branch_68867.rs:20:11: 20:18 + StorageDead(_34); // scope 0 at $DIR/early_otherwise_branch_68867.rs:20:11: 20:18 -+ switchInt(move _35) -> [false: bb13, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:20:11: 20:18 ++ switchInt(move _35) -> [false: bb8, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:20:11: 20:18 } bb1: { - _7 = discriminant((*(_4.1: &ViewportPercentageLength))); // scope 0 at $DIR/early_otherwise_branch_68867.rs:20:21: 20:30 - switchInt(move _7) -> [0_isize: bb6, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:20:21: 20:30 - } - - bb2: { +- _7 = discriminant((*(_4.1: &ViewportPercentageLength))); // scope 0 at $DIR/early_otherwise_branch_68867.rs:20:21: 20:30 +- switchInt(move _7) -> [0_isize: bb6, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:20:21: 20:30 +- } +- +- bb2: { + StorageDead(_35); // scope 0 at $DIR/early_otherwise_branch_68867.rs:24:25: 24:27 StorageLive(_33); // scope 0 at $DIR/early_otherwise_branch_68867.rs:24:25: 24:27 ((_0 as Err).0: ()) = const (); // scope 0 at $DIR/early_otherwise_branch_68867.rs:24:21: 24:28 @@ -89,25 +89,27 @@ StorageDead(_33); // scope 0 at $DIR/early_otherwise_branch_68867.rs:24:27: 24:28 StorageDead(_3); // scope 0 at $DIR/early_otherwise_branch_68867.rs:25:6: 25:7 StorageDead(_4); // scope 0 at $DIR/early_otherwise_branch_68867.rs:26:1: 26:2 - goto -> bb10; // scope 0 at $DIR/early_otherwise_branch_68867.rs:24:14: 24:28 +- goto -> bb10; // scope 0 at $DIR/early_otherwise_branch_68867.rs:24:14: 24:28 ++ goto -> bb6; // scope 0 at $DIR/early_otherwise_branch_68867.rs:24:14: 24:28 } - bb3: { - _8 = discriminant((*(_4.1: &ViewportPercentageLength))); // scope 0 at $DIR/early_otherwise_branch_68867.rs:21:21: 21:30 - switchInt(move _8) -> [1_isize: bb7, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:21:21: 21:30 - } - - bb4: { - _9 = discriminant((*(_4.1: &ViewportPercentageLength))); // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:23: 22:34 - switchInt(move _9) -> [2_isize: bb8, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:23: 22:34 - } - - bb5: { - _10 = discriminant((*(_4.1: &ViewportPercentageLength))); // scope 0 at $DIR/early_otherwise_branch_68867.rs:23:23: 23:34 - switchInt(move _10) -> [3_isize: bb9, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:23:23: 23:34 - } - - bb6: { +- bb3: { +- _8 = discriminant((*(_4.1: &ViewportPercentageLength))); // scope 0 at $DIR/early_otherwise_branch_68867.rs:21:21: 21:30 +- switchInt(move _8) -> [1_isize: bb7, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:21:21: 21:30 +- } +- +- bb4: { +- _9 = discriminant((*(_4.1: &ViewportPercentageLength))); // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:23: 22:34 +- switchInt(move _9) -> [2_isize: bb8, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:23: 22:34 +- } +- +- bb5: { +- _10 = discriminant((*(_4.1: &ViewportPercentageLength))); // scope 0 at $DIR/early_otherwise_branch_68867.rs:23:23: 23:34 +- switchInt(move _10) -> [3_isize: bb9, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:23:23: 23:34 +- } +- +- bb6: { ++ bb2: { StorageLive(_12); // scope 0 at $DIR/early_otherwise_branch_68867.rs:20:14: 20:17 _12 = (((*(_4.0: &ViewportPercentageLength)) as Vw).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:20:14: 20:17 StorageLive(_13); // scope 0 at $DIR/early_otherwise_branch_68867.rs:20:24: 20:29 @@ -125,10 +127,12 @@ StorageDead(_14); // scope 1 at $DIR/early_otherwise_branch_68867.rs:20:49: 20:50 StorageDead(_13); // scope 0 at $DIR/early_otherwise_branch_68867.rs:20:49: 20:50 StorageDead(_12); // scope 0 at $DIR/early_otherwise_branch_68867.rs:20:49: 20:50 - goto -> bb11; // scope 0 at $DIR/early_otherwise_branch_68867.rs:19:8: 25:6 +- goto -> bb11; // scope 0 at $DIR/early_otherwise_branch_68867.rs:19:8: 25:6 ++ goto -> bb7; // scope 0 at $DIR/early_otherwise_branch_68867.rs:19:8: 25:6 } - bb7: { +- bb7: { ++ bb3: { StorageLive(_17); // scope 0 at $DIR/early_otherwise_branch_68867.rs:21:14: 21:17 _17 = (((*(_4.0: &ViewportPercentageLength)) as Vh).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:21:14: 21:17 StorageLive(_18); // scope 0 at $DIR/early_otherwise_branch_68867.rs:21:24: 21:29 @@ -146,10 +150,12 @@ StorageDead(_19); // scope 2 at $DIR/early_otherwise_branch_68867.rs:21:49: 21:50 StorageDead(_18); // scope 0 at $DIR/early_otherwise_branch_68867.rs:21:49: 21:50 StorageDead(_17); // scope 0 at $DIR/early_otherwise_branch_68867.rs:21:49: 21:50 - goto -> bb11; // scope 0 at $DIR/early_otherwise_branch_68867.rs:19:8: 25:6 +- goto -> bb11; // scope 0 at $DIR/early_otherwise_branch_68867.rs:19:8: 25:6 ++ goto -> bb7; // scope 0 at $DIR/early_otherwise_branch_68867.rs:19:8: 25:6 } - bb8: { +- bb8: { ++ bb4: { StorageLive(_22); // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:16: 22:19 _22 = (((*(_4.0: &ViewportPercentageLength)) as Vmin).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:16: 22:19 StorageLive(_23); // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:28: 22:33 @@ -167,10 +173,12 @@ StorageDead(_24); // scope 3 at $DIR/early_otherwise_branch_68867.rs:22:55: 22:56 StorageDead(_23); // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:55: 22:56 StorageDead(_22); // scope 0 at $DIR/early_otherwise_branch_68867.rs:22:55: 22:56 - goto -> bb11; // scope 0 at $DIR/early_otherwise_branch_68867.rs:19:8: 25:6 +- goto -> bb11; // scope 0 at $DIR/early_otherwise_branch_68867.rs:19:8: 25:6 ++ goto -> bb7; // scope 0 at $DIR/early_otherwise_branch_68867.rs:19:8: 25:6 } - bb9: { +- bb9: { ++ bb5: { StorageLive(_27); // scope 0 at $DIR/early_otherwise_branch_68867.rs:23:16: 23:19 _27 = (((*(_4.0: &ViewportPercentageLength)) as Vmax).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:23:16: 23:19 StorageLive(_28); // scope 0 at $DIR/early_otherwise_branch_68867.rs:23:28: 23:33 @@ -188,28 +196,28 @@ StorageDead(_29); // scope 4 at $DIR/early_otherwise_branch_68867.rs:23:55: 23:56 StorageDead(_28); // scope 0 at $DIR/early_otherwise_branch_68867.rs:23:55: 23:56 StorageDead(_27); // scope 0 at $DIR/early_otherwise_branch_68867.rs:23:55: 23:56 - goto -> bb11; // scope 0 at $DIR/early_otherwise_branch_68867.rs:19:8: 25:6 +- goto -> bb11; // scope 0 at $DIR/early_otherwise_branch_68867.rs:19:8: 25:6 ++ goto -> bb7; // scope 0 at $DIR/early_otherwise_branch_68867.rs:19:8: 25:6 } - bb10: { +- bb10: { ++ bb6: { return; // scope 0 at $DIR/early_otherwise_branch_68867.rs:26:2: 26:2 } - bb11: { +- bb11: { ++ bb7: { ((_0 as Ok).0: ViewportPercentageLength) = move _3; // scope 0 at $DIR/early_otherwise_branch_68867.rs:19:5: 25:7 discriminant(_0) = 0; // scope 0 at $DIR/early_otherwise_branch_68867.rs:19:5: 25:7 StorageDead(_3); // scope 0 at $DIR/early_otherwise_branch_68867.rs:25:6: 25:7 StorageDead(_4); // scope 0 at $DIR/early_otherwise_branch_68867.rs:26:1: 26:2 - goto -> bb10; // scope 0 at $DIR/early_otherwise_branch_68867.rs:26:2: 26:2 +- goto -> bb10; // scope 0 at $DIR/early_otherwise_branch_68867.rs:26:2: 26:2 ++ goto -> bb6; // scope 0 at $DIR/early_otherwise_branch_68867.rs:26:2: 26:2 + } + -+ bb12 (cleanup): { -+ resume; // scope 0 at $DIR/early_otherwise_branch_68867.rs:15:1: 26:2 -+ } -+ -+ bb13: { ++ bb8: { + StorageDead(_35); // scope 0 at $DIR/early_otherwise_branch_68867.rs:20:21: 20:30 -+ switchInt(_11) -> [0_isize: bb6, 1_isize: bb7, 2_isize: bb8, 3_isize: bb9, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:20:21: 20:30 ++ switchInt(_11) -> [0_isize: bb2, 1_isize: bb3, 2_isize: bb4, 3_isize: bb5, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:20:21: 20:30 } }