[llvm] e18a547 - [VPlan] Fold if into return in prepareToExecute assertion (NFC).

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 8 04:46:27 PDT 2023


Author: Florian Hahn
Date: 2023-08-08T12:45:55+01:00
New Revision: e18a547ce21ba9ce9bfc41ec0f644a0bd733b360

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

LOG: [VPlan] Fold if into return in prepareToExecute assertion (NFC).

Independent simplification suggested in D157194.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/VPlan.cpp b/llvm/lib/Transforms/Vectorize/VPlan.cpp
index 565337f355c04f..6aa748a9ce7958 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlan.cpp
@@ -758,12 +758,10 @@ void VPlan::prepareToExecute(Value *TripCountV, Value *VectorTripCountV,
     auto *IV = getCanonicalIV();
     assert(all_of(IV->users(),
                   [](const VPUser *U) {
-                    if (isa<VPScalarIVStepsRecipe>(U) ||
-                        isa<VPDerivedIVRecipe>(U))
-                      return true;
-                    auto *VPI = cast<VPInstruction>(U);
-                    return VPI->getOpcode() ==
-                           VPInstruction::CanonicalIVIncrement;
+                    return isa<VPScalarIVStepsRecipe>(U) ||
+                           isa<VPDerivedIVRecipe>(U) ||
+                           cast<VPInstruction>(U)->getOpcode() ==
+                               VPInstruction::CanonicalIVIncrement;
                   }) &&
            "the canonical IV should only be used by its increment or "
            "ScalarIVSteps when resetting the start value");


        


More information about the llvm-commits mailing list