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

[compiler] Visit nested scopes in pruned scopes in PromoteUsedTemporaries #30537

Merged
merged 1 commit into from
Jul 30, 2024

Conversation

poteto
Copy link
Member

@poteto poteto commented Jul 30, 2024

Stack from ghstack (oldest at bottom):

While debugging #30536 I happened to notice that the bug only reproduced
when there was interleaving scopes, and observed that an unpruned scope
nested inside of a pruned one was not being visited by
CollectPromotableTemporaries, which keeps track of which identifiers
should be promoted later. Therefore when actually promoting temporaries
we were skipping over the identifiers in children of pruned scopes

[ghstack-poisoned]
Copy link

vercel bot commented Jul 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-compiler-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 30, 2024 8:52pm

poteto added a commit that referenced this pull request Jul 30, 2024
PromoteUsedTemporaries

While debugging #30536 I happened to notice that the bug only reproduced
when there was interleaving scopes, and observed that an unpruned scope
nested inside of a pruned one was not being visited by
CollectPromotableTemporaries, which keeps track of which identifiers
should be promoted later. Therefore when actually promoting temporaries
we were skipping over the identifiers in children of pruned scopes

ghstack-source-id: d805f62f22fda04beedb6c7063312451f36d678c
Pull Request resolved: #30537
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Jul 30, 2024
@poteto poteto changed the title [compiler] Visit nested scopes in pruned scopes in [compiler] Visit nested scopes in pruned scopes in PromoteUsedTemporaries Jul 30, 2024
Copy link
Contributor

@mofeiZ mofeiZ left a comment

Choose a reason for hiding this comment

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

Nice!! It looks like RenameVariables already visits instructions within pruned scopes, so this seems to be the only edge case

poteto added a commit that referenced this pull request Jul 30, 2024
…ries

While debugging #30536 I happened to notice that the bug only reproduced
when there was interleaving scopes, and observed that an unpruned scope
nested inside of a pruned one was not being visited by
CollectPromotableTemporaries, which keeps track of which identifiers
should be promoted later. Therefore when actually promoting temporaries
we were skipping over the identifiers in children of pruned scopes

ghstack-source-id: d805f62f22fda04beedb6c7063312451f36d678c
Pull Request resolved: #30537
Copy link
Contributor

@josephsavona josephsavona left a comment

Choose a reason for hiding this comment

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

oops, nice catch!

@poteto poteto merged commit fc239eb into gh/poteto/1/base Jul 30, 2024
19 checks passed
poteto added a commit that referenced this pull request Jul 30, 2024
…ries

While debugging #30536 I happened to notice that the bug only reproduced
when there was interleaving scopes, and observed that an unpruned scope
nested inside of a pruned one was not being visited by
CollectPromotableTemporaries, which keeps track of which identifiers
should be promoted later. Therefore when actually promoting temporaries
we were skipping over the identifiers in children of pruned scopes

ghstack-source-id: d805f62f22fda04beedb6c7063312451f36d678c
Pull Request resolved: #30537
@poteto poteto deleted the gh/poteto/1/head branch July 30, 2024 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants