Skip to content

Commit 36345a4

Browse files
CoAlloc: Updated a 'MIR optimization' test
1 parent c81b741 commit 36345a4

File tree

1 file changed

+24
-20
lines changed

1 file changed

+24
-20
lines changed

tests/mir-opt/inline/inline_into_box_place.main.Inline.diff

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,40 @@
99
debug _x => _1; // in scope 1 at $DIR/inline_into_box_place.rs:+1:9: +1:11
1010
}
1111
+ scope 2 (inlined Vec::<u32>::new) { // at $DIR/inline_into_box_place.rs:7:38: 7:48
12-
+ let mut _3: alloc::raw_vec::RawVec<u32>; // in scope 2 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
12+
+ scope 3 {
13+
+ scope 4 (inlined Vec::<u32>::new_co) { // at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
14+
+ let mut _3: alloc::raw_vec::RawVec<u32>; // in scope 4 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
15+
+ }
16+
+ }
1317
+ }
14-
+ scope 3 (inlined Box::<Vec<u32>>::new) { // at $DIR/inline_into_box_place.rs:7:29: 7:49
15-
+ debug x => _2; // in scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
16-
+ let mut _4: usize; // in scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
17-
+ let mut _5: usize; // in scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
18-
+ let mut _6: *mut u8; // in scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
19-
+ let mut _7: *const std::vec::Vec<u32>; // in scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
20-
+ scope 4 {
18+
+ scope 5 (inlined Box::<Vec<u32>>::new) { // at $DIR/inline_into_box_place.rs:7:29: 7:49
19+
+ debug x => _2; // in scope 5 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
20+
+ let mut _4: usize; // in scope 5 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
21+
+ let mut _5: usize; // in scope 5 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
22+
+ let mut _6: *mut u8; // in scope 5 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
23+
+ let mut _7: *const std::vec::Vec<u32>; // in scope 5 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
24+
+ scope 6 {
2125
+ }
2226
+ }
2327

2428
bb0: {
2529
StorageLive(_1); // scope 0 at $DIR/inline_into_box_place.rs:+1:9: +1:11
2630
StorageLive(_2); // scope 0 at $DIR/inline_into_box_place.rs:+1:38: +1:48
2731
- _2 = Vec::<u32>::new() -> bb1; // scope 0 at $DIR/inline_into_box_place.rs:+1:38: +1:48
28-
+ StorageLive(_3); // scope 2 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
29-
+ _3 = const _; // scope 2 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
32+
+ StorageLive(_3); // scope 4 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
33+
+ _3 = const _; // scope 4 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
3034
// mir::Constant
3135
- // + span: $DIR/inline_into_box_place.rs:7:38: 7:46
3236
- // + user_ty: UserType(2)
3337
- // + literal: Const { ty: fn() -> Vec<u32> {Vec::<u32>::new}, val: Value(<ZST>) }
3438
+ // + span: $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
3539
+ // + user_ty: UserType(0)
36-
+ // + literal: Const { ty: alloc::raw_vec::RawVec<u32>, val: Unevaluated(alloc::raw_vec::RawVec::<T>::NEW, [u32], None) }
37-
+ _2 = Vec::<u32> { buf: move _3, len: const 0_usize }; // scope 2 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
38-
+ StorageDead(_3); // scope 2 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
39-
+ _4 = SizeOf(std::vec::Vec<u32>); // scope 4 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
40-
+ _5 = AlignOf(std::vec::Vec<u32>); // scope 4 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
41-
+ _6 = alloc::alloc::exchange_malloc(move _4, move _5) -> [return: bb3, unwind: bb4]; // scope 4 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
40+
+ // + literal: Const { ty: alloc::raw_vec::RawVec<u32>, val: Unevaluated(alloc::raw_vec::RawVec::<T, std::alloc::Global, CO_ALLOC_PREF>::NEW, [u32, Const { ty: usize, kind: Value(Leaf(0x0000000000000000)) }], None) }
41+
+ _2 = Vec::<u32> { buf: move _3, len: const 0_usize }; // scope 4 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
42+
+ StorageDead(_3); // scope 4 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
43+
+ _4 = SizeOf(std::vec::Vec<u32>); // scope 6 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
44+
+ _5 = AlignOf(std::vec::Vec<u32>); // scope 6 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
45+
+ _6 = alloc::alloc::exchange_malloc(move _4, move _5) -> [return: bb3, unwind: bb4]; // scope 6 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
4246
+ // mir::Constant
4347
+ // + span: $SRC_DIR/alloc/src/boxed.rs:LL:COL
4448
+ // + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(<ZST>) }
@@ -65,17 +69,17 @@
6569
bb3: {
6670
- StorageDead(_1); // scope 0 at $DIR/inline_into_box_place.rs:+2:1: +2:2
6771
- return; // scope 0 at $DIR/inline_into_box_place.rs:+2:2: +2:2
68-
+ _1 = ShallowInitBox(move _6, std::vec::Vec<u32>); // scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
69-
+ _7 = (((_1.0: std::ptr::Unique<std::vec::Vec<u32>>).0: std::ptr::NonNull<std::vec::Vec<u32>>).0: *const std::vec::Vec<u32>); // scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
70-
+ (*_7) = move _2; // scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
72+
+ _1 = ShallowInitBox(move _6, std::vec::Vec<u32>); // scope 5 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
73+
+ _7 = (((_1.0: std::ptr::Unique<std::vec::Vec<u32>>).0: std::ptr::NonNull<std::vec::Vec<u32>>).0: *const std::vec::Vec<u32>); // scope 5 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
74+
+ (*_7) = move _2; // scope 5 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
7175
+ StorageDead(_2); // scope 0 at $DIR/inline_into_box_place.rs:+1:48: +1:49
7276
+ _0 = const (); // scope 0 at $DIR/inline_into_box_place.rs:+0:11: +2:2
7377
+ drop(_1) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/inline_into_box_place.rs:+2:1: +2:2
7478
}
7579

7680
bb4 (cleanup): {
7781
- resume; // scope 0 at $DIR/inline_into_box_place.rs:+0:1: +2:2
78-
+ drop(_2) -> bb2; // scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
82+
+ drop(_2) -> bb2; // scope 5 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
7983
}
8084
}
8185

0 commit comments

Comments
 (0)