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] Avoid collecting unnecessary parents in OptimizeAddedConstants #6953

Merged
merged 2 commits into from
Sep 18, 2024

Conversation

kripken
Copy link
Member

@kripken kripken commented Sep 17, 2024

This makes the pass 20% faster.

struct Inner : public ExpressionStackWalker<Inner> {
void visitLocalGet(LocalGet* curr) { parentMap[curr] = getParent(); }

std::map<Expression*, Expression*> parentMap;
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this can be std::unordered_map. I'd be curious if that makes a measurable difference.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea, it does help by 1%. Added.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll separately see if the other class is likewise sped up with such a map.

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