@@ -898,7 +898,7 @@ class VPInstruction : public VPRecipeWithIRFlags,
898
898
// / Scale the first operand (vector step) by the second operand
899
899
// / (scalar-step). Casts both operands to the result type if needed.
900
900
WideIVStep,
901
- // Creates a step vector starting from 0 with a step of 1.
901
+ // Creates a step vector starting from 0 to VF with a step of 1.
902
902
StepVector,
903
903
904
904
};
@@ -1065,15 +1065,20 @@ class VPInstructionWithType : public VPInstruction {
1065
1065
: VPInstruction(Opcode, Operands, FMFs, DL, Name), ResultTy(ResultTy) {}
1066
1066
1067
1067
static inline bool classof (const VPRecipeBase *R) {
1068
- if (isa<VPInstruction>(R) &&
1069
- cast<VPInstruction>(R)->getOpcode () == VPInstruction::StepVector)
1070
- return true ;
1071
1068
// VPInstructionWithType are VPInstructions with specific opcodes requiring
1072
1069
// type information.
1073
1070
if (R->isScalarCast ())
1074
1071
return true ;
1075
1072
auto *VPI = dyn_cast<VPInstruction>(R);
1076
- return VPI && VPI->getOpcode () == VPInstruction::WideIVStep;
1073
+ if (!VPI)
1074
+ return false ;
1075
+ switch (VPI->getOpcode ()) {
1076
+ case VPInstruction::WideIVStep:
1077
+ case VPInstruction::StepVector:
1078
+ return true ;
1079
+ default :
1080
+ return false ;
1081
+ }
1077
1082
}
1078
1083
1079
1084
static inline bool classof (const VPUser *R) {
@@ -1833,6 +1838,8 @@ class VPWidenInductionRecipe : public VPHeaderPHIRecipe {
1833
1838
class VPWidenIntOrFpInductionRecipe : public VPWidenInductionRecipe {
1834
1839
TruncInst *Trunc;
1835
1840
1841
+ bool isUnrolled () const { return getNumOperands () == 6 ; }
1842
+
1836
1843
public:
1837
1844
VPWidenIntOrFpInductionRecipe (PHINode *IV, VPValue *Start, VPValue *Step,
1838
1845
VPValue *VF, const InductionDescriptor &IndDesc,
@@ -1913,9 +1920,6 @@ class VPWidenIntOrFpInductionRecipe : public VPWidenInductionRecipe {
1913
1920
VPValue *getLastUnrolledPartOperand () {
1914
1921
return isUnrolled () ? getOperand (getNumOperands () - 1 ) : this ;
1915
1922
}
1916
-
1917
- private:
1918
- bool isUnrolled () const { return getNumOperands () == 6 ; }
1919
1923
};
1920
1924
1921
1925
class VPWidenPointerInductionRecipe : public VPWidenInductionRecipe ,
0 commit comments