Skip to content

Commit a94497a

Browse files
committed
[VPlan] Move initial quote emission from ::print to ::dumpBasicBlock.
This means there will be no stray " when printing individual recipes using print()/dump() in a debugger, for example.
1 parent a6db7cf commit a94497a

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

llvm/lib/Transforms/Vectorize/VPlan.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ void VPInstruction::execute(VPTransformState &State) {
502502

503503
void VPInstruction::print(raw_ostream &O, const Twine &Indent,
504504
VPSlotTracker &SlotTracker) const {
505-
O << "\"EMIT ";
505+
O << "EMIT ";
506506
print(O, SlotTracker);
507507
}
508508

@@ -761,7 +761,7 @@ void VPlanPrinter::dumpBasicBlock(const VPBasicBlock *BasicBlock) {
761761
// Dump the block predicate.
762762
const VPValue *Pred = BasicBlock->getPredicate();
763763
if (Pred) {
764-
OS << " +\n" << Indent << " \"BlockPredicate: ";
764+
OS << " +\n" << Indent << " \"BlockPredicate: \"";
765765
if (const VPInstruction *PredI = dyn_cast<VPInstruction>(Pred)) {
766766
PredI->printAsOperand(OS, SlotTracker);
767767
OS << " (" << DOT::EscapeString(PredI->getParent()->getName())
@@ -771,7 +771,7 @@ void VPlanPrinter::dumpBasicBlock(const VPBasicBlock *BasicBlock) {
771771
}
772772

773773
for (const VPRecipeBase &Recipe : *BasicBlock) {
774-
OS << " +\n" << Indent;
774+
OS << " +\n" << Indent << "\"";
775775
Recipe.print(OS, Indent, SlotTracker);
776776
OS << "\\l\"";
777777
}
@@ -833,7 +833,7 @@ void VPlanPrinter::printAsIngredient(raw_ostream &O, const Value *V) {
833833

834834
void VPWidenCallRecipe::print(raw_ostream &O, const Twine &Indent,
835835
VPSlotTracker &SlotTracker) const {
836-
O << "\"WIDEN-CALL ";
836+
O << "WIDEN-CALL ";
837837

838838
auto *CI = cast<CallInst>(getUnderlyingInstr());
839839
if (CI->getType()->isVoidTy())
@@ -850,7 +850,7 @@ void VPWidenCallRecipe::print(raw_ostream &O, const Twine &Indent,
850850

851851
void VPWidenSelectRecipe::print(raw_ostream &O, const Twine &Indent,
852852
VPSlotTracker &SlotTracker) const {
853-
O << "\"WIDEN-SELECT ";
853+
O << "WIDEN-SELECT ";
854854
printAsOperand(O, SlotTracker);
855855
O << " = select ";
856856
getOperand(0)->printAsOperand(O, SlotTracker);
@@ -863,15 +863,15 @@ void VPWidenSelectRecipe::print(raw_ostream &O, const Twine &Indent,
863863

864864
void VPWidenRecipe::print(raw_ostream &O, const Twine &Indent,
865865
VPSlotTracker &SlotTracker) const {
866-
O << "\"WIDEN ";
866+
O << "WIDEN ";
867867
printAsOperand(O, SlotTracker);
868868
O << " = " << getUnderlyingInstr()->getOpcodeName() << " ";
869869
printOperands(O, SlotTracker);
870870
}
871871

872872
void VPWidenIntOrFpInductionRecipe::print(raw_ostream &O, const Twine &Indent,
873873
VPSlotTracker &SlotTracker) const {
874-
O << "\"WIDEN-INDUCTION";
874+
O << "WIDEN-INDUCTION";
875875
if (Trunc) {
876876
O << "\\l\"";
877877
O << " +\n" << Indent << "\" " << VPlanIngredient(IV) << "\\l\"";
@@ -882,7 +882,7 @@ void VPWidenIntOrFpInductionRecipe::print(raw_ostream &O, const Twine &Indent,
882882

883883
void VPWidenGEPRecipe::print(raw_ostream &O, const Twine &Indent,
884884
VPSlotTracker &SlotTracker) const {
885-
O << "\"WIDEN-GEP ";
885+
O << "WIDEN-GEP ";
886886
O << (IsPtrLoopInvariant ? "Inv" : "Var");
887887
size_t IndicesNumber = IsIndexLoopInvariant.size();
888888
for (size_t I = 0; I < IndicesNumber; ++I)
@@ -896,12 +896,12 @@ void VPWidenGEPRecipe::print(raw_ostream &O, const Twine &Indent,
896896

897897
void VPWidenPHIRecipe::print(raw_ostream &O, const Twine &Indent,
898898
VPSlotTracker &SlotTracker) const {
899-
O << "\"WIDEN-PHI " << VPlanIngredient(Phi);
899+
O << "WIDEN-PHI " << VPlanIngredient(Phi);
900900
}
901901

902902
void VPBlendRecipe::print(raw_ostream &O, const Twine &Indent,
903903
VPSlotTracker &SlotTracker) const {
904-
O << "\"BLEND ";
904+
O << "BLEND ";
905905
Phi->printAsOperand(O, false);
906906
O << " =";
907907
if (getNumIncomingValues() == 1) {
@@ -921,7 +921,7 @@ void VPBlendRecipe::print(raw_ostream &O, const Twine &Indent,
921921

922922
void VPReductionRecipe::print(raw_ostream &O, const Twine &Indent,
923923
VPSlotTracker &SlotTracker) const {
924-
O << "\"REDUCE ";
924+
O << "REDUCE ";
925925
printAsOperand(O, SlotTracker);
926926
O << " = ";
927927
getChainOp()->printAsOperand(O, SlotTracker);
@@ -937,7 +937,7 @@ void VPReductionRecipe::print(raw_ostream &O, const Twine &Indent,
937937

938938
void VPReplicateRecipe::print(raw_ostream &O, const Twine &Indent,
939939
VPSlotTracker &SlotTracker) const {
940-
O << "\"" << (IsUniform ? "CLONE " : "REPLICATE ");
940+
O << (IsUniform ? "CLONE " : "REPLICATE ");
941941

942942
if (!getUnderlyingInstr()->getType()->isVoidTy()) {
943943
printAsOperand(O, SlotTracker);
@@ -952,13 +952,13 @@ void VPReplicateRecipe::print(raw_ostream &O, const Twine &Indent,
952952

953953
void VPPredInstPHIRecipe::print(raw_ostream &O, const Twine &Indent,
954954
VPSlotTracker &SlotTracker) const {
955-
O << "\"PHI-PREDICATED-INSTRUCTION ";
955+
O << "PHI-PREDICATED-INSTRUCTION ";
956956
printOperands(O, SlotTracker);
957957
}
958958

959959
void VPWidenMemoryInstructionRecipe::print(raw_ostream &O, const Twine &Indent,
960960
VPSlotTracker &SlotTracker) const {
961-
O << "\"WIDEN ";
961+
O << "WIDEN ";
962962

963963
if (!isStore()) {
964964
getVPValue()->printAsOperand(O, SlotTracker);
@@ -996,7 +996,7 @@ void VPWidenCanonicalIVRecipe::execute(VPTransformState &State) {
996996

997997
void VPWidenCanonicalIVRecipe::print(raw_ostream &O, const Twine &Indent,
998998
VPSlotTracker &SlotTracker) const {
999-
O << "\"EMIT ";
999+
O << "EMIT ";
10001000
getVPValue()->printAsOperand(O, SlotTracker);
10011001
O << " = WIDEN-CANONICAL-INDUCTION";
10021002
}

0 commit comments

Comments
 (0)