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 {
1851
1851
class VPWidenIntOrFpInductionRecipe : public VPWidenInductionRecipe {
1852
1852
TruncInst *Trunc;
1853
1853
1854
+ bool isUnrolled () const { return getNumOperands () == 5 ; }
1855
+
1854
1856
public:
1855
1857
VPWidenIntOrFpInductionRecipe (PHINode *IV, VPValue *Start, VPValue *Step,
1856
1858
VPValue *VF, const InductionDescriptor &IndDesc,
@@ -1901,7 +1903,7 @@ class VPWidenIntOrFpInductionRecipe : public VPWidenInductionRecipe {
1901
1903
VPValue *getSplatVFValue () {
1902
1904
// If the recipe has been unrolled (4 operands), return the VPValue for the
1903
1905
// induction increment.
1904
- return getNumOperands () == 5 ? getOperand (3 ) : nullptr ;
1906
+ return isUnrolled () ? getOperand (getNumOperands () - 2 ) : nullptr ;
1905
1907
}
1906
1908
1907
1909
// / Returns the first defined value as TruncInst, if it is one or nullptr
@@ -1923,7 +1925,7 @@ class VPWidenIntOrFpInductionRecipe : public VPWidenInductionRecipe {
1923
1925
// / the last unrolled part, if it exists. Returns itself if unrolling did not
1924
1926
// / take place.
1925
1927
VPValue *getLastUnrolledPartOperand () {
1926
- return getNumOperands () == 5 ? getOperand (4 ) : this ;
1928
+ return isUnrolled () ? getOperand (getNumOperands () - 1 ) : this ;
1927
1929
}
1928
1930
};
1929
1931
You can’t perform that action at this time.
0 commit comments