Run branch cleanup after copy prop
This commit is contained in:
parent
ef4d1c4195
commit
ab41023fd4
@ -285,6 +285,7 @@ fn optimized_mir<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> &'tcx
|
||||
&simplify_branches::SimplifyBranches::new("after-const-prop"),
|
||||
&deaggregator::Deaggregator,
|
||||
©_prop::CopyPropagation,
|
||||
&simplify_branches::SimplifyBranches::new("after-copy-prop"),
|
||||
&remove_noop_landing_pads::RemoveNoopLandingPads,
|
||||
&simplify::SimplifyCfg::new("final"),
|
||||
&simplify::SimplifyLocals,
|
||||
|
22
src/test/mir-opt/simplify_match.rs
Normal file
22
src/test/mir-opt/simplify_match.rs
Normal file
@ -0,0 +1,22 @@
|
||||
fn main() {
|
||||
match { let x = false; x } {
|
||||
true => println!("hello world!"),
|
||||
false => {},
|
||||
}
|
||||
}
|
||||
|
||||
// END RUST SOURCE
|
||||
// START rustc.main.SimplifyBranches-after-copy-prop.before.mir
|
||||
// bb0: {
|
||||
// ...
|
||||
// switchInt(const false) -> [false: bb3, otherwise: bb1];
|
||||
// }
|
||||
// bb1: {
|
||||
// END rustc.main.SimplifyBranches-after-copy-prop.before.mir
|
||||
// START rustc.main.SimplifyBranches-after-copy-prop.after.mir
|
||||
// bb0: {
|
||||
// ...
|
||||
// goto -> bb3;
|
||||
// }
|
||||
// bb1: {
|
||||
// END rustc.main.SimplifyBranches-after-copy-prop.after.mir
|
Loading…
Reference in New Issue
Block a user