[llvm] [VPlan] Factor out isUnrolled() helper in VPWidenIntOrFpInductionRecipe. NFC (PR #137635)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 28 07:06:56 PDT 2025


================
@@ -1901,7 +1903,7 @@ class VPWidenIntOrFpInductionRecipe : public VPWidenInductionRecipe {
   VPValue *getSplatVFValue() {
     // If the recipe has been unrolled (4 operands), return the VPValue for the
     // induction increment.
-    return getNumOperands() == 5 ? getOperand(3) : nullptr;
+    return isUnrolled() ? getOperand(getNumOperands() - 2) : nullptr;
----------------
lukel97 wrote:

Oh good catch, I've cleaned it up in b9b058d6d0f6d90bcd970ac1c164e056f829e074

https://github.com/llvm/llvm-project/pull/137635


More information about the llvm-commits mailing list