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

Precompile correct invoke-targets #46907

Merged
merged 3 commits into from
Sep 27, 2022
Merged

Precompile correct invoke-targets #46907

merged 3 commits into from
Sep 27, 2022

Conversation

timholy
Copy link
Sponsor Member

@timholy timholy commented Sep 25, 2022

This fixes backedge-based invalidation when a precompiled invoke is followed by loading a package that adds new specializations for the invoked function. An example is LowRankApprox.jl, where FillArrays adds a specialization to unique which invokes unique for an arbitrary itr. CC @jishnub.

This also allows one to set intersections=false so that one can compute matching methods for invoke calls.

Copy link
Sponsor Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

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

Normally this is handled for invoke cases by calling jl_gf_invoke_lookup_worlds, since it is not typically that logical to return a list of things equal to some other thing, as there can only be zero or one of them.

This fixes backedge-based invalidation when a precompiled `invoke`
is followed by loading a package that adds new specializations
for the `invoke`d method. An example is LowRankApprox.jl, where
FillArrays adds a specialization to `unique`.
@timholy timholy changed the title Support intersections in jl_matching_methods and precompile correct invoke-targets Precompile correct invoke-targets Sep 26, 2022
@timholy
Copy link
Sponsor Member Author

timholy commented Sep 26, 2022

Thanks! I stripped out the changes to jl_matching_methods and replaced them with calls to jl_gf_invoke_lookup_worlds.

@vtjnash

This comment was marked as outdated.

@vtjnash vtjnash added merge me PR is reviewed. Merge when all tests are passing and removed don't squash Don't squash merge labels Sep 26, 2022
@vtjnash vtjnash merged commit 698beed into master Sep 27, 2022
@vtjnash vtjnash deleted the teh/methods_subtyping branch September 27, 2022 09:54
@DilumAluthge DilumAluthge removed the merge me PR is reviewed. Merge when all tests are passing label Sep 27, 2022
vtjnash pushed a commit that referenced this pull request Sep 27, 2022
This fixes backedge-based invalidation when a precompiled `invoke`
is followed by loading a package that adds new specializations
for the `invoke`d method. An example is LowRankApprox.jl, where
FillArrays adds a specialization to `unique`.
vtjnash pushed a commit that referenced this pull request Nov 29, 2022
This fixes backedge-based invalidation when a precompiled `invoke`
is followed by loading a package that adds new specializations
for the `invoke`d method. An example is LowRankApprox.jl, where
FillArrays adds a specialization to `unique`.

(cherry picked from commit 698beed)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants