[XLA] [NFC] Explain decisions not to remove copies in logging

PiperOrigin-RevId: 294571770
Change-Id: I2a2aad26e8af347c069d41cb301c8d3c26f30803
This commit is contained in:
George Karpenkov 2020-02-11 18:58:08 -08:00 committed by TensorFlower Gardener
parent da57baa3d4
commit 01cd184620

View File

@ -703,6 +703,9 @@ class CopyRemover {
if (next_dest != nullptr) {
// Live range of 'from' value (s_x) must be before 'next_dest' (d_1);
if (!LiveRangeBefore(*src, *next_dest)) {
VLOG(2) << "Not removing the copy: live range of "
<< src->value->ToShortString() << " is not before "
<< next_dest->value->ToShortString();
return false;
}
}
@ -713,6 +716,9 @@ class CopyRemover {
ValueNode* last_dest = dest->prev;
DCHECK(IsTail(*last_dest));
if (!LiveRangeBefore(*last_dest, *next_src)) {
VLOG(2) << "Not removing the copy: live range of "
<< last_dest->value->ToShortString() << " is not before "
<< next_src->value->ToShortString();
return false;
}
}
@ -743,12 +749,18 @@ class CopyRemover {
DCHECK(IsHead(*first_src));
if (!LiveRangeBefore(*prev_dest, *first_src)) {
// Live range of value d_{y-1} is not before s_0.
VLOG(2) << "Not removing the copy: live range of "
<< prev_dest->value->ToShortString() << " is not before "
<< first_src->value->ToShortString();
return false;
}
ValueNode* next_dest = Next(*dest);
if (next_dest != nullptr) {
if (!LiveRangeBefore(*src, *next_dest)) {
// Live range of value s_n is not before d_{y+1}.
VLOG(2) << "Not removing the copy: live range of "
<< src->value->ToShortString() << " is not before "
<< next_dest->value->ToShortString();
return false;
}
}