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

AbstractInterpreter: define new infresult_iterator interface #44000

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

aviatesk
Copy link
Member

@aviatesk aviatesk commented Feb 1, 2022

to make it easier to customize the behaviors of post processing of _typeinf.
Especially, this change is motivated by a need for JET, whose post processing
requires references of InferenceStates.

Separated from #43994.

Comment on lines +377 to +380
valid_worlds::WorldRange, result::InferenceResult)
inferred_result = result.src
Copy link
Member Author

Choose a reason for hiding this comment

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

The reason for this change is that identity of InferenceResult can be used as a key for inference cache and so it is sometimes very useful for customizing the behavior of caching mechanism of the native compilation pipeline.


struct InfResultInfo
caller::InferenceResult
edges::Vector{Any}
Copy link
Member

Choose a reason for hiding this comment

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

Maybe these should just be inside InferenceResult then?

Copy link
Member

@Keno Keno left a comment

Choose a reason for hiding this comment

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

I'm generally ok with this, but of course, this is all quite adhoc. Hopefully in another few iterations of this, we'll figure out a more long-term pattern for all of this.

to make it easier to customize the behaviors of post processing of `_typeinf`.
Especially, this change is motivated by a need for JET, whose post processing
requires references of `InferenceState`s.

Separated from #43994.
@@ -122,14 +122,15 @@ mutable struct InferenceResult
overridden_by_const::BitVector
result # ::Type, or InferenceState if WIP
src # ::Union{CodeInfo, OptimizationState} if inferred copy is available, nothing otherwise
edges::Vector{Any} # backedges for this result
Copy link
Member

@vtjnash vtjnash Feb 22, 2022

Choose a reason for hiding this comment

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

This seems a bit out of place here, since the others are either the keys describing this, or the inferred type results. This is neither (it is internal state of the optimizer)

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