Skip to content

[semantic-arc-opts] Add a worklist. #26877

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

gottesmm
Copy link
Contributor

We first build up the worklist by applying our visitor to the CFG via a simple
instruction walk. During this walk, we know that we will only ever modify
instructions that are dominated by the visited instruction since we do not look
through basic block arguments.

Then once we have finished traversing the CFG, optimizing and gathering
opportunities, we drain the worklist. This is eventually where we should process
block arguments that we may be able to optimize.

@gottesmm gottesmm requested a review from jckarter August 27, 2019 19:31
@gottesmm
Copy link
Contributor Author

@swift-ci test and merge

@gottesmm gottesmm requested a review from atrick August 27, 2019 19:38
@gottesmm gottesmm force-pushed the pr-283cbb40e1d2bae71f67901d5f94b51e04227029 branch from 9c6120c to 3029054 Compare August 27, 2019 19:59
@gottesmm
Copy link
Contributor Author

@swift-ci test and merge

4 similar comments
@gottesmm
Copy link
Contributor Author

@swift-ci test and merge

@gottesmm
Copy link
Contributor Author

@swift-ci test and merge

@gottesmm
Copy link
Contributor Author

@swift-ci test and merge

@gottesmm
Copy link
Contributor Author

@swift-ci test and merge

@gottesmm
Copy link
Contributor Author

@swift-ci test os x platform

1 similar comment
@gottesmm
Copy link
Contributor Author

@swift-ci test os x platform

We first build up the worklist by applying our visitor to the CFG via a simple
instruction walk. During this walk, we know that we will only ever modify
instructions that are dominated by the visited instruction since we do not look
through basic block arguments.

Then once we have finished traversing the CFG, optimizing and gathering
opportunities, we drain the worklist. This is eventually where we should process
block arguments that we may be able to optimize.
@gottesmm gottesmm force-pushed the pr-283cbb40e1d2bae71f67901d5f94b51e04227029 branch from 3029054 to d8870fc Compare August 27, 2019 21:45
@gottesmm
Copy link
Contributor Author

@swift-ci test and merge

5 similar comments
@gottesmm
Copy link
Contributor Author

@swift-ci test and merge

@gottesmm
Copy link
Contributor Author

@swift-ci test and merge

@gottesmm
Copy link
Contributor Author

@swift-ci test and merge

@gottesmm
Copy link
Contributor Author

@swift-ci test and merge

@gottesmm
Copy link
Contributor Author

@swift-ci test and merge

// the instruction).
if (auto *defInst = next->getDefiningInstruction()) {
if (isInstructionTriviallyDead(defInst)) {
madeChange = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks to me like all this should be factored with the normal eraseAndRAUWSingleValueInstruction path

@swift-ci swift-ci merged commit 870daf3 into swiftlang:master Aug 28, 2019
@gottesmm gottesmm deleted the pr-283cbb40e1d2bae71f67901d5f94b51e04227029 branch August 28, 2019 01:05
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