]> git.proxmox.com Git - rustc.git/blame - src/test/mir-opt/const_prop/optimizes_into_variable.main.ConstProp.diff.64bit
New upstream version 1.47.0+dfsg1
[rustc.git] / src / test / mir-opt / const_prop / optimizes_into_variable.main.ConstProp.diff.64bit
CommitLineData
3dfed10e
XL
1- // MIR for `main` before ConstProp
2+ // MIR for `main` after ConstProp
3
4 fn main() -> () {
5 let mut _0: (); // return place in scope 0 at $DIR/optimizes_into_variable.rs:11:11: 11:11
6 let _1: i32; // in scope 0 at $DIR/optimizes_into_variable.rs:12:9: 12:10
7 let mut _2: (i32, bool); // in scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
8 let mut _4: [i32; 6]; // in scope 0 at $DIR/optimizes_into_variable.rs:13:13: 13:31
9 let _5: usize; // in scope 0 at $DIR/optimizes_into_variable.rs:13:32: 13:33
10 let mut _6: usize; // in scope 0 at $DIR/optimizes_into_variable.rs:13:13: 13:34
11 let mut _7: bool; // in scope 0 at $DIR/optimizes_into_variable.rs:13:13: 13:34
12 let mut _9: Point; // in scope 0 at $DIR/optimizes_into_variable.rs:14:13: 14:36
13 scope 1 {
14 debug x => _1; // in scope 1 at $DIR/optimizes_into_variable.rs:12:9: 12:10
15 let _3: i32; // in scope 1 at $DIR/optimizes_into_variable.rs:13:9: 13:10
16 scope 2 {
17 debug y => _3; // in scope 2 at $DIR/optimizes_into_variable.rs:13:9: 13:10
18 let _8: u32; // in scope 2 at $DIR/optimizes_into_variable.rs:14:9: 14:10
19 scope 3 {
20 debug z => _8; // in scope 3 at $DIR/optimizes_into_variable.rs:14:9: 14:10
21 }
22 }
23 }
24
25 bb0: {
26 StorageLive(_1); // scope 0 at $DIR/optimizes_into_variable.rs:12:9: 12:10
27- _2 = CheckedAdd(const 2_i32, const 2_i32); // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
28- assert(!move (_2.1: bool), "attempt to compute `{} + {}` which would overflow", const 2_i32, const 2_i32) -> bb1; // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
29+ _2 = const (4_i32, false); // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
30+ // ty::Const
31+ // + ty: (i32, bool)
32+ // + val: Value(ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [31], len: Size { raw: 8 } }, size: Size { raw: 8 }, align: Align { pow2: 2 }, mutability: Not, extra: () }, offset: Size { raw: 0 } })
33+ // mir::Constant
34+ // + span: $DIR/optimizes_into_variable.rs:12:13: 12:18
35+ // + literal: Const { ty: (i32, bool), val: Value(ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [31], len: Size { raw: 8 } }, size: Size { raw: 8 }, align: Align { pow2: 2 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }) }
36+ assert(!const false, "attempt to compute `{} + {}` which would overflow", const 2_i32, const 2_i32) -> bb1; // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
37 }
38
39 bb1: {
40- _1 = move (_2.0: i32); // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
41+ _1 = const 4_i32; // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
42 StorageLive(_3); // scope 1 at $DIR/optimizes_into_variable.rs:13:9: 13:10
43 StorageLive(_4); // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:31
44 _4 = [const 0_i32, const 1_i32, const 2_i32, const 3_i32, const 4_i32, const 5_i32]; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:31
45 StorageLive(_5); // scope 1 at $DIR/optimizes_into_variable.rs:13:32: 13:33
46 _5 = const 3_usize; // scope 1 at $DIR/optimizes_into_variable.rs:13:32: 13:33
47 _6 = const 6_usize; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
48- _7 = Lt(_5, _6); // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
49- assert(move _7, "index out of bounds: the len is {} but the index is {}", move _6, _5) -> bb2; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
50+ _7 = const true; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
51+ assert(const true, "index out of bounds: the len is {} but the index is {}", const 6_usize, const 3_usize) -> bb2; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
52 }
53
54 bb2: {
55- _3 = _4[_5]; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
56+ _3 = const 3_i32; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
57 StorageDead(_5); // scope 1 at $DIR/optimizes_into_variable.rs:13:34: 13:35
58 StorageDead(_4); // scope 1 at $DIR/optimizes_into_variable.rs:13:34: 13:35
59 StorageLive(_8); // scope 2 at $DIR/optimizes_into_variable.rs:14:9: 14:10
60 StorageLive(_9); // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:36
61 (_9.0: u32) = const 12_u32; // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:36
62 (_9.1: u32) = const 42_u32; // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:36
63- _8 = (_9.1: u32); // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:38
64+ _8 = const 42_u32; // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:38
65 StorageDead(_9); // scope 2 at $DIR/optimizes_into_variable.rs:14:38: 14:39
66 _0 = const (); // scope 0 at $DIR/optimizes_into_variable.rs:11:11: 15:2
67 StorageDead(_8); // scope 2 at $DIR/optimizes_into_variable.rs:15:1: 15:2
68 StorageDead(_3); // scope 1 at $DIR/optimizes_into_variable.rs:15:1: 15:2
69 StorageDead(_1); // scope 0 at $DIR/optimizes_into_variable.rs:15:1: 15:2
70 return; // scope 0 at $DIR/optimizes_into_variable.rs:15:2: 15:2
71 }
72 }
73