@@ -1026,19 +1026,22 @@ class VPInstruction : public VPRecipeWithIRFlags,
10261026};
10271027
10281028// / A recipe to wrap on original IR instruction not to be modified during
1029- // / execution, execept for PHIs. For PHIs, a single VPValue operand is allowed,
1030- // / and it is used to add a new incoming value for the single predecessor VPBB.
1029+ // / execution, except for PHIs. PHIs are modeled via the VPIRPhi subclass.
10311030// / Expect PHIs, VPIRInstructions cannot have any operands.
10321031class VPIRInstruction : public VPRecipeBase {
10331032 Instruction &I;
10341033
10351034protected:
1035+ // / VPIRInstruction::create() should be used to create VPIRInstructions, as
1036+ // / subclasses may need to be created, e.g. VPIRPhi.
10361037 VPIRInstruction (Instruction &I)
10371038 : VPRecipeBase(VPDef::VPIRInstructionSC, ArrayRef<VPValue *>()), I(I) {}
10381039
10391040public:
10401041 ~VPIRInstruction () override = default ;
10411042
1043+ // / Create a new VPIRPhi for \p \I, if it is a PHINode, otherwise create a
1044+ // / VPIRInstruction.
10421045 static VPIRInstruction *create (Instruction &I);
10431046
10441047 VP_CLASSOF_IMPL (VPDef::VPIRInstructionSC)
@@ -1089,7 +1092,9 @@ class VPIRInstruction : public VPRecipeBase {
10891092};
10901093
10911094// / An overlay for VPIRInstructions wrapping PHI nodes enabling convenient use
1092- // / cast/dyn_cast/isa and execute() implementation.
1095+ // / cast/dyn_cast/isa and execute() implementation. A single VPValue operand is
1096+ // / allowed, and it is used to add a new incoming value for the single
1097+ // / predecessor VPBB.
10931098struct VPIRPhi : public VPIRInstruction {
10941099 VPIRPhi (PHINode &PN) : VPIRInstruction(PN) {}
10951100
0 commit comments