You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A register, edx, is assigned for a ref null node: CNS_INT ref null REG edx $VN.Null
But later we decide to re-use edx for a constant zero node: CNS_INT int 0 reuse reg val REG edx $40
This occurs because the two nodes are seen as equivalent, but we do not update the emitThisGCrefRegs to remove edx as GC tracked when edx is re-used in a non-GC way.
The decision to re-use the register is handled in LSRA, though the updating of the emitThisGCrefRegs appears to only be in the emitter. A possible fix might be to update emitThisGCrefRegs if we see that we are going to emit a constant int 0 that is re-using a register that was previously GC tracked.
// cc @kunalspathak - not sure if there needs to be something done in LSRA in this case
full dump: dump.txt
Activity
JulieLeeMSFT commentedon Mar 27, 2023
@TIHan PTAL.
TIHan commentedon Mar 28, 2023
I have managed to reproduce this locally, so I can iterate on this.
TIHan commentedon Mar 28, 2023
I think I know the underlying problem.
A register,
edx, is assigned for a ref null node:CNS_INT ref null REG edx $VN.NullBut later we decide to re-use
edxfor a constant zero node:CNS_INT int 0 reuse reg val REG edx $40This occurs because the two nodes are seen as equivalent, but we do not update the
emitThisGCrefRegsto removeedxas GC tracked whenedxis re-used in a non-GC way.The decision to re-use the register is handled in LSRA, though the updating of the
emitThisGCrefRegsappears to only be in the emitter. A possible fix might be to updateemitThisGCrefRegsif we see that we are going to emit a constant int 0 that is re-using a register that was previously GC tracked.// cc @kunalspathak - not sure if there needs to be something done in LSRA in this case
full dump: dump.txt