-
Notifications
You must be signed in to change notification settings - Fork 5k
JIT: remember indir store addresses in escape analysis #115689
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: remember indir store addresses in escape analysis #115689
Conversation
Instead of analyzing the indir store address when we are processing the stored value, save off the address bvIndex when processing the address.
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
x86 failures seem unrelated. I have another unrelated PR going so will see if they turn up there too. |
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 in the JIT by recording the indir store addresses during analysis and adjusting conditions for handling GT_BLK instructions.
- Introduces a new NodeToIndexMap in objectalloc.h and a corresponding instance in ObjectAllocator.
- Adjusts escape analysis logic in objectalloc.cpp, including changes to conditionals in GT_STOREIND and GT_IND/GT_BLK handling.
- Adds a new CONFIG_INTEGER for dumping the connection graph in jitconfigvalues.h.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/coreclr/jit/objectalloc.h | Added NodeToIndexMap typedef and new member for address indexing |
src/coreclr/jit/objectalloc.cpp | Updated escape analysis logic, including GT_STOREIND and GT_BLK handling |
src/coreclr/jit/jitconfigvalues.h | Added configuration option for dumping the connection graph |
{ | ||
// If we are loading from a GC struct field, we may need to retype the load | ||
// | ||
if (retypeFields && (tree->OperIs(GT_FIELD_ADDR)) && (varTypeIsGC(parent->TypeGet()))) | ||
if (retypeFields && (varTypeIsGC(parent->TypeGet()))) |
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 updated retyping condition no longer checks for GT_FIELD_ADDR as it did previously, which may modify the intended behavior for retyping GC struct field loads. Please review to ensure this change is aligned with the intended analysis logic.
if (retypeFields && (varTypeIsGC(parent->TypeGet()))) | |
if (retypeFields && parent->OperIs(GT_FIELD_ADDR) && varTypeIsGC(parent->TypeGet())) |
Copilot uses AI. Check for mistakes.
@jakobbotsch PTAL Not (yet) a full rewrite of the connection graph analysis, but puts it in a simpler form. Minimal diffs; we now prove a few more arrays don't escape. |
/ba-g timeout in x86 libraries test |
Instead of analyzing the indir store address when we are processing the stored value, save off the address bvIndex when processing the address.