-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify some of the copy-like forms
- Loading branch information
Showing
13 changed files
with
663 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
tests/mir-opt/instsimplify/copy_like.all_copy.InstSimplify-after-simplifycfg.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
- // MIR for `all_copy` before InstSimplify-after-simplifycfg | ||
+ // MIR for `all_copy` after InstSimplify-after-simplifycfg | ||
|
||
fn all_copy(_1: &AllCopy) -> AllCopy { | ||
debug v => _1; | ||
let mut _0: AllCopy; | ||
let _2: i32; | ||
let mut _5: i32; | ||
let mut _6: u64; | ||
let mut _7: [i8; 3]; | ||
scope 1 { | ||
debug a => _2; | ||
let _3: u64; | ||
scope 2 { | ||
debug b => _3; | ||
let _4: [i8; 3]; | ||
scope 3 { | ||
debug c => _4; | ||
} | ||
} | ||
} | ||
|
||
bb0: { | ||
StorageLive(_2); | ||
_2 = ((*_1).0: i32); | ||
StorageLive(_3); | ||
_3 = ((*_1).1: u64); | ||
StorageLive(_4); | ||
_4 = ((*_1).2: [i8; 3]); | ||
StorageLive(_5); | ||
_5 = _2; | ||
StorageLive(_6); | ||
_6 = _3; | ||
StorageLive(_7); | ||
_7 = _4; | ||
- _0 = AllCopy { a: move _5, b: move _6, c: move _7 }; | ||
+ _0 = (*_1); | ||
StorageDead(_7); | ||
StorageDead(_6); | ||
StorageDead(_5); | ||
StorageDead(_4); | ||
StorageDead(_3); | ||
StorageDead(_2); | ||
return; | ||
} | ||
} | ||
|
46 changes: 46 additions & 0 deletions
46
...ir-opt/instsimplify/copy_like.all_copy_different_type.InstSimplify-after-simplifycfg.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
- // MIR for `all_copy_different_type` before InstSimplify-after-simplifycfg | ||
+ // MIR for `all_copy_different_type` after InstSimplify-after-simplifycfg | ||
|
||
fn all_copy_different_type(_1: &AllCopy) -> AllCopy2 { | ||
debug v => _1; | ||
let mut _0: AllCopy2; | ||
let _2: i32; | ||
let mut _5: i32; | ||
let mut _6: u64; | ||
let mut _7: [i8; 3]; | ||
scope 1 { | ||
debug a => _2; | ||
let _3: u64; | ||
scope 2 { | ||
debug b => _3; | ||
let _4: [i8; 3]; | ||
scope 3 { | ||
debug c => _4; | ||
} | ||
} | ||
} | ||
|
||
bb0: { | ||
StorageLive(_2); | ||
_2 = ((*_1).0: i32); | ||
StorageLive(_3); | ||
_3 = ((*_1).1: u64); | ||
StorageLive(_4); | ||
_4 = ((*_1).2: [i8; 3]); | ||
StorageLive(_5); | ||
_5 = _2; | ||
StorageLive(_6); | ||
_6 = _3; | ||
StorageLive(_7); | ||
_7 = _4; | ||
_0 = AllCopy2 { a: move _5, b: move _6, c: move _7 }; | ||
StorageDead(_7); | ||
StorageDead(_6); | ||
StorageDead(_5); | ||
StorageDead(_4); | ||
StorageDead(_3); | ||
StorageDead(_2); | ||
return; | ||
} | ||
} | ||
|
47 changes: 47 additions & 0 deletions
47
...s/mir-opt/instsimplify/copy_like.all_copy_has_changed.InstSimplify-after-simplifycfg.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
- // MIR for `all_copy_has_changed` before InstSimplify-after-simplifycfg | ||
+ // MIR for `all_copy_has_changed` after InstSimplify-after-simplifycfg | ||
|
||
fn all_copy_has_changed(_1: &mut AllCopy) -> AllCopy { | ||
debug v => _1; | ||
let mut _0: AllCopy; | ||
let _2: i32; | ||
let mut _5: i32; | ||
let mut _6: u64; | ||
let mut _7: [i8; 3]; | ||
scope 1 { | ||
debug a => _2; | ||
let _3: u64; | ||
scope 2 { | ||
debug b => _3; | ||
let _4: [i8; 3]; | ||
scope 3 { | ||
debug c => _4; | ||
} | ||
} | ||
} | ||
|
||
bb0: { | ||
StorageLive(_2); | ||
_2 = ((*_1).0: i32); | ||
StorageLive(_3); | ||
_3 = ((*_1).1: u64); | ||
StorageLive(_4); | ||
_4 = ((*_1).2: [i8; 3]); | ||
((*_1).0: i32) = const 1_i32; | ||
StorageLive(_5); | ||
_5 = _2; | ||
StorageLive(_6); | ||
_6 = _3; | ||
StorageLive(_7); | ||
_7 = _4; | ||
_0 = AllCopy { a: move _5, b: move _6, c: move _7 }; | ||
StorageDead(_7); | ||
StorageDead(_6); | ||
StorageDead(_5); | ||
StorageDead(_4); | ||
StorageDead(_3); | ||
StorageDead(_2); | ||
return; | ||
} | ||
} | ||
|
46 changes: 46 additions & 0 deletions
46
tests/mir-opt/instsimplify/copy_like.all_copy_move.InstSimplify-after-simplifycfg.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
- // MIR for `all_copy_move` before InstSimplify-after-simplifycfg | ||
+ // MIR for `all_copy_move` after InstSimplify-after-simplifycfg | ||
|
||
fn all_copy_move(_1: AllCopy) -> AllCopy { | ||
debug v => _1; | ||
let mut _0: AllCopy; | ||
let _2: i32; | ||
let mut _5: i32; | ||
let mut _6: u64; | ||
let mut _7: [i8; 3]; | ||
scope 1 { | ||
debug a => _2; | ||
let _3: u64; | ||
scope 2 { | ||
debug b => _3; | ||
let _4: [i8; 3]; | ||
scope 3 { | ||
debug c => _4; | ||
} | ||
} | ||
} | ||
|
||
bb0: { | ||
StorageLive(_2); | ||
_2 = (_1.0: i32); | ||
StorageLive(_3); | ||
_3 = (_1.1: u64); | ||
StorageLive(_4); | ||
_4 = (_1.2: [i8; 3]); | ||
StorageLive(_5); | ||
_5 = _2; | ||
StorageLive(_6); | ||
_6 = _3; | ||
StorageLive(_7); | ||
_7 = _4; | ||
_0 = AllCopy { a: move _5, b: move _6, c: move _7 }; | ||
StorageDead(_7); | ||
StorageDead(_6); | ||
StorageDead(_5); | ||
StorageDead(_4); | ||
StorageDead(_3); | ||
StorageDead(_2); | ||
return; | ||
} | ||
} | ||
|
68 changes: 68 additions & 0 deletions
68
tests/mir-opt/instsimplify/copy_like.all_copy_ret_2.InstSimplify-after-simplifycfg.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
- // MIR for `all_copy_ret_2` before InstSimplify-after-simplifycfg | ||
+ // MIR for `all_copy_ret_2` after InstSimplify-after-simplifycfg | ||
|
||
fn all_copy_ret_2(_1: &AllCopy) -> (AllCopy, AllCopy) { | ||
debug v => _1; | ||
let mut _0: (AllCopy, AllCopy); | ||
let _2: i32; | ||
let mut _5: AllCopy; | ||
let mut _6: i32; | ||
let mut _7: u64; | ||
let mut _8: [i8; 3]; | ||
let mut _9: AllCopy; | ||
let mut _10: i32; | ||
let mut _11: u64; | ||
let mut _12: [i8; 3]; | ||
scope 1 { | ||
debug a => _2; | ||
let _3: u64; | ||
scope 2 { | ||
debug b => _3; | ||
let _4: [i8; 3]; | ||
scope 3 { | ||
debug c => _4; | ||
} | ||
} | ||
} | ||
|
||
bb0: { | ||
StorageLive(_2); | ||
_2 = ((*_1).0: i32); | ||
StorageLive(_3); | ||
_3 = ((*_1).1: u64); | ||
StorageLive(_4); | ||
_4 = ((*_1).2: [i8; 3]); | ||
StorageLive(_5); | ||
StorageLive(_6); | ||
_6 = _2; | ||
StorageLive(_7); | ||
_7 = _3; | ||
StorageLive(_8); | ||
_8 = _4; | ||
- _5 = AllCopy { a: move _6, b: move _7, c: move _8 }; | ||
+ _5 = (*_1); | ||
StorageDead(_8); | ||
StorageDead(_7); | ||
StorageDead(_6); | ||
StorageLive(_9); | ||
StorageLive(_10); | ||
_10 = _2; | ||
StorageLive(_11); | ||
_11 = _3; | ||
StorageLive(_12); | ||
_12 = _4; | ||
- _9 = AllCopy { a: move _10, b: move _11, c: move _12 }; | ||
+ _9 = (*_1); | ||
StorageDead(_12); | ||
StorageDead(_11); | ||
StorageDead(_10); | ||
_0 = (move _5, move _9); | ||
StorageDead(_9); | ||
StorageDead(_5); | ||
StorageDead(_4); | ||
StorageDead(_3); | ||
StorageDead(_2); | ||
return; | ||
} | ||
} | ||
|
53 changes: 53 additions & 0 deletions
53
...s/mir-opt/instsimplify/copy_like.all_copy_use_changed.InstSimplify-after-simplifycfg.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
- // MIR for `all_copy_use_changed` before InstSimplify-after-simplifycfg | ||
+ // MIR for `all_copy_use_changed` after InstSimplify-after-simplifycfg | ||
|
||
fn all_copy_use_changed(_1: &mut AllCopy) -> AllCopy { | ||
debug v => _1; | ||
let mut _0: AllCopy; | ||
let mut _2: i32; | ||
let mut _3: i32; | ||
let mut _6: i32; | ||
let mut _7: u64; | ||
let mut _8: [i8; 3]; | ||
scope 1 { | ||
debug a => _2; | ||
let _4: u64; | ||
scope 2 { | ||
debug b => _4; | ||
let _5: [i8; 3]; | ||
scope 3 { | ||
debug c => _5; | ||
} | ||
} | ||
} | ||
|
||
bb0: { | ||
StorageLive(_2); | ||
_2 = ((*_1).0: i32); | ||
((*_1).0: i32) = const 1_i32; | ||
StorageLive(_3); | ||
_3 = ((*_1).0: i32); | ||
_2 = move _3; | ||
StorageDead(_3); | ||
StorageLive(_4); | ||
_4 = ((*_1).1: u64); | ||
StorageLive(_5); | ||
_5 = ((*_1).2: [i8; 3]); | ||
StorageLive(_6); | ||
_6 = _2; | ||
StorageLive(_7); | ||
_7 = _4; | ||
StorageLive(_8); | ||
_8 = _5; | ||
- _0 = AllCopy { a: move _6, b: move _7, c: move _8 }; | ||
+ _0 = (*_1); | ||
StorageDead(_8); | ||
StorageDead(_7); | ||
StorageDead(_6); | ||
StorageDead(_5); | ||
StorageDead(_4); | ||
StorageDead(_2); | ||
return; | ||
} | ||
} | ||
|
52 changes: 52 additions & 0 deletions
52
...mir-opt/instsimplify/copy_like.all_copy_use_changed_2.InstSimplify-after-simplifycfg.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
- // MIR for `all_copy_use_changed_2` before InstSimplify-after-simplifycfg | ||
+ // MIR for `all_copy_use_changed_2` after InstSimplify-after-simplifycfg | ||
|
||
fn all_copy_use_changed_2(_1: &mut AllCopy) -> AllCopy { | ||
debug v => _1; | ||
let mut _0: AllCopy; | ||
let mut _2: i32; | ||
let mut _5: i32; | ||
let mut _6: i32; | ||
let mut _7: u64; | ||
let mut _8: [i8; 3]; | ||
scope 1 { | ||
debug a => _2; | ||
let _3: u64; | ||
scope 2 { | ||
debug b => _3; | ||
let _4: [i8; 3]; | ||
scope 3 { | ||
debug c => _4; | ||
} | ||
} | ||
} | ||
|
||
bb0: { | ||
StorageLive(_2); | ||
_2 = ((*_1).0: i32); | ||
StorageLive(_3); | ||
_3 = ((*_1).1: u64); | ||
StorageLive(_4); | ||
_4 = ((*_1).2: [i8; 3]); | ||
((*_1).0: i32) = const 1_i32; | ||
StorageLive(_5); | ||
_5 = ((*_1).0: i32); | ||
_2 = move _5; | ||
StorageDead(_5); | ||
StorageLive(_6); | ||
_6 = _2; | ||
StorageLive(_7); | ||
_7 = _3; | ||
StorageLive(_8); | ||
_8 = _4; | ||
_0 = AllCopy { a: move _6, b: move _7, c: move _8 }; | ||
StorageDead(_8); | ||
StorageDead(_7); | ||
StorageDead(_6); | ||
StorageDead(_4); | ||
StorageDead(_3); | ||
StorageDead(_2); | ||
return; | ||
} | ||
} | ||
|
Oops, something went wrong.