[llvm] a28d753 - [Vectorize] Fix a warning

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Wed May 21 08:03:22 PDT 2025


Author: Kazu Hirata
Date: 2025-05-21T08:03:16-07:00
New Revision: a28d753e9645f62bff4d65c5ddce17e11e8fd078

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

LOG: [Vectorize] Fix a warning

This patch fixes:

  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:8564:20: error:
  unused variable 'LoopRegionOf' [-Werror,-Wunused-variable]

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index d2d1dad119ea7..275b3d5678560 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -8564,6 +8564,7 @@ VPRecipeBase *VPRecipeBuilder::tryToCreateWidenRecipe(VPSingleDefRecipe *R,
     VPRegionBlock *LoopRegionOf = Parent->getEnclosingLoopRegion();
     assert(LoopRegionOf && LoopRegionOf->getEntry() == Parent &&
            "Non-header phis should have been handled during predication");
+    (void)LoopRegionOf;
     auto *Phi = cast<PHINode>(R->getUnderlyingInstr());
     assert(Operands.size() == 2 && "Must have 2 operands for header phis");
     if ((Recipe = tryToOptimizeInductionPHI(Phi, Operands, Range)))


        


More information about the llvm-commits mailing list