SSA CFG: stack to memory spilling#16767
Open
clonker wants to merge 6 commits into
Open
Conversation
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.
Implements stack to memory spilling for the SSA CFG pipeline in a simple stupid version.
Adds:
ssa/spill/MemoryAddressingis a per-subobject owner of spill memorynumSpilled()across each CFGsSpillSetand bumps memory guard accordingly, allocates non-overlapping memory addresses for spilled valuesssa/spill/Emitteremits bytecode against the symbolic stack for spilled valuesssa/spill/SpillSetgot a new methodfeasilizewhich will check for all spilled values whether they can be feasibly spilled at the point of origin, may add more things to spill accordinglyModifies
ssa/StackLayoutGeneratorsgenerate()to return{layout, spillSet}instead of just the layout and also validates back-edges asserting that back-edge targets can be safely shuffled tossa/CodeTransformis reworked to first generate per-CFG layouts and spill sets (feasilize them), then build a single globalMemoryAddressingto hand into theCodeTransforminstanceTest
SpillTestsuite undertest/libyul/ssa/spillwhich runs thegenerate->feasilize->addresssequence and emits that plus a text representation of the input object. does not generate any code.