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

[Compiler] fix some cycle_fix_limited usage #57545

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vtjnash
Copy link
Member

@vtjnash vtjnash commented Feb 26, 2025

Recompute some O(n) things a bit less on every statement. Fix an assert that ensured LimitedAccuracy does not accidentally get preserved when it should have been deleted: the (local) cache should not contain things that are marked as dead (RIP), as that was leading to much code not getting cached when it logically should have. Simplify the computation of frame_parent when the cycle_parent isn't needed.

Recompute some O(n) things a bit less on every statement. Fix an assert
that ensured LimitedAccuracy does not accidentally get preserved when it
should have been deleted: the (local) cache should not contain things
that are marked as dead (RIP), as that was leading to much code not
getting cached when it logically should have. Simplify the computation
of frame_parent when the cycle_parent isn't needed.
@vtjnash vtjnash added compiler:inference Type inference backport 1.12 Change should be backported to release-1.12 labels Feb 26, 2025
@@ -183,7 +183,8 @@ function cache_lookup(𝕃::AbstractLattice, mi::MethodInstance, given_argtypes:
method = mi.def::Method
nargtypes = length(given_argtypes)
for cached_result in cache
cached_result.linfo === mi || @goto next_cache
cached_result.tombstone && continue # ignore deleted entries (due to LimitedAccuracy)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW: this is the bugfix, the rest is various improvements of various sorts

n.b. the LimitedAccuracy object does not need to contain a Set anymore, since all of the nodes now have a frameid::Int, which is reliable and strongly ordered, so we could now build the lattice over the frameid value instead, which may be much simpler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.12 Change should be backported to release-1.12 compiler:inference Type inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant