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

virtualprocess: implement a better control flow selection logic #631

Merged
merged 1 commit into from
May 18, 2024

Conversation

aviatesk
Copy link
Owner

@aviatesk aviatesk commented May 17, 2024

The goal of this commit is to refine add_control_flow!, which requests
concretization of the minimal necessary control flow to evaluate
statements whose concretization have already been requested.

The basic approach is to check if there are any active successors for
each basic block, and if there is an active successor and the terminator
is not a fall-through, then request the concretization of that terminator.
Additionally, for conditional terminators, a simple optimization using
post-domination analysis is also performed: we can ignore the control
flow of a conditional terminator and treat it as a fall-through if only
one of its successors is active and the active block post-dominates the
inactive one, since the post-domination ensures that the active basic
block will be reached regardless of the control flow.

The goal of this commit is to refine `add_control_flow!`, which requests
concretization of the minimal necessary control flow to evaluate
statements whose concretization have already been requested.

The basic approach is to check if there are any active successors for
each basic block, and if there is an active successor and the terminator
is not a fall-through, then request the concretization of that terminator.
Additionally, for conditional terminators, a simple optimization using
post-domination analysis is also performed: we can ignore the control
flow of a conditional terminator and treat it as a fall-through if only
one of its successors is active and the active block post-dominates the
inactive one, since the post-domination ensures that the active basic
block will be reached regardless of the control flow.
@aviatesk aviatesk force-pushed the avi/statement-selection branch from 9073de1 to 6ba273c Compare May 18, 2024 04:16
@aviatesk aviatesk merged commit 01f6225 into master May 18, 2024
15 of 22 checks passed
@aviatesk aviatesk deleted the avi/statement-selection branch May 18, 2024 04:24
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.

1 participant