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

Remove RemoveUnneededReferences from LamdaRewriter #21367

Merged
merged 5 commits into from
Aug 11, 2017

Commits on Aug 8, 2017

  1. Remove RemoveUnneededReferences from closure conversion

    Currently, the lambda rewriter has an early optimization pass in
    analysis that tries to find all local functions that only capture 'this'
    and remove references to local functions that do the same. There are two
    problems with this approach:
    
        1) Generally, removing information from the tree is a bad idea
        because it hurts further analysis passes that may have needed that
        information.
    
        2) The optimization strategy itself is very tricky and has a number
        of complex corner cases. This has lead to bugs, for example dotnet#19033.
    
    This PR deletes the current method and adds a new optimization routine
    at the end of the analysis, operating on assigned scopes and
    environments rather than removing captured variable analysis. The new
    optimization is as follows: if we end up with an environment containing
    only 'this', the environment can be removed, all containing methods can
    be moved to the top-level type, and all environments which capture the
    'this' environment can instead directly capture the 'this' parameter.
    This produces almost the same results as the previous optimization, but
    is easier to validate as an algebraic equivalence.
    
    Fixes dotnet#19033, dotnet#20577
    agocke committed Aug 8, 2017
    Configuration menu
    Copy the full SHA
    f2dd03e View commit details
    Browse the repository at this point in the history
  2. Update baselines with the new optimization

    The changes come from the new optimization being less aggressive about
    moving functions which only capture 'this' to the top level. This
    appears to be a wash -- some codegen gets slightly better, some gets
    slightly worse.
    agocke committed Aug 8, 2017
    Configuration menu
    Copy the full SHA
    1de4f54 View commit details
    Browse the repository at this point in the history

Commits on Aug 9, 2017

  1. PR comments

    agocke committed Aug 9, 2017
    Configuration menu
    Copy the full SHA
    d360dd2 View commit details
    Browse the repository at this point in the history
  2. More PR comments

    agocke committed Aug 9, 2017
    Configuration menu
    Copy the full SHA
    0c3a8c1 View commit details
    Browse the repository at this point in the history

Commits on Aug 10, 2017

  1. Configuration menu
    Copy the full SHA
    884a081 View commit details
    Browse the repository at this point in the history