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

Eliminate write barrier branches from codegen and late-gc-lowering #43384

Closed

Conversation

pchintalapudi
Copy link
Member

@pchintalapudi pchintalapudi commented Dec 9, 2021

Branches on the how flag of freshly allocated arrays for write barriers are unnecessary and could block escape analysis of arrays in the future. This PR proposes to eliminate those branches as generated in codegen and late-gc-lowering.

Compilation timing comparison:

Sysimage built. Summary:
Total ───────  61.639983 seconds
Base: ───────  24.926984 seconds 40.4396%
Stdlibs: ────  36.711467 seconds 59.5579%
    JULIA usr/lib/julia/sys-o.a
Generating REPL precompile statements... 36/36
Executing precompile statements... 1393/1428
Precompilation complete. Summary:
Total ─────── 115.848746 seconds
Generation ──  89.879481 seconds 77.5835%
Execution ───  25.969266 seconds 22.4165%

PR:

Sysimage built. Summary:
Total ───────  60.190534 seconds
Base: ───────  24.592287 seconds 40.8574%
Stdlibs: ────  35.596712 seconds 59.1401%
    JULIA usr/lib/julia/sys-o.a
Generating REPL precompile statements... 36/36
Executing precompile statements... 1393/1428
Precompilation complete. Summary:
Total ─────── 114.047976 seconds
Generation ──  87.002346 seconds 76.2857%
Execution ───  27.045631 seconds 23.7143%

Godbolt comparison:
Master: https://godbolt.org/z/5KrTqnW4e
PR: https://godbolt.org/z/oP6z4nT5a

This PR depends on #43547 and #43487 for array optimization improvements and allocation identification, and #43057 for escape analysis improvements.

@pchintalapudi
Copy link
Member Author

Since my branches are part of a fork, I've created a PR comparing this one and the data load hoisting PR immediately before it here: pchintalapudi#2

@pchintalapudi pchintalapudi marked this pull request as ready for review December 28, 2021 00:50
@pchintalapudi pchintalapudi force-pushed the pc/array-branch-elimination branch from 856923e to 7a6e5e5 Compare January 5, 2022 07:08
@pchintalapudi
Copy link
Member Author

Branches in late-gc-lower cannot be removed, as they are dependent on unobservable GC low bit stores and cannot be forwarded from the original type pointer.

@pchintalapudi pchintalapudi force-pushed the pc/array-branch-elimination branch 2 times, most recently from 6e1184f to 91cb322 Compare January 7, 2022 08:59
@pchintalapudi pchintalapudi marked this pull request as draft January 9, 2022 21:34
@pchintalapudi
Copy link
Member Author

Converting to draft because #43547 and #43487 are still under review.

@pchintalapudi pchintalapudi force-pushed the pc/array-branch-elimination branch from 91cb322 to 0bf738b Compare January 14, 2022 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:codegen Generation of LLVM IR and native code GC Garbage collector
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants