forked from OSchip/llvm-project
Pretty up the debug output during RemoveCopyByCommutingDef.
llvm-svn: 115384
This commit is contained in:
parent
07e96866a2
commit
8fd5b3c071
|
@ -406,7 +406,8 @@ bool SimpleRegisterCoalescing::RemoveCopyByCommutingDef(const CoalescerPair &CP,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG(dbgs() << "\tRemoveCopyByCommutingDef: " << *DefMI);
|
DEBUG(dbgs() << "\tRemoveCopyByCommutingDef: " << AValNo->def << '\t'
|
||||||
|
<< *DefMI << "\t\tALR: " << *ALR << ", BLR: " << *BLR << '\n');
|
||||||
|
|
||||||
// At this point we have decided that it is legal to do this
|
// At this point we have decided that it is legal to do this
|
||||||
// transformation. Start by commuting the instruction.
|
// transformation. Start by commuting the instruction.
|
||||||
|
@ -479,6 +480,7 @@ bool SimpleRegisterCoalescing::RemoveCopyByCommutingDef(const CoalescerPair &CP,
|
||||||
const LiveRange *DLR = IntB.getLiveRangeContaining(DefIdx);
|
const LiveRange *DLR = IntB.getLiveRangeContaining(DefIdx);
|
||||||
if (!DLR)
|
if (!DLR)
|
||||||
continue;
|
continue;
|
||||||
|
DEBUG(dbgs() << "\t\tnoop: " << DefIdx << '\t' << *UseMI);
|
||||||
BHasPHIKill |= DLR->valno->hasPHIKill();
|
BHasPHIKill |= DLR->valno->hasPHIKill();
|
||||||
assert(DLR->valno->def == DefIdx);
|
assert(DLR->valno->def == DefIdx);
|
||||||
BDeadValNos.push_back(DLR->valno);
|
BDeadValNos.push_back(DLR->valno);
|
||||||
|
@ -488,10 +490,6 @@ bool SimpleRegisterCoalescing::RemoveCopyByCommutingDef(const CoalescerPair &CP,
|
||||||
|
|
||||||
// We need to insert a new liverange: [ALR.start, LastUse). It may be we can
|
// We need to insert a new liverange: [ALR.start, LastUse). It may be we can
|
||||||
// simply extend BLR if CopyMI doesn't end the range.
|
// simply extend BLR if CopyMI doesn't end the range.
|
||||||
DEBUG({
|
|
||||||
dbgs() << "Extending: ";
|
|
||||||
IntB.print(dbgs(), tri_);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Remove val#'s defined by copies that will be coalesced away.
|
// Remove val#'s defined by copies that will be coalesced away.
|
||||||
for (unsigned i = 0, e = BDeadValNos.size(); i != e; ++i) {
|
for (unsigned i = 0, e = BDeadValNos.size(); i != e; ++i) {
|
||||||
|
@ -507,6 +505,8 @@ bool SimpleRegisterCoalescing::RemoveCopyByCommutingDef(const CoalescerPair &CP,
|
||||||
}
|
}
|
||||||
IntB.removeValNo(BDeadValNos[i]);
|
IntB.removeValNo(BDeadValNos[i]);
|
||||||
}
|
}
|
||||||
|
DEBUG(dbgs() << "\t\ttrimmed: " << IntB << '\n');
|
||||||
|
|
||||||
|
|
||||||
// Extend BValNo by merging in IntA live ranges of AValNo. Val# definition
|
// Extend BValNo by merging in IntA live ranges of AValNo. Val# definition
|
||||||
// is updated.
|
// is updated.
|
||||||
|
@ -524,22 +524,10 @@ bool SimpleRegisterCoalescing::RemoveCopyByCommutingDef(const CoalescerPair &CP,
|
||||||
IntB.addRange(LiveRange(AI->start, End, ValNo));
|
IntB.addRange(LiveRange(AI->start, End, ValNo));
|
||||||
}
|
}
|
||||||
ValNo->setHasPHIKill(BHasPHIKill);
|
ValNo->setHasPHIKill(BHasPHIKill);
|
||||||
|
DEBUG(dbgs() << "\t\textended: " << IntB << '\n');
|
||||||
DEBUG({
|
|
||||||
dbgs() << " result = ";
|
|
||||||
IntB.print(dbgs(), tri_);
|
|
||||||
dbgs() << "\nShortening: ";
|
|
||||||
IntA.print(dbgs(), tri_);
|
|
||||||
});
|
|
||||||
|
|
||||||
IntA.removeValNo(AValNo);
|
IntA.removeValNo(AValNo);
|
||||||
|
DEBUG(dbgs() << "\t\ttrimmed: " << IntA << '\n');
|
||||||
DEBUG({
|
|
||||||
dbgs() << " result = ";
|
|
||||||
IntA.print(dbgs(), tri_);
|
|
||||||
dbgs() << '\n';
|
|
||||||
});
|
|
||||||
|
|
||||||
++numCommutes;
|
++numCommutes;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue