-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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: allow reordering of loadlocal after last assignment #29668
Conversation
[ghstack-poisoned]
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
ghstack-source-id: f134097b97884f63f4f9d7c643839eb07c83deee Pull Request resolved: #29668
…ent" [ghstack-poisoned]
ghstack-source-id: 804744fb562ea3639090a0c4c6cefa871a6aa9c0 Pull Request resolved: #29668
Comparing: c4b433f...a1bd51e Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: Expand to show
|
…ent" Extends the instruction reordering from the previous PR to allow reordering LoadLocal, but only after the last assignment of the loaded variable. Thus if we have: ``` t0 = StoreLocal const x = ... t1 = LoadLocal x t2 = foo t3 = bar t1 # t1 used here ``` We know that x isn't assigned after the first instruction, and can safely reorder the loadlocal to where it's first used: ``` t0 = StoreLocal const x = ... t2 = foo t1 = LoadLocal x t3 = bar t1 ``` Note that this assumes each LoadLocal temporary is used exactly once, which we already guarantee in BuildHIR. [ghstack-poisoned]
Extends the instruction reordering from the previous PR to allow reordering LoadLocal, but only after the last assignment of the loaded variable. Thus if we have: ``` t0 = StoreLocal const x = ... t1 = LoadLocal x t2 = foo t3 = bar t1 # t1 used here ``` We know that x isn't assigned after the first instruction, and can safely reorder the loadlocal to where it's first used: ``` t0 = StoreLocal const x = ... t2 = foo t1 = LoadLocal x t3 = bar t1 ``` Note that this assumes each LoadLocal temporary is used exactly once, which we already guarantee in BuildHIR. ghstack-source-id: 804744fb562ea3639090a0c4c6cefa871a6aa9c0 Pull Request resolved: #29668
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.
Third test still failing
…ent" Extends the instruction reordering from the previous PR to allow reordering LoadLocal, but only after the last assignment of the loaded variable. Thus if we have: ``` t0 = StoreLocal const x = ... t1 = LoadLocal x t2 = foo t3 = bar t1 # t1 used here ``` We know that x isn't assigned after the first instruction, and can safely reorder the loadlocal to where it's first used: ``` t0 = StoreLocal const x = ... t2 = foo t1 = LoadLocal x t3 = bar t1 ``` Note that this assumes each LoadLocal temporary is used exactly once, which we already guarantee in BuildHIR. [ghstack-poisoned]
Extends the instruction reordering from the previous PR to allow reordering LoadLocal, but only after the last assignment of the loaded variable. Thus if we have: ``` t0 = StoreLocal const x = ... t1 = LoadLocal x t2 = foo t3 = bar t1 # t1 used here ``` We know that x isn't assigned after the first instruction, and can safely reorder the loadlocal to where it's first used: ``` t0 = StoreLocal const x = ... t2 = foo t1 = LoadLocal x t3 = bar t1 ``` Note that this assumes each LoadLocal temporary is used exactly once, which we already guarantee in BuildHIR. ghstack-source-id: 8781cb6763f87a593b92583df6a3fbc368e078e7 Pull Request resolved: #29668
t1 = $[2]; | ||
} | ||
return t1; | ||
return <>{posts}</>; |
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.
this is weird. technically correct - posts will always invalidate, so no point memoizing the jsx - but i want to double-check why the memo is getting removed here
…ent" Extends the instruction reordering from the previous PR to allow reordering LoadLocal, but only after the last assignment of the loaded variable. Thus if we have: ``` t0 = StoreLocal const x = ... t1 = LoadLocal x t2 = foo t3 = bar t1 # t1 used here ``` We know that x isn't assigned after the first instruction, and can safely reorder the loadlocal to where it's first used: ``` t0 = StoreLocal const x = ... t2 = foo t1 = LoadLocal x t3 = bar t1 ``` Note that this assumes each LoadLocal temporary is used exactly once, which we already guarantee in BuildHIR. [ghstack-poisoned]
Stack from ghstack (oldest at bottom):
Extends the instruction reordering from the previous PR to allow reordering LoadLocal, but only after the last assignment of the loaded variable.
Thus if we have:
We know that x isn't assigned after the first instruction, and can safely reorder the loadlocal to where it's first used:
Note that this assumes each LoadLocal temporary is used exactly once, which we already guarantee in BuildHIR.