-
Notifications
You must be signed in to change notification settings - Fork 47.2k
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][hir-rewrite] Infer non-null props, destructure source #31033
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This optimization makes sense, but why not just make this part of enablePropagateScopeDepsInHIR? Given that we're already still testing this new mode, it's fine to include additional optimizations. |
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.
I would keep the optimization but make it the default for this flag, and revert the changes related to making the flag non-boolean
Makes sense! I was originally hoping that this flag would help us validate hir-rewrite of propagateScopeDeps by letting us diff |
Followup from #30894. This adds a new flagged mode `enablePropagateScopeDepsInHIR: "enabled_with_optimizations"`, under which we infer more hoistable loads: - it's always safe to evaluate loads from `props` (i.e. first parameter of a `component`) - destructuring sources are safe to evaluate loads from (e.g. given `{x} = obj`, we infer that it's safe to evaluate obj.y) - computed load sources are safe to evaluate loads from (e.g. given `arr[0]`, we can infer that it's safe to evaluate arr.length) ghstack-source-id: 32f3bb72e9f85922825579bd785d636f4ccf724d Pull Request resolved: #31033
Stack from ghstack (oldest at bottom):
Followup from #30894.
This adds a new flagged mode
enablePropagateScopeDepsInHIR: "enabled_with_optimizations"
, under which we infer more hoistable loads:props
(i.e. first parameter of acomponent
){x} = obj
, we infer that it's safe to evaluate obj.y)arr[0]
, we can infer that it's safe to evaluate arr.length)