1
Fork 0

Don't change the otherwise of the switch

This commit is contained in:
DianQK 2024-03-12 22:34:02 +08:00
parent 928c57dc9a
commit 166bb1bd46
No known key found for this signature in database
4 changed files with 20 additions and 10 deletions

View file

@ -168,7 +168,8 @@ impl<'tcx> MirPass<'tcx> for EarlyOtherwiseBranch {
};
(value, targets.target_for_value(value))
});
let eq_targets = SwitchTargets::new(eq_new_targets, opt_data.destination);
// The otherwise either is the same target branch or an unreachable.
let eq_targets = SwitchTargets::new(eq_new_targets, parent_targets.otherwise());
// Create `bbEq` in example above
let eq_switch = BasicBlockData::new(Some(Terminator {