-
-
Notifications
You must be signed in to change notification settings - Fork 871
feat[venom]: offset instruction #4180
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[venom]: offset instruction #4180
Conversation
| while i < len(bb.instructions): | ||
| inst = bb.instructions[i] | ||
| if inst.opcode == "store": | ||
| if inst.opcode in ["store", "offset"]: |
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.
| if inst.opcode in ["store", "offset"]: | |
| if inst.opcode in ("store", "offset"): |
| for inst in bb.instructions: | ||
| if ( | ||
| inst.opcode == "add" | ||
| and isinstance(inst.operands[0], IRLiteral) |
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.
i guess this works so long as this pass runs after the store elimination pass
|
i'm seeing about a 1% reduction in bytecode size for some contracts which use immutables :) |
What I did
Created offset handling for statically resolvable values
How I did it
I introduced
offsetinstruction that is emited in algebraic pass when theaddinstruction calculates offset with literal valuesHow to verify it
Created new test in algebraic pass tests
Commit message