-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
base: master
Are you sure you want to change the base?
Conversation
valid_worlds::WorldRange, result::InferenceResult) | ||
inferred_result = result.src |
There was a problem hiding this comment.
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.
base/compiler/typeinfer.jl
Outdated
|
||
struct InfResultInfo | ||
caller::InferenceResult | ||
edges::Vector{Any} |
There was a problem hiding this comment.
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?
There was a problem hiding this 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.
b2334af
to
fdc8b00
Compare
@@ -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 |
There was a problem hiding this comment.
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)
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.