-
-
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
deprecate @pure and make it just @assume_effects :foldable #48588
Conversation
Ideally this would remove the |
Co-authored-by: Valentin Churavy <[email protected]>
# TODO: this used to trigger a bug in inference recursion detection, and is unmaintained now | ||
# sigtuple = unwrap_unionall(sig)::DataType | ||
# splitunions = 1 < unionsplitcost(sigtuple.parameters) * napplicable <= InferenceParams(interp).max_union_splitting | ||
if splitunions |
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.
Please don't remove this branch. We have kinda maintained this branch since we may enable it again in the future. And this change is unrelated to this PR.
@@ -2022,7 +1969,7 @@ function abstract_call_known(interp::AbstractInterpreter, @nospecialize(f), | |||
if isa(rty, Conditional) | |||
return CallMeta(Conditional(rty.slot, rty.elsetype, rty.thentype), EFFECTS_TOTAL, NoCallInfo()) # swap if-else | |||
elseif isa(rty, Const) | |||
return CallMeta(Const(rty.val === false), EFFECTS_TOTAL, MethodResultPure()) |
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.
Don't remove MethodResultPure
. This would result in bad performance.
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.
couldn't this just check the effects rather than using MethodResultPure
?
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.
We currently don't propagate per-statement level effects. CallInfo
is what we use for propagating per-statement information to the optimizer.
At this point the effects system is the better way to express these types of guarantees. (Also @vtjnash told me this was OK).