bless mir-opt
To reproduce the changes in this commit locally: - Run `./x test tidy` and remove all the output files not associated with a test file anymore, as reported by tidy. - Run `./x test tests/mir-opt --bless` to generate the new outputs.
This commit is contained in:
parent
070cc836e9
commit
4668123945
@ -0,0 +1,64 @@
|
||||
// MIR for `main` after SimplifyCfg-elaborate-drops
|
||||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/array_index_is_temporary.rs:+0:11: +0:11
|
||||
let mut _1: [u32; 3]; // in scope 0 at $DIR/array_index_is_temporary.rs:+1:9: +1:14
|
||||
let mut _4: &mut usize; // in scope 0 at $DIR/array_index_is_temporary.rs:+3:25: +3:31
|
||||
let mut _5: u32; // in scope 0 at $DIR/array_index_is_temporary.rs:+4:12: +4:29
|
||||
let mut _6: *mut usize; // in scope 0 at $DIR/array_index_is_temporary.rs:+4:25: +4:26
|
||||
let _7: usize; // in scope 0 at $DIR/array_index_is_temporary.rs:+4:7: +4:8
|
||||
let mut _8: usize; // in scope 0 at $DIR/array_index_is_temporary.rs:+4:5: +4:9
|
||||
let mut _9: bool; // in scope 0 at $DIR/array_index_is_temporary.rs:+4:5: +4:9
|
||||
scope 1 {
|
||||
debug x => _1; // in scope 1 at $DIR/array_index_is_temporary.rs:+1:9: +1:14
|
||||
let mut _2: usize; // in scope 1 at $DIR/array_index_is_temporary.rs:+2:9: +2:14
|
||||
scope 2 {
|
||||
debug y => _2; // in scope 2 at $DIR/array_index_is_temporary.rs:+2:9: +2:14
|
||||
let _3: *mut usize; // in scope 2 at $DIR/array_index_is_temporary.rs:+3:9: +3:10
|
||||
scope 3 {
|
||||
debug z => _3; // in scope 3 at $DIR/array_index_is_temporary.rs:+3:9: +3:10
|
||||
scope 4 {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/array_index_is_temporary.rs:+1:9: +1:14
|
||||
_1 = [const 42_u32, const 43_u32, const 44_u32]; // scope 0 at $DIR/array_index_is_temporary.rs:+1:17: +1:29
|
||||
StorageLive(_2); // scope 1 at $DIR/array_index_is_temporary.rs:+2:9: +2:14
|
||||
_2 = const 1_usize; // scope 1 at $DIR/array_index_is_temporary.rs:+2:17: +2:18
|
||||
StorageLive(_3); // scope 2 at $DIR/array_index_is_temporary.rs:+3:9: +3:10
|
||||
StorageLive(_4); // scope 2 at $DIR/array_index_is_temporary.rs:+3:25: +3:31
|
||||
_4 = &mut _2; // scope 2 at $DIR/array_index_is_temporary.rs:+3:25: +3:31
|
||||
_3 = &raw mut (*_4); // scope 2 at $DIR/array_index_is_temporary.rs:+3:25: +3:31
|
||||
StorageDead(_4); // scope 2 at $DIR/array_index_is_temporary.rs:+3:31: +3:32
|
||||
StorageLive(_5); // scope 3 at $DIR/array_index_is_temporary.rs:+4:12: +4:29
|
||||
StorageLive(_6); // scope 4 at $DIR/array_index_is_temporary.rs:+4:25: +4:26
|
||||
_6 = _3; // scope 4 at $DIR/array_index_is_temporary.rs:+4:25: +4:26
|
||||
_5 = foo(move _6) -> [return: bb1, unwind unreachable]; // scope 4 at $DIR/array_index_is_temporary.rs:+4:21: +4:27
|
||||
// mir::Constant
|
||||
// + span: $DIR/array_index_is_temporary.rs:17:21: 17:24
|
||||
// + literal: Const { ty: unsafe fn(*mut usize) -> u32 {foo}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb1: {
|
||||
StorageDead(_6); // scope 4 at $DIR/array_index_is_temporary.rs:+4:26: +4:27
|
||||
StorageLive(_7); // scope 3 at $DIR/array_index_is_temporary.rs:+4:7: +4:8
|
||||
_7 = _2; // scope 3 at $DIR/array_index_is_temporary.rs:+4:7: +4:8
|
||||
_8 = Len(_1); // scope 3 at $DIR/array_index_is_temporary.rs:+4:5: +4:9
|
||||
_9 = Lt(_7, _8); // scope 3 at $DIR/array_index_is_temporary.rs:+4:5: +4:9
|
||||
assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> [success: bb2, unwind unreachable]; // scope 3 at $DIR/array_index_is_temporary.rs:+4:5: +4:9
|
||||
}
|
||||
|
||||
bb2: {
|
||||
_1[_7] = move _5; // scope 3 at $DIR/array_index_is_temporary.rs:+4:5: +4:29
|
||||
StorageDead(_5); // scope 3 at $DIR/array_index_is_temporary.rs:+4:28: +4:29
|
||||
StorageDead(_7); // scope 3 at $DIR/array_index_is_temporary.rs:+4:29: +4:30
|
||||
_0 = const (); // scope 0 at $DIR/array_index_is_temporary.rs:+0:11: +5:2
|
||||
StorageDead(_3); // scope 2 at $DIR/array_index_is_temporary.rs:+5:1: +5:2
|
||||
StorageDead(_2); // scope 1 at $DIR/array_index_is_temporary.rs:+5:1: +5:2
|
||||
StorageDead(_1); // scope 0 at $DIR/array_index_is_temporary.rs:+5:1: +5:2
|
||||
return; // scope 0 at $DIR/array_index_is_temporary.rs:+5:2: +5:2
|
||||
}
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
// MIR for `main` before ElaborateDrops
|
||||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/box_expr.rs:+0:11: +0:11
|
||||
let _1: std::boxed::Box<S>; // in scope 0 at $DIR/box_expr.rs:+1:9: +1:10
|
||||
let mut _2: usize; // in scope 0 at $DIR/box_expr.rs:+2:5: +2:23
|
||||
let mut _3: usize; // in scope 0 at $DIR/box_expr.rs:+2:5: +2:23
|
||||
let mut _4: *mut u8; // in scope 0 at $DIR/box_expr.rs:+2:5: +2:23
|
||||
let mut _5: std::boxed::Box<S>; // in scope 0 at $DIR/box_expr.rs:+2:5: +2:23
|
||||
let _6: (); // in scope 0 at $DIR/box_expr.rs:+3:5: +3:12
|
||||
let mut _7: std::boxed::Box<S>; // in scope 0 at $DIR/box_expr.rs:+3:10: +3:11
|
||||
scope 1 {
|
||||
debug x => _1; // in scope 1 at $DIR/box_expr.rs:+1:9: +1:10
|
||||
}
|
||||
scope 2 {
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/box_expr.rs:+1:9: +1:10
|
||||
_2 = SizeOf(S); // scope 2 at $DIR/box_expr.rs:+2:5: +2:23
|
||||
_3 = AlignOf(S); // scope 2 at $DIR/box_expr.rs:+2:5: +2:23
|
||||
_4 = alloc::alloc::exchange_malloc(move _2, move _3) -> [return: bb1, unwind: bb9]; // scope 2 at $DIR/box_expr.rs:+2:5: +2:23
|
||||
// mir::Constant
|
||||
// + span: $DIR/box_expr.rs:8:5: 8:23
|
||||
// + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb1: {
|
||||
StorageLive(_5); // scope 0 at $DIR/box_expr.rs:+2:5: +2:23
|
||||
_5 = ShallowInitBox(move _4, S); // scope 0 at $DIR/box_expr.rs:+2:5: +2:23
|
||||
(*_5) = S::new() -> [return: bb2, unwind: bb8]; // scope 0 at $DIR/box_expr.rs:+2:14: +2:22
|
||||
// mir::Constant
|
||||
// + span: $DIR/box_expr.rs:8:14: 8:20
|
||||
// + literal: Const { ty: fn() -> S {S::new}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb2: {
|
||||
_1 = move _5; // scope 0 at $DIR/box_expr.rs:+2:5: +2:23
|
||||
drop(_5) -> [return: bb3, unwind: bb9]; // scope 0 at $DIR/box_expr.rs:+2:22: +2:23
|
||||
}
|
||||
|
||||
bb3: {
|
||||
StorageDead(_5); // scope 0 at $DIR/box_expr.rs:+2:22: +2:23
|
||||
StorageLive(_6); // scope 1 at $DIR/box_expr.rs:+3:5: +3:12
|
||||
StorageLive(_7); // scope 1 at $DIR/box_expr.rs:+3:10: +3:11
|
||||
_7 = move _1; // scope 1 at $DIR/box_expr.rs:+3:10: +3:11
|
||||
_6 = std::mem::drop::<Box<S>>(move _7) -> [return: bb4, unwind: bb6]; // scope 1 at $DIR/box_expr.rs:+3:5: +3:12
|
||||
// mir::Constant
|
||||
// + span: $DIR/box_expr.rs:9:5: 9:9
|
||||
// + literal: Const { ty: fn(Box<S>) {std::mem::drop::<Box<S>>}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb4: {
|
||||
StorageDead(_7); // scope 1 at $DIR/box_expr.rs:+3:11: +3:12
|
||||
StorageDead(_6); // scope 1 at $DIR/box_expr.rs:+3:12: +3:13
|
||||
_0 = const (); // scope 0 at $DIR/box_expr.rs:+0:11: +4:2
|
||||
drop(_1) -> [return: bb5, unwind: bb9]; // scope 0 at $DIR/box_expr.rs:+4:1: +4:2
|
||||
}
|
||||
|
||||
bb5: {
|
||||
StorageDead(_1); // scope 0 at $DIR/box_expr.rs:+4:1: +4:2
|
||||
return; // scope 0 at $DIR/box_expr.rs:+4:2: +4:2
|
||||
}
|
||||
|
||||
bb6 (cleanup): {
|
||||
drop(_7) -> [return: bb7, unwind terminate]; // scope 1 at $DIR/box_expr.rs:+3:11: +3:12
|
||||
}
|
||||
|
||||
bb7 (cleanup): {
|
||||
drop(_1) -> [return: bb9, unwind terminate]; // scope 0 at $DIR/box_expr.rs:+4:1: +4:2
|
||||
}
|
||||
|
||||
bb8 (cleanup): {
|
||||
drop(_5) -> [return: bb9, unwind terminate]; // scope 0 at $DIR/box_expr.rs:+2:22: +2:23
|
||||
}
|
||||
|
||||
bb9 (cleanup): {
|
||||
resume; // scope 0 at $DIR/box_expr.rs:+0:1: +4:2
|
||||
}
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
- // MIR for `norm2` before InstSimplify
|
||||
+ // MIR for `norm2` after InstSimplify
|
||||
|
||||
fn norm2(_1: [f32; 2]) -> f32 {
|
||||
debug x => _1; // in scope 0 at $DIR/combine_array_len.rs:+0:10: +0:11
|
||||
let mut _0: f32; // return place in scope 0 at $DIR/combine_array_len.rs:+0:26: +0:29
|
||||
let _2: f32; // in scope 0 at $DIR/combine_array_len.rs:+1:9: +1:10
|
||||
let _3: usize; // in scope 0 at $DIR/combine_array_len.rs:+1:15: +1:16
|
||||
let mut _4: usize; // in scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
|
||||
let mut _5: bool; // in scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
|
||||
let _7: usize; // in scope 0 at $DIR/combine_array_len.rs:+2:15: +2:16
|
||||
let mut _8: usize; // in scope 0 at $DIR/combine_array_len.rs:+2:13: +2:17
|
||||
let mut _9: bool; // in scope 0 at $DIR/combine_array_len.rs:+2:13: +2:17
|
||||
let mut _10: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:5: +3:8
|
||||
let mut _11: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:5: +3:6
|
||||
let mut _12: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:7: +3:8
|
||||
let mut _13: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:11: +3:14
|
||||
let mut _14: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:11: +3:12
|
||||
let mut _15: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:13: +3:14
|
||||
scope 1 {
|
||||
debug a => _2; // in scope 1 at $DIR/combine_array_len.rs:+1:9: +1:10
|
||||
let _6: f32; // in scope 1 at $DIR/combine_array_len.rs:+2:9: +2:10
|
||||
scope 2 {
|
||||
debug b => _6; // in scope 2 at $DIR/combine_array_len.rs:+2:9: +2:10
|
||||
}
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_2); // scope 0 at $DIR/combine_array_len.rs:+1:9: +1:10
|
||||
StorageLive(_3); // scope 0 at $DIR/combine_array_len.rs:+1:15: +1:16
|
||||
_3 = const 0_usize; // scope 0 at $DIR/combine_array_len.rs:+1:15: +1:16
|
||||
- _4 = Len(_1); // scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
|
||||
+ _4 = const 2_usize; // scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
|
||||
_5 = Lt(_3, _4); // scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
|
||||
assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable]; // scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
|
||||
}
|
||||
|
||||
bb1: {
|
||||
_2 = _1[_3]; // scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
|
||||
StorageDead(_3); // scope 0 at $DIR/combine_array_len.rs:+1:17: +1:18
|
||||
StorageLive(_6); // scope 1 at $DIR/combine_array_len.rs:+2:9: +2:10
|
||||
StorageLive(_7); // scope 1 at $DIR/combine_array_len.rs:+2:15: +2:16
|
||||
_7 = const 1_usize; // scope 1 at $DIR/combine_array_len.rs:+2:15: +2:16
|
||||
- _8 = Len(_1); // scope 1 at $DIR/combine_array_len.rs:+2:13: +2:17
|
||||
+ _8 = const 2_usize; // scope 1 at $DIR/combine_array_len.rs:+2:13: +2:17
|
||||
_9 = Lt(_7, _8); // scope 1 at $DIR/combine_array_len.rs:+2:13: +2:17
|
||||
assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> [success: bb2, unwind unreachable]; // scope 1 at $DIR/combine_array_len.rs:+2:13: +2:17
|
||||
}
|
||||
|
||||
bb2: {
|
||||
_6 = _1[_7]; // scope 1 at $DIR/combine_array_len.rs:+2:13: +2:17
|
||||
StorageDead(_7); // scope 1 at $DIR/combine_array_len.rs:+2:17: +2:18
|
||||
StorageLive(_10); // scope 2 at $DIR/combine_array_len.rs:+3:5: +3:8
|
||||
StorageLive(_11); // scope 2 at $DIR/combine_array_len.rs:+3:5: +3:6
|
||||
_11 = _2; // scope 2 at $DIR/combine_array_len.rs:+3:5: +3:6
|
||||
StorageLive(_12); // scope 2 at $DIR/combine_array_len.rs:+3:7: +3:8
|
||||
_12 = _2; // scope 2 at $DIR/combine_array_len.rs:+3:7: +3:8
|
||||
_10 = Mul(move _11, move _12); // scope 2 at $DIR/combine_array_len.rs:+3:5: +3:8
|
||||
StorageDead(_12); // scope 2 at $DIR/combine_array_len.rs:+3:7: +3:8
|
||||
StorageDead(_11); // scope 2 at $DIR/combine_array_len.rs:+3:7: +3:8
|
||||
StorageLive(_13); // scope 2 at $DIR/combine_array_len.rs:+3:11: +3:14
|
||||
StorageLive(_14); // scope 2 at $DIR/combine_array_len.rs:+3:11: +3:12
|
||||
_14 = _6; // scope 2 at $DIR/combine_array_len.rs:+3:11: +3:12
|
||||
StorageLive(_15); // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14
|
||||
_15 = _6; // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14
|
||||
_13 = Mul(move _14, move _15); // scope 2 at $DIR/combine_array_len.rs:+3:11: +3:14
|
||||
StorageDead(_15); // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14
|
||||
StorageDead(_14); // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14
|
||||
_0 = Add(move _10, move _13); // scope 2 at $DIR/combine_array_len.rs:+3:5: +3:14
|
||||
StorageDead(_13); // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14
|
||||
StorageDead(_10); // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14
|
||||
StorageDead(_6); // scope 1 at $DIR/combine_array_len.rs:+4:1: +4:2
|
||||
StorageDead(_2); // scope 0 at $DIR/combine_array_len.rs:+4:1: +4:2
|
||||
return; // scope 0 at $DIR/combine_array_len.rs:+4:2: +4:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,74 @@
|
||||
- // MIR for `<impl at $DIR/combine_clone_of_primitives.rs:6:10: 6:15>::clone` before InstSimplify
|
||||
+ // MIR for `<impl at $DIR/combine_clone_of_primitives.rs:6:10: 6:15>::clone` after InstSimplify
|
||||
|
||||
fn <impl at $DIR/combine_clone_of_primitives.rs:6:10: 6:15>::clone(_1: &MyThing<T>) -> MyThing<T> {
|
||||
debug self => _1; // in scope 0 at $DIR/combine_clone_of_primitives.rs:+0:10: +0:15
|
||||
let mut _0: MyThing<T>; // return place in scope 0 at $DIR/combine_clone_of_primitives.rs:+0:10: +0:15
|
||||
let mut _2: T; // in scope 0 at $DIR/combine_clone_of_primitives.rs:8:5: 8:9
|
||||
let mut _3: &T; // in scope 0 at $DIR/combine_clone_of_primitives.rs:8:5: 8:9
|
||||
let _4: &T; // in scope 0 at $DIR/combine_clone_of_primitives.rs:8:5: 8:9
|
||||
let mut _5: u64; // in scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
|
||||
let mut _6: &u64; // in scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
|
||||
let _7: &u64; // in scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
|
||||
let mut _8: [f32; 3]; // in scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
|
||||
let mut _9: &[f32; 3]; // in scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
|
||||
let _10: &[f32; 3]; // in scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
|
||||
|
||||
bb0: {
|
||||
StorageLive(_2); // scope 0 at $DIR/combine_clone_of_primitives.rs:8:5: 8:9
|
||||
StorageLive(_3); // scope 0 at $DIR/combine_clone_of_primitives.rs:8:5: 8:9
|
||||
StorageLive(_4); // scope 0 at $DIR/combine_clone_of_primitives.rs:8:5: 8:9
|
||||
_4 = &((*_1).0: T); // scope 0 at $DIR/combine_clone_of_primitives.rs:8:5: 8:9
|
||||
- _3 = &(*_4); // scope 0 at $DIR/combine_clone_of_primitives.rs:8:5: 8:9
|
||||
+ _3 = _4; // scope 0 at $DIR/combine_clone_of_primitives.rs:8:5: 8:9
|
||||
_2 = <T as Clone>::clone(move _3) -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/combine_clone_of_primitives.rs:8:5: 8:9
|
||||
// mir::Constant
|
||||
// + span: $DIR/combine_clone_of_primitives.rs:8:5: 8:9
|
||||
// + literal: Const { ty: for<'a> fn(&'a T) -> T {<T as Clone>::clone}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb1: {
|
||||
StorageDead(_3); // scope 0 at $DIR/combine_clone_of_primitives.rs:8:8: 8:9
|
||||
StorageLive(_5); // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
|
||||
StorageLive(_6); // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
|
||||
StorageLive(_7); // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
|
||||
_7 = &((*_1).1: u64); // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
|
||||
- _6 = &(*_7); // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
|
||||
- _5 = <u64 as Clone>::clone(move _6) -> [return: bb2, unwind unreachable]; // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
|
||||
- // mir::Constant
|
||||
- // + span: $DIR/combine_clone_of_primitives.rs:9:5: 9:11
|
||||
- // + literal: Const { ty: for<'a> fn(&'a u64) -> u64 {<u64 as Clone>::clone}, val: Value(<ZST>) }
|
||||
+ _6 = _7; // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
|
||||
+ _5 = (*_6); // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
|
||||
+ goto -> bb2; // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
|
||||
}
|
||||
|
||||
bb2: {
|
||||
StorageDead(_6); // scope 0 at $DIR/combine_clone_of_primitives.rs:9:10: 9:11
|
||||
StorageLive(_8); // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
|
||||
StorageLive(_9); // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
|
||||
StorageLive(_10); // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
|
||||
_10 = &((*_1).2: [f32; 3]); // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
|
||||
- _9 = &(*_10); // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
|
||||
- _8 = <[f32; 3] as Clone>::clone(move _9) -> [return: bb3, unwind unreachable]; // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
|
||||
- // mir::Constant
|
||||
- // + span: $DIR/combine_clone_of_primitives.rs:10:5: 10:16
|
||||
- // + literal: Const { ty: for<'a> fn(&'a [f32; 3]) -> [f32; 3] {<[f32; 3] as Clone>::clone}, val: Value(<ZST>) }
|
||||
+ _9 = _10; // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
|
||||
+ _8 = (*_9); // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
|
||||
+ goto -> bb3; // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
|
||||
}
|
||||
|
||||
bb3: {
|
||||
StorageDead(_9); // scope 0 at $DIR/combine_clone_of_primitives.rs:10:15: 10:16
|
||||
_0 = MyThing::<T> { v: move _2, i: move _5, a: move _8 }; // scope 0 at $DIR/combine_clone_of_primitives.rs:+0:10: +0:15
|
||||
StorageDead(_8); // scope 0 at $DIR/combine_clone_of_primitives.rs:+0:14: +0:15
|
||||
StorageDead(_5); // scope 0 at $DIR/combine_clone_of_primitives.rs:+0:14: +0:15
|
||||
StorageDead(_2); // scope 0 at $DIR/combine_clone_of_primitives.rs:+0:14: +0:15
|
||||
StorageDead(_10); // scope 0 at $DIR/combine_clone_of_primitives.rs:+0:14: +0:15
|
||||
StorageDead(_7); // scope 0 at $DIR/combine_clone_of_primitives.rs:+0:14: +0:15
|
||||
StorageDead(_4); // scope 0 at $DIR/combine_clone_of_primitives.rs:+0:14: +0:15
|
||||
return; // scope 0 at $DIR/combine_clone_of_primitives.rs:+0:15: +0:15
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,55 @@
|
||||
- // MIR for `foo` before ConstProp
|
||||
+ // MIR for `foo` after ConstProp
|
||||
|
||||
fn foo(_1: u8) -> () {
|
||||
debug x => _1; // in scope 0 at $DIR/aggregate.rs:+0:8: +0:9
|
||||
let mut _0: (); // return place in scope 0 at $DIR/aggregate.rs:+0:15: +0:15
|
||||
let _2: i32; // in scope 0 at $DIR/aggregate.rs:+2:9: +2:14
|
||||
let mut _3: i32; // in scope 0 at $DIR/aggregate.rs:+2:17: +2:25
|
||||
let mut _4: (i32, u8); // in scope 0 at $DIR/aggregate.rs:+2:17: +2:23
|
||||
let mut _5: u8; // in scope 0 at $DIR/aggregate.rs:+2:21: +2:22
|
||||
let mut _7: i32; // in scope 0 at $DIR/aggregate.rs:+3:18: +3:26
|
||||
let mut _8: (u8, i32); // in scope 0 at $DIR/aggregate.rs:+3:18: +3:24
|
||||
let mut _9: u8; // in scope 0 at $DIR/aggregate.rs:+3:19: +3:20
|
||||
scope 1 {
|
||||
debug first => _2; // in scope 1 at $DIR/aggregate.rs:+2:9: +2:14
|
||||
let _6: i32; // in scope 1 at $DIR/aggregate.rs:+3:9: +3:15
|
||||
scope 2 {
|
||||
debug second => _6; // in scope 2 at $DIR/aggregate.rs:+3:9: +3:15
|
||||
}
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_2); // scope 0 at $DIR/aggregate.rs:+2:9: +2:14
|
||||
StorageLive(_3); // scope 0 at $DIR/aggregate.rs:+2:17: +2:25
|
||||
StorageLive(_4); // scope 0 at $DIR/aggregate.rs:+2:17: +2:23
|
||||
StorageLive(_5); // scope 0 at $DIR/aggregate.rs:+2:21: +2:22
|
||||
_5 = _1; // scope 0 at $DIR/aggregate.rs:+2:21: +2:22
|
||||
_4 = (const 0_i32, move _5); // scope 0 at $DIR/aggregate.rs:+2:17: +2:23
|
||||
StorageDead(_5); // scope 0 at $DIR/aggregate.rs:+2:22: +2:23
|
||||
- _3 = (_4.0: i32); // scope 0 at $DIR/aggregate.rs:+2:17: +2:25
|
||||
- _2 = Add(move _3, const 1_i32); // scope 0 at $DIR/aggregate.rs:+2:17: +2:29
|
||||
+ _3 = const 0_i32; // scope 0 at $DIR/aggregate.rs:+2:17: +2:25
|
||||
+ _2 = const 1_i32; // scope 0 at $DIR/aggregate.rs:+2:17: +2:29
|
||||
StorageDead(_3); // scope 0 at $DIR/aggregate.rs:+2:28: +2:29
|
||||
StorageDead(_4); // scope 0 at $DIR/aggregate.rs:+2:29: +2:30
|
||||
StorageLive(_6); // scope 1 at $DIR/aggregate.rs:+3:9: +3:15
|
||||
StorageLive(_7); // scope 1 at $DIR/aggregate.rs:+3:18: +3:26
|
||||
StorageLive(_8); // scope 1 at $DIR/aggregate.rs:+3:18: +3:24
|
||||
StorageLive(_9); // scope 1 at $DIR/aggregate.rs:+3:19: +3:20
|
||||
_9 = _1; // scope 1 at $DIR/aggregate.rs:+3:19: +3:20
|
||||
_8 = (move _9, const 1_i32); // scope 1 at $DIR/aggregate.rs:+3:18: +3:24
|
||||
StorageDead(_9); // scope 1 at $DIR/aggregate.rs:+3:23: +3:24
|
||||
- _7 = (_8.1: i32); // scope 1 at $DIR/aggregate.rs:+3:18: +3:26
|
||||
- _6 = Add(move _7, const 2_i32); // scope 1 at $DIR/aggregate.rs:+3:18: +3:30
|
||||
+ _7 = const 1_i32; // scope 1 at $DIR/aggregate.rs:+3:18: +3:26
|
||||
+ _6 = const 3_i32; // scope 1 at $DIR/aggregate.rs:+3:18: +3:30
|
||||
StorageDead(_7); // scope 1 at $DIR/aggregate.rs:+3:29: +3:30
|
||||
StorageDead(_8); // scope 1 at $DIR/aggregate.rs:+3:30: +3:31
|
||||
_0 = const (); // scope 0 at $DIR/aggregate.rs:+0:15: +4:2
|
||||
StorageDead(_6); // scope 1 at $DIR/aggregate.rs:+4:1: +4:2
|
||||
StorageDead(_2); // scope 0 at $DIR/aggregate.rs:+4:1: +4:2
|
||||
return; // scope 0 at $DIR/aggregate.rs:+4:2: +4:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,49 @@
|
||||
// MIR for `foo` after PreCodegen
|
||||
|
||||
fn foo(_1: u8) -> () {
|
||||
debug x => _1; // in scope 0 at $DIR/aggregate.rs:+0:8: +0:9
|
||||
let mut _0: (); // return place in scope 0 at $DIR/aggregate.rs:+0:15: +0:15
|
||||
let _2: i32; // in scope 0 at $DIR/aggregate.rs:+2:9: +2:14
|
||||
let mut _3: i32; // in scope 0 at $DIR/aggregate.rs:+2:17: +2:25
|
||||
let mut _4: (i32, u8); // in scope 0 at $DIR/aggregate.rs:+2:17: +2:23
|
||||
let mut _5: u8; // in scope 0 at $DIR/aggregate.rs:+2:21: +2:22
|
||||
let mut _7: i32; // in scope 0 at $DIR/aggregate.rs:+3:18: +3:26
|
||||
let mut _8: (u8, i32); // in scope 0 at $DIR/aggregate.rs:+3:18: +3:24
|
||||
let mut _9: u8; // in scope 0 at $DIR/aggregate.rs:+3:19: +3:20
|
||||
scope 1 {
|
||||
debug first => _2; // in scope 1 at $DIR/aggregate.rs:+2:9: +2:14
|
||||
let _6: i32; // in scope 1 at $DIR/aggregate.rs:+3:9: +3:15
|
||||
scope 2 {
|
||||
debug second => _6; // in scope 2 at $DIR/aggregate.rs:+3:9: +3:15
|
||||
}
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_2); // scope 0 at $DIR/aggregate.rs:+2:9: +2:14
|
||||
StorageLive(_3); // scope 0 at $DIR/aggregate.rs:+2:17: +2:25
|
||||
StorageLive(_4); // scope 0 at $DIR/aggregate.rs:+2:17: +2:23
|
||||
StorageLive(_5); // scope 0 at $DIR/aggregate.rs:+2:21: +2:22
|
||||
_5 = _1; // scope 0 at $DIR/aggregate.rs:+2:21: +2:22
|
||||
_4 = (const 0_i32, move _5); // scope 0 at $DIR/aggregate.rs:+2:17: +2:23
|
||||
StorageDead(_5); // scope 0 at $DIR/aggregate.rs:+2:22: +2:23
|
||||
_3 = const 0_i32; // scope 0 at $DIR/aggregate.rs:+2:17: +2:25
|
||||
_2 = const 1_i32; // scope 0 at $DIR/aggregate.rs:+2:17: +2:29
|
||||
StorageDead(_3); // scope 0 at $DIR/aggregate.rs:+2:28: +2:29
|
||||
StorageDead(_4); // scope 0 at $DIR/aggregate.rs:+2:29: +2:30
|
||||
StorageLive(_6); // scope 1 at $DIR/aggregate.rs:+3:9: +3:15
|
||||
StorageLive(_7); // scope 1 at $DIR/aggregate.rs:+3:18: +3:26
|
||||
StorageLive(_8); // scope 1 at $DIR/aggregate.rs:+3:18: +3:24
|
||||
StorageLive(_9); // scope 1 at $DIR/aggregate.rs:+3:19: +3:20
|
||||
_9 = _1; // scope 1 at $DIR/aggregate.rs:+3:19: +3:20
|
||||
_8 = (move _9, const 1_i32); // scope 1 at $DIR/aggregate.rs:+3:18: +3:24
|
||||
StorageDead(_9); // scope 1 at $DIR/aggregate.rs:+3:23: +3:24
|
||||
_7 = const 1_i32; // scope 1 at $DIR/aggregate.rs:+3:18: +3:26
|
||||
_6 = const 3_i32; // scope 1 at $DIR/aggregate.rs:+3:18: +3:30
|
||||
StorageDead(_7); // scope 1 at $DIR/aggregate.rs:+3:29: +3:30
|
||||
StorageDead(_8); // scope 1 at $DIR/aggregate.rs:+3:30: +3:31
|
||||
_0 = const (); // scope 0 at $DIR/aggregate.rs:+0:15: +4:2
|
||||
StorageDead(_6); // scope 1 at $DIR/aggregate.rs:+4:1: +4:2
|
||||
StorageDead(_2); // scope 0 at $DIR/aggregate.rs:+4:1: +4:2
|
||||
return; // scope 0 at $DIR/aggregate.rs:+4:2: +4:2
|
||||
}
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
- // MIR for `main` before ConstProp
|
||||
+ // MIR for `main` after ConstProp
|
||||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/aggregate.rs:+0:11: +0:11
|
||||
let _1: u8; // in scope 0 at $DIR/aggregate.rs:+1:9: +1:10
|
||||
let mut _2: u8; // in scope 0 at $DIR/aggregate.rs:+1:13: +1:24
|
||||
let mut _3: (i32, u8, i32); // in scope 0 at $DIR/aggregate.rs:+1:13: +1:22
|
||||
let _4: (); // in scope 0 at $DIR/aggregate.rs:+2:5: +2:11
|
||||
let mut _5: u8; // in scope 0 at $DIR/aggregate.rs:+2:9: +2:10
|
||||
scope 1 {
|
||||
debug x => _1; // in scope 1 at $DIR/aggregate.rs:+1:9: +1:10
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/aggregate.rs:+1:9: +1:10
|
||||
StorageLive(_2); // scope 0 at $DIR/aggregate.rs:+1:13: +1:24
|
||||
StorageLive(_3); // scope 0 at $DIR/aggregate.rs:+1:13: +1:22
|
||||
_3 = (const 0_i32, const 1_u8, const 2_i32); // scope 0 at $DIR/aggregate.rs:+1:13: +1:22
|
||||
- _2 = (_3.1: u8); // scope 0 at $DIR/aggregate.rs:+1:13: +1:24
|
||||
- _1 = Add(move _2, const 0_u8); // scope 0 at $DIR/aggregate.rs:+1:13: +1:28
|
||||
+ _2 = const 1_u8; // scope 0 at $DIR/aggregate.rs:+1:13: +1:24
|
||||
+ _1 = const 1_u8; // scope 0 at $DIR/aggregate.rs:+1:13: +1:28
|
||||
StorageDead(_2); // scope 0 at $DIR/aggregate.rs:+1:27: +1:28
|
||||
StorageDead(_3); // scope 0 at $DIR/aggregate.rs:+1:28: +1:29
|
||||
StorageLive(_4); // scope 1 at $DIR/aggregate.rs:+2:5: +2:11
|
||||
StorageLive(_5); // scope 1 at $DIR/aggregate.rs:+2:9: +2:10
|
||||
- _5 = _1; // scope 1 at $DIR/aggregate.rs:+2:9: +2:10
|
||||
+ _5 = const 1_u8; // scope 1 at $DIR/aggregate.rs:+2:9: +2:10
|
||||
_4 = foo(move _5) -> [return: bb1, unwind unreachable]; // scope 1 at $DIR/aggregate.rs:+2:5: +2:11
|
||||
// mir::Constant
|
||||
// + span: $DIR/aggregate.rs:9:5: 9:8
|
||||
// + literal: Const { ty: fn(u8) {foo}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb1: {
|
||||
StorageDead(_5); // scope 1 at $DIR/aggregate.rs:+2:10: +2:11
|
||||
StorageDead(_4); // scope 1 at $DIR/aggregate.rs:+2:11: +2:12
|
||||
_0 = const (); // scope 0 at $DIR/aggregate.rs:+0:11: +3:2
|
||||
StorageDead(_1); // scope 0 at $DIR/aggregate.rs:+3:1: +3:2
|
||||
return; // scope 0 at $DIR/aggregate.rs:+3:2: +3:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,39 @@
|
||||
// MIR for `main` after PreCodegen
|
||||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/aggregate.rs:+0:11: +0:11
|
||||
let _1: u8; // in scope 0 at $DIR/aggregate.rs:+1:9: +1:10
|
||||
let mut _2: u8; // in scope 0 at $DIR/aggregate.rs:+1:13: +1:24
|
||||
let mut _3: (i32, u8, i32); // in scope 0 at $DIR/aggregate.rs:+1:13: +1:22
|
||||
let _4: (); // in scope 0 at $DIR/aggregate.rs:+2:5: +2:11
|
||||
let mut _5: u8; // in scope 0 at $DIR/aggregate.rs:+2:9: +2:10
|
||||
scope 1 {
|
||||
debug x => _1; // in scope 1 at $DIR/aggregate.rs:+1:9: +1:10
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/aggregate.rs:+1:9: +1:10
|
||||
StorageLive(_2); // scope 0 at $DIR/aggregate.rs:+1:13: +1:24
|
||||
StorageLive(_3); // scope 0 at $DIR/aggregate.rs:+1:13: +1:22
|
||||
_3 = (const 0_i32, const 1_u8, const 2_i32); // scope 0 at $DIR/aggregate.rs:+1:13: +1:22
|
||||
_2 = const 1_u8; // scope 0 at $DIR/aggregate.rs:+1:13: +1:24
|
||||
_1 = const 1_u8; // scope 0 at $DIR/aggregate.rs:+1:13: +1:28
|
||||
StorageDead(_2); // scope 0 at $DIR/aggregate.rs:+1:27: +1:28
|
||||
StorageDead(_3); // scope 0 at $DIR/aggregate.rs:+1:28: +1:29
|
||||
StorageLive(_4); // scope 1 at $DIR/aggregate.rs:+2:5: +2:11
|
||||
StorageLive(_5); // scope 1 at $DIR/aggregate.rs:+2:9: +2:10
|
||||
_5 = const 1_u8; // scope 1 at $DIR/aggregate.rs:+2:9: +2:10
|
||||
_4 = foo(move _5) -> [return: bb1, unwind unreachable]; // scope 1 at $DIR/aggregate.rs:+2:5: +2:11
|
||||
// mir::Constant
|
||||
// + span: $DIR/aggregate.rs:9:5: 9:8
|
||||
// + literal: Const { ty: fn(u8) {foo}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb1: {
|
||||
StorageDead(_5); // scope 1 at $DIR/aggregate.rs:+2:10: +2:11
|
||||
StorageDead(_4); // scope 1 at $DIR/aggregate.rs:+2:11: +2:12
|
||||
_0 = const (); // scope 0 at $DIR/aggregate.rs:+0:11: +3:2
|
||||
StorageDead(_1); // scope 0 at $DIR/aggregate.rs:+3:1: +3:2
|
||||
return; // scope 0 at $DIR/aggregate.rs:+3:2: +3:2
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
- // MIR for `main` before ConstProp
|
||||
+ // MIR for `main` after ConstProp
|
||||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/array_index.rs:+0:11: +0:11
|
||||
let _1: u32; // in scope 0 at $DIR/array_index.rs:+1:9: +1:10
|
||||
let mut _2: [u32; 4]; // in scope 0 at $DIR/array_index.rs:+1:18: +1:30
|
||||
let _3: usize; // in scope 0 at $DIR/array_index.rs:+1:31: +1:32
|
||||
let mut _4: usize; // in scope 0 at $DIR/array_index.rs:+1:18: +1:33
|
||||
let mut _5: bool; // in scope 0 at $DIR/array_index.rs:+1:18: +1:33
|
||||
scope 1 {
|
||||
debug x => _1; // in scope 1 at $DIR/array_index.rs:+1:9: +1:10
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/array_index.rs:+1:9: +1:10
|
||||
StorageLive(_2); // scope 0 at $DIR/array_index.rs:+1:18: +1:30
|
||||
_2 = [const 0_u32, const 1_u32, const 2_u32, const 3_u32]; // scope 0 at $DIR/array_index.rs:+1:18: +1:30
|
||||
StorageLive(_3); // scope 0 at $DIR/array_index.rs:+1:31: +1:32
|
||||
_3 = const 2_usize; // scope 0 at $DIR/array_index.rs:+1:31: +1:32
|
||||
- _4 = Len(_2); // scope 0 at $DIR/array_index.rs:+1:18: +1:33
|
||||
- _5 = Lt(_3, _4); // scope 0 at $DIR/array_index.rs:+1:18: +1:33
|
||||
- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable]; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
|
||||
+ _4 = const 4_usize; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
|
||||
+ _5 = const true; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
|
||||
+ assert(const true, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable]; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
|
||||
}
|
||||
|
||||
bb1: {
|
||||
- _1 = _2[_3]; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
|
||||
+ _1 = const 2_u32; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
|
||||
StorageDead(_3); // scope 0 at $DIR/array_index.rs:+1:33: +1:34
|
||||
StorageDead(_2); // scope 0 at $DIR/array_index.rs:+1:33: +1:34
|
||||
_0 = const (); // scope 0 at $DIR/array_index.rs:+0:11: +2:2
|
||||
StorageDead(_1); // scope 0 at $DIR/array_index.rs:+2:1: +2:2
|
||||
return; // scope 0 at $DIR/array_index.rs:+2:2: +2:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,39 @@
|
||||
- // MIR for `main` before ConstProp
|
||||
+ // MIR for `main` after ConstProp
|
||||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/array_index.rs:+0:11: +0:11
|
||||
let _1: u32; // in scope 0 at $DIR/array_index.rs:+1:9: +1:10
|
||||
let mut _2: [u32; 4]; // in scope 0 at $DIR/array_index.rs:+1:18: +1:30
|
||||
let _3: usize; // in scope 0 at $DIR/array_index.rs:+1:31: +1:32
|
||||
let mut _4: usize; // in scope 0 at $DIR/array_index.rs:+1:18: +1:33
|
||||
let mut _5: bool; // in scope 0 at $DIR/array_index.rs:+1:18: +1:33
|
||||
scope 1 {
|
||||
debug x => _1; // in scope 1 at $DIR/array_index.rs:+1:9: +1:10
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/array_index.rs:+1:9: +1:10
|
||||
StorageLive(_2); // scope 0 at $DIR/array_index.rs:+1:18: +1:30
|
||||
_2 = [const 0_u32, const 1_u32, const 2_u32, const 3_u32]; // scope 0 at $DIR/array_index.rs:+1:18: +1:30
|
||||
StorageLive(_3); // scope 0 at $DIR/array_index.rs:+1:31: +1:32
|
||||
_3 = const 2_usize; // scope 0 at $DIR/array_index.rs:+1:31: +1:32
|
||||
- _4 = Len(_2); // scope 0 at $DIR/array_index.rs:+1:18: +1:33
|
||||
- _5 = Lt(_3, _4); // scope 0 at $DIR/array_index.rs:+1:18: +1:33
|
||||
- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable]; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
|
||||
+ _4 = const 4_usize; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
|
||||
+ _5 = const true; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
|
||||
+ assert(const true, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable]; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
|
||||
}
|
||||
|
||||
bb1: {
|
||||
- _1 = _2[_3]; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
|
||||
+ _1 = const 2_u32; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
|
||||
StorageDead(_3); // scope 0 at $DIR/array_index.rs:+1:33: +1:34
|
||||
StorageDead(_2); // scope 0 at $DIR/array_index.rs:+1:33: +1:34
|
||||
_0 = const (); // scope 0 at $DIR/array_index.rs:+0:11: +2:2
|
||||
StorageDead(_1); // scope 0 at $DIR/array_index.rs:+2:1: +2:2
|
||||
return; // scope 0 at $DIR/array_index.rs:+2:2: +2:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,53 @@
|
||||
- // MIR for `main` before ConstProp
|
||||
+ // MIR for `main` after ConstProp
|
||||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/bad_op_div_by_zero.rs:+0:11: +0:11
|
||||
let _1: i32; // in scope 0 at $DIR/bad_op_div_by_zero.rs:+1:9: +1:10
|
||||
let mut _3: i32; // in scope 0 at $DIR/bad_op_div_by_zero.rs:+2:18: +2:19
|
||||
let mut _4: bool; // in scope 0 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
|
||||
let mut _5: bool; // in scope 0 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
|
||||
let mut _6: bool; // in scope 0 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
|
||||
let mut _7: bool; // in scope 0 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
|
||||
scope 1 {
|
||||
debug y => _1; // in scope 1 at $DIR/bad_op_div_by_zero.rs:+1:9: +1:10
|
||||
let _2: i32; // in scope 1 at $DIR/bad_op_div_by_zero.rs:+2:9: +2:11
|
||||
scope 2 {
|
||||
debug _z => _2; // in scope 2 at $DIR/bad_op_div_by_zero.rs:+2:9: +2:11
|
||||
}
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/bad_op_div_by_zero.rs:+1:9: +1:10
|
||||
_1 = const 0_i32; // scope 0 at $DIR/bad_op_div_by_zero.rs:+1:13: +1:14
|
||||
StorageLive(_2); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:9: +2:11
|
||||
StorageLive(_3); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:18: +2:19
|
||||
- _3 = _1; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:18: +2:19
|
||||
- _4 = Eq(_3, const 0_i32); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
|
||||
- assert(!move _4, "attempt to divide `{}` by zero", const 1_i32) -> [success: bb1, unwind unreachable]; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
|
||||
+ _3 = const 0_i32; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:18: +2:19
|
||||
+ _4 = const true; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
|
||||
+ assert(!const true, "attempt to divide `{}` by zero", const 1_i32) -> [success: bb1, unwind unreachable]; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
|
||||
}
|
||||
|
||||
bb1: {
|
||||
- _5 = Eq(_3, const -1_i32); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
|
||||
- _6 = Eq(const 1_i32, const i32::MIN); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
|
||||
- _7 = BitAnd(move _5, move _6); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
|
||||
- assert(!move _7, "attempt to compute `{} / {}`, which would overflow", const 1_i32, _3) -> [success: bb2, unwind unreachable]; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
|
||||
+ _5 = const false; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
|
||||
+ _6 = const false; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
|
||||
+ _7 = const false; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
|
||||
+ assert(!const false, "attempt to compute `{} / {}`, which would overflow", const 1_i32, _3) -> [success: bb2, unwind unreachable]; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
|
||||
}
|
||||
|
||||
bb2: {
|
||||
_2 = Div(const 1_i32, move _3); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
|
||||
StorageDead(_3); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:18: +2:19
|
||||
_0 = const (); // scope 0 at $DIR/bad_op_div_by_zero.rs:+0:11: +3:2
|
||||
StorageDead(_2); // scope 1 at $DIR/bad_op_div_by_zero.rs:+3:1: +3:2
|
||||
StorageDead(_1); // scope 0 at $DIR/bad_op_div_by_zero.rs:+3:1: +3:2
|
||||
return; // scope 0 at $DIR/bad_op_div_by_zero.rs:+3:2: +3:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,53 @@
|
||||
- // MIR for `main` before ConstProp
|
||||
+ // MIR for `main` after ConstProp
|
||||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/bad_op_mod_by_zero.rs:+0:11: +0:11
|
||||
let _1: i32; // in scope 0 at $DIR/bad_op_mod_by_zero.rs:+1:9: +1:10
|
||||
let mut _3: i32; // in scope 0 at $DIR/bad_op_mod_by_zero.rs:+2:18: +2:19
|
||||
let mut _4: bool; // in scope 0 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
|
||||
let mut _5: bool; // in scope 0 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
|
||||
let mut _6: bool; // in scope 0 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
|
||||
let mut _7: bool; // in scope 0 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
|
||||
scope 1 {
|
||||
debug y => _1; // in scope 1 at $DIR/bad_op_mod_by_zero.rs:+1:9: +1:10
|
||||
let _2: i32; // in scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:9: +2:11
|
||||
scope 2 {
|
||||
debug _z => _2; // in scope 2 at $DIR/bad_op_mod_by_zero.rs:+2:9: +2:11
|
||||
}
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/bad_op_mod_by_zero.rs:+1:9: +1:10
|
||||
_1 = const 0_i32; // scope 0 at $DIR/bad_op_mod_by_zero.rs:+1:13: +1:14
|
||||
StorageLive(_2); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:9: +2:11
|
||||
StorageLive(_3); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:18: +2:19
|
||||
- _3 = _1; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:18: +2:19
|
||||
- _4 = Eq(_3, const 0_i32); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
|
||||
- assert(!move _4, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_i32) -> [success: bb1, unwind unreachable]; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
|
||||
+ _3 = const 0_i32; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:18: +2:19
|
||||
+ _4 = const true; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
|
||||
+ assert(!const true, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_i32) -> [success: bb1, unwind unreachable]; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
|
||||
}
|
||||
|
||||
bb1: {
|
||||
- _5 = Eq(_3, const -1_i32); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
|
||||
- _6 = Eq(const 1_i32, const i32::MIN); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
|
||||
- _7 = BitAnd(move _5, move _6); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
|
||||
- assert(!move _7, "attempt to compute the remainder of `{} % {}`, which would overflow", const 1_i32, _3) -> [success: bb2, unwind unreachable]; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
|
||||
+ _5 = const false; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
|
||||
+ _6 = const false; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
|
||||
+ _7 = const false; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
|
||||
+ assert(!const false, "attempt to compute the remainder of `{} % {}`, which would overflow", const 1_i32, _3) -> [success: bb2, unwind unreachable]; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
|
||||
}
|
||||
|
||||
bb2: {
|
||||
_2 = Rem(const 1_i32, move _3); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
|
||||
StorageDead(_3); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:18: +2:19
|
||||
_0 = const (); // scope 0 at $DIR/bad_op_mod_by_zero.rs:+0:11: +3:2
|
||||
StorageDead(_2); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+3:1: +3:2
|
||||
StorageDead(_1); // scope 0 at $DIR/bad_op_mod_by_zero.rs:+3:1: +3:2
|
||||
return; // scope 0 at $DIR/bad_op_mod_by_zero.rs:+3:2: +3:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,57 @@
|
||||
- // MIR for `main` before ConstProp
|
||||
+ // MIR for `main` after ConstProp
|
||||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+0:11: +0:11
|
||||
let _1: *const [i32]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:9: +1:10
|
||||
let mut _2: *const [i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
let _3: &[i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
let _4: [i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:26: +1:35
|
||||
let _6: usize; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:23: +3:24
|
||||
let mut _7: usize; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
let mut _8: bool; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
let mut _9: &[i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
scope 1 {
|
||||
debug a => _1; // in scope 1 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:9: +1:10
|
||||
scope 2 {
|
||||
let _5: i32; // in scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:13: +3:15
|
||||
scope 3 {
|
||||
debug _b => _5; // in scope 3 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:13: +3:15
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:9: +1:10
|
||||
StorageLive(_2); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
StorageLive(_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
_9 = const _; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
// mir::Constant
|
||||
// + span: $DIR/bad_op_unsafe_oob_for_slices.rs:9:25: 9:35
|
||||
// + literal: Const { ty: &[i32; 3], val: Unevaluated(main, [], Some(promoted[0])) }
|
||||
_3 = &(*_9); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
_2 = &raw const (*_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
_1 = move _2 as *const [i32] (Pointer(Unsize)); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
StorageDead(_2); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:34: +1:35
|
||||
StorageDead(_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:35: +1:36
|
||||
StorageLive(_5); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:13: +3:15
|
||||
StorageLive(_6); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:23: +3:24
|
||||
_6 = const 3_usize; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:23: +3:24
|
||||
_7 = const 3_usize; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
- _8 = Lt(_6, _7); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind unreachable]; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
+ _8 = const false; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
+ assert(const false, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind unreachable]; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
}
|
||||
|
||||
bb1: {
|
||||
- _5 = (*_1)[_6]; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
+ _5 = (*_1)[3 of 4]; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
StorageDead(_6); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:25: +3:26
|
||||
_0 = const (); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+2:5: +4:6
|
||||
StorageDead(_5); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+4:5: +4:6
|
||||
StorageDead(_1); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+5:1: +5:2
|
||||
return; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+5:2: +5:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,57 @@
|
||||
- // MIR for `main` before ConstProp
|
||||
+ // MIR for `main` after ConstProp
|
||||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+0:11: +0:11
|
||||
let _1: *const [i32]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:9: +1:10
|
||||
let mut _2: *const [i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
let _3: &[i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
let _4: [i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:26: +1:35
|
||||
let _6: usize; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:23: +3:24
|
||||
let mut _7: usize; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
let mut _8: bool; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
let mut _9: &[i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
scope 1 {
|
||||
debug a => _1; // in scope 1 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:9: +1:10
|
||||
scope 2 {
|
||||
let _5: i32; // in scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:13: +3:15
|
||||
scope 3 {
|
||||
debug _b => _5; // in scope 3 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:13: +3:15
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:9: +1:10
|
||||
StorageLive(_2); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
StorageLive(_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
_9 = const _; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
// mir::Constant
|
||||
// + span: $DIR/bad_op_unsafe_oob_for_slices.rs:9:25: 9:35
|
||||
// + literal: Const { ty: &[i32; 3], val: Unevaluated(main, [], Some(promoted[0])) }
|
||||
_3 = &(*_9); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
_2 = &raw const (*_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
_1 = move _2 as *const [i32] (Pointer(Unsize)); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
StorageDead(_2); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:34: +1:35
|
||||
StorageDead(_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:35: +1:36
|
||||
StorageLive(_5); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:13: +3:15
|
||||
StorageLive(_6); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:23: +3:24
|
||||
_6 = const 3_usize; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:23: +3:24
|
||||
_7 = const 3_usize; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
- _8 = Lt(_6, _7); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind unreachable]; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
+ _8 = const false; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
+ assert(const false, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind unreachable]; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
}
|
||||
|
||||
bb1: {
|
||||
- _5 = (*_1)[_6]; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
+ _5 = (*_1)[3 of 4]; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
StorageDead(_6); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:25: +3:26
|
||||
_0 = const (); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+2:5: +4:6
|
||||
StorageDead(_5); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+4:5: +4:6
|
||||
StorageDead(_1); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+5:1: +5:2
|
||||
return; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+5:2: +5:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,56 @@
|
||||
- // MIR for `main` before ConstProp
|
||||
+ // MIR for `main` after ConstProp
|
||||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/boxes.rs:+0:11: +0:11
|
||||
let _1: i32; // in scope 0 at $DIR/boxes.rs:+1:9: +1:10
|
||||
let mut _2: i32; // in scope 0 at $DIR/boxes.rs:+1:13: +2:18
|
||||
let mut _3: std::boxed::Box<i32>; // in scope 0 at $DIR/boxes.rs:+1:14: +2:18
|
||||
let mut _4: usize; // in scope 0 at $DIR/boxes.rs:+1:14: +2:18
|
||||
let mut _5: usize; // in scope 0 at $DIR/boxes.rs:+1:14: +2:18
|
||||
let mut _6: *mut u8; // in scope 0 at $DIR/boxes.rs:+1:14: +2:18
|
||||
let mut _7: std::boxed::Box<i32>; // in scope 0 at $DIR/boxes.rs:+1:14: +2:18
|
||||
let mut _8: *const i32; // in scope 0 at $DIR/boxes.rs:+1:14: +2:18
|
||||
let mut _9: *const i32; // in scope 0 at $DIR/boxes.rs:+1:14: +2:18
|
||||
scope 1 {
|
||||
debug x => _1; // in scope 1 at $DIR/boxes.rs:+1:9: +1:10
|
||||
}
|
||||
scope 2 {
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/boxes.rs:+1:9: +1:10
|
||||
StorageLive(_2); // scope 0 at $DIR/boxes.rs:+1:13: +2:18
|
||||
StorageLive(_3); // scope 0 at $DIR/boxes.rs:+1:14: +2:18
|
||||
- _4 = SizeOf(i32); // scope 2 at $DIR/boxes.rs:+1:14: +2:18
|
||||
- _5 = AlignOf(i32); // scope 2 at $DIR/boxes.rs:+1:14: +2:18
|
||||
+ _4 = const 4_usize; // scope 2 at $DIR/boxes.rs:+1:14: +2:18
|
||||
+ _5 = const 4_usize; // scope 2 at $DIR/boxes.rs:+1:14: +2:18
|
||||
_6 = alloc::alloc::exchange_malloc(move _4, move _5) -> [return: bb1, unwind unreachable]; // scope 2 at $DIR/boxes.rs:+1:14: +2:18
|
||||
// mir::Constant
|
||||
// + span: $DIR/boxes.rs:13:14: 14:18
|
||||
// + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb1: {
|
||||
StorageLive(_7); // scope 0 at $DIR/boxes.rs:+1:14: +2:18
|
||||
_7 = ShallowInitBox(move _6, i32); // scope 0 at $DIR/boxes.rs:+1:14: +2:18
|
||||
_8 = (((_7.0: std::ptr::Unique<i32>).0: std::ptr::NonNull<i32>).0: *const i32); // scope 0 at $DIR/boxes.rs:+2:14: +2:16
|
||||
(*_8) = const 42_i32; // scope 0 at $DIR/boxes.rs:+2:14: +2:16
|
||||
_3 = move _7; // scope 0 at $DIR/boxes.rs:+1:14: +2:18
|
||||
StorageDead(_7); // scope 0 at $DIR/boxes.rs:+2:17: +2:18
|
||||
_9 = (((_3.0: std::ptr::Unique<i32>).0: std::ptr::NonNull<i32>).0: *const i32); // scope 0 at $DIR/boxes.rs:+1:13: +2:18
|
||||
_2 = (*_9); // scope 0 at $DIR/boxes.rs:+1:13: +2:18
|
||||
_1 = Add(move _2, const 0_i32); // scope 0 at $DIR/boxes.rs:+1:13: +3:12
|
||||
StorageDead(_2); // scope 0 at $DIR/boxes.rs:+3:11: +3:12
|
||||
drop(_3) -> [return: bb2, unwind unreachable]; // scope 0 at $DIR/boxes.rs:+3:12: +3:13
|
||||
}
|
||||
|
||||
bb2: {
|
||||
StorageDead(_3); // scope 0 at $DIR/boxes.rs:+3:12: +3:13
|
||||
_0 = const (); // scope 0 at $DIR/boxes.rs:+0:11: +4:2
|
||||
StorageDead(_1); // scope 0 at $DIR/boxes.rs:+4:1: +4:2
|
||||
return; // scope 0 at $DIR/boxes.rs:+4:2: +4:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,28 @@
|
||||
- // MIR for `main` before ConstProp
|
||||
+ // MIR for `main` after ConstProp
|
||||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/checked_add.rs:+0:11: +0:11
|
||||
let _1: u32; // in scope 0 at $DIR/checked_add.rs:+1:9: +1:10
|
||||
let mut _2: (u32, bool); // in scope 0 at $DIR/checked_add.rs:+1:18: +1:23
|
||||
scope 1 {
|
||||
debug x => _1; // in scope 1 at $DIR/checked_add.rs:+1:9: +1:10
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/checked_add.rs:+1:9: +1:10
|
||||
- _2 = CheckedAdd(const 1_u32, const 1_u32); // scope 0 at $DIR/checked_add.rs:+1:18: +1:23
|
||||
- assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 1_u32, const 1_u32) -> [success: bb1, unwind unreachable]; // scope 0 at $DIR/checked_add.rs:+1:18: +1:23
|
||||
+ _2 = const (2_u32, false); // scope 0 at $DIR/checked_add.rs:+1:18: +1:23
|
||||
+ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 1_u32, const 1_u32) -> [success: bb1, unwind unreachable]; // scope 0 at $DIR/checked_add.rs:+1:18: +1:23
|
||||
}
|
||||
|
||||
bb1: {
|
||||
- _1 = move (_2.0: u32); // scope 0 at $DIR/checked_add.rs:+1:18: +1:23
|
||||
+ _1 = const 2_u32; // scope 0 at $DIR/checked_add.rs:+1:18: +1:23
|
||||
_0 = const (); // scope 0 at $DIR/checked_add.rs:+0:11: +2:2
|
||||
StorageDead(_1); // scope 0 at $DIR/checked_add.rs:+2:1: +2:2
|
||||
return; // scope 0 at $DIR/checked_add.rs:+2:2: +2:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,44 @@
|
||||
- // MIR for `main` before ConstProp
|
||||
+ // MIR for `main` after ConstProp
|
||||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/const_prop_fails_gracefully.rs:+0:11: +0:11
|
||||
let _1: usize; // in scope 0 at $DIR/const_prop_fails_gracefully.rs:+2:9: +2:10
|
||||
let mut _2: *const i32; // in scope 0 at $DIR/const_prop_fails_gracefully.rs:+2:13: +2:30
|
||||
let _3: &i32; // in scope 0 at $DIR/const_prop_fails_gracefully.rs:+2:13: +2:16
|
||||
let _4: (); // in scope 0 at $DIR/const_prop_fails_gracefully.rs:+3:5: +3:12
|
||||
let mut _5: usize; // in scope 0 at $DIR/const_prop_fails_gracefully.rs:+3:10: +3:11
|
||||
scope 1 {
|
||||
debug x => _1; // in scope 1 at $DIR/const_prop_fails_gracefully.rs:+2:9: +2:10
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/const_prop_fails_gracefully.rs:+2:9: +2:10
|
||||
StorageLive(_2); // scope 0 at $DIR/const_prop_fails_gracefully.rs:+2:13: +2:30
|
||||
StorageLive(_3); // scope 0 at $DIR/const_prop_fails_gracefully.rs:+2:13: +2:16
|
||||
_3 = const _; // scope 0 at $DIR/const_prop_fails_gracefully.rs:+2:13: +2:16
|
||||
// mir::Constant
|
||||
// + span: $DIR/const_prop_fails_gracefully.rs:9:13: 9:16
|
||||
// + literal: Const { ty: &i32, val: Unevaluated(FOO, [], None) }
|
||||
_2 = &raw const (*_3); // scope 0 at $DIR/const_prop_fails_gracefully.rs:+2:13: +2:16
|
||||
_1 = move _2 as usize (PointerExposeAddress); // scope 0 at $DIR/const_prop_fails_gracefully.rs:+2:13: +2:39
|
||||
StorageDead(_2); // scope 0 at $DIR/const_prop_fails_gracefully.rs:+2:38: +2:39
|
||||
StorageDead(_3); // scope 0 at $DIR/const_prop_fails_gracefully.rs:+2:39: +2:40
|
||||
StorageLive(_4); // scope 1 at $DIR/const_prop_fails_gracefully.rs:+3:5: +3:12
|
||||
StorageLive(_5); // scope 1 at $DIR/const_prop_fails_gracefully.rs:+3:10: +3:11
|
||||
_5 = _1; // scope 1 at $DIR/const_prop_fails_gracefully.rs:+3:10: +3:11
|
||||
_4 = read(move _5) -> [return: bb1, unwind unreachable]; // scope 1 at $DIR/const_prop_fails_gracefully.rs:+3:5: +3:12
|
||||
// mir::Constant
|
||||
// + span: $DIR/const_prop_fails_gracefully.rs:10:5: 10:9
|
||||
// + literal: Const { ty: fn(usize) {read}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb1: {
|
||||
StorageDead(_5); // scope 1 at $DIR/const_prop_fails_gracefully.rs:+3:11: +3:12
|
||||
StorageDead(_4); // scope 1 at $DIR/const_prop_fails_gracefully.rs:+3:12: +3:13
|
||||
_0 = const (); // scope 0 at $DIR/const_prop_fails_gracefully.rs:+0:11: +4:2
|
||||
StorageDead(_1); // scope 0 at $DIR/const_prop_fails_gracefully.rs:+4:1: +4:2
|
||||
return; // scope 0 at $DIR/const_prop_fails_gracefully.rs:+4:2: +4:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,31 @@
|
||||
- // MIR for `hello` before ConstProp
|
||||
+ // MIR for `hello` after ConstProp
|
||||
|
||||
fn hello() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/control_flow_simplification.rs:+0:14: +0:14
|
||||
let mut _1: bool; // in scope 0 at $DIR/control_flow_simplification.rs:+1:8: +1:21
|
||||
let mut _2: !; // in scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/control_flow_simplification.rs:+1:8: +1:21
|
||||
_1 = const _; // scope 0 at $DIR/control_flow_simplification.rs:+1:8: +1:21
|
||||
- switchInt(move _1) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/control_flow_simplification.rs:+1:8: +1:21
|
||||
+ switchInt(const false) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/control_flow_simplification.rs:+1:8: +1:21
|
||||
}
|
||||
|
||||
bb1: {
|
||||
_2 = begin_panic::<&str>(const "explicit panic") -> unwind unreachable; // scope 0 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(<ZST>) }
|
||||
// mir::Constant
|
||||
// + span: $SRC_DIR/std/src/panic.rs:LL:COL
|
||||
// + literal: Const { ty: &str, val: Value(Slice(..)) }
|
||||
}
|
||||
|
||||
bb2: {
|
||||
StorageDead(_1); // scope 0 at $DIR/control_flow_simplification.rs:+3:5: +3:6
|
||||
return; // scope 0 at $DIR/control_flow_simplification.rs:+4:2: +4:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,9 @@
|
||||
// MIR for `hello` before PreCodegen
|
||||
|
||||
fn hello() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/control_flow_simplification.rs:+0:14: +0:14
|
||||
|
||||
bb0: {
|
||||
return; // scope 0 at $DIR/control_flow_simplification.rs:+4:2: +4:2
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
- // MIR for `main` before ConstProp
|
||||
+ // MIR for `main` after ConstProp
|
||||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/indirect.rs:+0:11: +0:11
|
||||
let _1: u8; // in scope 0 at $DIR/indirect.rs:+1:9: +1:10
|
||||
let mut _2: u8; // in scope 0 at $DIR/indirect.rs:+1:13: +1:25
|
||||
let mut _3: (u8, bool); // in scope 0 at $DIR/indirect.rs:+1:13: +1:29
|
||||
scope 1 {
|
||||
debug x => _1; // in scope 1 at $DIR/indirect.rs:+1:9: +1:10
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/indirect.rs:+1:9: +1:10
|
||||
StorageLive(_2); // scope 0 at $DIR/indirect.rs:+1:13: +1:25
|
||||
- _2 = const 2_u32 as u8 (IntToInt); // scope 0 at $DIR/indirect.rs:+1:13: +1:25
|
||||
- _3 = CheckedAdd(_2, const 1_u8); // scope 0 at $DIR/indirect.rs:+1:13: +1:29
|
||||
- assert(!move (_3.1: bool), "attempt to compute `{} + {}`, which would overflow", move _2, const 1_u8) -> [success: bb1, unwind unreachable]; // scope 0 at $DIR/indirect.rs:+1:13: +1:29
|
||||
+ _2 = const 2_u8; // scope 0 at $DIR/indirect.rs:+1:13: +1:25
|
||||
+ _3 = const (3_u8, false); // scope 0 at $DIR/indirect.rs:+1:13: +1:29
|
||||
+ assert(!const false, "attempt to compute `{} + {}`, which would overflow", move _2, const 1_u8) -> [success: bb1, unwind unreachable]; // scope 0 at $DIR/indirect.rs:+1:13: +1:29
|
||||
}
|
||||
|
||||
bb1: {
|
||||
- _1 = move (_3.0: u8); // scope 0 at $DIR/indirect.rs:+1:13: +1:29
|
||||
+ _1 = const 3_u8; // scope 0 at $DIR/indirect.rs:+1:13: +1:29
|
||||
StorageDead(_2); // scope 0 at $DIR/indirect.rs:+1:28: +1:29
|
||||
_0 = const (); // scope 0 at $DIR/indirect.rs:+0:11: +2:2
|
||||
StorageDead(_1); // scope 0 at $DIR/indirect.rs:+2:1: +2:2
|
||||
return; // scope 0 at $DIR/indirect.rs:+2:2: +2:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,39 @@
|
||||
- // MIR for `main` before ConstProp
|
||||
+ // MIR for `main` after ConstProp
|
||||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/inherit_overflow.rs:+0:11: +0:11
|
||||
let mut _1: u8; // in scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
|
||||
let mut _2: u8; // in scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
|
||||
let mut _3: u8; // in scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
|
||||
scope 1 {
|
||||
}
|
||||
scope 2 (inlined <u8 as Add>::add) { // at $DIR/inherit_overflow.rs:9:13: 9:47
|
||||
debug self => _2; // in scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
debug other => _3; // in scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
let mut _4: (u8, bool); // in scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
|
||||
StorageLive(_2); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
|
||||
_2 = const u8::MAX; // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
|
||||
StorageLive(_3); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
|
||||
_3 = const 1_u8; // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
|
||||
- _4 = CheckedAdd(_2, _3); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
- assert(!move (_4.1: bool), "attempt to compute `{} + {}`, which would overflow", _2, _3) -> [success: bb1, unwind unreachable]; // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
+ _4 = const (0_u8, true); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
+ assert(!const true, "attempt to compute `{} + {}`, which would overflow", _2, _3) -> [success: bb1, unwind unreachable]; // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
}
|
||||
|
||||
bb1: {
|
||||
- _1 = move (_4.0: u8); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
+ _1 = const 0_u8; // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
StorageDead(_3); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
|
||||
StorageDead(_2); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
|
||||
StorageDead(_1); // scope 0 at $DIR/inherit_overflow.rs:+3:47: +3:48
|
||||
_0 = const (); // scope 0 at $DIR/inherit_overflow.rs:+0:11: +4:2
|
||||
return; // scope 0 at $DIR/inherit_overflow.rs:+4:2: +4:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,23 @@
|
||||
- // MIR for `main` before ConstProp
|
||||
+ // MIR for `main` after ConstProp
|
||||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/issue_66971.rs:+0:11: +0:11
|
||||
let _1: (); // in scope 0 at $DIR/issue_66971.rs:+1:5: +1:23
|
||||
let mut _2: ((), u8, u8); // in scope 0 at $DIR/issue_66971.rs:+1:12: +1:22
|
||||
|
||||
bb0: {
|
||||
StorageLive(_2); // scope 0 at $DIR/issue_66971.rs:+1:12: +1:22
|
||||
_2 = (const (), const 0_u8, const 0_u8); // scope 0 at $DIR/issue_66971.rs:+1:12: +1:22
|
||||
_1 = encode(move _2) -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/issue_66971.rs:+1:5: +1:23
|
||||
// mir::Constant
|
||||
// + span: $DIR/issue_66971.rs:18:5: 18:11
|
||||
// + literal: Const { ty: fn(((), u8, u8)) {encode}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb1: {
|
||||
StorageDead(_2); // scope 0 at $DIR/issue_66971.rs:+1:22: +1:23
|
||||
return; // scope 0 at $DIR/issue_66971.rs:+2:2: +2:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,28 @@
|
||||
- // MIR for `main` before ConstProp
|
||||
+ // MIR for `main` after ConstProp
|
||||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/issue_67019.rs:+0:11: +0:11
|
||||
let _1: (); // in scope 0 at $DIR/issue_67019.rs:+1:5: +1:20
|
||||
let mut _2: ((u8, u8),); // in scope 0 at $DIR/issue_67019.rs:+1:10: +1:19
|
||||
let mut _3: (u8, u8); // in scope 0 at $DIR/issue_67019.rs:+1:11: +1:17
|
||||
|
||||
bb0: {
|
||||
StorageLive(_2); // scope 0 at $DIR/issue_67019.rs:+1:10: +1:19
|
||||
StorageLive(_3); // scope 0 at $DIR/issue_67019.rs:+1:11: +1:17
|
||||
- _3 = (const 1_u8, const 2_u8); // scope 0 at $DIR/issue_67019.rs:+1:11: +1:17
|
||||
+ _3 = const (1_u8, 2_u8); // scope 0 at $DIR/issue_67019.rs:+1:11: +1:17
|
||||
_2 = (move _3,); // scope 0 at $DIR/issue_67019.rs:+1:10: +1:19
|
||||
StorageDead(_3); // scope 0 at $DIR/issue_67019.rs:+1:18: +1:19
|
||||
_1 = test(move _2) -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/issue_67019.rs:+1:5: +1:20
|
||||
// mir::Constant
|
||||
// + span: $DIR/issue_67019.rs:13:5: 13:9
|
||||
// + literal: Const { ty: fn(((u8, u8),)) {test}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb1: {
|
||||
StorageDead(_2); // scope 0 at $DIR/issue_67019.rs:+1:19: +1:20
|
||||
return; // scope 0 at $DIR/issue_67019.rs:+2:2: +2:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,39 @@
|
||||
- // MIR for `main` before ConstProp
|
||||
+ // MIR for `main` after ConstProp
|
||||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/large_array_index.rs:+0:11: +0:11
|
||||
let _1: u8; // in scope 0 at $DIR/large_array_index.rs:+2:9: +2:10
|
||||
let mut _2: [u8; 5000]; // in scope 0 at $DIR/large_array_index.rs:+2:17: +2:29
|
||||
let _3: usize; // in scope 0 at $DIR/large_array_index.rs:+2:30: +2:31
|
||||
let mut _4: usize; // in scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
|
||||
let mut _5: bool; // in scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
|
||||
scope 1 {
|
||||
debug x => _1; // in scope 1 at $DIR/large_array_index.rs:+2:9: +2:10
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/large_array_index.rs:+2:9: +2:10
|
||||
StorageLive(_2); // scope 0 at $DIR/large_array_index.rs:+2:17: +2:29
|
||||
_2 = [const 0_u8; 5000]; // scope 0 at $DIR/large_array_index.rs:+2:17: +2:29
|
||||
StorageLive(_3); // scope 0 at $DIR/large_array_index.rs:+2:30: +2:31
|
||||
_3 = const 2_usize; // scope 0 at $DIR/large_array_index.rs:+2:30: +2:31
|
||||
- _4 = Len(_2); // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
|
||||
- _5 = Lt(_3, _4); // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
|
||||
- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable]; // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
|
||||
+ _4 = const 5000_usize; // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
|
||||
+ _5 = const true; // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
|
||||
+ assert(const true, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable]; // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
|
||||
}
|
||||
|
||||
bb1: {
|
||||
- _1 = _2[_3]; // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
|
||||
+ _1 = _2[2 of 3]; // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
|
||||
StorageDead(_3); // scope 0 at $DIR/large_array_index.rs:+2:32: +2:33
|
||||
StorageDead(_2); // scope 0 at $DIR/large_array_index.rs:+2:32: +2:33
|
||||
_0 = const (); // scope 0 at $DIR/large_array_index.rs:+0:11: +3:2
|
||||
StorageDead(_1); // scope 0 at $DIR/large_array_index.rs:+3:1: +3:2
|
||||
return; // scope 0 at $DIR/large_array_index.rs:+3:2: +3:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,39 @@
|
||||
- // MIR for `main` before ConstProp
|
||||
+ // MIR for `main` after ConstProp
|
||||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/large_array_index.rs:+0:11: +0:11
|
||||
let _1: u8; // in scope 0 at $DIR/large_array_index.rs:+2:9: +2:10
|
||||
let mut _2: [u8; 5000]; // in scope 0 at $DIR/large_array_index.rs:+2:17: +2:29
|
||||
let _3: usize; // in scope 0 at $DIR/large_array_index.rs:+2:30: +2:31
|
||||
let mut _4: usize; // in scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
|
||||
let mut _5: bool; // in scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
|
||||
scope 1 {
|
||||
debug x => _1; // in scope 1 at $DIR/large_array_index.rs:+2:9: +2:10
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/large_array_index.rs:+2:9: +2:10
|
||||
StorageLive(_2); // scope 0 at $DIR/large_array_index.rs:+2:17: +2:29
|
||||
_2 = [const 0_u8; 5000]; // scope 0 at $DIR/large_array_index.rs:+2:17: +2:29
|
||||
StorageLive(_3); // scope 0 at $DIR/large_array_index.rs:+2:30: +2:31
|
||||
_3 = const 2_usize; // scope 0 at $DIR/large_array_index.rs:+2:30: +2:31
|
||||
- _4 = Len(_2); // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
|
||||
- _5 = Lt(_3, _4); // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
|
||||
- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable]; // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
|
||||
+ _4 = const 5000_usize; // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
|
||||
+ _5 = const true; // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
|
||||
+ assert(const true, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable]; // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
|
||||
}
|
||||
|
||||
bb1: {
|
||||
- _1 = _2[_3]; // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
|
||||
+ _1 = _2[2 of 3]; // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
|
||||
StorageDead(_3); // scope 0 at $DIR/large_array_index.rs:+2:32: +2:33
|
||||
StorageDead(_2); // scope 0 at $DIR/large_array_index.rs:+2:32: +2:33
|
||||
_0 = const (); // scope 0 at $DIR/large_array_index.rs:+0:11: +3:2
|
||||
StorageDead(_1); // scope 0 at $DIR/large_array_index.rs:+3:1: +3:2
|
||||
return; // scope 0 at $DIR/large_array_index.rs:+3:2: +3:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,35 @@
|
||||
- // MIR for `main` before ConstProp
|
||||
+ // MIR for `main` after ConstProp
|
||||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:+0:11: +0:11
|
||||
let mut _1: (i32, i32); // in scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:+1:9: +1:14
|
||||
scope 1 {
|
||||
debug x => _1; // in scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:+1:9: +1:14
|
||||
let _2: i32; // in scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:+4:9: +4:10
|
||||
scope 2 {
|
||||
debug y => _2; // in scope 2 at $DIR/mutable_variable_aggregate_partial_read.rs:+4:9: +4:10
|
||||
}
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:+1:9: +1:14
|
||||
_1 = foo() -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:+1:29: +1:34
|
||||
// mir::Constant
|
||||
// + span: $DIR/mutable_variable_aggregate_partial_read.rs:6:29: 6:32
|
||||
// + literal: Const { ty: fn() -> (i32, i32) {foo}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb1: {
|
||||
(_1.1: i32) = const 99_i32; // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:+2:5: +2:13
|
||||
(_1.0: i32) = const 42_i32; // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:+3:5: +3:13
|
||||
StorageLive(_2); // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:+4:9: +4:10
|
||||
- _2 = (_1.1: i32); // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:+4:13: +4:16
|
||||
+ _2 = const 99_i32; // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:+4:13: +4:16
|
||||
_0 = const (); // scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:+0:11: +5:2
|
||||
StorageDead(_2); // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:+5:1: +5:2
|
||||
StorageDead(_1); // scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:+5:1: +5:2
|
||||
return; // scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:+5:2: +5:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,53 @@
|
||||
- // MIR for `main` before ConstProp
|
||||
+ // MIR for `main` after ConstProp
|
||||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/mutable_variable_unprop_assign.rs:+0:11: +0:11
|
||||
let _1: i32; // in scope 0 at $DIR/mutable_variable_unprop_assign.rs:+1:9: +1:10
|
||||
let mut _3: i32; // in scope 0 at $DIR/mutable_variable_unprop_assign.rs:+3:11: +3:12
|
||||
scope 1 {
|
||||
debug a => _1; // in scope 1 at $DIR/mutable_variable_unprop_assign.rs:+1:9: +1:10
|
||||
let mut _2: (i32, i32); // in scope 1 at $DIR/mutable_variable_unprop_assign.rs:+2:9: +2:14
|
||||
scope 2 {
|
||||
debug x => _2; // in scope 2 at $DIR/mutable_variable_unprop_assign.rs:+2:9: +2:14
|
||||
let _4: i32; // in scope 2 at $DIR/mutable_variable_unprop_assign.rs:+4:9: +4:10
|
||||
scope 3 {
|
||||
debug y => _4; // in scope 3 at $DIR/mutable_variable_unprop_assign.rs:+4:9: +4:10
|
||||
let _5: i32; // in scope 3 at $DIR/mutable_variable_unprop_assign.rs:+5:9: +5:10
|
||||
scope 4 {
|
||||
debug z => _5; // in scope 4 at $DIR/mutable_variable_unprop_assign.rs:+5:9: +5:10
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/mutable_variable_unprop_assign.rs:+1:9: +1:10
|
||||
_1 = foo() -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/mutable_variable_unprop_assign.rs:+1:13: +1:18
|
||||
// mir::Constant
|
||||
// + span: $DIR/mutable_variable_unprop_assign.rs:6:13: 6:16
|
||||
// + literal: Const { ty: fn() -> i32 {foo}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb1: {
|
||||
StorageLive(_2); // scope 1 at $DIR/mutable_variable_unprop_assign.rs:+2:9: +2:14
|
||||
- _2 = (const 1_i32, const 2_i32); // scope 1 at $DIR/mutable_variable_unprop_assign.rs:+2:29: +2:35
|
||||
+ _2 = const (1_i32, 2_i32); // scope 1 at $DIR/mutable_variable_unprop_assign.rs:+2:29: +2:35
|
||||
StorageLive(_3); // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+3:11: +3:12
|
||||
_3 = _1; // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+3:11: +3:12
|
||||
(_2.1: i32) = move _3; // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+3:5: +3:12
|
||||
StorageDead(_3); // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+3:11: +3:12
|
||||
StorageLive(_4); // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+4:9: +4:10
|
||||
_4 = (_2.1: i32); // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+4:13: +4:16
|
||||
StorageLive(_5); // scope 3 at $DIR/mutable_variable_unprop_assign.rs:+5:9: +5:10
|
||||
- _5 = (_2.0: i32); // scope 3 at $DIR/mutable_variable_unprop_assign.rs:+5:13: +5:16
|
||||
+ _5 = const 1_i32; // scope 3 at $DIR/mutable_variable_unprop_assign.rs:+5:13: +5:16
|
||||
_0 = const (); // scope 0 at $DIR/mutable_variable_unprop_assign.rs:+0:11: +6:2
|
||||
StorageDead(_5); // scope 3 at $DIR/mutable_variable_unprop_assign.rs:+6:1: +6:2
|
||||
StorageDead(_4); // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+6:1: +6:2
|
||||
StorageDead(_2); // scope 1 at $DIR/mutable_variable_unprop_assign.rs:+6:1: +6:2
|
||||
StorageDead(_1); // scope 0 at $DIR/mutable_variable_unprop_assign.rs:+6:1: +6:2
|
||||
return; // scope 0 at $DIR/mutable_variable_unprop_assign.rs:+6:2: +6:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,44 @@
|
||||
- // MIR for `main` before ConstProp
|
||||
+ // MIR for `main` after ConstProp
|
||||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/repeat.rs:+0:11: +0:11
|
||||
let _1: u32; // in scope 0 at $DIR/repeat.rs:+1:9: +1:10
|
||||
let mut _2: u32; // in scope 0 at $DIR/repeat.rs:+1:18: +1:28
|
||||
let mut _3: [u32; 8]; // in scope 0 at $DIR/repeat.rs:+1:18: +1:25
|
||||
let _4: usize; // in scope 0 at $DIR/repeat.rs:+1:26: +1:27
|
||||
let mut _5: usize; // in scope 0 at $DIR/repeat.rs:+1:18: +1:28
|
||||
let mut _6: bool; // in scope 0 at $DIR/repeat.rs:+1:18: +1:28
|
||||
scope 1 {
|
||||
debug x => _1; // in scope 1 at $DIR/repeat.rs:+1:9: +1:10
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/repeat.rs:+1:9: +1:10
|
||||
StorageLive(_2); // scope 0 at $DIR/repeat.rs:+1:18: +1:28
|
||||
StorageLive(_3); // scope 0 at $DIR/repeat.rs:+1:18: +1:25
|
||||
_3 = [const 42_u32; 8]; // scope 0 at $DIR/repeat.rs:+1:18: +1:25
|
||||
StorageLive(_4); // scope 0 at $DIR/repeat.rs:+1:26: +1:27
|
||||
_4 = const 2_usize; // scope 0 at $DIR/repeat.rs:+1:26: +1:27
|
||||
- _5 = Len(_3); // scope 0 at $DIR/repeat.rs:+1:18: +1:28
|
||||
- _6 = Lt(_4, _5); // scope 0 at $DIR/repeat.rs:+1:18: +1:28
|
||||
- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> [success: bb1, unwind unreachable]; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
|
||||
+ _5 = const 8_usize; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
|
||||
+ _6 = const true; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
|
||||
+ assert(const true, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> [success: bb1, unwind unreachable]; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
|
||||
}
|
||||
|
||||
bb1: {
|
||||
- _2 = _3[_4]; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
|
||||
- _1 = Add(move _2, const 0_u32); // scope 0 at $DIR/repeat.rs:+1:18: +1:32
|
||||
+ _2 = const 42_u32; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
|
||||
+ _1 = const 42_u32; // scope 0 at $DIR/repeat.rs:+1:18: +1:32
|
||||
StorageDead(_2); // scope 0 at $DIR/repeat.rs:+1:31: +1:32
|
||||
StorageDead(_4); // scope 0 at $DIR/repeat.rs:+1:32: +1:33
|
||||
StorageDead(_3); // scope 0 at $DIR/repeat.rs:+1:32: +1:33
|
||||
_0 = const (); // scope 0 at $DIR/repeat.rs:+0:11: +2:2
|
||||
StorageDead(_1); // scope 0 at $DIR/repeat.rs:+2:1: +2:2
|
||||
return; // scope 0 at $DIR/repeat.rs:+2:2: +2:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,44 @@
|
||||
- // MIR for `main` before ConstProp
|
||||
+ // MIR for `main` after ConstProp
|
||||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/repeat.rs:+0:11: +0:11
|
||||
let _1: u32; // in scope 0 at $DIR/repeat.rs:+1:9: +1:10
|
||||
let mut _2: u32; // in scope 0 at $DIR/repeat.rs:+1:18: +1:28
|
||||
let mut _3: [u32; 8]; // in scope 0 at $DIR/repeat.rs:+1:18: +1:25
|
||||
let _4: usize; // in scope 0 at $DIR/repeat.rs:+1:26: +1:27
|
||||
let mut _5: usize; // in scope 0 at $DIR/repeat.rs:+1:18: +1:28
|
||||
let mut _6: bool; // in scope 0 at $DIR/repeat.rs:+1:18: +1:28
|
||||
scope 1 {
|
||||
debug x => _1; // in scope 1 at $DIR/repeat.rs:+1:9: +1:10
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/repeat.rs:+1:9: +1:10
|
||||
StorageLive(_2); // scope 0 at $DIR/repeat.rs:+1:18: +1:28
|
||||
StorageLive(_3); // scope 0 at $DIR/repeat.rs:+1:18: +1:25
|
||||
_3 = [const 42_u32; 8]; // scope 0 at $DIR/repeat.rs:+1:18: +1:25
|
||||
StorageLive(_4); // scope 0 at $DIR/repeat.rs:+1:26: +1:27
|
||||
_4 = const 2_usize; // scope 0 at $DIR/repeat.rs:+1:26: +1:27
|
||||
- _5 = Len(_3); // scope 0 at $DIR/repeat.rs:+1:18: +1:28
|
||||
- _6 = Lt(_4, _5); // scope 0 at $DIR/repeat.rs:+1:18: +1:28
|
||||
- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> [success: bb1, unwind unreachable]; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
|
||||
+ _5 = const 8_usize; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
|
||||
+ _6 = const true; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
|
||||
+ assert(const true, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> [success: bb1, unwind unreachable]; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
|
||||
}
|
||||
|
||||
bb1: {
|
||||
- _2 = _3[_4]; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
|
||||
- _1 = Add(move _2, const 0_u32); // scope 0 at $DIR/repeat.rs:+1:18: +1:32
|
||||
+ _2 = const 42_u32; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
|
||||
+ _1 = const 42_u32; // scope 0 at $DIR/repeat.rs:+1:18: +1:32
|
||||
StorageDead(_2); // scope 0 at $DIR/repeat.rs:+1:31: +1:32
|
||||
StorageDead(_4); // scope 0 at $DIR/repeat.rs:+1:32: +1:33
|
||||
StorageDead(_3); // scope 0 at $DIR/repeat.rs:+1:32: +1:33
|
||||
_0 = const (); // scope 0 at $DIR/repeat.rs:+0:11: +2:2
|
||||
StorageDead(_1); // scope 0 at $DIR/repeat.rs:+2:1: +2:2
|
||||
return; // scope 0 at $DIR/repeat.rs:+2:2: +2:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,21 @@
|
||||
- // MIR for `add` before ConstProp
|
||||
+ // MIR for `add` after ConstProp
|
||||
|
||||
fn add() -> u32 {
|
||||
let mut _0: u32; // return place in scope 0 at $DIR/return_place.rs:+0:13: +0:16
|
||||
let mut _1: (u32, bool); // in scope 0 at $DIR/return_place.rs:+1:5: +1:10
|
||||
|
||||
bb0: {
|
||||
- _1 = CheckedAdd(const 2_u32, const 2_u32); // scope 0 at $DIR/return_place.rs:+1:5: +1:10
|
||||
- assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 2_u32, const 2_u32) -> [success: bb1, unwind unreachable]; // scope 0 at $DIR/return_place.rs:+1:5: +1:10
|
||||
+ _1 = const (4_u32, false); // scope 0 at $DIR/return_place.rs:+1:5: +1:10
|
||||
+ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 2_u32, const 2_u32) -> [success: bb1, unwind unreachable]; // scope 0 at $DIR/return_place.rs:+1:5: +1:10
|
||||
}
|
||||
|
||||
bb1: {
|
||||
- _0 = move (_1.0: u32); // scope 0 at $DIR/return_place.rs:+1:5: +1:10
|
||||
+ _0 = const 4_u32; // scope 0 at $DIR/return_place.rs:+1:5: +1:10
|
||||
return; // scope 0 at $DIR/return_place.rs:+2:2: +2:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,16 @@
|
||||
// MIR for `add` before PreCodegen
|
||||
|
||||
fn add() -> u32 {
|
||||
let mut _0: u32; // return place in scope 0 at $DIR/return_place.rs:+0:13: +0:16
|
||||
let mut _1: (u32, bool); // in scope 0 at $DIR/return_place.rs:+1:5: +1:10
|
||||
|
||||
bb0: {
|
||||
_1 = const (4_u32, false); // scope 0 at $DIR/return_place.rs:+1:5: +1:10
|
||||
assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 2_u32, const 2_u32) -> [success: bb1, unwind unreachable]; // scope 0 at $DIR/return_place.rs:+1:5: +1:10
|
||||
}
|
||||
|
||||
bb1: {
|
||||
_0 = const 4_u32; // scope 0 at $DIR/return_place.rs:+1:5: +1:10
|
||||
return; // scope 0 at $DIR/return_place.rs:+2:2: +2:2
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
- // MIR for `main` before ConstProp
|
||||
+ // MIR for `main` after ConstProp
|
||||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/scalar_literal_propagation.rs:+0:11: +0:11
|
||||
let _1: u32; // in scope 0 at $DIR/scalar_literal_propagation.rs:+1:9: +1:10
|
||||
let _2: (); // in scope 0 at $DIR/scalar_literal_propagation.rs:+2:5: +2:15
|
||||
let mut _3: u32; // in scope 0 at $DIR/scalar_literal_propagation.rs:+2:13: +2:14
|
||||
scope 1 {
|
||||
debug x => _1; // in scope 1 at $DIR/scalar_literal_propagation.rs:+1:9: +1:10
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/scalar_literal_propagation.rs:+1:9: +1:10
|
||||
_1 = const 1_u32; // scope 0 at $DIR/scalar_literal_propagation.rs:+1:13: +1:14
|
||||
StorageLive(_2); // scope 1 at $DIR/scalar_literal_propagation.rs:+2:5: +2:15
|
||||
StorageLive(_3); // scope 1 at $DIR/scalar_literal_propagation.rs:+2:13: +2:14
|
||||
- _3 = _1; // scope 1 at $DIR/scalar_literal_propagation.rs:+2:13: +2:14
|
||||
+ _3 = const 1_u32; // scope 1 at $DIR/scalar_literal_propagation.rs:+2:13: +2:14
|
||||
_2 = consume(move _3) -> [return: bb1, unwind unreachable]; // scope 1 at $DIR/scalar_literal_propagation.rs:+2:5: +2:15
|
||||
// mir::Constant
|
||||
// + span: $DIR/scalar_literal_propagation.rs:6:5: 6:12
|
||||
// + literal: Const { ty: fn(u32) {consume}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb1: {
|
||||
StorageDead(_3); // scope 1 at $DIR/scalar_literal_propagation.rs:+2:14: +2:15
|
||||
StorageDead(_2); // scope 1 at $DIR/scalar_literal_propagation.rs:+2:15: +2:16
|
||||
_0 = const (); // scope 0 at $DIR/scalar_literal_propagation.rs:+0:11: +3:2
|
||||
StorageDead(_1); // scope 0 at $DIR/scalar_literal_propagation.rs:+3:1: +3:2
|
||||
return; // scope 0 at $DIR/scalar_literal_propagation.rs:+3:2: +3:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,50 @@
|
||||
- // MIR for `main` before ConstProp
|
||||
+ // MIR for `main` after ConstProp
|
||||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/slice_len.rs:+0:11: +0:11
|
||||
let _1: u32; // in scope 0 at $DIR/slice_len.rs:+1:5: +1:33
|
||||
let mut _2: &[u32]; // in scope 0 at $DIR/slice_len.rs:+1:5: +1:30
|
||||
let mut _3: &[u32; 3]; // in scope 0 at $DIR/slice_len.rs:+1:6: +1:19
|
||||
let _4: &[u32; 3]; // in scope 0 at $DIR/slice_len.rs:+1:6: +1:19
|
||||
let _5: [u32; 3]; // in scope 0 at $DIR/slice_len.rs:+1:7: +1:19
|
||||
let _6: usize; // in scope 0 at $DIR/slice_len.rs:+1:31: +1:32
|
||||
let mut _7: usize; // in scope 0 at $DIR/slice_len.rs:+1:5: +1:33
|
||||
let mut _8: bool; // in scope 0 at $DIR/slice_len.rs:+1:5: +1:33
|
||||
let mut _9: &[u32; 3]; // in scope 0 at $DIR/slice_len.rs:+1:6: +1:19
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
|
||||
StorageLive(_2); // scope 0 at $DIR/slice_len.rs:+1:5: +1:30
|
||||
StorageLive(_3); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
|
||||
StorageLive(_4); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
|
||||
_9 = const _; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
|
||||
// mir::Constant
|
||||
// + span: $DIR/slice_len.rs:8:6: 8:19
|
||||
// + literal: Const { ty: &[u32; 3], val: Unevaluated(main, [], Some(promoted[0])) }
|
||||
_4 = _9; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
|
||||
_3 = _4; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
|
||||
_2 = move _3 as &[u32] (Pointer(Unsize)); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
|
||||
StorageDead(_3); // scope 0 at $DIR/slice_len.rs:+1:18: +1:19
|
||||
StorageLive(_6); // scope 0 at $DIR/slice_len.rs:+1:31: +1:32
|
||||
_6 = const 1_usize; // scope 0 at $DIR/slice_len.rs:+1:31: +1:32
|
||||
- _7 = Len((*_2)); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
|
||||
- _8 = Lt(_6, _7); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
|
||||
- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind unreachable]; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
|
||||
+ _7 = const 3_usize; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
|
||||
+ _8 = const true; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
|
||||
+ assert(const true, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind unreachable]; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
|
||||
}
|
||||
|
||||
bb1: {
|
||||
- _1 = (*_2)[_6]; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
|
||||
+ _1 = const 2_u32; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
|
||||
StorageDead(_6); // scope 0 at $DIR/slice_len.rs:+1:33: +1:34
|
||||
StorageDead(_4); // scope 0 at $DIR/slice_len.rs:+1:33: +1:34
|
||||
StorageDead(_2); // scope 0 at $DIR/slice_len.rs:+1:33: +1:34
|
||||
StorageDead(_1); // scope 0 at $DIR/slice_len.rs:+1:33: +1:34
|
||||
_0 = const (); // scope 0 at $DIR/slice_len.rs:+0:11: +2:2
|
||||
return; // scope 0 at $DIR/slice_len.rs:+2:2: +2:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,50 @@
|
||||
- // MIR for `main` before ConstProp
|
||||
+ // MIR for `main` after ConstProp
|
||||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/slice_len.rs:+0:11: +0:11
|
||||
let _1: u32; // in scope 0 at $DIR/slice_len.rs:+1:5: +1:33
|
||||
let mut _2: &[u32]; // in scope 0 at $DIR/slice_len.rs:+1:5: +1:30
|
||||
let mut _3: &[u32; 3]; // in scope 0 at $DIR/slice_len.rs:+1:6: +1:19
|
||||
let _4: &[u32; 3]; // in scope 0 at $DIR/slice_len.rs:+1:6: +1:19
|
||||
let _5: [u32; 3]; // in scope 0 at $DIR/slice_len.rs:+1:7: +1:19
|
||||
let _6: usize; // in scope 0 at $DIR/slice_len.rs:+1:31: +1:32
|
||||
let mut _7: usize; // in scope 0 at $DIR/slice_len.rs:+1:5: +1:33
|
||||
let mut _8: bool; // in scope 0 at $DIR/slice_len.rs:+1:5: +1:33
|
||||
let mut _9: &[u32; 3]; // in scope 0 at $DIR/slice_len.rs:+1:6: +1:19
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
|
||||
StorageLive(_2); // scope 0 at $DIR/slice_len.rs:+1:5: +1:30
|
||||
StorageLive(_3); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
|
||||
StorageLive(_4); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
|
||||
_9 = const _; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
|
||||
// mir::Constant
|
||||
// + span: $DIR/slice_len.rs:8:6: 8:19
|
||||
// + literal: Const { ty: &[u32; 3], val: Unevaluated(main, [], Some(promoted[0])) }
|
||||
_4 = _9; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
|
||||
_3 = _4; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
|
||||
_2 = move _3 as &[u32] (Pointer(Unsize)); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
|
||||
StorageDead(_3); // scope 0 at $DIR/slice_len.rs:+1:18: +1:19
|
||||
StorageLive(_6); // scope 0 at $DIR/slice_len.rs:+1:31: +1:32
|
||||
_6 = const 1_usize; // scope 0 at $DIR/slice_len.rs:+1:31: +1:32
|
||||
- _7 = Len((*_2)); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
|
||||
- _8 = Lt(_6, _7); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
|
||||
- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind unreachable]; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
|
||||
+ _7 = const 3_usize; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
|
||||
+ _8 = const true; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
|
||||
+ assert(const true, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind unreachable]; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
|
||||
}
|
||||
|
||||
bb1: {
|
||||
- _1 = (*_2)[_6]; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
|
||||
+ _1 = const 2_u32; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
|
||||
StorageDead(_6); // scope 0 at $DIR/slice_len.rs:+1:33: +1:34
|
||||
StorageDead(_4); // scope 0 at $DIR/slice_len.rs:+1:33: +1:34
|
||||
StorageDead(_2); // scope 0 at $DIR/slice_len.rs:+1:33: +1:34
|
||||
StorageDead(_1); // scope 0 at $DIR/slice_len.rs:+1:33: +1:34
|
||||
_0 = const (); // scope 0 at $DIR/slice_len.rs:+0:11: +2:2
|
||||
return; // scope 0 at $DIR/slice_len.rs:+2:2: +2:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,34 @@
|
||||
- // MIR for `main` before ConstProp
|
||||
+ // MIR for `main` after ConstProp
|
||||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/switch_int.rs:+0:11: +0:11
|
||||
let mut _1: i32; // in scope 0 at $DIR/switch_int.rs:+1:11: +1:12
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/switch_int.rs:+1:11: +1:12
|
||||
_1 = const 1_i32; // scope 0 at $DIR/switch_int.rs:+1:11: +1:12
|
||||
- switchInt(_1) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/switch_int.rs:+1:5: +1:12
|
||||
+ switchInt(const 1_i32) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/switch_int.rs:+1:5: +1:12
|
||||
}
|
||||
|
||||
bb1: {
|
||||
_0 = foo(const -1_i32) -> [return: bb3, unwind unreachable]; // scope 0 at $DIR/switch_int.rs:+3:14: +3:21
|
||||
// mir::Constant
|
||||
// + span: $DIR/switch_int.rs:12:14: 12:17
|
||||
// + literal: Const { ty: fn(i32) {foo}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb2: {
|
||||
_0 = foo(const 0_i32) -> [return: bb3, unwind unreachable]; // scope 0 at $DIR/switch_int.rs:+2:14: +2:20
|
||||
// mir::Constant
|
||||
// + span: $DIR/switch_int.rs:11:14: 11:17
|
||||
// + literal: Const { ty: fn(i32) {foo}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb3: {
|
||||
StorageDead(_1); // scope 0 at $DIR/switch_int.rs:+5:1: +5:2
|
||||
return; // scope 0 at $DIR/switch_int.rs:+5:2: +5:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,34 @@
|
||||
- // MIR for `main` before SimplifyConstCondition-after-const-prop
|
||||
+ // MIR for `main` after SimplifyConstCondition-after-const-prop
|
||||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/switch_int.rs:+0:11: +0:11
|
||||
let mut _1: i32; // in scope 0 at $DIR/switch_int.rs:+1:11: +1:12
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/switch_int.rs:+1:11: +1:12
|
||||
_1 = const 1_i32; // scope 0 at $DIR/switch_int.rs:+1:11: +1:12
|
||||
- switchInt(const 1_i32) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/switch_int.rs:+1:5: +1:12
|
||||
+ goto -> bb2; // scope 0 at $DIR/switch_int.rs:+1:5: +1:12
|
||||
}
|
||||
|
||||
bb1: {
|
||||
_0 = foo(const -1_i32) -> [return: bb3, unwind unreachable]; // scope 0 at $DIR/switch_int.rs:+3:14: +3:21
|
||||
// mir::Constant
|
||||
// + span: $DIR/switch_int.rs:12:14: 12:17
|
||||
// + literal: Const { ty: fn(i32) {foo}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb2: {
|
||||
_0 = foo(const 0_i32) -> [return: bb3, unwind unreachable]; // scope 0 at $DIR/switch_int.rs:+2:14: +2:20
|
||||
// mir::Constant
|
||||
// + span: $DIR/switch_int.rs:11:14: 11:17
|
||||
// + literal: Const { ty: fn(i32) {foo}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb3: {
|
||||
StorageDead(_1); // scope 0 at $DIR/switch_int.rs:+5:1: +5:2
|
||||
return; // scope 0 at $DIR/switch_int.rs:+5:2: +5:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,35 @@
|
||||
- // MIR for `main` before ConstProp
|
||||
+ // MIR for `main` after ConstProp
|
||||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/tuple_literal_propagation.rs:+0:11: +0:11
|
||||
let _1: (u32, u32); // in scope 0 at $DIR/tuple_literal_propagation.rs:+1:9: +1:10
|
||||
let _2: (); // in scope 0 at $DIR/tuple_literal_propagation.rs:+3:5: +3:15
|
||||
let mut _3: (u32, u32); // in scope 0 at $DIR/tuple_literal_propagation.rs:+3:13: +3:14
|
||||
scope 1 {
|
||||
debug x => _1; // in scope 1 at $DIR/tuple_literal_propagation.rs:+1:9: +1:10
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/tuple_literal_propagation.rs:+1:9: +1:10
|
||||
- _1 = (const 1_u32, const 2_u32); // scope 0 at $DIR/tuple_literal_propagation.rs:+1:13: +1:19
|
||||
+ _1 = const (1_u32, 2_u32); // scope 0 at $DIR/tuple_literal_propagation.rs:+1:13: +1:19
|
||||
StorageLive(_2); // scope 1 at $DIR/tuple_literal_propagation.rs:+3:5: +3:15
|
||||
StorageLive(_3); // scope 1 at $DIR/tuple_literal_propagation.rs:+3:13: +3:14
|
||||
- _3 = _1; // scope 1 at $DIR/tuple_literal_propagation.rs:+3:13: +3:14
|
||||
+ _3 = const (1_u32, 2_u32); // scope 1 at $DIR/tuple_literal_propagation.rs:+3:13: +3:14
|
||||
_2 = consume(move _3) -> [return: bb1, unwind unreachable]; // scope 1 at $DIR/tuple_literal_propagation.rs:+3:5: +3:15
|
||||
// mir::Constant
|
||||
// + span: $DIR/tuple_literal_propagation.rs:7:5: 7:12
|
||||
// + literal: Const { ty: fn((u32, u32)) {consume}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb1: {
|
||||
StorageDead(_3); // scope 1 at $DIR/tuple_literal_propagation.rs:+3:14: +3:15
|
||||
StorageDead(_2); // scope 1 at $DIR/tuple_literal_propagation.rs:+3:15: +3:16
|
||||
_0 = const (); // scope 0 at $DIR/tuple_literal_propagation.rs:+0:11: +4:2
|
||||
StorageDead(_1); // scope 0 at $DIR/tuple_literal_propagation.rs:+4:1: +4:2
|
||||
return; // scope 0 at $DIR/tuple_literal_propagation.rs:+4:2: +4:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,33 @@
|
||||
- // MIR for `f` before CopyProp
|
||||
+ // MIR for `f` after CopyProp
|
||||
|
||||
fn f() -> bool {
|
||||
let mut _0: bool; // return place in scope 0 at $DIR/borrowed_local.rs:+0:11: +0:15
|
||||
let mut _1: u8; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
|
||||
let mut _2: &u8; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
|
||||
let mut _3: u8; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
|
||||
let mut _4: &u8; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
|
||||
|
||||
bb0: {
|
||||
_1 = const 5_u8; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
|
||||
_2 = &_1; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
|
||||
_3 = _1; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
|
||||
_4 = &_3; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
|
||||
_0 = cmp_ref(_2, _4) -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/borrowed_local.rs:+8:13: +8:45
|
||||
// mir::Constant
|
||||
// + span: $DIR/borrowed_local.rs:24:29: 24:36
|
||||
// + literal: Const { ty: for<'a, 'b> fn(&'a u8, &'b u8) -> bool {cmp_ref}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb1: {
|
||||
_0 = opaque::<u8>(_3) -> [return: bb2, unwind unreachable]; // scope 0 at $DIR/borrowed_local.rs:+12:13: +12:38
|
||||
// mir::Constant
|
||||
// + span: $DIR/borrowed_local.rs:28:28: 28:34
|
||||
// + literal: Const { ty: fn(u8) -> bool {opaque::<u8>}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb2: {
|
||||
return; // scope 0 at $DIR/borrowed_local.rs:+15:13: +15:21
|
||||
}
|
||||
}
|
||||
|
65
tests/mir-opt/copy-prop/branch.foo.CopyProp.panic-abort.diff
Normal file
65
tests/mir-opt/copy-prop/branch.foo.CopyProp.panic-abort.diff
Normal file
@ -0,0 +1,65 @@
|
||||
- // MIR for `foo` before CopyProp
|
||||
+ // MIR for `foo` after CopyProp
|
||||
|
||||
fn foo() -> i32 {
|
||||
let mut _0: i32; // return place in scope 0 at $DIR/branch.rs:+0:13: +0:16
|
||||
let _1: i32; // in scope 0 at $DIR/branch.rs:+1:9: +1:10
|
||||
let mut _3: bool; // in scope 0 at $DIR/branch.rs:+3:16: +3:22
|
||||
let _4: i32; // in scope 0 at $DIR/branch.rs:+6:9: +6:14
|
||||
scope 1 {
|
||||
debug x => _1; // in scope 1 at $DIR/branch.rs:+1:9: +1:10
|
||||
let _2: i32; // in scope 1 at $DIR/branch.rs:+3:9: +3:10
|
||||
scope 2 {
|
||||
debug y => _2; // in scope 2 at $DIR/branch.rs:+3:9: +3:10
|
||||
}
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/branch.rs:+1:9: +1:10
|
||||
_1 = val() -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/branch.rs:+1:13: +1:18
|
||||
// mir::Constant
|
||||
// + span: $DIR/branch.rs:14:13: 14:16
|
||||
// + literal: Const { ty: fn() -> i32 {val}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb1: {
|
||||
StorageLive(_2); // scope 1 at $DIR/branch.rs:+3:9: +3:10
|
||||
StorageLive(_3); // scope 1 at $DIR/branch.rs:+3:16: +3:22
|
||||
_3 = cond() -> [return: bb2, unwind unreachable]; // scope 1 at $DIR/branch.rs:+3:16: +3:22
|
||||
// mir::Constant
|
||||
// + span: $DIR/branch.rs:16:16: 16:20
|
||||
// + literal: Const { ty: fn() -> bool {cond}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb2: {
|
||||
switchInt(move _3) -> [0: bb4, otherwise: bb3]; // scope 1 at $DIR/branch.rs:+3:16: +3:22
|
||||
}
|
||||
|
||||
bb3: {
|
||||
_2 = _1; // scope 1 at $DIR/branch.rs:+4:9: +4:10
|
||||
goto -> bb6; // scope 1 at $DIR/branch.rs:+3:13: +8:6
|
||||
}
|
||||
|
||||
bb4: {
|
||||
StorageLive(_4); // scope 1 at $DIR/branch.rs:+6:9: +6:14
|
||||
_4 = val() -> [return: bb5, unwind unreachable]; // scope 1 at $DIR/branch.rs:+6:9: +6:14
|
||||
// mir::Constant
|
||||
// + span: $DIR/branch.rs:19:9: 19:12
|
||||
// + literal: Const { ty: fn() -> i32 {val}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb5: {
|
||||
StorageDead(_4); // scope 1 at $DIR/branch.rs:+6:14: +6:15
|
||||
_2 = _1; // scope 1 at $DIR/branch.rs:+7:9: +7:10
|
||||
goto -> bb6; // scope 1 at $DIR/branch.rs:+3:13: +8:6
|
||||
}
|
||||
|
||||
bb6: {
|
||||
StorageDead(_3); // scope 1 at $DIR/branch.rs:+8:5: +8:6
|
||||
_0 = _2; // scope 2 at $DIR/branch.rs:+10:5: +10:6
|
||||
StorageDead(_2); // scope 1 at $DIR/branch.rs:+11:1: +11:2
|
||||
StorageDead(_1); // scope 0 at $DIR/branch.rs:+11:1: +11:2
|
||||
return; // scope 0 at $DIR/branch.rs:+11:2: +11:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,23 @@
|
||||
- // MIR for `arg_src` before CopyProp
|
||||
+ // MIR for `arg_src` after CopyProp
|
||||
|
||||
fn arg_src(_1: i32) -> i32 {
|
||||
debug x => _1; // in scope 0 at $DIR/copy_propagation_arg.rs:+0:12: +0:17
|
||||
let mut _0: i32; // return place in scope 0 at $DIR/copy_propagation_arg.rs:+0:27: +0:30
|
||||
let _2: i32; // in scope 0 at $DIR/copy_propagation_arg.rs:+1:9: +1:10
|
||||
scope 1 {
|
||||
- debug y => _2; // in scope 1 at $DIR/copy_propagation_arg.rs:+1:9: +1:10
|
||||
+ debug y => _0; // in scope 1 at $DIR/copy_propagation_arg.rs:+1:9: +1:10
|
||||
}
|
||||
|
||||
bb0: {
|
||||
- StorageLive(_2); // scope 0 at $DIR/copy_propagation_arg.rs:+1:9: +1:10
|
||||
- _2 = _1; // scope 0 at $DIR/copy_propagation_arg.rs:+1:13: +1:14
|
||||
+ _0 = _1; // scope 0 at $DIR/copy_propagation_arg.rs:+1:13: +1:14
|
||||
_1 = const 123_i32; // scope 1 at $DIR/copy_propagation_arg.rs:+2:5: +2:12
|
||||
- _0 = _2; // scope 1 at $DIR/copy_propagation_arg.rs:+3:5: +3:6
|
||||
- StorageDead(_2); // scope 0 at $DIR/copy_propagation_arg.rs:+4:1: +4:2
|
||||
return; // scope 0 at $DIR/copy_propagation_arg.rs:+4:2: +4:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,28 @@
|
||||
- // MIR for `bar` before CopyProp
|
||||
+ // MIR for `bar` after CopyProp
|
||||
|
||||
fn bar(_1: u8) -> () {
|
||||
debug x => _1; // in scope 0 at $DIR/copy_propagation_arg.rs:+0:8: +0:13
|
||||
let mut _0: (); // return place in scope 0 at $DIR/copy_propagation_arg.rs:+0:19: +0:19
|
||||
let _2: u8; // in scope 0 at $DIR/copy_propagation_arg.rs:+1:5: +1:13
|
||||
let mut _3: u8; // in scope 0 at $DIR/copy_propagation_arg.rs:+1:11: +1:12
|
||||
|
||||
bb0: {
|
||||
StorageLive(_2); // scope 0 at $DIR/copy_propagation_arg.rs:+1:5: +1:13
|
||||
StorageLive(_3); // scope 0 at $DIR/copy_propagation_arg.rs:+1:11: +1:12
|
||||
_3 = _1; // scope 0 at $DIR/copy_propagation_arg.rs:+1:11: +1:12
|
||||
_2 = dummy(move _3) -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/copy_propagation_arg.rs:+1:5: +1:13
|
||||
// mir::Constant
|
||||
// + span: $DIR/copy_propagation_arg.rs:17:5: 17:10
|
||||
// + literal: Const { ty: fn(u8) -> u8 {dummy}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb1: {
|
||||
StorageDead(_3); // scope 0 at $DIR/copy_propagation_arg.rs:+1:12: +1:13
|
||||
StorageDead(_2); // scope 0 at $DIR/copy_propagation_arg.rs:+1:13: +1:14
|
||||
_1 = const 5_u8; // scope 0 at $DIR/copy_propagation_arg.rs:+2:5: +2:10
|
||||
_0 = const (); // scope 0 at $DIR/copy_propagation_arg.rs:+0:19: +3:2
|
||||
return; // scope 0 at $DIR/copy_propagation_arg.rs:+3:2: +3:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,18 @@
|
||||
- // MIR for `baz` before CopyProp
|
||||
+ // MIR for `baz` after CopyProp
|
||||
|
||||
fn baz(_1: i32) -> i32 {
|
||||
debug x => _1; // in scope 0 at $DIR/copy_propagation_arg.rs:+0:8: +0:13
|
||||
let mut _0: i32; // return place in scope 0 at $DIR/copy_propagation_arg.rs:+0:23: +0:26
|
||||
let mut _2: i32; // in scope 0 at $DIR/copy_propagation_arg.rs:+2:9: +2:10
|
||||
|
||||
bb0: {
|
||||
StorageLive(_2); // scope 0 at $DIR/copy_propagation_arg.rs:+2:9: +2:10
|
||||
_2 = _1; // scope 0 at $DIR/copy_propagation_arg.rs:+2:9: +2:10
|
||||
_1 = move _2; // scope 0 at $DIR/copy_propagation_arg.rs:+2:5: +2:10
|
||||
StorageDead(_2); // scope 0 at $DIR/copy_propagation_arg.rs:+2:9: +2:10
|
||||
_0 = _1; // scope 0 at $DIR/copy_propagation_arg.rs:+3:5: +3:6
|
||||
return; // scope 0 at $DIR/copy_propagation_arg.rs:+4:2: +4:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,28 @@
|
||||
- // MIR for `foo` before CopyProp
|
||||
+ // MIR for `foo` after CopyProp
|
||||
|
||||
fn foo(_1: u8) -> () {
|
||||
debug x => _1; // in scope 0 at $DIR/copy_propagation_arg.rs:+0:8: +0:13
|
||||
let mut _0: (); // return place in scope 0 at $DIR/copy_propagation_arg.rs:+0:19: +0:19
|
||||
let mut _2: u8; // in scope 0 at $DIR/copy_propagation_arg.rs:+2:9: +2:17
|
||||
let mut _3: u8; // in scope 0 at $DIR/copy_propagation_arg.rs:+2:15: +2:16
|
||||
|
||||
bb0: {
|
||||
StorageLive(_2); // scope 0 at $DIR/copy_propagation_arg.rs:+2:9: +2:17
|
||||
StorageLive(_3); // scope 0 at $DIR/copy_propagation_arg.rs:+2:15: +2:16
|
||||
_3 = _1; // scope 0 at $DIR/copy_propagation_arg.rs:+2:15: +2:16
|
||||
_2 = dummy(move _3) -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/copy_propagation_arg.rs:+2:9: +2:17
|
||||
// mir::Constant
|
||||
// + span: $DIR/copy_propagation_arg.rs:12:9: 12:14
|
||||
// + literal: Const { ty: fn(u8) -> u8 {dummy}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb1: {
|
||||
StorageDead(_3); // scope 0 at $DIR/copy_propagation_arg.rs:+2:16: +2:17
|
||||
_1 = move _2; // scope 0 at $DIR/copy_propagation_arg.rs:+2:5: +2:17
|
||||
StorageDead(_2); // scope 0 at $DIR/copy_propagation_arg.rs:+2:16: +2:17
|
||||
_0 = const (); // scope 0 at $DIR/copy_propagation_arg.rs:+0:19: +3:2
|
||||
return; // scope 0 at $DIR/copy_propagation_arg.rs:+3:2: +3:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,31 @@
|
||||
- // MIR for `f` before CopyProp
|
||||
+ // MIR for `f` after CopyProp
|
||||
|
||||
fn f(_1: NotCopy) -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/custom_move_arg.rs:+0:19: +0:19
|
||||
let mut _2: NotCopy; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
|
||||
let mut _3: NotCopy; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
|
||||
|
||||
bb0: {
|
||||
- _2 = _1; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
|
||||
- _0 = opaque::<NotCopy>(move _1) -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/custom_move_arg.rs:+3:9: +3:41
|
||||
+ _0 = opaque::<NotCopy>(_1) -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/custom_move_arg.rs:+3:9: +3:41
|
||||
// mir::Constant
|
||||
// + span: $DIR/custom_move_arg.rs:16:24: 16:30
|
||||
// + literal: Const { ty: fn(NotCopy) {opaque::<NotCopy>}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb1: {
|
||||
- _3 = move _2; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
|
||||
- _0 = opaque::<NotCopy>(_3) -> [return: bb2, unwind unreachable]; // scope 0 at $DIR/custom_move_arg.rs:+7:9: +7:35
|
||||
+ _0 = opaque::<NotCopy>(_1) -> [return: bb2, unwind unreachable]; // scope 0 at $DIR/custom_move_arg.rs:+7:9: +7:35
|
||||
// mir::Constant
|
||||
// + span: $DIR/custom_move_arg.rs:20:24: 20:30
|
||||
// + literal: Const { ty: fn(NotCopy) {opaque::<NotCopy>}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb2: {
|
||||
return; // scope 0 at $DIR/custom_move_arg.rs:+10:9: +10:17
|
||||
}
|
||||
}
|
||||
|
60
tests/mir-opt/copy-prop/cycle.main.CopyProp.panic-abort.diff
Normal file
60
tests/mir-opt/copy-prop/cycle.main.CopyProp.panic-abort.diff
Normal file
@ -0,0 +1,60 @@
|
||||
- // MIR for `main` before CopyProp
|
||||
+ // MIR for `main` after CopyProp
|
||||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/cycle.rs:+0:11: +0:11
|
||||
let mut _1: i32; // in scope 0 at $DIR/cycle.rs:+1:9: +1:14
|
||||
let mut _4: i32; // in scope 0 at $DIR/cycle.rs:+4:9: +4:10
|
||||
let _5: (); // in scope 0 at $DIR/cycle.rs:+6:5: +6:12
|
||||
let mut _6: i32; // in scope 0 at $DIR/cycle.rs:+6:10: +6:11
|
||||
scope 1 {
|
||||
debug x => _1; // in scope 1 at $DIR/cycle.rs:+1:9: +1:14
|
||||
let _2: i32; // in scope 1 at $DIR/cycle.rs:+2:9: +2:10
|
||||
scope 2 {
|
||||
debug y => _2; // in scope 2 at $DIR/cycle.rs:+2:9: +2:10
|
||||
let _3: i32; // in scope 2 at $DIR/cycle.rs:+3:9: +3:10
|
||||
scope 3 {
|
||||
- debug z => _3; // in scope 3 at $DIR/cycle.rs:+3:9: +3:10
|
||||
+ debug z => _2; // in scope 3 at $DIR/cycle.rs:+3:9: +3:10
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/cycle.rs:+1:9: +1:14
|
||||
_1 = val() -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/cycle.rs:+1:17: +1:22
|
||||
// mir::Constant
|
||||
// + span: $DIR/cycle.rs:10:17: 10:20
|
||||
// + literal: Const { ty: fn() -> i32 {val}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb1: {
|
||||
- StorageLive(_2); // scope 1 at $DIR/cycle.rs:+2:9: +2:10
|
||||
_2 = _1; // scope 1 at $DIR/cycle.rs:+2:13: +2:14
|
||||
- StorageLive(_3); // scope 2 at $DIR/cycle.rs:+3:9: +3:10
|
||||
- _3 = _2; // scope 2 at $DIR/cycle.rs:+3:13: +3:14
|
||||
- StorageLive(_4); // scope 3 at $DIR/cycle.rs:+4:9: +4:10
|
||||
- _4 = _3; // scope 3 at $DIR/cycle.rs:+4:9: +4:10
|
||||
- _1 = move _4; // scope 3 at $DIR/cycle.rs:+4:5: +4:10
|
||||
- StorageDead(_4); // scope 3 at $DIR/cycle.rs:+4:9: +4:10
|
||||
+ _1 = _2; // scope 3 at $DIR/cycle.rs:+4:5: +4:10
|
||||
StorageLive(_5); // scope 3 at $DIR/cycle.rs:+6:5: +6:12
|
||||
StorageLive(_6); // scope 3 at $DIR/cycle.rs:+6:10: +6:11
|
||||
_6 = _1; // scope 3 at $DIR/cycle.rs:+6:10: +6:11
|
||||
_5 = std::mem::drop::<i32>(move _6) -> [return: bb2, unwind unreachable]; // scope 3 at $DIR/cycle.rs:+6:5: +6:12
|
||||
// mir::Constant
|
||||
// + span: $DIR/cycle.rs:15:5: 15:9
|
||||
// + literal: Const { ty: fn(i32) {std::mem::drop::<i32>}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb2: {
|
||||
StorageDead(_6); // scope 3 at $DIR/cycle.rs:+6:11: +6:12
|
||||
StorageDead(_5); // scope 3 at $DIR/cycle.rs:+6:12: +6:13
|
||||
_0 = const (); // scope 0 at $DIR/cycle.rs:+0:11: +7:2
|
||||
- StorageDead(_3); // scope 2 at $DIR/cycle.rs:+7:1: +7:2
|
||||
- StorageDead(_2); // scope 1 at $DIR/cycle.rs:+7:1: +7:2
|
||||
StorageDead(_1); // scope 0 at $DIR/cycle.rs:+7:1: +7:2
|
||||
return; // scope 0 at $DIR/cycle.rs:+7:2: +7:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,29 @@
|
||||
// MIR for `f` after CopyProp
|
||||
|
||||
fn f(_1: usize) -> usize {
|
||||
debug a => _1; // in scope 0 at $DIR/dead_stores_79191.rs:+0:6: +0:11
|
||||
let mut _0: usize; // return place in scope 0 at $DIR/dead_stores_79191.rs:+0:23: +0:28
|
||||
let _2: usize; // in scope 0 at $DIR/dead_stores_79191.rs:+1:9: +1:10
|
||||
let mut _3: usize; // in scope 0 at $DIR/dead_stores_79191.rs:+3:9: +3:10
|
||||
let mut _4: usize; // in scope 0 at $DIR/dead_stores_79191.rs:+4:8: +4:9
|
||||
scope 1 {
|
||||
debug b => _2; // in scope 1 at $DIR/dead_stores_79191.rs:+1:9: +1:10
|
||||
}
|
||||
|
||||
bb0: {
|
||||
_2 = _1; // scope 0 at $DIR/dead_stores_79191.rs:+1:13: +1:14
|
||||
_1 = const 5_usize; // scope 1 at $DIR/dead_stores_79191.rs:+2:5: +2:10
|
||||
_1 = _2; // scope 1 at $DIR/dead_stores_79191.rs:+3:5: +3:10
|
||||
StorageLive(_4); // scope 1 at $DIR/dead_stores_79191.rs:+4:8: +4:9
|
||||
_4 = _1; // scope 1 at $DIR/dead_stores_79191.rs:+4:8: +4:9
|
||||
_0 = id::<usize>(move _4) -> [return: bb1, unwind unreachable]; // scope 1 at $DIR/dead_stores_79191.rs:+4:5: +4:10
|
||||
// mir::Constant
|
||||
// + span: $DIR/dead_stores_79191.rs:13:5: 13:7
|
||||
// + literal: Const { ty: fn(usize) -> usize {id::<usize>}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb1: {
|
||||
StorageDead(_4); // scope 1 at $DIR/dead_stores_79191.rs:+4:9: +4:10
|
||||
return; // scope 0 at $DIR/dead_stores_79191.rs:+5:2: +5:2
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
// MIR for `f` after CopyProp
|
||||
|
||||
fn f(_1: usize) -> usize {
|
||||
debug a => _1; // in scope 0 at $DIR/dead_stores_better.rs:+0:10: +0:15
|
||||
let mut _0: usize; // return place in scope 0 at $DIR/dead_stores_better.rs:+0:27: +0:32
|
||||
let _2: usize; // in scope 0 at $DIR/dead_stores_better.rs:+1:9: +1:10
|
||||
let mut _3: usize; // in scope 0 at $DIR/dead_stores_better.rs:+3:9: +3:10
|
||||
let mut _4: usize; // in scope 0 at $DIR/dead_stores_better.rs:+4:8: +4:9
|
||||
scope 1 {
|
||||
debug b => _2; // in scope 1 at $DIR/dead_stores_better.rs:+1:9: +1:10
|
||||
}
|
||||
|
||||
bb0: {
|
||||
_2 = _1; // scope 0 at $DIR/dead_stores_better.rs:+1:13: +1:14
|
||||
_1 = const 5_usize; // scope 1 at $DIR/dead_stores_better.rs:+2:5: +2:10
|
||||
_1 = _2; // scope 1 at $DIR/dead_stores_better.rs:+3:5: +3:10
|
||||
StorageLive(_4); // scope 1 at $DIR/dead_stores_better.rs:+4:8: +4:9
|
||||
_4 = _1; // scope 1 at $DIR/dead_stores_better.rs:+4:8: +4:9
|
||||
_0 = id::<usize>(move _4) -> [return: bb1, unwind unreachable]; // scope 1 at $DIR/dead_stores_better.rs:+4:5: +4:10
|
||||
// mir::Constant
|
||||
// + span: $DIR/dead_stores_better.rs:17:5: 17:7
|
||||
// + literal: Const { ty: fn(usize) -> usize {id::<usize>}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb1: {
|
||||
StorageDead(_4); // scope 1 at $DIR/dead_stores_better.rs:+4:9: +4:10
|
||||
return; // scope 0 at $DIR/dead_stores_better.rs:+5:2: +5:2
|
||||
}
|
||||
}
|
@ -0,0 +1,138 @@
|
||||
- // MIR for `main` before CopyProp
|
||||
+ // MIR for `main` after CopyProp
|
||||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/issue_107511.rs:+0:11: +0:11
|
||||
let mut _1: i32; // in scope 0 at $DIR/issue_107511.rs:+1:9: +1:16
|
||||
let mut _3: std::ops::Range<usize>; // in scope 0 at $DIR/issue_107511.rs:+6:14: +6:24
|
||||
let mut _4: std::ops::Range<usize>; // in scope 0 at $DIR/issue_107511.rs:+6:14: +6:24
|
||||
let mut _5: usize; // in scope 0 at $DIR/issue_107511.rs:+6:17: +6:24
|
||||
let mut _6: &[i32]; // in scope 0 at $DIR/issue_107511.rs:+6:17: +6:24
|
||||
let mut _7: &[i32; 4]; // in scope 0 at $DIR/issue_107511.rs:+6:17: +6:24
|
||||
let mut _9: (); // in scope 0 at $DIR/issue_107511.rs:+0:1: +9:2
|
||||
let _10: (); // in scope 0 at $DIR/issue_107511.rs:+6:14: +6:24
|
||||
let mut _11: std::option::Option<usize>; // in scope 0 at $DIR/issue_107511.rs:+6:14: +6:24
|
||||
let mut _12: &mut std::ops::Range<usize>; // in scope 0 at $DIR/issue_107511.rs:+6:14: +6:24
|
||||
let mut _13: &mut std::ops::Range<usize>; // in scope 0 at $DIR/issue_107511.rs:+6:14: +6:24
|
||||
let mut _14: isize; // in scope 0 at $DIR/issue_107511.rs:+6:5: +8:6
|
||||
let mut _15: !; // in scope 0 at $DIR/issue_107511.rs:+6:5: +8:6
|
||||
let mut _17: i32; // in scope 0 at $DIR/issue_107511.rs:+7:16: +7:20
|
||||
let _18: usize; // in scope 0 at $DIR/issue_107511.rs:+7:18: +7:19
|
||||
let mut _19: usize; // in scope 0 at $DIR/issue_107511.rs:+7:16: +7:20
|
||||
let mut _20: bool; // in scope 0 at $DIR/issue_107511.rs:+7:16: +7:20
|
||||
scope 1 {
|
||||
debug sum => _1; // in scope 1 at $DIR/issue_107511.rs:+1:9: +1:16
|
||||
let _2: [i32; 4]; // in scope 1 at $DIR/issue_107511.rs:+2:9: +2:10
|
||||
scope 2 {
|
||||
debug a => _2; // in scope 2 at $DIR/issue_107511.rs:+2:9: +2:10
|
||||
let mut _8: std::ops::Range<usize>; // in scope 2 at $DIR/issue_107511.rs:+6:14: +6:24
|
||||
scope 3 {
|
||||
debug iter => _8; // in scope 3 at $DIR/issue_107511.rs:+6:14: +6:24
|
||||
let _16: usize; // in scope 3 at $DIR/issue_107511.rs:+6:9: +6:10
|
||||
scope 4 {
|
||||
debug i => _16; // in scope 4 at $DIR/issue_107511.rs:+6:9: +6:10
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/issue_107511.rs:+1:9: +1:16
|
||||
_1 = const 0_i32; // scope 0 at $DIR/issue_107511.rs:+1:19: +1:20
|
||||
StorageLive(_2); // scope 1 at $DIR/issue_107511.rs:+2:9: +2:10
|
||||
_2 = [const 0_i32, const 10_i32, const 20_i32, const 30_i32]; // scope 1 at $DIR/issue_107511.rs:+2:13: +2:28
|
||||
StorageLive(_3); // scope 2 at $DIR/issue_107511.rs:+6:14: +6:24
|
||||
StorageLive(_4); // scope 2 at $DIR/issue_107511.rs:+6:14: +6:24
|
||||
StorageLive(_5); // scope 2 at $DIR/issue_107511.rs:+6:17: +6:24
|
||||
StorageLive(_6); // scope 2 at $DIR/issue_107511.rs:+6:17: +6:24
|
||||
StorageLive(_7); // scope 2 at $DIR/issue_107511.rs:+6:17: +6:24
|
||||
_7 = &_2; // scope 2 at $DIR/issue_107511.rs:+6:17: +6:24
|
||||
_6 = move _7 as &[i32] (Pointer(Unsize)); // scope 2 at $DIR/issue_107511.rs:+6:17: +6:24
|
||||
StorageDead(_7); // scope 2 at $DIR/issue_107511.rs:+6:17: +6:18
|
||||
_5 = core::slice::<impl [i32]>::len(move _6) -> [return: bb1, unwind unreachable]; // scope 2 at $DIR/issue_107511.rs:+6:17: +6:24
|
||||
// mir::Constant
|
||||
// + span: $DIR/issue_107511.rs:11:19: 11:22
|
||||
// + literal: Const { ty: for<'a> fn(&'a [i32]) -> usize {core::slice::<impl [i32]>::len}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb1: {
|
||||
StorageDead(_6); // scope 2 at $DIR/issue_107511.rs:+6:23: +6:24
|
||||
_4 = std::ops::Range::<usize> { start: const 0_usize, end: move _5 }; // scope 2 at $DIR/issue_107511.rs:+6:14: +6:24
|
||||
StorageDead(_5); // scope 2 at $DIR/issue_107511.rs:+6:23: +6:24
|
||||
_3 = <std::ops::Range<usize> as IntoIterator>::into_iter(move _4) -> [return: bb2, unwind unreachable]; // scope 2 at $DIR/issue_107511.rs:+6:14: +6:24
|
||||
// mir::Constant
|
||||
// + span: $DIR/issue_107511.rs:11:14: 11:24
|
||||
// + literal: Const { ty: fn(std::ops::Range<usize>) -> <std::ops::Range<usize> as IntoIterator>::IntoIter {<std::ops::Range<usize> as IntoIterator>::into_iter}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb2: {
|
||||
StorageDead(_4); // scope 2 at $DIR/issue_107511.rs:+6:23: +6:24
|
||||
StorageLive(_8); // scope 2 at $DIR/issue_107511.rs:+6:14: +6:24
|
||||
_8 = move _3; // scope 2 at $DIR/issue_107511.rs:+6:14: +6:24
|
||||
goto -> bb3; // scope 3 at $DIR/issue_107511.rs:+6:5: +8:6
|
||||
}
|
||||
|
||||
bb3: {
|
||||
- StorageLive(_10); // scope 3 at $DIR/issue_107511.rs:+6:14: +6:24
|
||||
StorageLive(_11); // scope 3 at $DIR/issue_107511.rs:+6:14: +6:24
|
||||
StorageLive(_12); // scope 3 at $DIR/issue_107511.rs:+6:14: +6:24
|
||||
StorageLive(_13); // scope 3 at $DIR/issue_107511.rs:+6:14: +6:24
|
||||
_13 = &mut _8; // scope 3 at $DIR/issue_107511.rs:+6:14: +6:24
|
||||
_12 = &mut (*_13); // scope 3 at $DIR/issue_107511.rs:+6:14: +6:24
|
||||
_11 = <std::ops::Range<usize> as Iterator>::next(move _12) -> [return: bb4, unwind unreachable]; // scope 3 at $DIR/issue_107511.rs:+6:14: +6:24
|
||||
// mir::Constant
|
||||
// + span: $DIR/issue_107511.rs:11:14: 11:24
|
||||
// + literal: Const { ty: for<'a> fn(&'a mut std::ops::Range<usize>) -> Option<<std::ops::Range<usize> as Iterator>::Item> {<std::ops::Range<usize> as Iterator>::next}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb4: {
|
||||
StorageDead(_12); // scope 3 at $DIR/issue_107511.rs:+6:23: +6:24
|
||||
_14 = discriminant(_11); // scope 3 at $DIR/issue_107511.rs:+6:14: +6:24
|
||||
switchInt(move _14) -> [0: bb7, 1: bb5, otherwise: bb6]; // scope 3 at $DIR/issue_107511.rs:+6:14: +6:24
|
||||
}
|
||||
|
||||
bb5: {
|
||||
- StorageLive(_16); // scope 3 at $DIR/issue_107511.rs:+6:9: +6:10
|
||||
_16 = ((_11 as Some).0: usize); // scope 3 at $DIR/issue_107511.rs:+6:9: +6:10
|
||||
StorageLive(_17); // scope 4 at $DIR/issue_107511.rs:+7:16: +7:20
|
||||
- StorageLive(_18); // scope 4 at $DIR/issue_107511.rs:+7:18: +7:19
|
||||
- _18 = _16; // scope 4 at $DIR/issue_107511.rs:+7:18: +7:19
|
||||
_19 = Len(_2); // scope 4 at $DIR/issue_107511.rs:+7:16: +7:20
|
||||
- _20 = Lt(_18, _19); // scope 4 at $DIR/issue_107511.rs:+7:16: +7:20
|
||||
- assert(move _20, "index out of bounds: the length is {} but the index is {}", move _19, _18) -> [success: bb8, unwind unreachable]; // scope 4 at $DIR/issue_107511.rs:+7:16: +7:20
|
||||
+ _20 = Lt(_16, _19); // scope 4 at $DIR/issue_107511.rs:+7:16: +7:20
|
||||
+ assert(move _20, "index out of bounds: the length is {} but the index is {}", move _19, _16) -> [success: bb8, unwind unreachable]; // scope 4 at $DIR/issue_107511.rs:+7:16: +7:20
|
||||
}
|
||||
|
||||
bb6: {
|
||||
unreachable; // scope 3 at $DIR/issue_107511.rs:+6:14: +6:24
|
||||
}
|
||||
|
||||
bb7: {
|
||||
_0 = const (); // scope 3 at $DIR/issue_107511.rs:+6:5: +8:6
|
||||
StorageDead(_13); // scope 3 at $DIR/issue_107511.rs:+8:5: +8:6
|
||||
StorageDead(_11); // scope 3 at $DIR/issue_107511.rs:+8:5: +8:6
|
||||
- StorageDead(_10); // scope 3 at $DIR/issue_107511.rs:+8:5: +8:6
|
||||
StorageDead(_8); // scope 2 at $DIR/issue_107511.rs:+8:5: +8:6
|
||||
StorageDead(_3); // scope 2 at $DIR/issue_107511.rs:+8:5: +8:6
|
||||
StorageDead(_2); // scope 1 at $DIR/issue_107511.rs:+9:1: +9:2
|
||||
StorageDead(_1); // scope 0 at $DIR/issue_107511.rs:+9:1: +9:2
|
||||
return; // scope 0 at $DIR/issue_107511.rs:+9:2: +9:2
|
||||
}
|
||||
|
||||
bb8: {
|
||||
- _17 = _2[_18]; // scope 4 at $DIR/issue_107511.rs:+7:16: +7:20
|
||||
+ _17 = _2[_16]; // scope 4 at $DIR/issue_107511.rs:+7:16: +7:20
|
||||
_1 = Add(_1, move _17); // scope 4 at $DIR/issue_107511.rs:+7:9: +7:20
|
||||
StorageDead(_17); // scope 4 at $DIR/issue_107511.rs:+7:19: +7:20
|
||||
- StorageDead(_18); // scope 4 at $DIR/issue_107511.rs:+7:20: +7:21
|
||||
- _10 = const (); // scope 4 at $DIR/issue_107511.rs:+6:25: +8:6
|
||||
- StorageDead(_16); // scope 3 at $DIR/issue_107511.rs:+8:5: +8:6
|
||||
StorageDead(_13); // scope 3 at $DIR/issue_107511.rs:+8:5: +8:6
|
||||
StorageDead(_11); // scope 3 at $DIR/issue_107511.rs:+8:5: +8:6
|
||||
- StorageDead(_10); // scope 3 at $DIR/issue_107511.rs:+8:5: +8:6
|
||||
- _9 = const (); // scope 3 at $DIR/issue_107511.rs:+6:5: +8:6
|
||||
goto -> bb3; // scope 3 at $DIR/issue_107511.rs:+6:5: +8:6
|
||||
}
|
||||
}
|
||||
|
40
tests/mir-opt/copy-prop/move_arg.f.CopyProp.panic-abort.diff
Normal file
40
tests/mir-opt/copy-prop/move_arg.f.CopyProp.panic-abort.diff
Normal file
@ -0,0 +1,40 @@
|
||||
- // MIR for `f` before CopyProp
|
||||
+ // MIR for `f` after CopyProp
|
||||
|
||||
fn f(_1: T) -> () {
|
||||
debug a => _1; // in scope 0 at $DIR/move_arg.rs:+0:19: +0:20
|
||||
let mut _0: (); // return place in scope 0 at $DIR/move_arg.rs:+0:25: +0:25
|
||||
let _2: T; // in scope 0 at $DIR/move_arg.rs:+1:9: +1:10
|
||||
let _3: (); // in scope 0 at $DIR/move_arg.rs:+2:5: +2:12
|
||||
let mut _4: T; // in scope 0 at $DIR/move_arg.rs:+2:7: +2:8
|
||||
let mut _5: T; // in scope 0 at $DIR/move_arg.rs:+2:10: +2:11
|
||||
scope 1 {
|
||||
- debug b => _2; // in scope 1 at $DIR/move_arg.rs:+1:9: +1:10
|
||||
+ debug b => _1; // in scope 1 at $DIR/move_arg.rs:+1:9: +1:10
|
||||
}
|
||||
|
||||
bb0: {
|
||||
- StorageLive(_2); // scope 0 at $DIR/move_arg.rs:+1:9: +1:10
|
||||
- _2 = _1; // scope 0 at $DIR/move_arg.rs:+1:13: +1:14
|
||||
StorageLive(_3); // scope 1 at $DIR/move_arg.rs:+2:5: +2:12
|
||||
- StorageLive(_4); // scope 1 at $DIR/move_arg.rs:+2:7: +2:8
|
||||
- _4 = _1; // scope 1 at $DIR/move_arg.rs:+2:7: +2:8
|
||||
- StorageLive(_5); // scope 1 at $DIR/move_arg.rs:+2:10: +2:11
|
||||
- _5 = _2; // scope 1 at $DIR/move_arg.rs:+2:10: +2:11
|
||||
- _3 = g::<T>(move _4, move _5) -> [return: bb1, unwind unreachable]; // scope 1 at $DIR/move_arg.rs:+2:5: +2:12
|
||||
+ _3 = g::<T>(_1, _1) -> [return: bb1, unwind unreachable]; // scope 1 at $DIR/move_arg.rs:+2:5: +2:12
|
||||
// mir::Constant
|
||||
// + span: $DIR/move_arg.rs:8:5: 8:6
|
||||
// + literal: Const { ty: fn(T, T) {g::<T>}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb1: {
|
||||
- StorageDead(_5); // scope 1 at $DIR/move_arg.rs:+2:11: +2:12
|
||||
- StorageDead(_4); // scope 1 at $DIR/move_arg.rs:+2:11: +2:12
|
||||
StorageDead(_3); // scope 1 at $DIR/move_arg.rs:+2:12: +2:13
|
||||
_0 = const (); // scope 0 at $DIR/move_arg.rs:+0:25: +3:2
|
||||
- StorageDead(_2); // scope 0 at $DIR/move_arg.rs:+3:1: +3:2
|
||||
return; // scope 0 at $DIR/move_arg.rs:+3:2: +3:2
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,31 @@
|
||||
- // MIR for `f` before CopyProp
|
||||
+ // MIR for `f` after CopyProp
|
||||
|
||||
fn f(_1: Foo) -> bool {
|
||||
let mut _0: bool; // return place in scope 0 at $DIR/move_projection.rs:+0:17: +0:21
|
||||
let mut _2: Foo; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
|
||||
let mut _3: u8; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
|
||||
|
||||
bb0: {
|
||||
- _2 = _1; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
|
||||
- _3 = move (_2.0: u8); // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
|
||||
- _0 = opaque::<Foo>(move _1) -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/move_projection.rs:+6:13: +6:44
|
||||
+ _3 = (_1.0: u8); // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
|
||||
+ _0 = opaque::<Foo>(_1) -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/move_projection.rs:+6:13: +6:44
|
||||
// mir::Constant
|
||||
// + span: $DIR/move_projection.rs:20:28: 20:34
|
||||
// + literal: Const { ty: fn(Foo) -> bool {opaque::<Foo>}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb1: {
|
||||
_0 = opaque::<u8>(move _3) -> [return: bb2, unwind unreachable]; // scope 0 at $DIR/move_projection.rs:+9:13: +9:44
|
||||
// mir::Constant
|
||||
// + span: $DIR/move_projection.rs:23:28: 23:34
|
||||
// + literal: Const { ty: fn(u8) -> bool {opaque::<u8>}, val: Value(<ZST>) }
|
||||
}
|
||||
|
||||
bb2: {
|
||||
return; // scope 0 at $DIR/move_projection.rs:+12:13: +12:21
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user