]> git.proxmox.com Git - rustc.git/blob - src/test/mir-opt/const_prop/optimizes_into_variable/64bit/rustc.main.ConstProp.diff
New upstream version 1.46.0~beta.2+dfsg1
[rustc.git] / src / test / mir-opt / const_prop / optimizes_into_variable / 64bit / rustc.main.ConstProp.diff
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 + _2 = (const 4_i32, const false); // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
29 // ty::Const
30 // + ty: i32
31 - // + val: Value(Scalar(0x00000002))
32 + // + val: Value(Scalar(0x00000004))
33 // mir::Constant
34 - // + span: $DIR/optimizes_into_variable.rs:12:13: 12:14
35 - // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
36 + // + span: $DIR/optimizes_into_variable.rs:12:13: 12:18
37 + // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
38 // ty::Const
39 - // + ty: i32
40 - // + val: Value(Scalar(0x00000002))
41 + // + ty: bool
42 + // + val: Value(Scalar(0x00))
43 // mir::Constant
44 - // + span: $DIR/optimizes_into_variable.rs:12:17: 12:18
45 - // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
46 - 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
47 + // + span: $DIR/optimizes_into_variable.rs:12:13: 12:18
48 + // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
49 + 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
50 // ty::Const
51 + // + ty: bool
52 + // + val: Value(Scalar(0x00))
53 + // mir::Constant
54 + // + span: $DIR/optimizes_into_variable.rs:12:13: 12:18
55 + // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
56 + // ty::Const
57 // + ty: i32
58 // + val: Value(Scalar(0x00000002))
59 // mir::Constant
60 // + span: $DIR/optimizes_into_variable.rs:12:13: 12:14
61 // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
62 // ty::Const
63 // + ty: i32
64 // + val: Value(Scalar(0x00000002))
65 // mir::Constant
66 // + span: $DIR/optimizes_into_variable.rs:12:17: 12:18
67 // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
68 }
69
70 bb1: {
71 - _1 = move (_2.0: i32); // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
72 + _1 = const 4_i32; // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
73 + // ty::Const
74 + // + ty: i32
75 + // + val: Value(Scalar(0x00000004))
76 + // mir::Constant
77 + // + span: $DIR/optimizes_into_variable.rs:12:13: 12:18
78 + // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
79 StorageLive(_3); // scope 1 at $DIR/optimizes_into_variable.rs:13:9: 13:10
80 StorageLive(_4); // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:31
81 _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
82 // ty::Const
83 // + ty: i32
84 // + val: Value(Scalar(0x00000000))
85 // mir::Constant
86 // + span: $DIR/optimizes_into_variable.rs:13:14: 13:15
87 // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
88 // ty::Const
89 // + ty: i32
90 // + val: Value(Scalar(0x00000001))
91 // mir::Constant
92 // + span: $DIR/optimizes_into_variable.rs:13:17: 13:18
93 // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
94 // ty::Const
95 // + ty: i32
96 // + val: Value(Scalar(0x00000002))
97 // mir::Constant
98 // + span: $DIR/optimizes_into_variable.rs:13:20: 13:21
99 // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
100 // ty::Const
101 // + ty: i32
102 // + val: Value(Scalar(0x00000003))
103 // mir::Constant
104 // + span: $DIR/optimizes_into_variable.rs:13:23: 13:24
105 // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
106 // ty::Const
107 // + ty: i32
108 // + val: Value(Scalar(0x00000004))
109 // mir::Constant
110 // + span: $DIR/optimizes_into_variable.rs:13:26: 13:27
111 // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
112 // ty::Const
113 // + ty: i32
114 // + val: Value(Scalar(0x00000005))
115 // mir::Constant
116 // + span: $DIR/optimizes_into_variable.rs:13:29: 13:30
117 // + literal: Const { ty: i32, val: Value(Scalar(0x00000005)) }
118 StorageLive(_5); // scope 1 at $DIR/optimizes_into_variable.rs:13:32: 13:33
119 _5 = const 3_usize; // scope 1 at $DIR/optimizes_into_variable.rs:13:32: 13:33
120 // ty::Const
121 // + ty: usize
122 // + val: Value(Scalar(0x0000000000000003))
123 // mir::Constant
124 // + span: $DIR/optimizes_into_variable.rs:13:32: 13:33
125 // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000003)) }
126 _6 = const 6_usize; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
127 // ty::Const
128 // + ty: usize
129 // + val: Value(Scalar(0x0000000000000006))
130 // mir::Constant
131 // + span: $DIR/optimizes_into_variable.rs:13:13: 13:34
132 // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000006)) }
133 - _7 = Lt(_5, _6); // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
134 - 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
135 + _7 = const true; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
136 + // ty::Const
137 + // + ty: bool
138 + // + val: Value(Scalar(0x01))
139 + // mir::Constant
140 + // + span: $DIR/optimizes_into_variable.rs:13:13: 13:34
141 + // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
142 + assert(const true, "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
143 + // ty::Const
144 + // + ty: bool
145 + // + val: Value(Scalar(0x01))
146 + // mir::Constant
147 + // + span: $DIR/optimizes_into_variable.rs:13:13: 13:34
148 + // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
149 }
150
151 bb2: {
152 - _3 = _4[_5]; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
153 + _3 = const 3_i32; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
154 + // ty::Const
155 + // + ty: i32
156 + // + val: Value(Scalar(0x00000003))
157 + // mir::Constant
158 + // + span: $DIR/optimizes_into_variable.rs:13:13: 13:34
159 + // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
160 StorageDead(_5); // scope 1 at $DIR/optimizes_into_variable.rs:13:34: 13:35
161 StorageDead(_4); // scope 1 at $DIR/optimizes_into_variable.rs:13:34: 13:35
162 StorageLive(_8); // scope 2 at $DIR/optimizes_into_variable.rs:14:9: 14:10
163 StorageLive(_9); // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:36
164 _9 = Point { x: const 12_u32, y: const 42_u32 }; // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:36
165 // ty::Const
166 // + ty: u32
167 // + val: Value(Scalar(0x0000000c))
168 // mir::Constant
169 // + span: $DIR/optimizes_into_variable.rs:14:25: 14:27
170 // + literal: Const { ty: u32, val: Value(Scalar(0x0000000c)) }
171 // ty::Const
172 // + ty: u32
173 // + val: Value(Scalar(0x0000002a))
174 // mir::Constant
175 // + span: $DIR/optimizes_into_variable.rs:14:32: 14:34
176 // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
177 - _8 = (_9.1: u32); // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:38
178 + _8 = const 42_u32; // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:38
179 + // ty::Const
180 + // + ty: u32
181 + // + val: Value(Scalar(0x0000002a))
182 + // mir::Constant
183 + // + span: $DIR/optimizes_into_variable.rs:14:13: 14:38
184 + // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
185 StorageDead(_9); // scope 2 at $DIR/optimizes_into_variable.rs:14:38: 14:39
186 _0 = const (); // scope 0 at $DIR/optimizes_into_variable.rs:11:11: 15:2
187 // ty::Const
188 // + ty: ()
189 // + val: Value(Scalar(<ZST>))
190 // mir::Constant
191 // + span: $DIR/optimizes_into_variable.rs:11:11: 15:2
192 // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
193 StorageDead(_8); // scope 2 at $DIR/optimizes_into_variable.rs:15:1: 15:2
194 StorageDead(_3); // scope 1 at $DIR/optimizes_into_variable.rs:15:1: 15:2
195 StorageDead(_1); // scope 0 at $DIR/optimizes_into_variable.rs:15:1: 15:2
196 return; // scope 0 at $DIR/optimizes_into_variable.rs:15:2: 15:2
197 }
198 }
199