Skip to content

Commit f1e7e9b

Browse files
committed
Replace VPValue printer with VPRecipeBase
1 parent e6061f2 commit f1e7e9b

File tree

4 files changed

+5
-12
lines changed

4 files changed

+5
-12
lines changed

llvm/lib/Transforms/Vectorize/VPlan.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,9 @@ static cl::opt<bool> PrintVPlansInDotFormat(
6464
#define DEBUG_TYPE "loop-vectorize"
6565

6666
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
67-
raw_ostream &llvm::operator<<(raw_ostream &OS, const VPValue &V) {
68-
const VPInstruction *Instr = dyn_cast<VPInstruction>(&V);
69-
VPSlotTracker SlotTracker(
70-
(Instr && Instr->getParent()) ? Instr->getParent()->getPlan() : nullptr);
71-
V.print(OS, SlotTracker);
72-
return OS;
73-
}
7467
raw_ostream &llvm::operator<<(raw_ostream &OS, const VPRecipeBase &R) {
75-
VPSlotTracker SlotTracker(R.getParent()->getPlan());
68+
const VPBasicBlock *Parent = R.getParent();
69+
VPSlotTracker SlotTracker(Parent ? Parent->getPlan() : nullptr);
7670
R.print(OS, "", SlotTracker);
7771
return OS;
7872
}

llvm/lib/Transforms/Vectorize/VPlanSLP.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,8 @@ VPInstruction *VPlanSlp::buildGraph(ArrayRef<VPValue *> Values) {
516516
auto *Inst = cast<VPInstruction>(Values[0])->getUnderlyingInstr();
517517
auto *VPI = new VPInstruction(Opcode, CombinedOperands, Inst->getDebugLoc());
518518

519-
LLVM_DEBUG(dbgs() << "Create VPInstruction " << cast<VPValue>(*VPI) << " "
520-
<< Values[0] << "\n");
519+
LLVM_DEBUG(dbgs() << "Create VPInstruction " << *VPI << " " << Values[0]
520+
<< "\n");
521521
addCombined(Values, VPI);
522522
return VPI;
523523
}

llvm/lib/Transforms/Vectorize/VPlanValue.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ class VPValue {
194194
typedef DenseMap<Value *, VPValue *> Value2VPValueTy;
195195
typedef DenseMap<VPValue *, Value *> VPValue2ValueTy;
196196

197-
raw_ostream &operator<<(raw_ostream &OS, const VPValue &V);
198197
raw_ostream &operator<<(raw_ostream &OS, const VPRecipeBase &R);
199198

200199
/// This class augments VPValue with operands which provide the inverse def-use

llvm/unittests/Transforms/Vectorize/VPlanTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ Successor(s): ir-bb<scalar.header>
812812
{
813813
std::string I4Dump;
814814
raw_string_ostream OS(I4Dump);
815-
OS << *cast<VPValue>(I4);
815+
OS << *I4;
816816
EXPECT_EQ("EMIT vp<%5> = mul vp<%3>, vp<%2>", I4Dump);
817817
}
818818
}

0 commit comments

Comments
 (0)