rust/tests/mir-opt/const_prop/discriminant.main.GVN.32bit.diff

53 lines
1.2 KiB
Diff
Raw Normal View History

2023-09-20 21:43:33 +00:00
- // MIR for `main` before GVN
+ // MIR for `main` after GVN
2020-04-04 17:15:01 +00:00
fn main() -> () {
2023-06-06 13:47:00 +00:00
let mut _0: ();
let _1: i32;
let mut _2: i32;
let mut _3: std::option::Option<bool>;
let mut _4: isize;
2020-04-04 17:15:01 +00:00
scope 1 {
2023-06-06 13:47:00 +00:00
debug x => _1;
2020-04-04 17:15:01 +00:00
}
2022-06-10 21:12:58 +00:00
scope 2 {
}
2020-04-04 17:15:01 +00:00
bb0: {
2023-06-06 13:47:00 +00:00
StorageLive(_1);
StorageLive(_2);
StorageLive(_3);
- _3 = Option::<bool>::Some(const true);
- _4 = discriminant(_3);
- switchInt(move _4) -> [1: bb1, otherwise: bb3];
+ _3 = const Option::<bool>::Some(true);
+ _4 = const 1_isize;
+ switchInt(const 1_isize) -> [1: bb1, otherwise: bb3];
2020-04-04 17:15:01 +00:00
}
bb1: {
2023-06-06 13:47:00 +00:00
- switchInt(((_3 as Some).0: bool)) -> [0: bb3, otherwise: bb2];
+ switchInt(const true) -> [0: bb3, otherwise: bb2];
2020-04-04 17:15:01 +00:00
}
bb2: {
2023-06-06 13:47:00 +00:00
_2 = const 42_i32;
goto -> bb4;
2020-04-04 17:15:01 +00:00
}
bb3: {
2023-06-06 13:47:00 +00:00
_2 = const 10_i32;
goto -> bb4;
2020-04-04 17:15:01 +00:00
}
bb4: {
2023-06-06 13:47:00 +00:00
_1 = Add(move _2, const 0_i32);
StorageDead(_2);
StorageDead(_3);
_0 = const ();
StorageDead(_1);
return;
2020-04-04 17:15:01 +00:00
}
}