]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/combine_array_len/32bit/rustc.norm2.InstCombine.diff
e11619cf0cd0eb14da1cee8ab0fc74bce3faf5e3
[rust.git] / src / test / mir-opt / combine_array_len / 32bit / rustc.norm2.InstCombine.diff
1 - // MIR for `norm2` before InstCombine
2 + // MIR for `norm2` after InstCombine
3   
4   fn norm2(_1: [f32; 2]) -> f32 {
5       debug x => _1;                       // in scope 0 at $DIR/combine_array_len.rs:4:10: 4:11
6       let mut _0: f32;                     // return place in scope 0 at $DIR/combine_array_len.rs:4:26: 4:29
7       let _2: f32;                         // in scope 0 at $DIR/combine_array_len.rs:5:9: 5:10
8       let _3: usize;                       // in scope 0 at $DIR/combine_array_len.rs:5:15: 5:16
9       let mut _4: usize;                   // in scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
10       let mut _5: bool;                    // in scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
11       let _7: usize;                       // in scope 0 at $DIR/combine_array_len.rs:6:15: 6:16
12       let mut _8: usize;                   // in scope 0 at $DIR/combine_array_len.rs:6:13: 6:17
13       let mut _9: bool;                    // in scope 0 at $DIR/combine_array_len.rs:6:13: 6:17
14       let mut _10: f32;                    // in scope 0 at $DIR/combine_array_len.rs:7:5: 7:8
15       let mut _11: f32;                    // in scope 0 at $DIR/combine_array_len.rs:7:5: 7:6
16       let mut _12: f32;                    // in scope 0 at $DIR/combine_array_len.rs:7:7: 7:8
17       let mut _13: f32;                    // in scope 0 at $DIR/combine_array_len.rs:7:11: 7:14
18       let mut _14: f32;                    // in scope 0 at $DIR/combine_array_len.rs:7:11: 7:12
19       let mut _15: f32;                    // in scope 0 at $DIR/combine_array_len.rs:7:13: 7:14
20       scope 1 {
21           debug a => _2;                   // in scope 1 at $DIR/combine_array_len.rs:5:9: 5:10
22           let _6: f32;                     // in scope 1 at $DIR/combine_array_len.rs:6:9: 6:10
23           scope 2 {
24               debug b => _6;               // in scope 2 at $DIR/combine_array_len.rs:6:9: 6:10
25           }
26       }
27   
28       bb0: {
29           StorageLive(_2);                 // scope 0 at $DIR/combine_array_len.rs:5:9: 5:10
30           StorageLive(_3);                 // scope 0 at $DIR/combine_array_len.rs:5:15: 5:16
31           _3 = const 0usize;               // scope 0 at $DIR/combine_array_len.rs:5:15: 5:16
32                                            // ty::Const
33                                            // + ty: usize
34                                            // + val: Value(Scalar(0x00000000))
35                                            // mir::Constant
36                                            // + span: $DIR/combine_array_len.rs:5:15: 5:16
37                                            // + literal: Const { ty: usize, val: Value(Scalar(0x00000000)) }
38 -         _4 = Len(_1);                    // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
39 +         _4 = const 2usize;               // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
40 +                                          // ty::Const
41 +                                          // + ty: usize
42 +                                          // + val: Value(Scalar(0x00000002))
43 +                                          // mir::Constant
44 +                                          // + span: $DIR/combine_array_len.rs:5:13: 5:17
45 +                                          // + literal: Const { ty: usize, val: Value(Scalar(0x00000002)) }
46           _5 = Lt(_3, _4);                 // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
47           assert(move _5, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
48       }
49   
50       bb1: {
51           _2 = _1[_3];                     // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
52           StorageDead(_3);                 // scope 0 at $DIR/combine_array_len.rs:5:17: 5:18
53           StorageLive(_6);                 // scope 1 at $DIR/combine_array_len.rs:6:9: 6:10
54           StorageLive(_7);                 // scope 1 at $DIR/combine_array_len.rs:6:15: 6:16
55           _7 = const 1usize;               // scope 1 at $DIR/combine_array_len.rs:6:15: 6:16
56                                            // ty::Const
57                                            // + ty: usize
58                                            // + val: Value(Scalar(0x00000001))
59                                            // mir::Constant
60                                            // + span: $DIR/combine_array_len.rs:6:15: 6:16
61                                            // + literal: Const { ty: usize, val: Value(Scalar(0x00000001)) }
62 -         _8 = Len(_1);                    // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
63 +         _8 = const 2usize;               // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
64 +                                          // ty::Const
65 +                                          // + ty: usize
66 +                                          // + val: Value(Scalar(0x00000002))
67 +                                          // mir::Constant
68 +                                          // + span: $DIR/combine_array_len.rs:6:13: 6:17
69 +                                          // + literal: Const { ty: usize, val: Value(Scalar(0x00000002)) }
70           _9 = Lt(_7, _8);                 // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
71           assert(move _9, "index out of bounds: the len is {} but the index is {}", move _8, _7) -> bb2; // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
72       }
73   
74       bb2: {
75           _6 = _1[_7];                     // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
76           StorageDead(_7);                 // scope 1 at $DIR/combine_array_len.rs:6:17: 6:18
77           StorageLive(_10);                // scope 2 at $DIR/combine_array_len.rs:7:5: 7:8
78           StorageLive(_11);                // scope 2 at $DIR/combine_array_len.rs:7:5: 7:6
79           _11 = _2;                        // scope 2 at $DIR/combine_array_len.rs:7:5: 7:6
80           StorageLive(_12);                // scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
81           _12 = _2;                        // scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
82           _10 = Mul(move _11, move _12);   // scope 2 at $DIR/combine_array_len.rs:7:5: 7:8
83           StorageDead(_12);                // scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
84           StorageDead(_11);                // scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
85           StorageLive(_13);                // scope 2 at $DIR/combine_array_len.rs:7:11: 7:14
86           StorageLive(_14);                // scope 2 at $DIR/combine_array_len.rs:7:11: 7:12
87           _14 = _6;                        // scope 2 at $DIR/combine_array_len.rs:7:11: 7:12
88           StorageLive(_15);                // scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
89           _15 = _6;                        // scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
90           _13 = Mul(move _14, move _15);   // scope 2 at $DIR/combine_array_len.rs:7:11: 7:14
91           StorageDead(_15);                // scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
92           StorageDead(_14);                // scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
93           _0 = Add(move _10, move _13);    // scope 2 at $DIR/combine_array_len.rs:7:5: 7:14
94           StorageDead(_13);                // scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
95           StorageDead(_10);                // scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
96           StorageDead(_6);                 // scope 1 at $DIR/combine_array_len.rs:8:1: 8:2
97           StorageDead(_2);                 // scope 0 at $DIR/combine_array_len.rs:8:1: 8:2
98           return;                          // scope 0 at $DIR/combine_array_len.rs:8:2: 8:2
99       }
100   }
101