-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Variable Debug Info covers 0 instructions (using USING_VARIABLE_LIVE_RANGE) #47202
Comments
Tagging subscribers to this area: @tommcdon Issue DetailsR2RDump of windows, x64, release build of System.Private.CoreLib built using crossgen2 shows that
|
@cshung please just one area label |
CC @davidwrighton for crossgen2 related issue. |
|
Probably worth assigning to @BrianBohe who worked on this feature in the first place? 🙂 |
First, let me share the steps to reproduce this. On an up-to-date copy of the repo run:
And now we can search for any Start Offset: reported above an End Offset: with equal value. In particular, the reported case is still there:
We can use corerun in place of dotnet to get the same result: Interop.GetRandomBytes is compiled and pre-jitted in System.Private.CoreLib.dll when building the repository, so we can take part of the command used when building the repository and debug the jit at the moment of jitting that method: In particular, I opened crossgen2 on vs running |
In this example, we have block BB03, which begins with V02 alive in rsi and is last used in gtID [000030].
Note that [000066] doesn't emit code and operands are consumed before the parent node, so V02 is marked as death before the first instruction of BB03 is emitted.
As BB06 is emitted before BB03 and finished with no variable alive, V02 live range starts at the beginning of BB03: Reporting an empty range can be helpful if the variable becomes alive in the instruction emitted immediately after it dies, as its range is just extended as it has never been dead. A few examples of this when running crossgen over private corelib are:
A workaround for this is to remove any empty range non-extended while creating new live ranges and iterate through all variables' last range, removing the leading empty ranges (if they are). They are usually a few variables tracked with this system, so a linear scan over this list of last ranges seems reasonable. Also, V02 is the last use in an operand, but the outer tree [000032] emits an instruction that does not alter its src dst operands. V02 will be in rsi even after executing cmp. It may have value to reconsider when a variable should be marked as dead. |
Solved in 77289 |
R2RDump of windows, x64, release build of System.Private.CoreLib built using crossgen2 shows that
USING_VARIABLE_LIVE_RANGE
can produce variable mapping that covers 0 instruction. Attached please find the R2RDump of the offending method.The text was updated successfully, but these errors were encountered: