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

Use a more efficient iteration order for forward dataflow #62062

Merged
merged 1 commit into from
Jul 1, 2019

Commits on Jun 27, 2019

  1. Use a more efficient iteration order for forward dataflow

    Currently, dataflow begins by visiting each block in order of ID
    (`BasicBlock(0)`, `BasicBlock(1)`, etc.). This PR changes that initial
    iteration to reverse post-order. This ensures that the effects of all
    predecessors will be applied before a basic block is visited if the CFG
    has no back-edges, and should result in less total iterations even when
    back-edges exist. This should not change the results of dataflow
    analysis.
    
    The current ordering for basic blocks is pretty close to RPO
    already--`BasicBlock(0)` is already the start block, so the gains from
    this are pretty small, especially since we need to do an extra traversal
    up front.
    
    Note that some basic blocks are unreachable from the `START_BLOCK`
    during dataflow. We add these blocks to the work queue as well to
    preserve the original behavior.
    ecstatic-morse committed Jun 27, 2019
    Configuration menu
    Copy the full SHA
    07c5e2b View commit details
    Browse the repository at this point in the history