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

Enable globopt for functions with try finally #2954

Merged
merged 1 commit into from
May 17, 2017

Commits on May 17, 2017

  1. Enable globopt for functions with try finally

    This change enables globopt on functions with try finally.
    We transform the flowgraph such that we have 2 flow edges -
    try to a excepting finally region and try to non excepting finally region.
    This enables us to optimize the function on the non exception path.
    We bailout on the exception path.
    
    Special handling is needed when there are early exits (break, continue, return) within the tryfinally.
    We need to execute the finally block on early exit, currently we bailout on early exit.
    We transform the flow graph from (eh region -> early exit) to have an edge from  (eh region -> finally) and (finally -> early exit)
    This transformation can be done only after the regions are assigned in FlowGraph.
    
    So the flowgraph builder now has the following order of phase:
    
    - build flow graph -> add the excepting and non excepting finallys alongside
    - remove unreachable blocks
    - assign regions
    - identify early exits and add edges (does region info update when required)
    - break blocks removal (does region info update when required)
    Meghana Gupta committed May 17, 2017
    Configuration menu
    Copy the full SHA
    82ff317 View commit details
    Browse the repository at this point in the history