Skip to content

feat[venom]: add dead store elimination pass #4556

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
361 commits
Select commit Hold shift + click to select a range
4c4de68
disable for test_calldatacopy_example
harkal Mar 27, 2025
120d030
disable hevm for infinte loop
harkal Mar 27, 2025
a6c4908
completely overlaps tests
harkal Mar 28, 2025
c56a0df
refactor
harkal Mar 28, 2025
0f6d0d7
move memory location test
harkal Mar 28, 2025
abfc20f
tests
harkal Mar 28, 2025
f5924f2
instruction updater add annotations
harkal Mar 28, 2025
e0d6449
reduntant load test
harkal Mar 28, 2025
8bb92f8
updater
harkal Mar 28, 2025
68686aa
redundant mload elimination
harkal Mar 28, 2025
8cb4928
lint
harkal Mar 28, 2025
bfca974
wip
harkal Mar 28, 2025
469dbec
proper dom post order compute
harkal Mar 28, 2025
7ca3312
wip
harkal Mar 28, 2025
770133d
wip
harkal Mar 28, 2025
01d1d79
proper dom post order compute
harkal Mar 28, 2025
545686e
convert to iteratable property
harkal Mar 28, 2025
a1def95
refactor
harkal Mar 28, 2025
6bcd5fb
Merge branch 'fix/venom/dom_walk' into feat/memssa
harkal Mar 28, 2025
b5ce26e
Merge remote-tracking branch 'origin-vyper/master' into feat/memssa
harkal Mar 30, 2025
aad9275
use property
harkal Mar 30, 2025
ece4ac3
add comment
harkal Mar 30, 2025
c338183
comments, signatures
harkal Mar 30, 2025
c6291b1
cleaner
harkal Mar 30, 2025
687e4de
naming
harkal Mar 30, 2025
c100d1b
tests
harkal Mar 30, 2025
7ddf275
branching tests
harkal Mar 30, 2025
2aa256b
wip
harkal Mar 30, 2025
8a353bb
wip
harkal Mar 30, 2025
78c3f5d
wip loops
harkal Mar 30, 2025
ca934a8
attempt
harkal Mar 31, 2025
6c64e67
wip
harkal Mar 31, 2025
5b646ee
more test cases
harkal Mar 31, 2025
7a376d7
wip
harkal Mar 31, 2025
923f625
work with all dominated
harkal Mar 31, 2025
970f815
wip
harkal Mar 31, 2025
e93ea70
enable passes
harkal Mar 31, 2025
08ee728
lint
harkal Mar 31, 2025
7dcb2f0
remove alloca case handling
harkal Apr 4, 2025
d66726a
make use of the alias sets
harkal Apr 4, 2025
4710c77
no add location alias to self
harkal Apr 4, 2025
36f57e3
memssa separation
harkal Apr 4, 2025
734569b
lint
harkal Apr 4, 2025
988d79b
use typing module equivalents
harkal Apr 4, 2025
57b87e2
add __eq__ method
harkal Apr 4, 2025
6854c07
Merge branch 'feat/venom/memssa' into feat/venom/dead_store_elimination
harkal Apr 4, 2025
87629c9
remove irrelevant pass
harkal Apr 4, 2025
35736ed
tests squash commit
harkal Apr 6, 2025
20a222a
tests squash commit
harkal Apr 6, 2025
d82962b
lint
harkal Apr 6, 2025
a34a7e3
tests
harkal Apr 6, 2025
2aae62d
tests
harkal Apr 6, 2025
fbe92f5
Merge remote-tracking branch 'origin-vyper/master' into feat/venom/de…
harkal Apr 6, 2025
195ac51
Merge remote-tracking branch 'origin-vyper/master' into feat/venom/me…
harkal Apr 6, 2025
4ee5a32
lint
harkal Apr 6, 2025
21204ee
remove MemoryAliasPass
harkal Apr 6, 2025
5b1d7db
wip tests
harkal Apr 7, 2025
48652fe
fixtures
harkal Apr 7, 2025
54f1410
covert to use the fixtures
harkal Apr 7, 2025
cd5966e
add back
harkal Apr 7, 2025
fbf720b
add back
harkal Apr 7, 2025
c9a55ba
lint
harkal Apr 7, 2025
46f7fe2
lint
harkal Apr 7, 2025
74d83dd
refactor
harkal Apr 7, 2025
77bce4e
backport from dead store elimination
harkal Apr 7, 2025
4dff0e1
Merge branch 'master' into feat/venom/memssa
harkal Apr 9, 2025
0e02018
Merge branch 'master' into feat/venom/dead_store_elimination
harkal Apr 9, 2025
6c45937
Update vyper/venom/analysis/mem_alias.py
harkal Apr 10, 2025
b43e52e
Update vyper/venom/analysis/mem_ssa.py
harkal Apr 10, 2025
cf249b5
Update vyper/venom/analysis/mem_ssa.py
harkal Apr 10, 2025
fcd4d1b
read/write location cleanup
harkal Apr 11, 2025
e78d7a1
remove reduntant parameter
harkal Apr 11, 2025
f895ad1
lint
harkal Apr 11, 2025
4411d46
some explanations
harkal Apr 11, 2025
bbfe08c
rename `self.alias` to `self.memalias`
harkal Apr 11, 2025
858a047
update tests
harkal Apr 11, 2025
0c8dcb5
refactor
harkal Apr 11, 2025
7ed6140
comment and truthies
harkal Apr 11, 2025
f0adf7c
rename `completely_overlaps` to `completely_contains`
harkal Apr 11, 2025
4261fd3
note
harkal Apr 11, 2025
bad9460
Merge branch 'master' into feat/venom/memssa
harkal Apr 11, 2025
c404b08
data structure explanations
harkal Apr 11, 2025
05ec321
lint
harkal Apr 11, 2025
a3548d2
Merge branch 'master' into feat/venom/memssa
harkal Apr 21, 2025
503896d
Update vyper/venom/analysis/mem_ssa.py
harkal Apr 21, 2025
e27c3c6
convert to assert
harkal Apr 21, 2025
401b01a
convert to assert
harkal Apr 21, 2025
6ed4360
Merge branch 'master' into feat/venom/dead_store_elimination
harkal Apr 21, 2025
3be2120
Merge branches 'feat/venom/memssa' and 'feat/venom/memssa' of github.…
harkal Apr 21, 2025
ccd9477
fix ident
harkal Apr 21, 2025
02c4851
add comment
harkal Apr 23, 2025
f519c63
add more docstring
charles-cooper Apr 23, 2025
fcd3ad5
add review
charles-cooper Apr 23, 2025
608fb04
comments
charles-cooper Apr 23, 2025
53975d6
update remove_redundant_phis
charles-cooper Apr 23, 2025
923924c
update comment
charles-cooper Apr 23, 2025
8003227
rename get_in_def => get_out_def
charles-cooper Apr 23, 2025
f8a9ef5
simplify get_reaching_def signature
charles-cooper Apr 23, 2025
ca965ec
merge `_get_reaching_def_for_def` and `_get_reaching_def`
harkal Apr 23, 2025
63ae7b0
Merge branch 'feat/venom/memssa' of github.com:harkal/vyper into feat…
harkal Apr 23, 2025
93097be
fix
harkal Apr 23, 2025
ddec1f3
style - use fastpath
charles-cooper Apr 23, 2025
890af5d
use dataclasses.replace
charles-cooper Apr 23, 2025
d2c5e8c
refactor `.inst` property so it is always defined
charles-cooper Apr 23, 2025
e9bc850
remove superfluous assert
charles-cooper Apr 23, 2025
234f8a8
review comments
charles-cooper Apr 23, 2025
2b94fbc
Merge branch 'master' into feat/venom/memssa
harkal Apr 24, 2025
de6869b
`_get_out_def()` refactor
harkal Apr 24, 2025
5c40d23
better `_get_reaching_def()` signature
harkal Apr 24, 2025
724f008
api change
harkal Apr 24, 2025
84bed02
remove review comment
harkal Apr 24, 2025
27fe145
Merge branch 'master' into feat/venom/dead_store_elimination
harkal Apr 24, 2025
72c0365
style - fastpath return
charles-cooper Apr 24, 2025
92e9965
style - use len check
charles-cooper Apr 24, 2025
cca134c
Merge branch 'feat/venom/memssa' into feat/venom/dead_store_elimination
harkal Apr 24, 2025
f09a88e
update instruction updater
harkal Apr 24, 2025
7d85f02
post merge fixup
harkal Apr 24, 2025
50a4d64
Merge branch 'feat/venom/memssa' into feat/venom/dead_store_elimination
harkal Apr 24, 2025
554bda7
bring memory location tests in this branch
harkal Apr 24, 2025
01422c3
use an assertion
charles-cooper Apr 24, 2025
bf6ac4a
use dataclasses.replace
charles-cooper Apr 24, 2025
5e90bab
add a comment
charles-cooper Apr 24, 2025
6cd122f
docstring
harkal Apr 24, 2025
625737a
Merge branch 'feat/venom/memssa' of github.com:harkal/vyper into feat…
harkal Apr 24, 2025
3a77276
Merge branch 'feat/venom/memssa' into feat/venom/dead_store_elimination
harkal Apr 24, 2025
ae78462
Merge branch 'master' into feat/venom/dead_store_elimination
harkal Apr 24, 2025
b81f59a
Merge branch 'master' into feat/venom/dead_store_elimination
harkal Apr 25, 2025
4fb2d0f
Merge branch 'master' into feat/venom/dead_store_elimination
harkal May 7, 2025
b94f751
post merge fixes
harkal May 7, 2025
600b19c
sha memory access fix
harkal May 7, 2025
abefa67
print large numbers as hex
harkal May 7, 2025
46b1049
more merge fixes
harkal May 7, 2025
6f3ffef
remove unecessary condition
harkal May 7, 2025
3e68025
lint
harkal May 7, 2025
0669105
refactor
harkal May 7, 2025
0d7978b
refactor moar
harkal May 7, 2025
a2082df
add some comments
harkal May 7, 2025
779e9ea
refactor
harkal May 7, 2025
2faa208
moved OTHER_EFFECTS to effects under NON_MEMORY_EFFECTS
harkal May 7, 2025
ee68628
add comment
harkal May 7, 2025
3576e33
add load elim file back
harkal May 7, 2025
546e8d6
lint
harkal May 7, 2025
15d3c06
remove irrelevant pass
harkal May 7, 2025
38845d6
fix
harkal May 7, 2025
91b7579
cyclic dep fix
harkal May 7, 2025
5b3dca9
refine dload and sha3_64 memory accesses
charles-cooper May 7, 2025
e4ffbca
fix lint
charles-cooper May 7, 2025
661cb9b
handle for used outputs and review comments
charles-cooper May 7, 2025
f9f88f6
style
charles-cooper May 7, 2025
f1f970f
review
charles-cooper May 7, 2025
8f5eaad
formatting
charles-cooper May 7, 2025
157a3a3
comment
charles-cooper May 7, 2025
e7d2f78
export `_get_exit_def` small clarity refactor
harkal May 7, 2025
618214e
reuse `get_exit_def` in dead_store_elimination
harkal May 7, 2025
85147e2
refactor
harkal May 8, 2025
55e5765
remove unused current_def
harkal May 8, 2025
231c6ad
don't use dft walk as it's confusing
harkal May 8, 2025
dfb7457
add a test for aliased uses
charles-cooper May 8, 2025
f61cb21
simplify the test
charles-cooper May 8, 2025
d8d3b4e
add another test no loops
charles-cooper May 8, 2025
86952c1
wip
harkal May 8, 2025
c523d69
test fix
harkal May 8, 2025
43d8824
cleanu
harkal May 8, 2025
0ad096f
refactor
harkal May 8, 2025
651d6d1
wip
harkal May 8, 2025
ce3275a
fix
harkal May 8, 2025
ad1e66d
wip
harkal May 8, 2025
5a7779d
wip
harkal May 8, 2025
f2639fa
fix
harkal May 8, 2025
d9d1242
refactor
harkal May 8, 2025
12128b6
new test
harkal May 9, 2025
d826561
wip
harkal May 9, 2025
e20dde8
wip
harkal May 9, 2025
f2f22de
fix tests
harkal May 12, 2025
6b4e70d
test
harkal May 12, 2025
87c97bf
lastnight wip
harkal May 13, 2025
4310654
no printing
harkal May 13, 2025
0aa5e65
lint
harkal May 13, 2025
a8da853
wip
harkal May 13, 2025
ddd4d56
new test
harkal May 13, 2025
bcf8076
fix clobbering test
harkal May 13, 2025
7f0e4b1
clobbers function wip
harkal May 13, 2025
436fd58
use clobbers
harkal May 13, 2025
3c74f76
update algorithm wip
harkal May 13, 2025
aaa2344
test
harkal May 14, 2025
c1f3eac
refactor memory location handling
harkal May 14, 2025
31849b8
fix test
harkal May 14, 2025
3414564
remove escape analysis for now
harkal May 14, 2025
fb5fb00
update test for venom pipeline
harkal May 14, 2025
dd850e9
lint
harkal May 14, 2025
f39217c
refactor
harkal May 14, 2025
46803a6
add test cases
harkal May 14, 2025
b661c7d
remove clobbers method refine behaviour
harkal May 14, 2025
8c36e25
Merge branch 'master' into feat/venom/dead_store_elimination
harkal May 14, 2025
b2a5e9f
cleanup
harkal May 14, 2025
1f1bf7b
refactor cleanup
harkal May 14, 2025
6a1888d
comments
harkal May 14, 2025
7503e7f
comments
harkal May 14, 2025
414ccee
refactor and comments
harkal May 14, 2025
6fd3ca9
comments
harkal May 14, 2025
8d614be
mem_ssa comments
harkal May 14, 2025
80f097c
cleanup test
harkal May 15, 2025
ad9be19
further fleshout get clobbered behaviour
harkal May 15, 2025
0a9c5ad
lint
harkal May 15, 2025
048247e
typo
harkal May 15, 2025
0c296b4
simplify some bit ops
charles-cooper May 19, 2025
a082551
fix a comment
charles-cooper May 19, 2025
cf8034b
formatting
charles-cooper May 19, 2025
7062434
use None for unknown offset and size
harkal May 19, 2025
958e316
refactor and mypy love
harkal May 19, 2025
efbc3a1
lint, disallow is_volatile from being positional
charles-cooper May 19, 2025
fcbfdc7
update dloadbytes write location
charles-cooper May 19, 2025
e0aea45
hygiene: use is not None
charles-cooper May 19, 2025
c0f86ec
remove comment
charles-cooper May 19, 2025
8bafac6
add a test
charles-cooper May 19, 2025
feaed1a
test for un-reverse-dominated use
charles-cooper May 19, 2025
e6a7096
handle jnz case
charles-cooper May 19, 2025
7d4128d
add more tests, different jnz configurations
charles-cooper May 19, 2025
8ccfe27
use worklist again
charles-cooper May 19, 2025
542c391
Merge branch 'master' into feat/venom/dead_store_elimination
charles-cooper May 19, 2025
f5a3c18
Update vyper/venom/passes/machinery/inst_updater.py
harkal May 20, 2025
a728f8a
Update vyper/venom/passes/machinery/inst_updater.py
harkal May 20, 2025
b3a44fc
Update vyper/venom/basicblock.py
harkal May 20, 2025
95c9191
Update vyper/venom/basicblock.py
harkal May 20, 2025
abd4d7f
Update vyper/venom/basicblock.py
harkal May 20, 2025
2f90f28
Update vyper/venom/basicblock.py
harkal May 20, 2025
eb13df0
Update vyper/venom/basicblock.py
harkal May 20, 2025
c74e1e6
clean up gets_clobbered
charles-cooper May 20, 2025
4377a91
syntax error
charles-cooper May 20, 2025
fdebc88
full deconstruct
harkal May 20, 2025
20d55be
Merge branch 'feat/venom/dead_store_elimination' of github.com:harkal…
harkal May 20, 2025
7392893
fix gets_clobbered
charles-cooper May 20, 2025
94880fd
add comments
charles-cooper May 20, 2025
8067adb
function renaming
harkal May 20, 2025
b46a243
no memssa dead store elimination
harkal May 20, 2025
5599e5a
refactor
harkal May 20, 2025
e2e2654
cleanup
harkal May 20, 2025
571c46b
remove print test
harkal May 21, 2025
3cbe959
split out instruction memory locations methods
harkal May 21, 2025
3716ea2
make source map override test work again
charles-cooper May 21, 2025
c8609c4
update a comment
charles-cooper May 21, 2025
61152f1
staticmethod -> classmethod
charles-cooper May 21, 2025
27885a1
move may_alias to MemoryLocation.may_overlap
charles-cooper May 21, 2025
76ae061
lint
charles-cooper May 21, 2025
6a3b306
add another loop test case
charles-cooper May 21, 2025
ba6ce3e
rename back to visited
charles-cooper May 21, 2025
65caad6
undo bad traversal
charles-cooper May 21, 2025
6906685
lint
harkal May 21, 2025
e30ea31
Merge remote-tracking branch 'origin-vyper/master' into feat/venom/de…
harkal May 21, 2025
e0fd3a1
use mem_alias
harkal May 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions tests/functional/codegen/types/test_dynamic_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
CompilerPanic,
ImmutableViolation,
OverflowException,
StackTooDeep,
StateAccessViolation,
StaticAssertionException,
TypeMismatch,
Expand Down Expand Up @@ -291,7 +290,6 @@ def test_array(x: int128, y: int128, z: int128, w: int128) -> int128:
assert c.test_array(2, 7, 1, 8) == -5454


