Closed Quuxplusone closed 4 years ago
Attached 0001-Add-failing-LiveIntervals-handleMoveUp-testcases.patch
(6855 bytes, text/plain): Patch adding failing tests
The incorrect endpoint is seemingly created here at *NewSegment. I'm pretty
confused by the usage of the next segment. After the copy_bacwkards, Next is an
identical copy of the segment at NewIdxIn.
// OldIdxIn and OldIdxVNI are now undef and can be overridden.
// We Slide [NewIdxIn, OldIdxIn) down one position.
// |- X0/NewIdxIn -| ... |- Xn-1 -||- Xn/OldIdxIn -||- OldIdxOut -|
// => |- undef/NexIdxIn -| |- X0 -| ... |- Xn-1 -| |- Xn/OldIdxOut -|
std::copy_backward(NewIdxIn, OldIdxIn, OldIdxOut);
// NewIdxIn is now considered undef so we can reuse it for the moved
// value.
LiveRange::iterator NewSegment = NewIdxIn;
LiveRange::iterator Next = std::next(NewSegment);
if (SlotIndex::isEarlierInstr(Next->start, NewIdx)) {
// There is no gap between NewSegment and its predecessor.
*NewSegment = LiveRange::Segment(Next->start, SplitPos,
Next->valno);
*Next = LiveRange::Segment(SplitPos, Next->end, OldIdxVNI);
Next->valno->def = SplitPos;
} else {
(In reply to Matt Arsenault from comment #2)
> If I force using the path added in r326087, it fixes the two unit tests.
> However, this breaks a few other cases and the original MIR testcase still
> errors.
On closer inspection, the verifier error passes but the updated interval looks
incorrect. The live range doesn't reach the right kill instruction
https://reviews.llvm.org/D68149 fixes these cases
r375300
0001-Add-failing-LiveIntervals-handleMoveUp-testcases.patch
(6855 bytes, text/plain)