Commit 007fa58
committed
optimizer: Julia-level escape analysis
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 mutable ϕ-node aware SROA,
`mutating_arrayfreeze` optimization (#42465), stack allocation of mutables,
dead array elimination, finalizer elision and so on[^2].
[^2]: It would be also interesting if LLVM-level optimizations can consume
some 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.
If there are no serious problems, EA will be used by #42465 for `mutating_arrayfreeze`
optimization for `ImmutableArray` construction.
This commit simply defines EA inside Julia base compiler and enables the
existing test suite with it. The plan is to validate EA's accuracy and
correctness and to check the latency impact by running EA before the
existing SROA pass and checking if it can detect all objects eliminated
by the SROA pass as "SROA-eliminatable".1 parent 1db8b8f commit 007fa58
File tree
20 files changed
+4697
-52
lines changed- base
- compiler
- ssair
- EscapeAnalysis
- doc
- src/devdocs
- EscapeAnalysis
- stdlib/InteractiveUtils/src
- test
- compiler
- EscapeAnalysis
20 files changed
+4697
-52
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
397 | 397 | | |
398 | 398 | | |
399 | 399 | | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
400 | 403 | | |
401 | 404 | | |
402 | 405 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
| 99 | + | |
98 | 100 | | |
99 | 101 | | |
100 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
3 | 43 | | |
4 | 44 | | |
5 | 45 | | |
| |||
52 | 92 | | |
53 | 93 | | |
54 | 94 | | |
| 95 | + | |
55 | 96 | | |
| 97 | + | |
| 98 | + | |
56 | 99 | | |
57 | 100 | | |
58 | 101 | | |
| |||
121 | 164 | | |
122 | 165 | | |
123 | 166 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | 167 | | |
165 | 168 | | |
166 | 169 | | |
| |||
514 | 517 | | |
515 | 518 | | |
516 | 519 | | |
517 | | - | |
| 520 | + | |
| 521 | + | |
518 | 522 | | |
519 | 523 | | |
520 | 524 | | |
| |||
0 commit comments