@@ -1026,19 +1026,22 @@ class VPInstruction : public VPRecipeWithIRFlags,
1026
1026
};
1027
1027
1028
1028
// / 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.
1031
1030
// / Expect PHIs, VPIRInstructions cannot have any operands.
1032
1031
class VPIRInstruction : public VPRecipeBase {
1033
1032
Instruction &I;
1034
1033
1035
1034
protected:
1035
+ // / VPIRInstruction::create() should be used to create VPIRInstructions, as
1036
+ // / subclasses may need to be created, e.g. VPIRPhi.
1036
1037
VPIRInstruction (Instruction &I)
1037
1038
: VPRecipeBase(VPDef::VPIRInstructionSC, ArrayRef<VPValue *>()), I(I) {}
1038
1039
1039
1040
public:
1040
1041
~VPIRInstruction () override = default ;
1041
1042
1043
+ // / Create a new VPIRPhi for \p \I, if it is a PHINode, otherwise create a
1044
+ // / VPIRInstruction.
1042
1045
static VPIRInstruction *create (Instruction &I);
1043
1046
1044
1047
VP_CLASSOF_IMPL (VPDef::VPIRInstructionSC)
@@ -1089,7 +1092,9 @@ class VPIRInstruction : public VPRecipeBase {
1089
1092
};
1090
1093
1091
1094
// / 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.
1093
1098
struct VPIRPhi : public VPIRInstruction {
1094
1099
VPIRPhi (PHINode &PN) : VPIRInstruction(PN) {}
1095
1100
0 commit comments