Set IL offsets for calls created during devirtualization #61189
Merged
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.
Since inlined statements use the IL location of the inliner's statement
all statements created while inlining devirtualized calls would get no
debug info before, while normally these will have IL location pointing
to the call statement in the root.
This behavior seems unwanted and was hard to keep with my upcoming debug info changes since there we are always able to walk back to the root context and get the IL offset from there, and it is hard to check for this particular case (call statement in an inlinee that previously would have had no debug info instead of pointing into root).
I've only changed this for the call statements and not for the various other statements inserted in this transformation as I need to think more about those first. For the call it seems logical that we do it, especially since we mainly use this information as a "stepping stone" since the devirtualized call should get inlined.
No code diffs, only debug info diffs. We see some more entries around devirtualized calls as expected. A lot of the time these diffs look like
since we can now associate a statement in an inlinee with the call in the root.
cc @dotnet/jit-contrib