-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[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
[semantic-arc-opts] Add a worklist. #26877
Conversation
@swift-ci test and merge |
9c6120c
to
3029054
Compare
@swift-ci test and merge |
4 similar comments
@swift-ci test and merge |
@swift-ci test and merge |
@swift-ci test and merge |
@swift-ci test and merge |
@swift-ci test os x platform |
1 similar comment
@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.
3029054
to
d8870fc
Compare
@swift-ci test and merge |
5 similar comments
@swift-ci test and merge |
@swift-ci test and merge |
@swift-ci test and merge |
@swift-ci test and merge |
@swift-ci test and merge |
// the instruction). | ||
if (auto *defInst = next->getDefiningInstruction()) { | ||
if (isInstructionTriviallyDead(defInst)) { | ||
madeChange = true; |
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.
It looks to me like all this should be factored with the normal eraseAndRAUWSingleValueInstruction
path
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.