Skip to content

Commit 091aece

Browse files
committed
[VPlan] Remove redundant transferFlags call from replicateByVF (NFC).
Flags are now passed on construction/cloning. Remove unnecessary transferFlags call, and make code independent of VPRecipeWithIRFlags, to support additional recipes in the future.
1 parent c475f8e commit 091aece

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

llvm/lib/Transforms/Vectorize/VPlanUnroll.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ void VPlanTransforms::unrollByUF(VPlan &Plan, unsigned UF) {
466466
/// definitions for operands of \DefR.
467467
static VPValue *
468468
cloneForLane(VPlan &Plan, VPBuilder &Builder, Type *IdxTy,
469-
VPRecipeWithIRFlags *DefR, VPLane Lane,
469+
VPSingleDefRecipe *DefR, VPLane Lane,
470470
const DenseMap<VPValue *, SmallVector<VPValue *>> &Def2LaneDefs) {
471471
VPValue *Op;
472472
if (match(DefR, m_VPInstruction<VPInstruction::Unpack>(m_VPValue(Op)))) {
@@ -513,7 +513,7 @@ cloneForLane(VPlan &Plan, VPBuilder &Builder, Type *IdxTy,
513513
NewOps.push_back(Ext);
514514
}
515515

516-
VPRecipeWithIRFlags *New;
516+
VPSingleDefRecipe *New;
517517
if (auto *RepR = dyn_cast<VPReplicateRecipe>(DefR)) {
518518
// TODO: have cloning of replicate recipes also provide the desired result
519519
// coupled with setting its operands to NewOps (deriving IsSingleScalar and
@@ -529,7 +529,6 @@ cloneForLane(VPlan &Plan, VPBuilder &Builder, Type *IdxTy,
529529
New->setOperand(Idx, Op);
530530
}
531531
}
532-
New->transferFlags(*DefR);
533532
New->insertBefore(DefR);
534533
return New;
535534
}
@@ -563,7 +562,7 @@ void VPlanTransforms::replicateByVF(VPlan &Plan, ElementCount VF) {
563562
cast<VPInstruction>(&R)->getOpcode() != VPInstruction::Unpack))
564563
continue;
565564

566-
auto *DefR = cast<VPRecipeWithIRFlags>(&R);
565+
auto *DefR = cast<VPSingleDefRecipe>(&R);
567566
VPBuilder Builder(DefR);
568567
if (DefR->getNumUsers() == 0) {
569568
// Create single-scalar version of DefR for all lanes.

0 commit comments

Comments
 (0)