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

optimizer: Julia-level escape analysis (rebase) #44195

Closed
wants to merge 1 commit into from

Conversation

ianatol
Copy link
Member

@ianatol ianatol commented Feb 16, 2022

This commit ports EscapeAnalysis.jl into Julia base.
You can find the documentation of this escape analysis at this GitHub page1.

This escape analysis will hopefully be an enabling technology for various
memory-related optimizations at Julia's high level compilation pipeline.
Possible target optimization includes alias aware SROA (#43888),
array SROA (#43909), mutating_arrayfreeze optimization (#42465),
stack allocation of mutables, finalizer elision and so on2.

The primary motivation for porting EA in this PR is to check its impact
on latency as well as to get feedbacks from a broader range of developers.
The plan is that we first introduce EA in this commit, and then merge the
depending PRs built on top of this commit like #43888, #43909 and #42465

This commit simply defines and runs EA inside Julia base compiler and
enables the existing test suite with it. In this commit, we just run EA
before inlining to generate IPO cache. The depending PRs, EA will be
invoked again after inlining to be used for various local optimizations.

Footnotes

  1. The same documentation will be included into Julia's developer
    documentation by this commit.

  2. It would be also interesting if LLVM-level optimizations can consume
    IPO information derived by this escape analysis to broaden
    optimization possibilities.

This commit ports [EscapeAnalysis.jl](https://github.com/aviatesk/EscapeAnalysis.jl) into Julia base.
You can find the documentation of this escape analysis at [this GitHub page](https://aviatesk.github.io/EscapeAnalysis.jl/dev/)[^1].

[^1]: The same documentation will be included into Julia's developer
      documentation by this commit.

This escape analysis will hopefully be an enabling technology for various
memory-related optimizations at Julia's high level compilation pipeline.
Possible target optimization includes alias aware SROA (JuliaLang#43888),
array SROA (JuliaLang#43909), `mutating_arrayfreeze` optimization (JuliaLang#42465),
stack allocation of mutables, finalizer elision and so on[^2].

[^2]: It would be also interesting if LLVM-level optimizations can consume
      IPO information derived by this escape analysis to broaden
      optimization possibilities.

The primary motivation for porting EA in this PR is to check its impact
on latency as well as to get feedbacks from a broader range of developers.
The plan is that we first introduce EA in this commit, and then merge the
depending PRs built on top of this commit like JuliaLang#43888, JuliaLang#43909 and JuliaLang#42465

This commit simply defines and runs EA inside Julia base compiler and
enables the existing test suite with it. In this commit, we just run EA
before inlining to generate IPO cache. The depending PRs, EA will be
invoked again after inlining to be used for various local optimizations.
@ianatol
Copy link
Member Author

ianatol commented Feb 16, 2022

Just rebases #43800 with the changes from #44008

@ianatol
Copy link
Member Author

ianatol commented Feb 16, 2022

Might as well start nanosoldier here too, I guess:

@nanosoldier runtests(ALL, vs = ":master")
@nanosoldier runbenchmarks(!"scalar", vs=":master")

@ianatol
Copy link
Member Author

ianatol commented Feb 16, 2022

Superseded by bad5206

@ianatol ianatol closed this Feb 16, 2022
@nanosoldier
Copy link
Collaborator

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here.

@nanosoldier
Copy link
Collaborator

Your package evaluation job has completed - possible new issues were detected. A full report can be found here.

@ianatol ianatol deleted the avi/EscapeAnalysis branch February 17, 2022 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants