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

[release/7.0] Fix branch removal in compiler generated code #3161

Merged

Commits on Dec 13, 2022

  1. Fix branch removal in compiler generated code (dotnet#3088)

    Changes to processing of compiler generated methods lead to a state where we don't call constant prop and branch removal in all cases before we mark instructions of the method. This can lead to overmarking
    
    This change fixes this by making sure that the branch removal executes on the method in all cases before we mark instructions of the method.
    
    The change guarantees that all accesses to Body are after the constant prop/branch removal happened on the method.
    
    This does have one possibly negative impact: the issue described in dotnet#2937 is now consistent and happens always.
    
    Added tests.
    
    Note that there's still a whole in analysis of compiler generated code around state machines, see dotnet#3087
    
    Basically if there's a local function which is going to be removed due to branch removal and if the body of that method contains code which produces a warning due to generic parameter validation, such warning will always be generated even though it's "dead" code and even if it's suppressed via RUC or similar.
    
    In such case the analysis can't figure out to which method the local function belongs (since the call site has been removed).
    vitek-karas committed Dec 13, 2022
    Configuration menu
    Copy the full SHA
    2bb32ee View commit details
    Browse the repository at this point in the history

Commits on Dec 15, 2022

  1. PR feedback

    vitek-karas committed Dec 15, 2022
    Configuration menu
    Copy the full SHA
    7ac1569 View commit details
    Browse the repository at this point in the history