-
-
Notifications
You must be signed in to change notification settings - Fork 804
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
feat: remove deploy
instruction from venom
#3703
feat: remove deploy
instruction from venom
#3703
Conversation
add_instruction methods
adopted a shorted name for frequently used methods
Refactored append instructions into a single append_instruction() method with named arguments for returning or not a variable
Until now log instructions where pass through. Now we have a log instruction in venom that takes the first argument to be the topic count (in shape of doing table jmp etc in the future -essentialy have instructions that require manipulation of operants before emit)
Remove output argument append_instruction() in IRBasicBlock now the method decides by itself if there is an output value
normalization pass
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #3703 +/- ##
==========================================
+ Coverage 83.99% 84.12% +0.13%
==========================================
Files 92 92
Lines 13056 13034 -22
Branches 2932 2919 -13
==========================================
- Hits 10966 10965 -1
+ Misses 1658 1649 -9
+ Partials 432 420 -12 ☔ View full report in Codecov by Sentry. |
vyper/venom/__init__.py
Outdated
@@ -19,17 +19,14 @@ | |||
|
|||
|
|||
def generate_assembly_experimental( | |||
ctx: IRFunction, optimize: Optional[OptimizationLevel] = None | |||
ctxs: tuple[IRFunction, IRFunction], optimize: Optional[OptimizationLevel] = None |
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 should either be a list of IRFunctions or specify by names -- runtime_ir and deploy_ir.
@@ -75,13 +77,13 @@ | |||
# with the assembler. My suggestion is to let this be for now, and we can | |||
# refactor it later when we are finished phasing out the old IR. | |||
class VenomCompiler: | |||
ctx: IRFunction | |||
ctxs: list[IRFunction] |
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.
should these still be named ctxs
? maybe functions
?
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.
seems fine, but not a fan of the new API for generate_assembly_experimental
. (ditto for VenomCompiler
-- i think it should not allow None
functions as part of its input.
generate_assembly_experimental() is just glue code for the old-new code interface. It's basic purpose is to "untangle" the combinations of ir_runtime and ir_nodes properties that depending on the run parameters can be multiple things (one of them being the (None, IRnode) tuple in the case of doing runtime only code. VenomCompiler() takes just a list of IRFunctions to compile, which is clean. With the last commit I removed the None check inside VenomCompiler for cleaning up the list of Nones in the glue code which is indeed nicer. |
…:harkal/vyper into feature/venom_deploy_instruction_removal
we no longer need special cases because of better handling now for deploy instruction.
deploy
instruction from venom
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.
nice! i made some changes as discussed offline, please take a look and see if you like them. i'll merge for now and if you have any changes you want to make we can do so in a follow up PR
What I did
Venom IR for an easier transition employed a
deploy
instruction like the old IR. This was creating friction in the new system as it was implicitly dictating basic block flows, that had to be handled with special cases code.This PR removes the need for the
deploy
instruction. The original IR is split into deploy and runtime code as soon as possible, and the two parts are handed to the new backend, which now handles any number of contexts that it links when emitting assembly.How I did it
How to verify it
Commit message
Removes the need for the
deploy
instructiondeploy
instructionDescription for the changelog
Cute Animal Picture