Skip to content

Commit 296e3ce

Browse files
committed
Fix test by printing VPRecipeBase
1 parent 5f14165 commit 296e3ce

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

llvm/lib/Transforms/Vectorize/VPlan.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,9 @@ raw_ostream &llvm::operator<<(raw_ostream &OS, const VPValue &V) {
7171
V.print(OS, SlotTracker);
7272
return OS;
7373
}
74-
raw_ostream &llvm::operator<<(raw_ostream &OS, const VPDef &D) {
75-
/// If this def has a single value, we can cast it to an instruction and use
76-
/// its plan for the slot tracker.
77-
if (const VPValue *Val = D.getVPSingleValue())
78-
return OS << *Val;
79-
VPSlotTracker SlotTracker(nullptr);
80-
D.print(OS, "", SlotTracker);
74+
raw_ostream &llvm::operator<<(raw_ostream &OS, const VPRecipeBase &R) {
75+
VPSlotTracker SlotTracker(R.getParent()->getPlan());
76+
R.print(OS, "", SlotTracker);
8177
return OS;
8278
}
8379
#endif

llvm/lib/Transforms/Vectorize/VPlanValue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ typedef DenseMap<Value *, VPValue *> Value2VPValueTy;
195195
typedef DenseMap<VPValue *, Value *> VPValue2ValueTy;
196196

197197
raw_ostream &operator<<(raw_ostream &OS, const VPValue &V);
198-
raw_ostream &operator<<(raw_ostream &OS, const VPDef &D);
198+
raw_ostream &operator<<(raw_ostream &OS, const VPRecipeBase &R);
199199

200200
/// This class augments VPValue with operands which provide the inverse def-use
201201
/// edges from VPValue's users to their defs.

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<VPDef>(I4);
815+
OS << *cast<VPValue>(I4);
816816
EXPECT_EQ("EMIT vp<%5> = mul vp<%3>, vp<%2>", I4Dump);
817817
}
818818
}

0 commit comments

Comments
 (0)