Skip to content

Commit 1be8097

Browse files
feat[venom]: tune function inliner (#4584)
this commit tunes the function inliner by assigning `param` and `ret` instructions a cost of 0 (in fact, they should probably have negative cost, since those only have cost in the call convention overhead, but when inlined, they disappear).
1 parent 8d2fd72 commit 1be8097

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

vyper/venom/basicblock.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,8 @@ def remove_phi_operand(self, label: IRLabel) -> None:
402402

403403
@property
404404
def code_size_cost(self) -> int:
405+
if self.opcode in ("ret", "param"):
406+
return 0
405407
if self.opcode == "store":
406408
return 1
407409
return 2

0 commit comments

Comments
 (0)