@pytest.mark.venom_xfail(raises=StackTooDeep, reason="stack scheduler regression")
def test_four_d_array_accessor(get_contract):
four_d_array_accessor = """
@external
Expand Down
3 changes: 1 addition & 2 deletions tests/functional/codegen/types/test_lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from tests.utils import check_precompile_asserts, decimal_to_int
from vyper.compiler.settings import OptimizationLevel
from vyper.evm.opcodes import version_check
from vyper.exceptions import ArrayIndexException, OverflowException, StackTooDeep, TypeMismatch
from vyper.exceptions import ArrayIndexException, OverflowException, TypeMismatch


def _map_nested(f, xs):
Expand Down Expand Up @@ -193,7 +193,6 @@ def test_array(x: int128, y: int128, z: int128, w: int128) -> int128:
assert c.test_array(2, 7, 1, 8) == -5454


@pytest.mark.venom_xfail(raises=StackTooDeep, reason="stack scheduler regression")
def test_four_d_array_accessor(get_contract):
four_d_array_accessor = """
@external
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/compiler/test_source_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ def foo(i: uint256):
raise self.bar(5%i)

@pure
def bar(i: uint256) -> String[32]:
return "foo foo"
def bar(i: uint256) -> String[85]:
return concat("foo foo", uint2str(i))
"""
error_map = compile_code(code, output_formats=["source_map"])["source_map"]["error_map"]
assert "user revert with reason" in error_map.values()
Expand Down
Loading