[NFC] Simple tidy-up in LoopVectorizationCostModel::selectEpilogueVectorizationFactor
authorDavid Sherwood <david.sherwood@arm.com>
Mon, 4 Oct 2021 08:52:26 +0000 (09:52 +0100)
committerDavid Sherwood <david.sherwood@arm.com>
Mon, 4 Oct 2021 09:14:22 +0000 (10:14 +0100)
Avoid creating EpilogueVectorizationForceVF twice.

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

index 6f17134..8a2f495 100644 (file)
@@ -6249,9 +6249,9 @@ LoopVectorizationCostModel::selectEpilogueVectorizationFactor(
 
   if (EpilogueVectorizationForceVF > 1) {
     LLVM_DEBUG(dbgs() << "LEV: Epilogue vectorization factor is forced.\n";);
-    if (LVP.hasPlanWithVFs(
-            {MainLoopVF, ElementCount::getFixed(EpilogueVectorizationForceVF)}))
-      return {ElementCount::getFixed(EpilogueVectorizationForceVF), 0};
+    ElementCount ForcedEC = ElementCount::getFixed(EpilogueVectorizationForceVF);
+    if (LVP.hasPlanWithVFs({MainLoopVF, ForcedEC}))
+      return {ForcedEC, 0};
     else {
       LLVM_DEBUG(
           dbgs()