Skip to content

Commit 863e17a

Browse files
committed
[VPlan] Make Phi operand for VPReductionPHIRecipe optional (NFC).
VPReductionPHIRecipe doesn't rely on the underlying phi any longer, allow empty underlying values when cloning. NFC at the moment but will enable follow-up patches.
1 parent f393211 commit 863e17a

File tree

1 file changed

+3
-3
lines changed
  • llvm/lib/Transforms/Vectorize

1 file changed

+3
-3
lines changed

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2212,9 +2212,9 @@ class VPReductionPHIRecipe : public VPHeaderPHIRecipe,
22122212
~VPReductionPHIRecipe() override = default;
22132213

22142214
VPReductionPHIRecipe *clone() override {
2215-
auto *R = new VPReductionPHIRecipe(cast<PHINode>(getUnderlyingInstr()),
2216-
RdxDesc, *getOperand(0), IsInLoop,
2217-
IsOrdered, VFScaleFactor);
2215+
auto *R = new VPReductionPHIRecipe(
2216+
dyn_cast_or_null<PHINode>(getUnderlyingValue()), RdxDesc,
2217+
*getOperand(0), IsInLoop, IsOrdered, VFScaleFactor);
22182218
R->addOperand(getBackedgeValue());
22192219
return R;
22202220
}

0 commit comments

Comments
 (0)