Repository navigation
JIT: Make GenTreeCall::Equals compare gtCallMoreFlags and more - #130811
Conversation
We may inadvertently merge calls that would behave differently at runtime, eg null-check vs non-null-check. Compare all the call more flags and other call metadata that may vary. Co-authored-by: Copilot <[email protected]>
|
Around 200 diffs, mostly merging null check vs non-null check calls. @jakobbotsch PTAL |
|
Azure Pipelines: Successfully started running 5 pipeline(s). 10 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
There was a problem hiding this comment.
Pull request overview
This PR tightens GenTreeCall::Equals so call-node equality checks incorporate additional call semantics (flags and metadata), reducing the risk of incorrectly treating semantically-different calls as identical during tree comparisons.
Changes:
- Add
ReturnTypeDesc::Equalsto enable structured comparisons of multi-reg return descriptors. - Expand
GenTreeCall::Equalsto compare additional call semantics (selectedgtFlags, allgtCallMoreFlags, return type metadata, async metadata, and argument signature metadata/layout compatibility). - Improve ReadyToRun entrypoint equality checks by comparing full
CORINFO_CONST_LOOKUP(not justaddr).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/coreclr/jit/gentree.h | Adds ReturnTypeDesc::Equals for comparing multi-reg return descriptors (and field offsets on RISC-V/LoongArch). |
| src/coreclr/jit/gentree.cpp | Broadens GenTreeCall::Equals to include more semantic metadata in call equality decisions. |
Co-authored-by: Copilot <[email protected]> Copilot-Session: 5d730a5b-5d90-4d97-9a4d-cd0ed578ef55
|
Tempted to also tack on a fix for #128659. |
tannergooding
left a comment
There was a problem hiding this comment.
Looks functionally correct to me and like we're meaningfully comparing the fields.
That being said, it might be goodness to explicitly call out the ones we aren't comparing and why that's ok as it will help ensure we've not missed one of the several union fields or special cases that could be impactful.
Co-authored-by: Copilot <[email protected]>
|
revised diffs Blocks tail merges in some cases, so code is a bit larger. |
|
/ba-g all legs green but build analysis stuck |
We may inadvertently merge calls that would behave differently at runtime, eg null-check vs non-null-check. Compare all the call more flags and other call metadata that may vary.