Skip to content

Commit 774a3d1

Browse files
committed
Auto merge of #111553 - cjgillot:mir-e2e, r=scottmcm
Add a few MIR pre-codegen tests r? `@scottmcm`
2 parents f85ab54 + d796c60 commit 774a3d1

25 files changed

+1762
-1082
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
// MIR for `bitand` after PreCodegen
2+
3+
fn bitand(_1: &Blueprint, _2: &Blueprint) -> bool {
4+
debug a => _1; // in scope 0 at $DIR/chained_comparison.rs:+0:15: +0:16
5+
debug b => _2; // in scope 0 at $DIR/chained_comparison.rs:+0:30: +0:31
6+
let mut _0: bool; // return place in scope 0 at $DIR/chained_comparison.rs:+0:48: +0:52
7+
let mut _3: u32; // in scope 0 at $DIR/chained_comparison.rs:+1:6: +1:22
8+
let mut _4: u32; // in scope 0 at $DIR/chained_comparison.rs:+1:26: +1:42
9+
let mut _5: bool; // in scope 0 at $DIR/chained_comparison.rs:+1:5: +1:43
10+
let mut _6: u32; // in scope 0 at $DIR/chained_comparison.rs:+2:12: +2:21
11+
let mut _7: u32; // in scope 0 at $DIR/chained_comparison.rs:+2:25: +2:34
12+
let mut _8: bool; // in scope 0 at $DIR/chained_comparison.rs:+2:11: +2:35
13+
let mut _9: bool; // in scope 0 at $DIR/chained_comparison.rs:+1:5: +2:35
14+
let mut _10: u32; // in scope 0 at $DIR/chained_comparison.rs:+3:12: +3:28
15+
let mut _11: u32; // in scope 0 at $DIR/chained_comparison.rs:+3:32: +3:48
16+
let mut _12: bool; // in scope 0 at $DIR/chained_comparison.rs:+3:11: +3:49
17+
let mut _13: bool; // in scope 0 at $DIR/chained_comparison.rs:+1:5: +3:49
18+
let mut _14: u32; // in scope 0 at $DIR/chained_comparison.rs:+4:12: +4:25
19+
let mut _15: u32; // in scope 0 at $DIR/chained_comparison.rs:+4:29: +4:42
20+
let mut _16: bool; // in scope 0 at $DIR/chained_comparison.rs:+4:11: +4:43
21+
let mut _17: bool; // in scope 0 at $DIR/chained_comparison.rs:+1:5: +4:43
22+
let mut _18: u32; // in scope 0 at $DIR/chained_comparison.rs:+5:12: +5:21
23+
let mut _19: u32; // in scope 0 at $DIR/chained_comparison.rs:+5:25: +5:34
24+
let mut _20: bool; // in scope 0 at $DIR/chained_comparison.rs:+5:11: +5:35
25+
26+
bb0: {
27+
StorageLive(_17); // scope 0 at $DIR/chained_comparison.rs:+1:5: +4:43
28+
StorageLive(_13); // scope 0 at $DIR/chained_comparison.rs:+1:5: +3:49
29+
StorageLive(_9); // scope 0 at $DIR/chained_comparison.rs:+1:5: +2:35
30+
StorageLive(_5); // scope 0 at $DIR/chained_comparison.rs:+1:5: +1:43
31+
StorageLive(_3); // scope 0 at $DIR/chained_comparison.rs:+1:6: +1:22
32+
_3 = ((*_1).0: u32); // scope 0 at $DIR/chained_comparison.rs:+1:6: +1:22
33+
StorageLive(_4); // scope 0 at $DIR/chained_comparison.rs:+1:26: +1:42
34+
_4 = ((*_2).0: u32); // scope 0 at $DIR/chained_comparison.rs:+1:26: +1:42
35+
_5 = Eq(move _3, move _4); // scope 0 at $DIR/chained_comparison.rs:+1:5: +1:43
36+
StorageDead(_4); // scope 0 at $DIR/chained_comparison.rs:+1:42: +1:43
37+
StorageDead(_3); // scope 0 at $DIR/chained_comparison.rs:+1:42: +1:43
38+
StorageLive(_8); // scope 0 at $DIR/chained_comparison.rs:+2:11: +2:35
39+
StorageLive(_6); // scope 0 at $DIR/chained_comparison.rs:+2:12: +2:21
40+
_6 = ((*_1).1: u32); // scope 0 at $DIR/chained_comparison.rs:+2:12: +2:21
41+
StorageLive(_7); // scope 0 at $DIR/chained_comparison.rs:+2:25: +2:34
42+
_7 = ((*_2).1: u32); // scope 0 at $DIR/chained_comparison.rs:+2:25: +2:34
43+
_8 = Eq(move _6, move _7); // scope 0 at $DIR/chained_comparison.rs:+2:11: +2:35
44+
StorageDead(_7); // scope 0 at $DIR/chained_comparison.rs:+2:34: +2:35
45+
StorageDead(_6); // scope 0 at $DIR/chained_comparison.rs:+2:34: +2:35
46+
_9 = BitAnd(move _5, move _8); // scope 0 at $DIR/chained_comparison.rs:+1:5: +2:35
47+
StorageDead(_8); // scope 0 at $DIR/chained_comparison.rs:+2:34: +2:35
48+
StorageDead(_5); // scope 0 at $DIR/chained_comparison.rs:+2:34: +2:35
49+
StorageLive(_12); // scope 0 at $DIR/chained_comparison.rs:+3:11: +3:49
50+
StorageLive(_10); // scope 0 at $DIR/chained_comparison.rs:+3:12: +3:28
51+
_10 = ((*_1).2: u32); // scope 0 at $DIR/chained_comparison.rs:+3:12: +3:28
52+
StorageLive(_11); // scope 0 at $DIR/chained_comparison.rs:+3:32: +3:48
53+
_11 = ((*_2).2: u32); // scope 0 at $DIR/chained_comparison.rs:+3:32: +3:48
54+
_12 = Eq(move _10, move _11); // scope 0 at $DIR/chained_comparison.rs:+3:11: +3:49
55+
StorageDead(_11); // scope 0 at $DIR/chained_comparison.rs:+3:48: +3:49
56+
StorageDead(_10); // scope 0 at $DIR/chained_comparison.rs:+3:48: +3:49
57+
_13 = BitAnd(move _9, move _12); // scope 0 at $DIR/chained_comparison.rs:+1:5: +3:49
58+
StorageDead(_12); // scope 0 at $DIR/chained_comparison.rs:+3:48: +3:49
59+
StorageDead(_9); // scope 0 at $DIR/chained_comparison.rs:+3:48: +3:49
60+
StorageLive(_16); // scope 0 at $DIR/chained_comparison.rs:+4:11: +4:43
61+
StorageLive(_14); // scope 0 at $DIR/chained_comparison.rs:+4:12: +4:25
62+
_14 = ((*_1).3: u32); // scope 0 at $DIR/chained_comparison.rs:+4:12: +4:25
63+
StorageLive(_15); // scope 0 at $DIR/chained_comparison.rs:+4:29: +4:42
64+
_15 = ((*_2).3: u32); // scope 0 at $DIR/chained_comparison.rs:+4:29: +4:42
65+
_16 = Eq(move _14, move _15); // scope 0 at $DIR/chained_comparison.rs:+4:11: +4:43
66+
StorageDead(_15); // scope 0 at $DIR/chained_comparison.rs:+4:42: +4:43
67+
StorageDead(_14); // scope 0 at $DIR/chained_comparison.rs:+4:42: +4:43
68+
_17 = BitAnd(move _13, move _16); // scope 0 at $DIR/chained_comparison.rs:+1:5: +4:43
69+
StorageDead(_16); // scope 0 at $DIR/chained_comparison.rs:+4:42: +4:43
70+
StorageDead(_13); // scope 0 at $DIR/chained_comparison.rs:+4:42: +4:43
71+
StorageLive(_20); // scope 0 at $DIR/chained_comparison.rs:+5:11: +5:35
72+
StorageLive(_18); // scope 0 at $DIR/chained_comparison.rs:+5:12: +5:21
73+
_18 = ((*_1).4: u32); // scope 0 at $DIR/chained_comparison.rs:+5:12: +5:21
74+
StorageLive(_19); // scope 0 at $DIR/chained_comparison.rs:+5:25: +5:34
75+
_19 = ((*_2).4: u32); // scope 0 at $DIR/chained_comparison.rs:+5:25: +5:34
76+
_20 = Eq(move _18, move _19); // scope 0 at $DIR/chained_comparison.rs:+5:11: +5:35
77+
StorageDead(_19); // scope 0 at $DIR/chained_comparison.rs:+5:34: +5:35
78+
StorageDead(_18); // scope 0 at $DIR/chained_comparison.rs:+5:34: +5:35
79+
_0 = BitAnd(move _17, move _20); // scope 0 at $DIR/chained_comparison.rs:+1:5: +5:35
80+
StorageDead(_20); // scope 0 at $DIR/chained_comparison.rs:+5:34: +5:35
81+
StorageDead(_17); // scope 0 at $DIR/chained_comparison.rs:+5:34: +5:35
82+
return; // scope 0 at $DIR/chained_comparison.rs:+6:2: +6:2
83+
}
84+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
// MIR for `naive` after PreCodegen
2+
3+
fn naive(_1: &Blueprint, _2: &Blueprint) -> bool {
4+
debug a => _1; // in scope 0 at $DIR/chained_comparison.rs:+0:14: +0:15
5+
debug b => _2; // in scope 0 at $DIR/chained_comparison.rs:+0:29: +0:30
6+
let mut _0: bool; // return place in scope 0 at $DIR/chained_comparison.rs:+0:47: +0:51
7+
let mut _3: u32; // in scope 0 at $DIR/chained_comparison.rs:+1:6: +1:22
8+
let mut _4: u32; // in scope 0 at $DIR/chained_comparison.rs:+1:26: +1:42
9+
let mut _5: bool; // in scope 0 at $DIR/chained_comparison.rs:+1:5: +1:43
10+
let mut _6: u32; // in scope 0 at $DIR/chained_comparison.rs:+2:13: +2:22
11+
let mut _7: u32; // in scope 0 at $DIR/chained_comparison.rs:+2:26: +2:35
12+
let mut _8: bool; // in scope 0 at $DIR/chained_comparison.rs:+2:12: +2:36
13+
let mut _9: bool; // in scope 0 at $DIR/chained_comparison.rs:+1:5: +2:36
14+
let mut _10: u32; // in scope 0 at $DIR/chained_comparison.rs:+3:13: +3:29
15+
let mut _11: u32; // in scope 0 at $DIR/chained_comparison.rs:+3:33: +3:49
16+
let mut _12: bool; // in scope 0 at $DIR/chained_comparison.rs:+3:12: +3:50
17+
let mut _13: bool; // in scope 0 at $DIR/chained_comparison.rs:+1:5: +3:50
18+
let mut _14: u32; // in scope 0 at $DIR/chained_comparison.rs:+4:13: +4:26
19+
let mut _15: u32; // in scope 0 at $DIR/chained_comparison.rs:+4:30: +4:43
20+
let mut _16: bool; // in scope 0 at $DIR/chained_comparison.rs:+4:12: +4:44
21+
let mut _17: bool; // in scope 0 at $DIR/chained_comparison.rs:+1:5: +4:44
22+
let mut _18: u32; // in scope 0 at $DIR/chained_comparison.rs:+5:13: +5:22
23+
let mut _19: u32; // in scope 0 at $DIR/chained_comparison.rs:+5:26: +5:35
24+
let mut _20: bool; // in scope 0 at $DIR/chained_comparison.rs:+5:12: +5:36
25+
26+
bb0: {
27+
StorageLive(_17); // scope 0 at $DIR/chained_comparison.rs:+1:5: +4:44
28+
StorageLive(_13); // scope 0 at $DIR/chained_comparison.rs:+1:5: +3:50
29+
StorageLive(_9); // scope 0 at $DIR/chained_comparison.rs:+1:5: +2:36
30+
StorageLive(_5); // scope 0 at $DIR/chained_comparison.rs:+1:5: +1:43
31+
StorageLive(_3); // scope 0 at $DIR/chained_comparison.rs:+1:6: +1:22
32+
_3 = ((*_1).0: u32); // scope 0 at $DIR/chained_comparison.rs:+1:6: +1:22
33+
StorageLive(_4); // scope 0 at $DIR/chained_comparison.rs:+1:26: +1:42
34+
_4 = ((*_2).0: u32); // scope 0 at $DIR/chained_comparison.rs:+1:26: +1:42
35+
_5 = Eq(move _3, move _4); // scope 0 at $DIR/chained_comparison.rs:+1:5: +1:43
36+
StorageDead(_4); // scope 0 at $DIR/chained_comparison.rs:+1:42: +1:43
37+
StorageDead(_3); // scope 0 at $DIR/chained_comparison.rs:+1:42: +1:43
38+
switchInt(move _5) -> [0: bb1, otherwise: bb2]; // scope 0 at $DIR/chained_comparison.rs:+1:5: +2:36
39+
}
40+
41+
bb1: {
42+
StorageDead(_8); // scope 0 at $DIR/chained_comparison.rs:+2:35: +2:36
43+
StorageDead(_5); // scope 0 at $DIR/chained_comparison.rs:+2:35: +2:36
44+
goto -> bb3; // scope 0 at $DIR/chained_comparison.rs:+1:5: +2:36
45+
}
46+
47+
bb2: {
48+
StorageLive(_8); // scope 0 at $DIR/chained_comparison.rs:+2:12: +2:36
49+
StorageLive(_6); // scope 0 at $DIR/chained_comparison.rs:+2:13: +2:22
50+
_6 = ((*_1).1: u32); // scope 0 at $DIR/chained_comparison.rs:+2:13: +2:22
51+
StorageLive(_7); // scope 0 at $DIR/chained_comparison.rs:+2:26: +2:35
52+
_7 = ((*_2).1: u32); // scope 0 at $DIR/chained_comparison.rs:+2:26: +2:35
53+
_8 = Eq(move _6, move _7); // scope 0 at $DIR/chained_comparison.rs:+2:12: +2:36
54+
StorageDead(_7); // scope 0 at $DIR/chained_comparison.rs:+2:35: +2:36
55+
StorageDead(_6); // scope 0 at $DIR/chained_comparison.rs:+2:35: +2:36
56+
_9 = move _8; // scope 0 at $DIR/chained_comparison.rs:+1:5: +2:36
57+
StorageDead(_8); // scope 0 at $DIR/chained_comparison.rs:+2:35: +2:36
58+
StorageDead(_5); // scope 0 at $DIR/chained_comparison.rs:+2:35: +2:36
59+
switchInt(move _9) -> [0: bb3, otherwise: bb4]; // scope 0 at $DIR/chained_comparison.rs:+1:5: +3:50
60+
}
61+
62+
bb3: {
63+
StorageDead(_12); // scope 0 at $DIR/chained_comparison.rs:+3:49: +3:50
64+
StorageDead(_9); // scope 0 at $DIR/chained_comparison.rs:+3:49: +3:50
65+
goto -> bb5; // scope 0 at $DIR/chained_comparison.rs:+1:5: +3:50
66+
}
67+
68+
bb4: {
69+
StorageLive(_12); // scope 0 at $DIR/chained_comparison.rs:+3:12: +3:50
70+
StorageLive(_10); // scope 0 at $DIR/chained_comparison.rs:+3:13: +3:29
71+
_10 = ((*_1).2: u32); // scope 0 at $DIR/chained_comparison.rs:+3:13: +3:29
72+
StorageLive(_11); // scope 0 at $DIR/chained_comparison.rs:+3:33: +3:49
73+
_11 = ((*_2).2: u32); // scope 0 at $DIR/chained_comparison.rs:+3:33: +3:49
74+
_12 = Eq(move _10, move _11); // scope 0 at $DIR/chained_comparison.rs:+3:12: +3:50
75+
StorageDead(_11); // scope 0 at $DIR/chained_comparison.rs:+3:49: +3:50
76+
StorageDead(_10); // scope 0 at $DIR/chained_comparison.rs:+3:49: +3:50
77+
_13 = move _12; // scope 0 at $DIR/chained_comparison.rs:+1:5: +3:50
78+
StorageDead(_12); // scope 0 at $DIR/chained_comparison.rs:+3:49: +3:50
79+
StorageDead(_9); // scope 0 at $DIR/chained_comparison.rs:+3:49: +3:50
80+
switchInt(move _13) -> [0: bb5, otherwise: bb6]; // scope 0 at $DIR/chained_comparison.rs:+1:5: +4:44
81+
}
82+
83+
bb5: {
84+
StorageDead(_16); // scope 0 at $DIR/chained_comparison.rs:+4:43: +4:44
85+
StorageDead(_13); // scope 0 at $DIR/chained_comparison.rs:+4:43: +4:44
86+
goto -> bb7; // scope 0 at $DIR/chained_comparison.rs:+1:5: +4:44
87+
}
88+
89+
bb6: {
90+
StorageLive(_16); // scope 0 at $DIR/chained_comparison.rs:+4:12: +4:44
91+
StorageLive(_14); // scope 0 at $DIR/chained_comparison.rs:+4:13: +4:26
92+
_14 = ((*_1).3: u32); // scope 0 at $DIR/chained_comparison.rs:+4:13: +4:26
93+
StorageLive(_15); // scope 0 at $DIR/chained_comparison.rs:+4:30: +4:43
94+
_15 = ((*_2).3: u32); // scope 0 at $DIR/chained_comparison.rs:+4:30: +4:43
95+
_16 = Eq(move _14, move _15); // scope 0 at $DIR/chained_comparison.rs:+4:12: +4:44
96+
StorageDead(_15); // scope 0 at $DIR/chained_comparison.rs:+4:43: +4:44
97+
StorageDead(_14); // scope 0 at $DIR/chained_comparison.rs:+4:43: +4:44
98+
_17 = move _16; // scope 0 at $DIR/chained_comparison.rs:+1:5: +4:44
99+
StorageDead(_16); // scope 0 at $DIR/chained_comparison.rs:+4:43: +4:44
100+
StorageDead(_13); // scope 0 at $DIR/chained_comparison.rs:+4:43: +4:44
101+
switchInt(move _17) -> [0: bb7, otherwise: bb8]; // scope 0 at $DIR/chained_comparison.rs:+1:5: +5:36
102+
}
103+
104+
bb7: {
105+
_0 = const false; // scope 0 at $DIR/chained_comparison.rs:+1:5: +5:36
106+
goto -> bb9; // scope 0 at $DIR/chained_comparison.rs:+1:5: +5:36
107+
}
108+
109+
bb8: {
110+
StorageLive(_20); // scope 0 at $DIR/chained_comparison.rs:+5:12: +5:36
111+
StorageLive(_18); // scope 0 at $DIR/chained_comparison.rs:+5:13: +5:22
112+
_18 = ((*_1).4: u32); // scope 0 at $DIR/chained_comparison.rs:+5:13: +5:22
113+
StorageLive(_19); // scope 0 at $DIR/chained_comparison.rs:+5:26: +5:35
114+
_19 = ((*_2).4: u32); // scope 0 at $DIR/chained_comparison.rs:+5:26: +5:35
115+
_20 = Eq(move _18, move _19); // scope 0 at $DIR/chained_comparison.rs:+5:12: +5:36
116+
StorageDead(_19); // scope 0 at $DIR/chained_comparison.rs:+5:35: +5:36
117+
StorageDead(_18); // scope 0 at $DIR/chained_comparison.rs:+5:35: +5:36
118+
_0 = move _20; // scope 0 at $DIR/chained_comparison.rs:+1:5: +5:36
119+
goto -> bb9; // scope 0 at $DIR/chained_comparison.rs:+1:5: +5:36
120+
}
121+
122+
bb9: {
123+
StorageDead(_20); // scope 0 at $DIR/chained_comparison.rs:+5:35: +5:36
124+
StorageDead(_17); // scope 0 at $DIR/chained_comparison.rs:+5:35: +5:36
125+
return; // scope 0 at $DIR/chained_comparison.rs:+6:2: +6:2
126+
}
127+
}

0 commit comments

Comments
 (0)