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

deprecate @pure and make it just @assume_effects :foldable #48588

Closed
wants to merge 3 commits into from

Conversation

oscardssmith
Copy link
Member

At this point the effects system is the better way to express these types of guarantees. (Also @vtjnash told me this was OK).

@oscardssmith oscardssmith requested a review from vtjnash February 8, 2023 14:04
base/compiler/stmtinfo.jl Outdated Show resolved Hide resolved
@vchuravy vchuravy requested a review from aviatesk February 8, 2023 14:18
@vchuravy
Copy link
Member

vchuravy commented Feb 8, 2023

Ideally this would remove the pure handling in abstractinterpretation as well.

base/compiler/stmtinfo.jl Outdated Show resolved Hide resolved
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
Copy link
Member

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())
Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member

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.

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