-
Notifications
You must be signed in to change notification settings - Fork 5.1k
JIT: another bit of refactoring in escape analysis #115812
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
JIT: another bit of refactoring in escape analysis #115812
Conversation
Update the transformation code to make it easier to reorder the checks in the future, for example trying to handle in-loop allocation sites.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the escape analysis transformation logic to allow easier reordering of checks and to support additional allocation site scenarios. Key changes include introducing the AllocationCandidate structure, adding new helper functions (for both object and array allocation nodes), and tracking stack allocation counts.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/coreclr/jit/objectalloc.h | Introduces AllocationCandidate and reorders typedefs for clarity |
src/coreclr/jit/objectalloc.cpp | Updates allocation morphing logic with new helper functions and candidate handling |
Comments suppressed due to low confidence (1)
src/coreclr/jit/objectalloc.h:124
- The new AllocationCandidate structure contains several members with specific roles. Consider adding a brief inline comment or updating the documentation to explain the purpose of each member to aid future maintainers.
struct AllocationCandidate {
{ | ||
JITDUMP("Allocating V%02u on the stack\n", lclNum); | ||
canStack = true; | ||
if (candidate.m_bashCall) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The usage of the candidate.m_bashCall flag is not immediately clear since it is only set in one allocation helper (for objects). Please add a comment explaining its intended role and why it is exclusive to certain cases to improve code clarity.
Copilot uses AI. Check for mistakes.
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
@dotnet/jit-contrib PTAL No diffs. Splits up one large method into smaller chunks, enabling "early return" style checks instead of a series of cascading if/then/elses. |
Update the transformation code to make it easier to reorder the checks in the future, for example trying to handle in-loop allocation sites.
Update the transformation code to make it easier to reorder the checks in the future, for example trying to handle in-loop allocation sites.