Skip to content
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

phis with identical operands don't get eliminated #4506

Open
charles-cooper opened this issue Mar 8, 2025 · 0 comments
Open

phis with identical operands don't get eliminated #4506

charles-cooper opened this issue Mar 8, 2025 · 0 comments
Assignees
Labels
bug - bytecode performance bug affecting bytecode performance (not correctness) bug - venom bug in experimental venom pipeline

Comments

@charles-cooper
Copy link
Member

Version Information

  • vyper Version (output of vyper --version): d395dd0

What's your issue about?

phi instructions where both branches produce the same value don't get reduced.

the following vyper source code demonstrates the issue:

@external
def foo(x: uint256) -> uint256:
    y: uint256 = x + 1
    z: uint256 = 0
    if msg.sender == self:
        z = y
    else:
        z = y
    return z

the resulting output looks like this:

Image

%alloca_2_18_1 could get reduced to %13, but it doesn't, leading to suboptimally branching and joining.

@charles-cooper charles-cooper added bug - bytecode performance bug affecting bytecode performance (not correctness) bug - venom bug in experimental venom pipeline labels Mar 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug - bytecode performance bug affecting bytecode performance (not correctness) bug - venom bug in experimental venom pipeline
Projects
None yet
Development

No branches or pull requests

3 participants