Handle CheckCastPP and SubTypeCheck in allocation merge reduction#61
Draft
raneashay wants to merge 1 commit intomicrosoft:mainfrom
Draft
Handle CheckCastPP and SubTypeCheck in allocation merge reduction#61raneashay wants to merge 1 commit intomicrosoft:mainfrom
CheckCastPP and SubTypeCheck in allocation merge reduction#61raneashay wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Prior to this patch, the ReduceAllocationMerges optimization only recognized `CastPP`, `CmpP`, and `CmpN` nodes as Phi users that could be moved into the input branches of the `Phi` node, thus rejecting `CheckCastPP` and `SubTypeCheck` nodes generated by the `instanceof` keyword or using pattern matching. As a result, allocations couldn't be merge through `Phi` nodes when the source Java prograpms contained `instanceof` checks or pattern matching code. This patch largely extends the logic for handling `CastPP` nodes to `CheckCastPP` nodes and that for handling `CmpP` and `CmpN` nodes to `SubTypeCheck` nodes. Effectively, this patch exposes more optimization opportunities in escape analysis.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Prior to this patch, the ReduceAllocationMerges optimization only
recognized
CastPP,CmpP, andCmpNnodes as Phi users that could bemoved into the input branches of the
Phinode, thus rejectingCheckCastPPandSubTypeChecknodes generated by theinstanceofkeyword or using pattern matching. As a result, allocations couldn't be
merge through
Phinodes when the source Java prograpms containedinstanceofchecks or pattern matching code.This patch largely extends the logic for handling
CastPPnodes toCheckCastPPnodes and that for handlingCmpPandCmpNnodes toSubTypeChecknodes. Effectively, this patch exposes more optimizationopportunities in escape analysis.