-
Notifications
You must be signed in to change notification settings - Fork 49.9k
[compiler] Bail out and log calls that likely have side effects #30572
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
[ghstack-poisoned]
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…fects" [ghstack-poisoned]
…fects" [ghstack-poisoned]
…fects" [ghstack-poisoned]
…fects" [ghstack-poisoned]
…fects" [ghstack-poisoned]
| let usedIdentifiers = new Set<IdentifierId>(); | ||
| let names = new Map<IdentifierId, string | undefined>(); | ||
|
|
||
| function visitFunction(fn: HIRFunction): void { |
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.
If i'm understanding correctly, this seems like it's redoing part of the analysis of DCE to figure out what's used or not. That logic is pretty tricky, i'm wondering if makes sense for DCE record information on unused instructions or produce a Set of unused values? I don't love that either though, just a thought.
josephsavona
left a comment
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.
Per offline discussion looks like this has a lot of of false positives, here's one example:
export default function MyApp() {
const fn = () => {
sideEffect();
}
return useFoo(fn);
}…fects" [ghstack-poisoned]
…fects" [ghstack-poisoned]
…ed to hooks and in return values" In investigating the results of #30572 we discovered a lot of false positives from when functions containing possibly-effectful calls were returned from hooks or passed into hooks. This corresponds to similar issues for GlobalMutations, because the effectful call work uses the same FunctionEffect infra. This fixes the infra to allow GlobalMutation function effects in return and throw terminals and in all hook arguments. [ghstack-poisoned]
|
This pull request has been automatically marked as stale. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated. |
|
Closing this pull request after a prolonged period of inactivity. If this issue is still present in the latest release, please ask for this pull request to be reopened. Thank you! |
Stack from ghstack (oldest at bottom):