[llvm] c0bf51e - [Vectorize] Fix a warning

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sat May 31 14:40:25 PDT 2025


Author: Kazu Hirata
Date: 2025-05-31T14:40:19-07:00
New Revision: c0bf51e3ad8e3785a4e44686dc17217c645fa8b4

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

LOG: [Vectorize] Fix a warning

This patch fixes:

  llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp:1865:17: error:
  unused variable 'Preds' [-Werror,-Wunused-variable]

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
index 5c8849be3d23e..6ee7df5dd9875 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
@@ -1862,8 +1862,7 @@ static void removeBranchOnConst(VPlan &Plan) {
 
     VPBasicBlock *RemovedSucc =
         cast<VPBasicBlock>(VPBB->getSuccessors()[RemovedIdx]);
-    const auto &Preds = RemovedSucc->getPredecessors();
-    assert(count(Preds, VPBB) == 1 &&
+    assert(count(RemovedSucc->getPredecessors(), VPBB) == 1 &&
            "There must be a single edge between VPBB and its successor");
     // Values coming from VPBB into phi recipes of RemoveSucc are removed from
     // these recipes.


        


More information about the llvm-commits mailing list