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

nll experiment: compute SCCs instead of iterative region solving #51987

Merged
merged 20 commits into from
Jul 13, 2018

Commits on Jul 12, 2018

  1. fix debug!

    nikomatsakis committed Jul 12, 2018
    Configuration menu
    Copy the full SHA
    fbb7306 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8fa24bb View commit details
    Browse the repository at this point in the history
  3. introduce ConstraintGraph, stop mutating constraints in place

    Encapsulate the dependencies more cleanly.
    nikomatsakis committed Jul 12, 2018
    Configuration menu
    Copy the full SHA
    d54e7e3 View commit details
    Browse the repository at this point in the history
  4. rename constraint_set to constraints

    also promote to its own directory, make local to nll
    nikomatsakis committed Jul 12, 2018
    Configuration menu
    Copy the full SHA
    5fa240e View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    28c483b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    3c30415 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    90c90ba View commit details
    Browse the repository at this point in the history
  8. strengthen Idx to require Ord + Hash

    You should always be able to know that any `T` where `T: Idx`
    can be used in a `BTreeMap` and a `FxHashMap`.
    nikomatsakis committed Jul 12, 2018
    Configuration menu
    Copy the full SHA
    dab206f View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    0052ddd View commit details
    Browse the repository at this point in the history
  10. make RegionValues generic over its domain

    We used to store one value per RegionVid; we will soon be storing one
    value per SCC.
    nikomatsakis committed Jul 12, 2018
    Configuration menu
    Copy the full SHA
    862c0dd View commit details
    Browse the repository at this point in the history

Commits on Jul 13, 2018

  1. compute region values using SCCs not iterative flow

    The strategy is this:
    
    - we compute SCCs once all outlives constraints are known
    - we allocate a set of values **per region** for storing liveness
    - we allocate a set of values **per SCC** for storing the final values
    - when we add a liveness constraint to the region R, we also add it
      to the final value of the SCC to which R belongs
    - then we can apply the constraints by just walking the DAG for the
      SCCs and union'ing the children (which have their liveness
      constraints within)
    
    There are a few intermediate refactorings that I really ought to have
    broken out into their own commits:
    
    - reverse the constraint graph so that `R1: R2` means `R1 -> R2` and
      not `R2 -> R1`. This fits better with the SCC computation and new
      style of inference (`->` now means "take value from" and not "push
      value into")
      - this does affect some of the UI tests, since they traverse the
        graph, but mostly the artificial ones and they don't necessarily
        seem worse
    - put some things (constraint set, etc) into `Rc`. This lets us root
      them to permit mutation and iteration. It also guarantees they don't
      change, which is critical to the correctness of the algorithm.
    - Generalize various helpers that previously operated only on points
      to work on any sort of region element.
    nikomatsakis committed Jul 13, 2018
    Configuration menu
    Copy the full SHA
    ed36698 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d5e77a3 View commit details
    Browse the repository at this point in the history
  3. dump scc graphviz too

    nikomatsakis committed Jul 13, 2018
    Configuration menu
    Copy the full SHA
    3f90bbc View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    48c4140 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    666c365 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    9d29994 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    114cdd0 View commit details
    Browse the repository at this point in the history
  8. nit: tweak comment order

    nikomatsakis committed Jul 13, 2018
    Configuration menu
    Copy the full SHA
    0472da3 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    eed2c09 View commit details
    Browse the repository at this point in the history
  10. nit: fix typo

    nikomatsakis committed Jul 13, 2018
    Configuration menu
    Copy the full SHA
    6918c17 View commit details
    Browse the repository at this point in the history