[compiler] Allow reordering more types of instructions - #30653
Closed
josephsavona wants to merge 3 commits into
Closed
[compiler] Allow reordering more types of instructions#30653josephsavona wants to merge 3 commits into
josephsavona wants to merge 3 commits into
Conversation
Updates InstructionReordering (still off by default) to allow reordering more types of instructions: * ArrayExpression and ObjectExpression can be reordered if they have no items * PropertyLoad can be reordered if the object is not mutable at the given instruction, and if the object is single-use (this avoid reordering in cases where the propertyload is part of a methodcall) * LoadLocal can be reordered if the temporary is used once (ie not as part of a methodcall) and if the value being loaded is not subsequently reassigned * StoreLocal can be reordered if the variable being assigned is only used once, and the rvalue is not later reassigned. We can further relax these rules but already it improves compilation output quite a bit, per the fixtures. [ghstack-poisoned]
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
josephsavona
added a commit
that referenced
this pull request
Aug 9, 2024
Updates InstructionReordering (still off by default) to allow reordering more types of instructions: * ArrayExpression and ObjectExpression can be reordered if they have no items * PropertyLoad can be reordered if the object is not mutable at the given instruction, and if the object is single-use (this avoid reordering in cases where the propertyload is part of a methodcall) * LoadLocal can be reordered if the temporary is used once (ie not as part of a methodcall) and if the value being loaded is not subsequently reassigned * StoreLocal can be reordered if the variable being assigned is only used once, and the rvalue is not later reassigned. We can further relax these rules but already it improves compilation output quite a bit, per the fixtures. ghstack-source-id: 22422b5 Pull Request resolved: #30653
Updates InstructionReordering (still off by default) to allow reordering more types of instructions: * ArrayExpression and ObjectExpression can be reordered if they have no items * PropertyLoad can be reordered if the object is not mutable at the given instruction, and if the object is single-use (this avoid reordering in cases where the propertyload is part of a methodcall) * LoadLocal can be reordered if the temporary is used once (ie not as part of a methodcall) and if the value being loaded is not subsequently reassigned * StoreLocal can be reordered if the variable being assigned is only used once, and the rvalue is not later reassigned. We can further relax these rules but already it improves compilation output quite a bit, per the fixtures. [ghstack-poisoned]
josephsavona
added a commit
that referenced
this pull request
Aug 9, 2024
Updates InstructionReordering (still off by default) to allow reordering more types of instructions: * ArrayExpression and ObjectExpression can be reordered if they have no items * PropertyLoad can be reordered if the object is not mutable at the given instruction, and if the object is single-use (this avoid reordering in cases where the propertyload is part of a methodcall) * LoadLocal can be reordered if the temporary is used once (ie not as part of a methodcall) and if the value being loaded is not subsequently reassigned * StoreLocal can be reordered if the variable being assigned is only used once, and the rvalue is not later reassigned. We can further relax these rules but already it improves compilation output quite a bit, per the fixtures. ghstack-source-id: 1b42599 Pull Request resolved: #30653
Updates InstructionReordering (still off by default) to allow reordering more types of instructions: * ArrayExpression and ObjectExpression can be reordered if they have no items * PropertyLoad can be reordered if the object is not mutable at the given instruction, and if the object is single-use (this avoid reordering in cases where the propertyload is part of a methodcall) * LoadLocal can be reordered if the temporary is used once (ie not as part of a methodcall) and if the value being loaded is not subsequently reassigned * StoreLocal can be reordered if the variable being assigned is only used once, and the rvalue is not later reassigned. We can further relax these rules but already it improves compilation output quite a bit, per the fixtures. [ghstack-poisoned]
josephsavona
added a commit
that referenced
this pull request
Aug 9, 2024
Updates InstructionReordering (still off by default) to allow reordering more types of instructions: * ArrayExpression and ObjectExpression can be reordered if they have no items * PropertyLoad can be reordered if the object is not mutable at the given instruction, and if the object is single-use (this avoid reordering in cases where the propertyload is part of a methodcall) * LoadLocal can be reordered if the temporary is used once (ie not as part of a methodcall) and if the value being loaded is not subsequently reassigned * StoreLocal can be reordered if the variable being assigned is only used once, and the rvalue is not later reassigned. We can further relax these rules but already it improves compilation output quite a bit, per the fixtures. ghstack-source-id: 896807c Pull Request resolved: #30653
Contributor
|
Mostly seems good, but consider this case (link is to this PR's playground). Unclear to me what's going wrong here--this example passes on master, and here it doesn't pass for very unclear reasons (bad error message at the least). In general I was trying to make sure that the logic for LoadLocal here is robust enough to handle a reassignment in a nested scope--maybe that's part of what's going wrong with this example? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack from ghstack (oldest at bottom):
Updates InstructionReordering (still off by default) to allow reordering more types of instructions:
We can further relax these rules but already it improves compilation output quite a bit, per the fixtures.