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

Add nothrow modeling for global assignment #45421

Merged
merged 1 commit into from
May 23, 2022
Merged

Conversation

Keno
Copy link
Member

@Keno Keno commented May 22, 2022

Currently global assignment conservatively taints nothrow.
We can do better by looking at whether the global exists,
isconst, its type, etc. and determine whether there is
any possibility that the assignment will throw and taint
the effect accordingly.

Split out from #45272

@simeonschaub
Copy link
Member

simeonschaub commented May 22, 2022

Can we add the same handling for the new setglobal! builtin?

@Keno
Copy link
Member Author

Keno commented May 22, 2022

Yes, but can be a separate PR. Do you want to take a crack?

tristate_merge!(frame, Effects(EFFECTS_TOTAL,
effect_free=TRISTATE_UNKNOWN,
nothrow=TRISTATE_UNKNOWN))
abstract_eval_global_assignment(interp, frame, lhs, t)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

abstract_eval_xxx usually get return type information back, which is already computed here, so maybe we want to name this as handle_global_assignment! (after handle_control_backedge!) or something?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, that seems reasonable.

Currently global assignment conservatively taints nothrow.
We can do better by looking at whether the global exists,
isconst, its type, etc. and determine whether there is
any possibility that the assignment will throw and taint
the effect accordingly.
@Keno Keno force-pushed the kf/globassignnothrow branch from 15cbf8f to cb0f486 Compare May 23, 2022 21:14
@Keno Keno added the merge me PR is reviewed. Merge when all tests are passing label May 23, 2022
@aviatesk aviatesk merged commit 40bfa7b into master May 23, 2022
@aviatesk aviatesk deleted the kf/globassignnothrow branch May 23, 2022 23:41
@pchintalapudi pchintalapudi removed the merge me PR is reviewed. Merge when all tests are passing label May 24, 2022
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.

4 participants