Skip to content

Commit

Permalink
feat[venom]: disable legacy optimizer in the venom pipeline
Browse files Browse the repository at this point in the history
this commit disables the legacy optimizer when the venom pipeline is
enabled. this should make the pipeline faster and removes the "training
wheels" for venom (since we can't depend on optimizations in the legacy
pipeline).
  • Loading branch information
charles-cooper committed Dec 18, 2024
1 parent e20c363 commit f0df458
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 1 addition & 5 deletions vyper/codegen/ir_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typing import Any, List, Optional, Union

import vyper.ast as vy_ast
from vyper.compiler.settings import VYPER_COLOR_OUTPUT, get_global_settings
from vyper.compiler.settings import VYPER_COLOR_OUTPUT
from vyper.evm.address_space import AddrSpace
from vyper.evm.opcodes import get_ir_opcodes
from vyper.exceptions import CodegenPanic, CompilerPanic
Expand Down Expand Up @@ -431,10 +431,6 @@ def is_pointer(self) -> bool:

@property # probably could be cached_property but be paranoid
def _optimized(self):
if get_global_settings().experimental_codegen:
# in venom pipeline, we don't need to inline constants.
return self

# TODO figure out how to fix this circular import
from vyper.ir.optimizer import optimize

Expand Down
4 changes: 4 additions & 0 deletions vyper/ir/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from typing import List, Optional, Tuple, Union

from vyper.codegen.ir_node import IRnode
from vyper.compiler.settings import get_global_settings
from vyper.evm.opcodes import version_check
from vyper.exceptions import CompilerPanic, StaticAssertionException
from vyper.utils import (
Expand Down Expand Up @@ -417,6 +418,9 @@ def _check_symbols(symbols, ir_node):


def optimize(node: IRnode) -> IRnode:
settings = get_global_settings()
if settings is not None and settings.experimental_codegen:
return node
_, ret = _optimize(node, parent=None)
return ret

Expand Down

0 comments on commit f0df458

Please sign in to comment.