diff --git a/llvm/lib/Transforms/Vectorize/VPlan.cpp b/llvm/lib/Transforms/Vectorize/VPlan.cpp --- a/llvm/lib/Transforms/Vectorize/VPlan.cpp +++ b/llvm/lib/Transforms/Vectorize/VPlan.cpp @@ -393,9 +393,8 @@ void VPInstruction::print(raw_ostream &O, const Twine &Indent, VPSlotTracker &SlotTracker) const { - O << " +\n" << Indent << "\"EMIT "; + O << Indent << "\"EMIT "; print(O, SlotTracker); - O << "\\l\""; } void VPInstruction::print(raw_ostream &O) const { @@ -652,10 +651,13 @@ << ")\\l\""; } else Pred->printAsOperand(OS, SlotTracker); + OS << "+\n"; } - for (const VPRecipeBase &Recipe : *BasicBlock) + for (const VPRecipeBase &Recipe : *BasicBlock) { Recipe.print(OS, Indent, SlotTracker); + OS << "\\l\"+\n"; + } // Dump the condition bit. const VPValue *CBV = BasicBlock->getCondBit(); @@ -714,53 +716,51 @@ void VPWidenCallRecipe::print(raw_ostream &O, const Twine &Indent, VPSlotTracker &SlotTracker) const { - O << " +\n" - << Indent << "\"WIDEN-CALL " << VPlanIngredient(&Ingredient) << "\\l\""; + O << Indent << "\"WIDEN-CALL " << VPlanIngredient(&Ingredient); } void VPWidenSelectRecipe::print(raw_ostream &O, const Twine &Indent, VPSlotTracker &SlotTracker) const { - O << " +\n" - << Indent << "\"WIDEN-SELECT" << VPlanIngredient(&Ingredient) - << (InvariantCond ? " (condition is loop invariant)" : "") << "\\l\""; + O << Indent << "\"WIDEN-SELECT" << VPlanIngredient(&Ingredient) + << (InvariantCond ? " (condition is loop invariant)" : ""); } void VPWidenRecipe::print(raw_ostream &O, const Twine &Indent, VPSlotTracker &SlotTracker) const { - O << " +\n" << Indent << "\"WIDEN\\l\""; - O << "\" " << VPlanIngredient(&Ingredient) << "\\l\""; + O << Indent << "\"WIDEN\\l\""; + O << "\" " << VPlanIngredient(&Ingredient); } void VPWidenIntOrFpInductionRecipe::print(raw_ostream &O, const Twine &Indent, VPSlotTracker &SlotTracker) const { - O << " +\n" << Indent << "\"WIDEN-INDUCTION"; + O << Indent << "\"WIDEN-INDUCTION"; if (Trunc) { O << "\\l\""; O << " +\n" << Indent << "\" " << VPlanIngredient(IV) << "\\l\""; - O << " +\n" << Indent << "\" " << VPlanIngredient(Trunc) << "\\l\""; + O << " +\n" << Indent << "\" " << VPlanIngredient(Trunc); } else - O << " " << VPlanIngredient(IV) << "\\l\""; + O << " " << VPlanIngredient(IV); } void VPWidenGEPRecipe::print(raw_ostream &O, const Twine &Indent, VPSlotTracker &SlotTracker) const { - O << " +\n" << Indent << "\"WIDEN-GEP "; + O << Indent << "\"WIDEN-GEP "; O << (IsPtrLoopInvariant ? "Inv" : "Var"); size_t IndicesNumber = IsIndexLoopInvariant.size(); for (size_t I = 0; I < IndicesNumber; ++I) O << "[" << (IsIndexLoopInvariant[I] ? "Inv" : "Var") << "]"; O << "\\l\""; - O << " +\n" << Indent << "\" " << VPlanIngredient(GEP) << "\\l\""; + O << " +\n" << Indent << "\" " << VPlanIngredient(GEP); } void VPWidenPHIRecipe::print(raw_ostream &O, const Twine &Indent, VPSlotTracker &SlotTracker) const { - O << " +\n" << Indent << "\"WIDEN-PHI " << VPlanIngredient(Phi) << "\\l\""; + O << Indent << "\"WIDEN-PHI " << VPlanIngredient(Phi); } void VPBlendRecipe::print(raw_ostream &O, const Twine &Indent, VPSlotTracker &SlotTracker) const { - O << " +\n" << Indent << "\"BLEND "; + O << Indent << "\"BLEND "; Phi->printAsOperand(O, false); O << " ="; if (getNumIncomingValues() == 1) { @@ -776,29 +776,24 @@ getMask(I)->printAsOperand(O, SlotTracker); } } - O << "\\l\""; } void VPReplicateRecipe::print(raw_ostream &O, const Twine &Indent, VPSlotTracker &SlotTracker) const { - O << " +\n" - << Indent << "\"" << (IsUniform ? "CLONE " : "REPLICATE ") + O << Indent << "\"" << (IsUniform ? "CLONE " : "REPLICATE ") << VPlanIngredient(Ingredient); if (AlsoPack) O << " (S->V)"; - O << "\\l\""; } void VPPredInstPHIRecipe::print(raw_ostream &O, const Twine &Indent, VPSlotTracker &SlotTracker) const { - O << " +\n" - << Indent << "\"PHI-PREDICATED-INSTRUCTION " << VPlanIngredient(PredInst) - << "\\l\""; + O << Indent << "\"PHI-PREDICATED-INSTRUCTION " << VPlanIngredient(PredInst); } void VPWidenMemoryInstructionRecipe::print(raw_ostream &O, const Twine &Indent, VPSlotTracker &SlotTracker) const { - O << " +\n" << Indent << "\"WIDEN " << VPlanIngredient(&Instr); + O << Indent << "\"WIDEN " << VPlanIngredient(&Instr); O << ", "; getAddr()->printAsOperand(O, SlotTracker); VPValue *Mask = getMask(); @@ -806,7 +801,6 @@ O << ", "; Mask->printAsOperand(O, SlotTracker); } - O << "\\l\""; } void VPWidenCanonicalIVRecipe::execute(VPTransformState &State) { @@ -827,9 +821,9 @@ void VPWidenCanonicalIVRecipe::print(raw_ostream &O, const Twine &Indent, VPSlotTracker &SlotTracker) const { - O << " +\n" << Indent << "\"EMIT "; + O << Indent << "\"EMIT "; getVPValue()->printAsOperand(O, SlotTracker); - O << " = WIDEN-CANONICAL-INDUCTION \\l\""; + O << " = WIDEN-CANONICAL-INDUCTION"; } template void DomTreeBuilder::Calculate(VPDominatorTree &DT);