Uh oh!
There was an error while loading. Please reload this page.
Add support for TYP_BYREFLCL_FLDs to VN - #64501
Conversation
ghost
commented
Jan 29, 2022
Tagging subscribers to this area: @JulieLeeMSFT Issue DetailsFirst, the code in privatestaticintProblem(StructWithRawFldPtrp){return((StructWithIndex*)p.RawFldPtr)->Index;}structStructWithRawFldPtr{publicnintRawFldPtr;}structStructWithIndex{publicintIndex;publicintValue;}LCL_FLD long V00 arg0 u:1[+0] Fseq[RawFldPtr, Index] (last use)The first two commits fix this issue, in LCL_FLD long V00 arg0 u:1[+0] Fseq[RawFldPtr] (last use) ZeroFseq[Index]That opens a possibility for another bug of course: partial sequences, that is cases where we will have Part of #58312. No diffs are expected.
|
SingleAccretion
commented
Jan 30, 2022
Will assume the Win-Arm64 timeout is not related (it passed on the previous CI run). @dotnet/jit-contrib |
53d8614 to
8608afaCompareSingleAccretion
commented
Feb 5, 2022
Pushed some fixes for typos in commit messages (no code changes). |
"fgAddFieldSeqForZeroOffset"'s contract is that it is passed an *address*. If that address is a LCL_FLD, we must use the "zero-offset sequence map", not the sequence of LCL_FLD itself, as that represents LCL_FLD's own value, not the value it produces (LCL_FLD == IND(LCL_FLD_ADDR), and LCL_FLD's sequence is the one attached to LCL_FLD_ADDR, not IND).
8608afa to
c93785cCompare
jakobbotsch
left a comment
There was a problem hiding this comment.
LGTM, thanks! Just to check my own understanding of the issue here, conceptually we can think of the zero-offset field seqs stored in the lookaside map to mean there is an implict ADD(x, 0) on top of the node with 0 having that field seq, but this code was mixing that up with the field accessed by x?
SingleAccretion
commented
Feb 6, 2022
Yep, exactly. |
First, the code in
fgAddFieldSeqForZeroOffsetthat was adding zero-offset sequence toLCL_FLDdirectly was incorrect, becausefgAddFieldSeqForZeroOffsetadds a sequence for the address that the passed-in node represents, while adding a field sequence toLCL_FLDdirectly means adding it to the "implicit"LCL_FLD_ADDRit indirects. One can reproduce this issue via code like the following (withJitNoStructPromotion=1):The first two commits fix this issue, in
fgAddFieldSeqForZeroOffsetand similar code inChangeOperand we now get the lovely combination ofLCL_FLD+ zero-offset sequence in the map.That opens a possibility for another bug of course: partial sequences, that is cases where we will have
ADD((LCL_FLD PtrToStatic [Zero FldSeq]), OFFSET FldSeq)and fail to incorporate theZero FldSeqinto thePtrToStatic's VN. This is fixed in the third commit.Part of #58312.
Contributes to #63768.
No diffs as expected.