forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#107270 - cjgillot:remove-zst, r=oli-obk
Replace ZST operands and debuginfo by constants. This is work that ConstProp will not have to do. Split from rust-lang#107267
- Loading branch information
Showing
29 changed files
with
304 additions
and
183 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
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
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
79 changes: 79 additions & 0 deletions
79
tests/mir-opt/const_prop/invalid_constant.main.RemoveZsts.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,79 @@ | ||
- // MIR for `main` before RemoveZsts | ||
+ // MIR for `main` after RemoveZsts | ||
|
||
fn main() -> () { | ||
let mut _0: (); // return place in scope 0 at $DIR/invalid_constant.rs:+0:11: +0:11 | ||
let _1: char; // in scope 0 at $DIR/invalid_constant.rs:+6:9: +6:22 | ||
let mut _2: main::InvalidChar; // in scope 0 at $DIR/invalid_constant.rs:+6:34: +6:63 | ||
let mut _4: E; // in scope 0 at $DIR/invalid_constant.rs:+13:25: +13:59 | ||
let mut _5: main::InvalidTag; // in scope 0 at $DIR/invalid_constant.rs:+13:34: +13:55 | ||
let mut _7: Empty; // in scope 0 at $DIR/invalid_constant.rs:+20:35: +20:73 | ||
let mut _8: main::NoVariants; // in scope 0 at $DIR/invalid_constant.rs:+20:44: +20:65 | ||
scope 1 { | ||
debug _invalid_char => _1; // in scope 1 at $DIR/invalid_constant.rs:+6:9: +6:22 | ||
let _3: [E; 1]; // in scope 1 at $DIR/invalid_constant.rs:+13:9: +13:21 | ||
scope 3 { | ||
debug _invalid_tag => _3; // in scope 3 at $DIR/invalid_constant.rs:+13:9: +13:21 | ||
let _6: [Empty; 1]; // in scope 3 at $DIR/invalid_constant.rs:+20:9: +20:31 | ||
scope 5 { | ||
- debug _enum_without_variants => _6; // in scope 5 at $DIR/invalid_constant.rs:+20:9: +20:31 | ||
+ debug _enum_without_variants => const [ZeroSized: Empty]; // in scope 5 at $DIR/invalid_constant.rs:+20:9: +20:31 | ||
let _9: main::Str<"���">; // in scope 5 at $DIR/invalid_constant.rs:+24:9: +24:22 | ||
scope 7 { | ||
- debug _non_utf8_str => _9; // in scope 7 at $DIR/invalid_constant.rs:+24:9: +24:22 | ||
+ debug _non_utf8_str => const Str::<"���">; // in scope 7 at $DIR/invalid_constant.rs:+24:9: +24:22 | ||
} | ||
} | ||
scope 6 { | ||
} | ||
} | ||
scope 4 { | ||
} | ||
} | ||
scope 2 { | ||
} | ||
|
||
bb0: { | ||
StorageLive(_1); // scope 0 at $DIR/invalid_constant.rs:+6:9: +6:22 | ||
StorageLive(_2); // scope 2 at $DIR/invalid_constant.rs:+6:34: +6:63 | ||
Deinit(_2); // scope 2 at $DIR/invalid_constant.rs:+6:34: +6:63 | ||
(_2.0: u32) = const 1114113_u32; // scope 2 at $DIR/invalid_constant.rs:+6:34: +6:63 | ||
_1 = (_2.1: char); // scope 2 at $DIR/invalid_constant.rs:+6:34: +6:67 | ||
StorageDead(_2); // scope 0 at $DIR/invalid_constant.rs:+6:69: +6:70 | ||
StorageLive(_3); // scope 1 at $DIR/invalid_constant.rs:+13:9: +13:21 | ||
StorageLive(_4); // scope 1 at $DIR/invalid_constant.rs:+13:25: +13:59 | ||
StorageLive(_5); // scope 4 at $DIR/invalid_constant.rs:+13:34: +13:55 | ||
Deinit(_5); // scope 4 at $DIR/invalid_constant.rs:+13:34: +13:55 | ||
(_5.0: u32) = const 4_u32; // scope 4 at $DIR/invalid_constant.rs:+13:34: +13:55 | ||
_4 = (_5.1: E); // scope 4 at $DIR/invalid_constant.rs:+13:34: +13:57 | ||
_3 = [move _4]; // scope 1 at $DIR/invalid_constant.rs:+13:24: +13:60 | ||
StorageDead(_4); // scope 1 at $DIR/invalid_constant.rs:+13:59: +13:60 | ||
StorageDead(_5); // scope 1 at $DIR/invalid_constant.rs:+13:60: +13:61 | ||
- StorageLive(_6); // scope 3 at $DIR/invalid_constant.rs:+20:9: +20:31 | ||
- StorageLive(_7); // scope 3 at $DIR/invalid_constant.rs:+20:35: +20:73 | ||
+ nop; // scope 3 at $DIR/invalid_constant.rs:+20:9: +20:31 | ||
+ nop; // scope 3 at $DIR/invalid_constant.rs:+20:35: +20:73 | ||
StorageLive(_8); // scope 6 at $DIR/invalid_constant.rs:+20:44: +20:65 | ||
Deinit(_8); // scope 6 at $DIR/invalid_constant.rs:+20:44: +20:65 | ||
(_8.0: u32) = const 0_u32; // scope 6 at $DIR/invalid_constant.rs:+20:44: +20:65 | ||
- _7 = (_8.1: Empty); // scope 6 at $DIR/invalid_constant.rs:+20:44: +20:71 | ||
- _6 = [move _7]; // scope 3 at $DIR/invalid_constant.rs:+20:34: +20:74 | ||
- StorageDead(_7); // scope 3 at $DIR/invalid_constant.rs:+20:73: +20:74 | ||
+ nop; // scope 6 at $DIR/invalid_constant.rs:+20:44: +20:71 | ||
+ nop; // scope 3 at $DIR/invalid_constant.rs:+20:34: +20:74 | ||
+ nop; // scope 3 at $DIR/invalid_constant.rs:+20:73: +20:74 | ||
StorageDead(_8); // scope 3 at $DIR/invalid_constant.rs:+20:74: +20:75 | ||
- StorageLive(_9); // scope 5 at $DIR/invalid_constant.rs:+24:9: +24:22 | ||
- _0 = const (); // scope 0 at $DIR/invalid_constant.rs:+0:11: +27:2 | ||
- StorageDead(_9); // scope 5 at $DIR/invalid_constant.rs:+27:1: +27:2 | ||
- StorageDead(_6); // scope 3 at $DIR/invalid_constant.rs:+27:1: +27:2 | ||
+ nop; // scope 5 at $DIR/invalid_constant.rs:+24:9: +24:22 | ||
+ nop; // scope 0 at $DIR/invalid_constant.rs:+0:11: +27:2 | ||
+ nop; // scope 5 at $DIR/invalid_constant.rs:+27:1: +27:2 | ||
+ nop; // scope 3 at $DIR/invalid_constant.rs:+27:1: +27:2 | ||
StorageDead(_3); // scope 1 at $DIR/invalid_constant.rs:+27:1: +27:2 | ||
StorageDead(_1); // scope 0 at $DIR/invalid_constant.rs:+27:1: +27:2 | ||
return; // scope 0 at $DIR/invalid_constant.rs:+27:2: +27:2 | ||
} | ||
} | ||
|
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
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
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
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
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
Oops, something went wrong.