Skip to content

Commit b74413b

Browse files
committed
[VPlan] Use VPSingleDef instead of VPValue in HCFG builder (NFC).
Use VPSingleDef to remove unneeded casts to a recipe type.
1 parent f5d153e commit b74413b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

llvm/lib/Transforms/Vectorize/VPlanHCFGBuilder.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -322,13 +322,13 @@ void PlainCFGBuilder::createVPInstructionsForVPBB(VPBasicBlock *VPBB,
322322
continue;
323323
}
324324

325-
VPValue *NewVPV;
325+
VPSingleDefRecipe *NewR;
326326
if (auto *Phi = dyn_cast<PHINode>(Inst)) {
327327
// Phi node's operands may have not been visited at this point. We create
328328
// an empty VPInstruction that we will fix once the whole plain CFG has
329329
// been built.
330-
NewVPV = new VPWidenPHIRecipe(Phi, nullptr, Phi->getDebugLoc());
331-
VPBB->appendRecipe(cast<VPWidenPHIRecipe>(NewVPV));
330+
NewR = new VPWidenPHIRecipe(Phi, nullptr, Phi->getDebugLoc());
331+
VPBB->appendRecipe(NewR);
332332
PhisToFix.push_back(Phi);
333333
} else {
334334
// Translate LLVM-IR operands into VPValue operands and set them in the
@@ -339,11 +339,11 @@ void PlainCFGBuilder::createVPInstructionsForVPBB(VPBasicBlock *VPBB,
339339

340340
// Build VPInstruction for any arbitrary Instruction without specific
341341
// representation in VPlan.
342-
NewVPV = cast<VPInstruction>(
342+
NewR = cast<VPInstruction>(
343343
VPIRBuilder.createNaryOp(Inst->getOpcode(), VPOperands, Inst));
344344
}
345345

346-
IRDef2VPValue[Inst] = NewVPV;
346+
IRDef2VPValue[Inst] = NewR;
347347
}
348348
}
349349

0 commit comments

Comments
 (0)