-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Fix dump of GC vars at call sites #45815
Conversation
@dotnet/jit-contrib I need to merge to the post-src-removal change. |
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.
LGTM.
I was not sure so I checked how Allocating Registers
is showing it, it actually shows that the local var is dying before the call and then we have a live fixedReg interval for the register
DefList: { }
N031 ( 3, 2) [000007] ------------ * LCL_VAR int V01 loc0 u:3 NA (last use) REG NA $140
DefList: { }
N033 (???,???) [000025] ------------ * PUTARG_REG int REG rcx
<RefPosition #7 @33 RefTypeFixedReg <Reg:rcx> BB03 regmask=[rcx] minReg=1>
<RefPosition #8 @33 RefTypeUse <Ivl:1 V01> LCL_VAR BB03 regmask=[rcx] minReg=1 last fixed> <- last use for V01, it is dead after it, happens before the call
Interval 2: int RefPositions {} physReg:NA Preferences=[allInt]
<RefPosition #9 @34 RefTypeFixedReg <Reg:rcx> BB03 regmask=[rcx] minReg=1>
<RefPosition #10 @34 RefTypeDef <Ivl:2> PUTARG_REG BB03 regmask=[rcx] minReg=1 fixed>
DefList: { N033.t25. PUTARG_REG }
N035 ( 17, 8) [000008] --CXG------- * CALL void UnitTest1.DoSomething REG NA $VN.Void
<RefPosition #11 @35 RefTypeFixedReg <Reg:rcx> BB03 regmask=[rcx] minReg=1>
<RefPosition #12 @35 RefTypeUse <Ivl:2> BB03 regmask=[rcx] minReg=1 last fixed>
33.#8 V1 Use * Copy rcx |V1 a|V1 a| | | | | | | | <- V1 is dead now
34.#9 rcx Fixd Keep rcx | | | | | | | | | |
34.#10 I2 Def Alloc rcx | |I2 a| | | | | | | |
35.#11 rcx Fixd Keep rcx | |I2 a| | | | | | | | <- first call refPosition
35.#12 I2 Use * Keep rcx | |I2 a| | | | | | | |
so it makes sense to show it dying before the call.
fwiw, SOS |
Needs |
GC vars are handled specially at call sites. In particular, kills happen at the call site address, meaning before the call. They JIT dump was displaying the kill after the call, which is confusing, and different from all the other cases of displaying GC refs. Fix this so the kills are properly displayed before the call site. Example diff: ``` call System.Collections.Immutable.ImmutableArray:ToImmutableArray(System.Collections.Generic.IEnumerable`1[__Canon]):System.Collections.Immutable.ImmutableArray`1[__Canon] ; gcrRegs -[rdx r14] ; GC ptr vars -{V21} ; gcr arg pop 0 => ; GC ptr vars -{V21} call System.Collections.Immutable.ImmutableArray:ToImmutableArray(System.Collections.Generic.IEnumerable`1[__Canon]):System.Collections.Immutable.ImmutableArray`1[__Canon] ; gcrRegs -[rdx r14] ; gcr arg pop 0 ```
ee319a8
to
8eea233
Compare
GC vars are handled specially at call sites. In particular,
kills happen at the call site address, meaning before the
call. They JIT dump was displaying the kill after the call,
which is confusing, and different from all the other cases
of displaying GC refs. Fix this so the kills are properly
displayed before the call site.
Example diff: