[GR-48178] Transitive Effect Summary Analysis #12559
Open
+1,263
−40
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The PR introduces Transitive Effect Summary Analysis (TESA):
TESA in a Nutshell
Overview
TesaEffectinterface and a concrete analysisKilledLocationTesawired into the Native Image build. Other analyses (e.g., for side effects, exceptions) are being tested at the moment and may be included in future PRs.What can be computed by TESA?
What could be enabled at invoke sites?
Effect Summary Representation
Core Algorithm
StrengthenGraphsto already utilize the effects of reachability analysis.Safety and Soundness
Current State of TESA
-H:+TransitiveEffectSummaryAnalysis(defaulttrue).KilledLocationTesais implemented and open for review.Architecture Overview
TesaEffect<T>,LocationEffectas an initial implementations.AbstractTesa<T>, e.g.,KilledLocationTesa, or (in future PRs)SideEffectTesa,ThrowsExceptionTesa,AllocationTesa,LoopTesa, ...TesaReverseCallGraphrecords per-invoke target info and caller edges, built from the analysis universe and saved during image build.results to compilation graphs before optimization.
Performance Characteristics
Extensibility
computeInitialStateandoptimizeInvokein a subclass ofAbstractTesa<T>.TesaEngine.Limitations and future work
Evaluation
While more than 5% of invokes and 10% of methods are can typically be improved by TESA (see the results of
Spring Petclinicbelow), the effects of the analysis are not visible on any of the peak metrics apart from a very slight inconclusive binary size reduction, which is in the level of noise. Note that the table includes also experimental analyses that are not part of this PR. (They will be more extensively tested and included in followup PRs if they prove useful).