[llvm] [LV] Emit truncate for widen-induction in VPlan during construction. (PR #225991)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 6 01:57:27 PDT 2026


================
@@ -2612,42 +2612,29 @@ class VPWidenInductionRecipe : public VPHeaderPHIRecipe {
 /// converted to concrete recipes before executing.
 class VPWidenIntOrFpInductionRecipe : public VPWidenInductionRecipe,
                                       public VPIRFlags {
-  TruncInst *Trunc;
-
   // If this recipe is unrolled it will have 2 additional operands.
   bool isUnrolled() const { return getNumOperands() == 5; }
 
+  // If this recipe contains narrower type than scalar IV.
+  bool IsTruncated;
+
 public:
   VPWidenIntOrFpInductionRecipe(PHINode *IV, VPValue *Start, VPValue *Step,
                                 VPValue *VF, const InductionDescriptor &IndDesc,
-                                const VPIRFlags &Flags, DebugLoc DL)
+                                const VPIRFlags &Flags, DebugLoc DL,
+                                bool IsTruncated = false)
----------------
artagnon wrote:

```suggestion
                                bool IsTruncated)
```

Would be good to drop the default argument, so we explicitly pass it everywhere?

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


More information about the llvm-commits mailing list