[llvm-branch-commits] [llvm] 38c6933 - [LV] Simplify lambda in all_of to directly return hasVF() result. (NFC)

Florian Hahn via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Jan 5 02:39:37 PST 2021


Author: Florian Hahn
Date: 2021-01-05T10:34:06Z
New Revision: 38c6933dcc9660b0c00f00ae62345339010dc764

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

LOG: [LV] Simplify lambda in all_of to directly return hasVF() result. (NFC)

The if in the lambda is not necessary. We can directly return the result
of hasVF.

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h b/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
index a61a1454aee1..1795470fa58c 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
@@ -274,9 +274,7 @@ class LoopVectorizationPlanner {
   bool hasPlanWithVFs(const ArrayRef<ElementCount> VFs) const {
     return any_of(VPlans, [&](const VPlanPtr &Plan) {
       return all_of(VFs, [&](const ElementCount &VF) {
-        if (Plan->hasVF(VF))
-          return true;
-        return false;
+        return Plan->hasVF(VF);
       });
     });
   }


        


More information about the llvm-branch-commits mailing list