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

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 2 11:52:42 PDT 2026


================
@@ -673,7 +673,8 @@ static void removeRedundantInductionCasts(VPlan &Plan) {
   for (VPWidenIntOrFpInductionRecipe &IV :
        make_isa_range<VPWidenIntOrFpInductionRecipe>(
            Plan.getVectorLoopRegion()->getEntryBasicBlock()->phis())) {
-    if (IV.getTruncInst())
+    if (any_of(IV.operands(),
+               [](VPValue *V) { return match(V, m_Trunc(m_VPValue())); }))
----------------
artagnon wrote:

```suggestion
               match_fn(V, m_Trunc(m_VPValue()))))
```

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


More information about the llvm-commits mailing list