Add option to opt-out of optimization pass#458
Open
daniellerozenblit wants to merge 3 commits intofacebook:devfrom
Open
Add option to opt-out of optimization pass#458daniellerozenblit wants to merge 3 commits intofacebook:devfrom
daniellerozenblit wants to merge 3 commits intofacebook:devfrom
Conversation
c3380eb to
03af081
Compare
|
@daniellerozenblit has exported this pull request. If you are a Meta employee, you can view the originating Diff in D95084139. |
03af081 to
c4d237c
Compare
daniellerozenblit
added a commit
to daniellerozenblit/openzl-1
that referenced
this pull request
Mar 3, 2026
Summary: Pull Request resolved: facebook#458 # Stack The purpose of this stack is to enhance the sddl2 compiler so it can produce code compatible with the sddl2 virtual machine. # Diff This diff adds a `with_optimization()` / `with_no_optimization()` option to `Compiler::Options`, allowing callers to skip the optimizer pass entirely. - Added `bool optimize` field to `Compiler::Options` (defaults to `true` so existing behavior is unchanged). - Added `with_optimization(bool)` and `with_no_optimization()` builder methods following the existing Options pattern. - Made the optimization pass in `Compiler::compile()` conditional on this flag, passing the unoptimized AST directly to codegen when disabled. Differential Revision: D95084139
Summary: Extend the optimizer to mark ASTVar nodes when they are the final value-reference to their variable. This metadata allows (1) the optimizer to remove variable assignments if they are never referenced (2) codegen to release variable storage after its last use. Differential Revision: D94932644
Summary: # Stack The purpose of this stack is to enhance the sddl2 compiler so it can produce code compatible with the sddl2 virtual machine. # Diff This diff adds register-based variable operations (`var.store`, `var.load`, `var.clear`) to the SDDL2 VM. These enable saving and restoring intermediate values across stack operations without complex stack manipulation. - Defined `var.store` (0x0001), `var.load` (0x0002), and `var.clear` (0x0003) opcodes in the VAR family. - Implemented a 256-register `SDDL2_Var_registers` register file that tracks occupancy, so loading from an uninitialized or cleared register produces a clear error. - Implemented the three VM operations in `sddl2_vm.c` and wired them into the interpreter dispatch loop. - Regenerated assembler opcode tables and disassembly headers. - Updated assembly opcode documentation. Differential Revision: D94396847
Summary: # Stack The purpose of this stack is to enhance the sddl2 compiler so it can produce code compatible with the sddl2 virtual machine. # Diff This diff adds a `with_optimization()` / `with_no_optimization()` option to `Compiler::Options`, allowing callers to skip the optimizer pass entirely. - Added `bool optimize` field to `Compiler::Options` (defaults to `true` so existing behavior is unchanged). - Added `with_optimization(bool)` and `with_no_optimization()` builder methods following the existing Options pattern. - Made the optimization pass in `Compiler::compile()` conditional on this flag, passing the unoptimized AST directly to codegen when disabled. Differential Revision: D95084139
c4d237c to
eb529a9
Compare
daniellerozenblit
added a commit
to daniellerozenblit/openzl-1
that referenced
this pull request
Mar 3, 2026
Summary: # Stack The purpose of this stack is to enhance the sddl2 compiler so it can produce code compatible with the sddl2 virtual machine. # Diff This diff adds a `with_optimization()` / `with_no_optimization()` option to `Compiler::Options`, allowing callers to skip the optimizer pass entirely. Differential Revision: D95084139
daniellerozenblit
added a commit
to daniellerozenblit/openzl-1
that referenced
this pull request
Mar 5, 2026
Summary: # Stack The goal of this stack is to add support for variable assignments and assume operations to SDDL2. # Diff This diff adds a `with_optimization()` / `with_no_optimization()` option to `Compiler::Options`, allowing callers to skip the optimizer pass entirely. Differential Revision: D95084139
daniellerozenblit
added a commit
to daniellerozenblit/openzl-1
that referenced
this pull request
Mar 5, 2026
Summary: # Stack The goal of this stack is to add support for variable assignments and assume operations to SDDL2. # Diff This diff adds a `with_optimization()` / `with_no_optimization()` option to `Compiler::Options`, allowing callers to skip the optimizer pass entirely. Differential Revision: D95084139
daniellerozenblit
added a commit
to daniellerozenblit/openzl-1
that referenced
this pull request
Mar 5, 2026
Summary: Pull Request resolved: facebook#458 # Stack The goal of this stack is to add support for variable assignments and assume operations to SDDL2. # Diff This diff adds a `with_optimization()` / `with_no_optimization()` option to `Compiler::Options`, allowing callers to skip the optimizer pass entirely. Differential Revision: D95084139
daniellerozenblit
added a commit
to daniellerozenblit/openzl-1
that referenced
this pull request
Mar 5, 2026
Summary: # Stack The goal of this stack is to add support for variable assignments and assume operations to SDDL2. # Diff This diff adds a `with_optimization()` / `with_no_optimization()` option to `Compiler::Options`, allowing callers to skip the optimizer pass entirely. Differential Revision: D95084139
daniellerozenblit
added a commit
to daniellerozenblit/openzl-1
that referenced
this pull request
Mar 5, 2026
Summary: # Stack The goal of this stack is to add support for variable assignments and assume operations to SDDL2. # Diff This diff adds a `with_optimization()` / `with_no_optimization()` option to `Compiler::Options`, allowing callers to skip the optimizer pass entirely. Differential Revision: D95084139
daniellerozenblit
added a commit
to daniellerozenblit/openzl-1
that referenced
this pull request
Mar 5, 2026
Summary: Pull Request resolved: facebook#458 # Stack The goal of this stack is to add support for variable assignments and assume operations to SDDL2. # Diff This diff adds a `with_optimization()` / `with_no_optimization()` option to `Compiler::Options`, allowing callers to skip the optimizer pass entirely. Differential Revision: D95084139
daniellerozenblit
added a commit
to daniellerozenblit/openzl-1
that referenced
this pull request
Mar 5, 2026
Summary: Pull Request resolved: facebook#458 # Stack The goal of this stack is to add support for variable assignments and assume operations to SDDL2. # Diff This diff adds a `with_optimization()` / `with_no_optimization()` option to `Compiler::Options`, allowing callers to skip the optimizer pass entirely. Differential Revision: D95084139
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.
Summary:
Stack
The purpose of this stack is to enhance the sddl2 compiler so it can produce code compatible with the sddl2 virtual machine.
Diff
This diff adds a
with_optimization()/with_no_optimization()option toCompiler::Options, allowing callers to skip the optimizer pass entirely.bool optimizefield toCompiler::Options(defaults totrueso existing behavior is unchanged).with_optimization(bool)andwith_no_optimization()builder methods following the existing Options pattern.Compiler::compile()conditional on this flag, passing the unoptimized AST directly to codegen when disabled.Differential Revision: D95084139