[llvm] c465a56 - [VPlan] Handle canonical IVs in ::isSingleScalar. (NFCI)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 30 13:52:17 PST 2025


Author: Florian Hahn
Date: 2025-11-30T21:51:03Z
New Revision: c465a56e9d1f244a32ea00a426d449bc7f38a9b1

URL: https://github.com/llvm/llvm-project/commit/c465a56e9d1f244a32ea00a426d449bc7f38a9b1
DIFF: https://github.com/llvm/llvm-project/commit/c465a56e9d1f244a32ea00a426d449bc7f38a9b1.diff

LOG: [VPlan] Handle canonical IVs in ::isSingleScalar. (NFCI)

The canonical IV is always a single scalar. They are already treated as
uniform-across-UF-and-VF.

This should currently be NFC.

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/VPlanUtils.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/VPlanUtils.cpp b/llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
index c7a0fd7407a4e..d36975699c4a8 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
@@ -197,7 +197,8 @@ bool vputils::isSingleScalar(const VPValue *VPV) {
             all_of(VPI->operands(), isSingleScalar));
   if (auto *RR = dyn_cast<VPReductionRecipe>(VPV))
     return !RR->isPartialReduction();
-  if (isa<VPVectorPointerRecipe, VPVectorEndPointerRecipe>(VPV))
+  if (isa<VPCanonicalIVPHIRecipe, VPVectorPointerRecipe,
+          VPVectorEndPointerRecipe>(VPV))
     return true;
   if (auto *Expr = dyn_cast<VPExpressionRecipe>(VPV))
     return Expr->isSingleScalar();


        


More information about the llvm-commits mailing list