File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -1851,6 +1851,8 @@ class VPWidenInductionRecipe : public VPHeaderPHIRecipe {
18511851class VPWidenIntOrFpInductionRecipe : public VPWidenInductionRecipe {
18521852 TruncInst *Trunc;
18531853
1854+ bool isUnrolled () const { return getNumOperands () == 5 ; }
1855+
18541856public:
18551857 VPWidenIntOrFpInductionRecipe (PHINode *IV, VPValue *Start, VPValue *Step,
18561858 VPValue *VF, const InductionDescriptor &IndDesc,
@@ -1901,7 +1903,7 @@ class VPWidenIntOrFpInductionRecipe : public VPWidenInductionRecipe {
19011903 VPValue *getSplatVFValue () {
19021904 // If the recipe has been unrolled (4 operands), return the VPValue for the
19031905 // induction increment.
1904- return getNumOperands () == 5 ? getOperand (3 ) : nullptr ;
1906+ return isUnrolled () ? getOperand (getNumOperands () - 2 ) : nullptr ;
19051907 }
19061908
19071909 // / Returns the first defined value as TruncInst, if it is one or nullptr
@@ -1923,7 +1925,7 @@ class VPWidenIntOrFpInductionRecipe : public VPWidenInductionRecipe {
19231925 // / the last unrolled part, if it exists. Returns itself if unrolling did not
19241926 // / take place.
19251927 VPValue *getLastUnrolledPartOperand () {
1926- return getNumOperands () == 5 ? getOperand (4 ) : this ;
1928+ return isUnrolled () ? getOperand (getNumOperands () - 1 ) : this ;
19271929 }
19281930};
19291931
You can’t perform that action at this time.
0 commit comments