Skip to content

Delete Dead Code from DI #16849

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

Merged

Conversation

gottesmm
Copy link
Contributor

Just deleting dead code. DefiniteInitialization has the property that MemoryInst is always a MarkUninitializedInst. So anything that will never run if MemoryInst is a MarkUninitializedInst is trivially dead.

gottesmm added 3 commits May 25, 2018 13:17
…I test by moving raw sil lowering tests => raw_sil_inst_lowering.sil.

rdar://i0332620
collectRetainCountInfo bails early if our memory instruction is a
mark_uninitialized... but our instruction is always a mark_uninitialized... so
this code is dead.

The origin of this code is from the flattening of the control flow in DI that
was necessary to be done to "extract" predictable mem opts from it.

rdar://40332620
…ore dead code and conditional checks.

rdar://40332620
@gottesmm
Copy link
Contributor Author

This is the dead code removal moved out of #16844.

@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

}

auto *MUI = cast<MarkUninitializedInst>(MemoryInst);
auto *MUI = MemoryInst;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove MUI since you never re-assign it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

@swift-ci swift-ci merged commit 7ec8133 into swiftlang:master May 25, 2018
@gottesmm gottesmm deleted the pr-537fd8c1a68c98da147241a4e7e958a4dfe1752d branch May 25, 2018 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants