JIT: remember indir store addresses in escape analysis#115689
JIT: remember indir store addresses in escape analysis#115689AndyAyersMS merged 1 commit intodotnet:mainfrom
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.
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.
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())) |
|
@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.