summaryrefslogtreecommitdiff
path: root/scripts/test/shared.py
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2024-08-13 16:04:09 -0700
committerGitHub <noreply@github.com>2024-08-13 16:04:09 -0700
commit0c84afe87ea67239c4d7bf885b43b5c4f52322af (patch)
treea4cbbddf095babea863c4a886d6501b54f8696d7 /scripts/test/shared.py
parent6dc5b907fc17fc7f705781dbe16c6b79ed3a1f9a (diff)
downloadbinaryen-0c84afe87ea67239c4d7bf885b43b5c4f52322af.tar.gz
binaryen-0c84afe87ea67239c4d7bf885b43b5c4f52322af.tar.bz2
binaryen-0c84afe87ea67239c4d7bf885b43b5c4f52322af.zip
Heap2Local: Track interactions in detail (#6834)
Previously we tracked only whether an expression was relevant to analysis, that is, whether it interacted with the allocation we were tracing the behavior of. That is not enough for all cases, though, so also track the form of the interaction, namely whether the allocation flows through or is fully consumed. An example where that matters: (ref.eq (struct.get $A 0 (local.tee $x (struct.new_default $A) ) ) (local.get $x) ) Here the local.get flows out the allocation, but the struct.get only fully consumes it. Before this PR we thought the struct.get flowed the allocation, and we misoptimized this to 1. To make this possible, do a bunch of minor refactoring: * Move ParentChildInteraction out of the class. * Add a "None" interaction there. * Replace the set of reached expressions with a map of them to their interactions. * Add helper functions to get an expression's interaction or to update it when replacing. The new testcase here shows the main fix. The new assertions are covered by existing testcases.
Diffstat (limited to 'scripts/test/shared.py')
0 files changed, 0 insertions, 0 deletions