[llvm] ae5f049 - [Transforms] Fix -Wunused-function for 'GetReplicateRegion' with -DLLVM_ENABLE_ASSERTIONS=OFF (NFC)

Jie Fu via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 5 07:36:08 PDT 2023


Author: Jie Fu
Date: 2023-04-05T22:34:42+08:00
New Revision: ae5f049378826f966828bd025d13f4a917cc230e

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

LOG: [Transforms] Fix -Wunused-function for 'GetReplicateRegion' with -DLLVM_ENABLE_ASSERTIONS=OFF (NFC)

/Users/jiefu/llvm-project/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp:614:23: error: unused function 'GetReplicateRegion' [-Werror,-Wunused-function]
static VPRegionBlock *GetReplicateRegion(VPRecipeBase *R) {
                      ^
1 error generated.

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 07abcdc27edb..e0188d2b518c 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
@@ -611,6 +611,7 @@ void VPlanTransforms::optimizeForVFAndUF(VPlan &Plan, ElementCount BestVF,
   //      2. Replace vector loop region with VPBasicBlock.
 }
 
+#ifndef NDEBUG
 static VPRegionBlock *GetReplicateRegion(VPRecipeBase *R) {
   auto *Region = dyn_cast_or_null<VPRegionBlock>(R->getParent()->getParent());
   if (Region && Region->isReplicator()) {
@@ -623,6 +624,7 @@ static VPRegionBlock *GetReplicateRegion(VPRecipeBase *R) {
   }
   return nullptr;
 }
+#endif
 
 static bool properlyDominates(const VPRecipeBase *A, const VPRecipeBase *B,
                               VPDominatorTree &VPDT) {


        


More information about the llvm-commits mailing list