forked from rust-lang/rust
-
-
Notifications
You must be signed in to change notification settings - Fork 0
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#66216 - wesleywiser:const_prop_codegen_impr…
…ovements, r=oli-obk [mir-opt] Handle return place in ConstProp and improve SimplifyLocals pass Temporarily rebased on top of rust-lang#66074. The top 2 commits are new. r? @oli-obk
- Loading branch information
Showing
4 changed files
with
101 additions
and
15 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
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,54 @@ | ||
// compile-flags: -C overflow-checks=on | ||
|
||
fn add() -> u32 { | ||
2 + 2 | ||
} | ||
|
||
fn main() { | ||
add(); | ||
} | ||
|
||
// END RUST SOURCE | ||
// START rustc.add.ConstProp.before.mir | ||
// fn add() -> u32 { | ||
// let mut _0: u32; | ||
// let mut _1: (u32, bool); | ||
// bb0: { | ||
// _1 = CheckedAdd(const 2u32, const 2u32); | ||
// assert(!move (_1.1: bool), "attempt to add with overflow") -> bb1; | ||
// } | ||
// bb1: { | ||
// _0 = move (_1.0: u32); | ||
// return; | ||
// } | ||
// bb2 (cleanup): { | ||
// resume; | ||
// } | ||
// } | ||
// END rustc.add.ConstProp.before.mir | ||
// START rustc.add.ConstProp.after.mir | ||
// fn add() -> u32 { | ||
// let mut _0: u32; | ||
// let mut _1: (u32, bool); | ||
// bb0: { | ||
// _1 = (const 4u32, const false); | ||
// assert(!const false, "attempt to add with overflow") -> bb1; | ||
// } | ||
// bb1: { | ||
// _0 = const 4u32; | ||
// return; | ||
// } | ||
// bb2 (cleanup): { | ||
// resume; | ||
// } | ||
// } | ||
// END rustc.add.ConstProp.after.mir | ||
// START rustc.add.PreCodegen.before.mir | ||
// fn add() -> u32 { | ||
// let mut _0: u32; | ||
// bb0: { | ||
// _0 = const 4u32; | ||
// return; | ||
// } | ||
// } | ||
// END rustc.add.PreCodegen.before.mir |