Skip to content

Commit 69d4076

Browse files
committed
Update comments to clarify which parts can only be used in the vplan-native path, also add back the assertion but check that the incomingblocks is empty
1 parent f31878c commit 69d4076

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2318,13 +2318,15 @@ class VPWidenPHIRecipe : public VPSingleDefRecipe {
23182318
VPSlotTracker &SlotTracker) const override;
23192319
#endif
23202320

2321-
/// Adds a pair (\p IncomingV, \p IncomingBlock) to the phi.
2321+
/// Adds a pair (\p IncomingV, \p IncomingBlock) to the phi. Only used in the
2322+
/// VPlan native path.
23222323
void addIncoming(VPValue *IncomingV, VPBasicBlock *IncomingBlock) {
23232324
addOperand(IncomingV);
23242325
IncomingBlocks.push_back(IncomingBlock);
23252326
}
23262327

2327-
/// Returns the \p I th incoming VPBasicBlock.
2328+
/// Returns the \p I th incoming VPBasicBlock. Only used in the VPlan native
2329+
/// path.
23282330
VPBasicBlock *getIncomingBlock(unsigned I) { return IncomingBlocks[I]; }
23292331

23302332
/// Returns the \p I th incoming VPValue.

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3440,6 +3440,10 @@ void VPReductionPHIRecipe::print(raw_ostream &O, const Twine &Indent,
34403440
#endif
34413441

34423442
void VPWidenPHIRecipe::execute(VPTransformState &State) {
3443+
assert((EnableVPlanNativePath || IncomingBlocks.empty()) &&
3444+
"Non-native vplans are not expected to have VPWidenPHIRecipes with "
3445+
"incoming blocks.");
3446+
34433447
State.setDebugLocFrom(getDebugLoc());
34443448
Value *Op0 = State.get(getOperand(0));
34453449
Type *VecTy = Op0->getType();

0 commit comments

Comments
 (0)