diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -7415,8 +7415,7 @@ void VPInterleaveRecipe::print(raw_ostream &O, const Twine &Indent, VPSlotTracker &SlotTracker) const { - O << " +\n" - << Indent << "\"INTERLEAVE-GROUP with factor " << IG->getFactor() << " at "; + O << "\"INTERLEAVE-GROUP with factor " << IG->getFactor() << " at "; IG->getInsertPos()->printAsOperand(O, false); O << ", "; getAddr()->printAsOperand(O, SlotTracker); @@ -7425,11 +7424,9 @@ O << ", "; Mask->printAsOperand(O, SlotTracker); } - O << "\\l\""; for (unsigned i = 0; i < IG->getFactor(); ++i) if (Instruction *I = IG->getMember(i)) - O << " +\n" - << Indent << "\" " << VPlanIngredient(I) << " " << i << "\\l\""; + O << "\\l\" +\n" << Indent << "\" " << VPlanIngredient(I) << " " << i; } void VPWidenCallRecipe::execute(VPTransformState &State) { 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 << "\"EMIT "; print(O, SlotTracker); - O << "\\l\""; } void VPInstruction::print(raw_ostream &O) const { @@ -656,8 +655,11 @@ Pred->printAsOperand(OS, SlotTracker); } - for (const VPRecipeBase &Recipe : *BasicBlock) + for (const VPRecipeBase &Recipe : *BasicBlock) { + OS << " +\n" << Indent; Recipe.print(OS, Indent, SlotTracker); + OS << "\\l\""; + } // Dump the condition bit. const VPValue *CBV = BasicBlock->getCondBit(); @@ -716,53 +718,51 @@ void VPWidenCallRecipe::print(raw_ostream &O, const Twine &Indent, VPSlotTracker &SlotTracker) const { - O << " +\n" - << Indent << "\"WIDEN-CALL " << VPlanIngredient(&Ingredient) << "\\l\""; + O << "\"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 << "\"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 << "\"WIDEN\\l\""; + O << "\" " << VPlanIngredient(&Ingredient); } void VPWidenIntOrFpInductionRecipe::print(raw_ostream &O, const Twine &Indent, VPSlotTracker &SlotTracker) const { - O << " +\n" << Indent << "\"WIDEN-INDUCTION"; + O << "\"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 << "\"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 << "\"WIDEN-PHI " << VPlanIngredient(Phi); } void VPBlendRecipe::print(raw_ostream &O, const Twine &Indent, VPSlotTracker &SlotTracker) const { - O << " +\n" << Indent << "\"BLEND "; + O << "\"BLEND "; Phi->printAsOperand(O, false); O << " ="; if (getNumIncomingValues() == 1) { @@ -778,29 +778,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 << "\"" << (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 << "\"PHI-PREDICATED-INSTRUCTION " << VPlanIngredient(PredInst); } void VPWidenMemoryInstructionRecipe::print(raw_ostream &O, const Twine &Indent, VPSlotTracker &SlotTracker) const { - O << " +\n" << Indent << "\"WIDEN " << VPlanIngredient(&Instr); + O << "\"WIDEN " << VPlanIngredient(&Instr); O << ", "; getAddr()->printAsOperand(O, SlotTracker); VPValue *Mask = getMask(); @@ -808,7 +803,6 @@ O << ", "; Mask->printAsOperand(O, SlotTracker); } - O << "\\l\""; } void VPWidenCanonicalIVRecipe::execute(VPTransformState &State) { @@ -829,9 +823,9 @@ void VPWidenCanonicalIVRecipe::print(raw_ostream &O, const Twine &Indent, VPSlotTracker &SlotTracker) const { - O << " +\n" << Indent << "\"EMIT "; + O << "\"EMIT "; getVPValue()->printAsOperand(O, SlotTracker); - O << " = WIDEN-CANONICAL-INDUCTION \\l\""; + O << " = WIDEN-CANONICAL-INDUCTION"; } template void DomTreeBuilder::Calculate(VPDominatorTree &DT);