forked from OSchip/llvm-project
[VPlan] Add printOperands helper to VPUser (NFC).
Factor out the code for printing operands of a VPUser so it can be re-used when printing other recipes.
This commit is contained in:
parent
1e70ec10eb
commit
091c5c9a18
|
@ -915,13 +915,7 @@ void VPWidenMemoryInstructionRecipe::print(raw_ostream &O, const Twine &Indent,
|
|||
O << "\"WIDEN "
|
||||
<< Instruction::getOpcodeName(getUnderlyingInstr()->getOpcode()) << " ";
|
||||
|
||||
bool First = true;
|
||||
for (VPValue *Op : operands()) {
|
||||
if (!First)
|
||||
O << ", ";
|
||||
Op->printAsOperand(O, SlotTracker);
|
||||
First = false;
|
||||
}
|
||||
printOperands(O, SlotTracker);
|
||||
}
|
||||
|
||||
void VPWidenCanonicalIVRecipe::execute(VPTransformState &State) {
|
||||
|
@ -988,6 +982,16 @@ void VPValue::printAsOperand(raw_ostream &OS, VPSlotTracker &Tracker) const {
|
|||
OS << "vp<%" << Tracker.getSlot(this) << ">";
|
||||
}
|
||||
|
||||
void VPUser::printOperands(raw_ostream &O, VPSlotTracker &SlotTracker) const {
|
||||
bool First = true;
|
||||
for (VPValue *Op : operands()) {
|
||||
if (!First)
|
||||
O << ", ";
|
||||
Op->printAsOperand(O, SlotTracker);
|
||||
First = false;
|
||||
}
|
||||
}
|
||||
|
||||
void VPInterleavedAccessInfo::visitRegion(VPRegionBlock *Region,
|
||||
Old2NewTy &Old2New,
|
||||
InterleavedAccessInfo &IAI) {
|
||||
|
|
|
@ -157,6 +157,10 @@ raw_ostream &operator<<(raw_ostream &OS, const VPValue &V);
|
|||
class VPUser {
|
||||
SmallVector<VPValue *, 2> Operands;
|
||||
|
||||
protected:
|
||||
/// Print the operands to \p O.
|
||||
void printOperands(raw_ostream &O, VPSlotTracker &SlotTracker) const;
|
||||
|
||||
public:
|
||||
VPUser() {}
|
||||
VPUser(ArrayRef<VPValue *> Operands) {
|
||||
|
|
Loading…
Reference in New Issue