[VPlan] Move live-out printing to VPLiveOut::print (NFC).

Preparation for D150398. This brings live-out printing in line with how
printing for recipes is handled.
This commit is contained in:
Florian Hahn committed 2023-05-22 09:53:53 +01:00
1 parent bcd1296a1a
commit 96686796f6
3 files changed
+14 -5

No files matched your search

+1 -5
View File
@@ -791,11 +791,7 @@ void VPlan::print(raw_ostream &O) const {
if (!LiveOuts.empty())
O << "\n";
for (const auto &KV : LiveOuts) {
O << "Live-out ";
KV.second->getPhi()->printAsOperand(O);
O << " = ";
KV.second->getOperand(0)->printAsOperand(O, SlotTracker);
O << "\n";
KV.second->print(O, SlotTracker);
}
O << "}\n";
+5
View File
@@ -686,6 +686,11 @@ public:
}
PHINode *getPhi() const { return Phi; }
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
/// Print the VPLiveOut to \p O.
void print(raw_ostream &O, VPSlotTracker &SlotTracker) const;
#endif
};
/// VPRecipeBase is a base class modeling a sequence of one or more output IR
@@ -169,6 +169,14 @@ void VPLiveOut::fixPhi(VPlan &Plan, VPTransformState &State) {
State.Builder.GetInsertBlock());
}
void VPLiveOut::print(raw_ostream &O, VPSlotTracker &SlotTracker) const {
O << "Live-out ";
getPhi()->printAsOperand(O);
O << " = ";
getOperand(0)->printAsOperand(O, SlotTracker);
O << "\n";
}
void VPRecipeBase::insertBefore(VPRecipeBase *InsertPos) {
assert(!Parent && "Recipe already in some VPBasicBlock");
assert(InsertPos->getParent() &&