-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Allow StorageDead(s) of the target block could be copied to the branching block #93987
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @matthewjasper (or someone else) soon. Please see the contribution instructions for more information. |
if !bridge_bb_statement.is_empty() { | ||
let storagedeads = bridge_bb_statement.clone(); | ||
body.basic_blocks_mut()[opt.bb_with_goto].statements.extend(storagedeads); | ||
debug!("SUCCESS: extending terminator's basic block with briding basic block."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debug!("SUCCESS: extending terminator's basic block with briding basic block."); | |
debug!("SUCCESS: extending terminator's basic block with bridging basic block."); |
src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.64bit.diff
Show resolved
Hide resolved
cc @simonvandel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change looks OK to me.
let bridge_bb_statement = &body.basic_blocks()[opt.bridge_bb].statements; | ||
if !bridge_bb_statement.is_empty() { | ||
let storagedeads = bridge_bb_statement.clone(); | ||
body.basic_blocks_mut()[opt.bb_with_goto].statements.extend(storagedeads); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let bridge_bb_statement = &body.basic_blocks()[opt.bridge_bb].statements; | |
if !bridge_bb_statement.is_empty() { | |
let storagedeads = bridge_bb_statement.clone(); | |
body.basic_blocks_mut()[opt.bb_with_goto].statements.extend(storagedeads); | |
let bridge_bb_statements = &body.basic_blocks()[opt.bridge_bb].statements; | |
if !bridge_bb_statements.is_empty() { | |
let storagedeads = bridge_bb_statements.into_iter().cloned(); | |
body.basic_blocks_mut()[opt.bb_with_goto].statements.extend(storagedeads); |
@@ -11,6 +11,24 @@ pub enum Foo { | |||
fn issue_77355_opt(num: Foo) -> u64 { | |||
if matches!(num, Foo::B | Foo::C) { 23 } else { 42 } | |||
} | |||
|
|||
// EMIT_MIR const_goto.match_nested_if.MatchBranchSimplification.diff |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// EMIT_MIR const_goto.match_nested_if.MatchBranchSimplification.diff | |
// EMIT_MIR const_goto.match_nested_if.MatchBranchSimplification.diff | |
// EMIT_MIR const_goto.match_nested_if.ConstGoto.diff |
Hi @yzwqf. Could you please address unresolved comments? |
☔ The latest upstream changes (presumably #95723) made this pull request unmergeable. Please resolve the merge conflicts. |
Ping from triage: |
@rustbot claim |
Assignment is not allowed on a closed PR. |
Just like 'FIXME(simonvandel)' says. However, intellegient mechanism is need if we care about code size.