Skip to content

Commit 46e5699

Browse files
committed
Add 64bit / 32bit files
1 parent 9ef5b88 commit 46e5699

3 files changed

+91
-22
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
- // MIR for `foo` before MatchBranchSimplification
2+
+ // MIR for `foo` after MatchBranchSimplification
3+
4+
fn foo(_1: std::option::Option<()>) -> () {
5+
debug bar => _1; // in scope 0 at $DIR/matches_reduce_branches.rs:4:8: 4:11
6+
let mut _0: (); // return place in scope 0 at $DIR/matches_reduce_branches.rs:4:25: 4:25
7+
let mut _2: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
8+
let mut _3: isize; // in scope 0 at $DIR/matches_reduce_branches.rs:5:22: 5:26
9+
10+
bb0: {
11+
StorageLive(_2); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
12+
_3 = discriminant(_1); // scope 0 at $DIR/matches_reduce_branches.rs:5:22: 5:26
13+
- switchInt(move _3) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_reduce_branches.rs:5:22: 5:26
14+
+ _2 = Eq(move _3, const 0_isize); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
15+
+ // ty::Const
16+
+ // + ty: isize
17+
+ // + val: Value(Scalar(0x00000000))
18+
+ // mir::Constant
19+
+ // + span: $DIR/matches_reduce_branches.rs:1:1: 1:1
20+
+ // + literal: Const { ty: isize, val: Value(Scalar(0x00000000)) }
21+
+ goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:5:22: 5:26
22+
}
23+
24+
bb1: {
25+
_2 = const false; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
26+
// ty::Const
27+
// + ty: bool
28+
// + val: Value(Scalar(0x00))
29+
// mir::Constant
30+
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
31+
// + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
32+
goto -> bb3; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
33+
}
34+
35+
bb2: {
36+
_2 = const true; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
37+
// ty::Const
38+
// + ty: bool
39+
// + val: Value(Scalar(0x01))
40+
// mir::Constant
41+
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
42+
// + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
43+
goto -> bb3; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
44+
}
45+
46+
bb3: {
47+
switchInt(_2) -> [false: bb4, otherwise: bb5]; // scope 0 at $DIR/matches_reduce_branches.rs:5:5: 7:6
48+
}
49+
50+
bb4: {
51+
_0 = const (); // scope 0 at $DIR/matches_reduce_branches.rs:5:5: 7:6
52+
// ty::Const
53+
// + ty: ()
54+
// + val: Value(Scalar(<ZST>))
55+
// mir::Constant
56+
// + span: $DIR/matches_reduce_branches.rs:5:5: 7:6
57+
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
58+
goto -> bb5; // scope 0 at $DIR/matches_reduce_branches.rs:5:5: 7:6
59+
}
60+
61+
bb5: {
62+
StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:8:1: 8:2
63+
return; // scope 0 at $DIR/matches_reduce_branches.rs:8:2: 8:2
64+
}
65+
}
66+

src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.diff renamed to src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.diff.64bit

+24-22
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,23 @@
22
+ // MIR for `foo` after MatchBranchSimplification
33

44
fn foo(_1: std::option::Option<()>) -> () {
5-
debug bar => _1; // in scope 0 at $DIR/matches_reduce_branches.rs:3:8: 3:11
6-
let mut _0: (); // return place in scope 0 at $DIR/matches_reduce_branches.rs:3:25: 3:25
5+
debug bar => _1; // in scope 0 at $DIR/matches_reduce_branches.rs:4:8: 4:11
6+
let mut _0: (); // return place in scope 0 at $DIR/matches_reduce_branches.rs:4:25: 4:25
77
let mut _2: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
8-
let mut _3: isize; // in scope 0 at $DIR/matches_reduce_branches.rs:4:22: 4:26
8+
let mut _3: isize; // in scope 0 at $DIR/matches_reduce_branches.rs:5:22: 5:26
99

1010
bb0: {
1111
StorageLive(_2); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
12-
_3 = discriminant(_1); // scope 0 at $DIR/matches_reduce_branches.rs:4:22: 4:26
13-
- switchInt(move _3) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_reduce_branches.rs:4:22: 4:26
14-
+ goto -> bb2; // scope 0 at $DIR/matches_reduce_branches.rs:4:22: 4:26
12+
_3 = discriminant(_1); // scope 0 at $DIR/matches_reduce_branches.rs:5:22: 5:26
13+
- switchInt(move _3) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_reduce_branches.rs:5:22: 5:26
14+
+ _2 = Eq(move _3, const 0_isize); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
15+
+ // ty::Const
16+
+ // + ty: isize
17+
+ // + val: Value(Scalar(0x0000000000000000))
18+
+ // mir::Constant
19+
+ // + span: $DIR/matches_reduce_branches.rs:1:1: 1:1
20+
+ // + literal: Const { ty: isize, val: Value(Scalar(0x0000000000000000)) }
21+
+ goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:5:22: 5:26
1522
}
1623

1724
bb1: {
@@ -26,39 +33,34 @@
2633
}
2734

2835
bb2: {
29-
- _2 = const true; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
30-
+ _2 = Eq(move _3, const 0_isize); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
36+
_2 = const true; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
3137
// ty::Const
32-
- // + ty: bool
33-
- // + val: Value(Scalar(0x01))
34-
+ // + ty: isize
35-
+ // + val: Value(Scalar(0x0000000000000000))
38+
// + ty: bool
39+
// + val: Value(Scalar(0x01))
3640
// mir::Constant
37-
- // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
38-
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
39-
+ // + span: $DIR/matches_reduce_branches.rs:1:1: 1:1
40-
+ // + literal: Const { ty: isize, val: Value(Scalar(0x0000000000000000)) }
41+
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
42+
// + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
4143
goto -> bb3; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
4244
}
4345

4446
bb3: {
45-
switchInt(_2) -> [false: bb4, otherwise: bb5]; // scope 0 at $DIR/matches_reduce_branches.rs:4:5: 6:6
47+
switchInt(_2) -> [false: bb4, otherwise: bb5]; // scope 0 at $DIR/matches_reduce_branches.rs:5:5: 7:6
4648
}
4749

4850
bb4: {
49-
_0 = const (); // scope 0 at $DIR/matches_reduce_branches.rs:4:5: 6:6
51+
_0 = const (); // scope 0 at $DIR/matches_reduce_branches.rs:5:5: 7:6
5052
// ty::Const
5153
// + ty: ()
5254
// + val: Value(Scalar(<ZST>))
5355
// mir::Constant
54-
// + span: $DIR/matches_reduce_branches.rs:4:5: 6:6
56+
// + span: $DIR/matches_reduce_branches.rs:5:5: 7:6
5557
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
56-
goto -> bb5; // scope 0 at $DIR/matches_reduce_branches.rs:4:5: 6:6
58+
goto -> bb5; // scope 0 at $DIR/matches_reduce_branches.rs:5:5: 7:6
5759
}
5860

5961
bb5: {
60-
StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:7:1: 7:2
61-
return; // scope 0 at $DIR/matches_reduce_branches.rs:7:2: 7:2
62+
StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:8:1: 8:2
63+
return; // scope 0 at $DIR/matches_reduce_branches.rs:8:2: 8:2
6264
}
6365
}
6466

src/test/mir-opt/matches_reduce_branches.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// EMIT_MIR_FOR_EACH_BIT_WIDTH
12
// EMIT_MIR matches_reduce_branches.foo.MatchBranchSimplification.diff
23

34
fn foo(bar: Option<()>) {

0 commit comments

Comments
 (0)