Skip to content

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
@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.

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.

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