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

Reworks Sccc computation to iteration instead of recursion #78588

Merged
merged 4 commits into from
Nov 21, 2020

Commits on Oct 31, 2020

  1. Add a benchmark test for sccc finding

    While a bit primitive, it should get us at least a better number than
    nothing.
    HeroicKatora committed Oct 31, 2020
    Configuration menu
    Copy the full SHA
    4fdf8a5 View commit details
    Browse the repository at this point in the history

Commits on Nov 5, 2020

  1. Convert the recursive find_state to a loop

    The basic conversion is a straightforward conversion of the linear
    recursion to a loop forwards and backwards propagation of the result.
    But this uses an optimization to avoid the need for extra space that
    would otherwise be necessary to store the stack of unfinished states as
    the function is not tail recursive.
    
    Observe that only non-root-nodes in cycles have a recursive call and
    that every such call overwrites their own node state. Thus we reuse the
    node state itself as temporary storage for the stack of unfinished
    states by inverting the links to a chain back to the previous state
    update. When we hit the root or end of the full explored chain we
    propagate the node state update backwards by following the chain until
    a node with a link to itself.
    HeroicKatora committed Nov 5, 2020
    Configuration menu
    Copy the full SHA
    a41e2fd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    355904d View commit details
    Browse the repository at this point in the history

Commits on Nov 8, 2020

  1. Remove recursion from sccc walking

    This allows constructing the sccc for large that visit many nodes before
    finding a single cycle of sccc, for example lists. When used to find
    dependencies in borrow checking the list case is what occurs in very
    long functions.
    HeroicKatora committed Nov 8, 2020
    Configuration menu
    Copy the full SHA
    eb597f5 View commit details
    Browse the repository at this point in the history