Skip to content
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

[NFC] Add isSSA to LazyLocalGraph, and use it in OptimizeAddedConstants #6952

Merged
merged 5 commits into from
Sep 18, 2024

Conversation

kripken
Copy link
Member

@kripken kripken commented Sep 17, 2024

This makes the pass 15% faster.

bool isSSA(Index index) const {
auto iter = SSAIndexes.find(index);
if (iter == SSAIndexes.end()) {
computeSSA(index);
Copy link
Member

Choose a reason for hiding this comment

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

Might as well have computeSSA return the result so we don't need to do another lookup afterward.

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense, done. It does make it stand out from the others, but in this case the code is simpler and more efficient.

}
}
for (auto* get : flower->getsByIndex[index]) {
for (auto* set : getSets(get)) {
Copy link
Member

Choose a reason for hiding this comment

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

How can looking at the sets for a get find sets that weren't already found by looking directly at the sets above?

Copy link
Member Author

Choose a reason for hiding this comment

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

The gets may also be reading from nullptr (the value at the function entry, for which there is no LocalSet).

@kripken kripken merged commit b285448 into WebAssembly:main Sep 18, 2024
13 checks passed
@kripken kripken deleted the oac.lazy branch September 18, 2024 23:58
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.

2 participants