}
}
- std::string PlanName;
- raw_string_ostream RSO(PlanName);
- ElementCount VF = Range.Start;
- Plan->addVF(VF);
- RSO << "Initial VPlan for VF={" << VF;
- for (VF *= 2; ElementCount::isKnownLT(VF, Range.End); VF *= 2) {
+ for (ElementCount VF = Range.Start; ElementCount::isKnownLT(VF, Range.End);
+ VF *= 2)
Plan->addVF(VF);
- RSO << "," << VF;
- }
- RSO << "},UF>=1";
- RSO.flush();
- Plan->setName(PlanName);
+ Plan->setName("Initial VPlan");
// From this point onwards, VPlan-to-VPlan transformations may change the plan
// in ways that accessing values using original IR values is incorrect.
void VPlan::print(raw_ostream &O) const {
VPSlotTracker SlotTracker(this);
- O << "VPlan '" << Name << "' {";
+ O << "VPlan '" << getName() << "' {";
if (VectorTripCount.getNumUsers() > 0) {
O << "\nLive-in ";
O << "}\n";
}
+std::string VPlan::getName() const {
+ std::string Out;
+ raw_string_ostream RSO(Out);
+ RSO << Name;
+ if (!VFs.empty()) {
+ RSO << " for VF={" << VFs[0];
+ for (ElementCount VF : drop_begin(VFs))
+ RSO << "," << VF;
+ RSO << "},UF>=1";
+ }
+
+ return Out;
+}
+
LLVM_DUMP_METHOD
void VPlan::printDOT(raw_ostream &O) const {
VPlanPrinter Printer(O, *this);
bool hasScalarVFOnly() const { return VFs.size() == 1 && VFs[0].isScalar(); }
- const std::string &getName() const { return Name; }
+ /// Return a string with the name of the plan and the applicable VFs and UFs.
+ std::string getName() const;
void setName(const Twine &newName) { Name = newName.str(); }