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
effects: define Core.Compiler.infer_effects
#44822
base: master
Are you sure you want to change the base?
Conversation
0d2c6b8
to
1604714
Compare
if !isempty(sv.pclimitations) | ||
# conservatively express uncertainty of this result | ||
return CallMeta(Effects, false) | ||
end |
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.
Are there any other cases where we need to take some uncertainty into account?
I think the current implementation is okay as we exclude case when any of input arguments isn't fully known.
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 case that are uncertain are known to be uncomputable presently (possibly always / fundamentally?), which is why this is a bad candidate for an inference tfunc, but a good candidate for a special-inliner.
This new reflection utility is similar to `Core.Compiler.return_type` but for the effect analysis. It comes with its own tfunc and similar compiler optimizations so that we can fold inferred effects at compiler time when possible (albeit it is as unreliable as `Core.Compiler.return_type`).
1604714
to
f07dea9
Compare
I think this has been added already now:
|
This new reflection utility is similar to
Core.Compiler.return_type
butfor the effect analysis. It comes with its own tfunc and similar compiler
optimizations so that we can fold inferred effects at compiler time when
possible (albeit it is as unreliable as
Core.Compiler.return_type
).For now
Core.Compiler.infer_effects
is folded at compile time only whenall the input arguments are fully known.