[llvm] 3e0f7c7 - [Vectorize] Fix an 'unused function' warning

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 18 11:25:21 PDT 2022


Author: Kazu Hirata
Date: 2022-03-18T11:24:57-07:00
New Revision: 3e0f7c78819147a3b0206b38861f847379b657d2

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

LOG: [Vectorize] Fix an 'unused function' warning

This patch fixes:

  llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:3917:13: error:
  unused function 'needToScheduleSingleInstruction'
  [-Werror,-Wunused-function]

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index df196ca3fb5bb..1029b5b5904c2 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -3914,6 +3914,7 @@ static LoadsState canVectorizeLoads(ArrayRef<Value *> VL, const Value *VL0,
 
 /// \return true if the specified list of values has only one instruction that
 /// requires scheduling, false otherwise.
+#ifndef NDEBUG
 static bool needToScheduleSingleInstruction(ArrayRef<Value *> VL) {
   Value *NeedsScheduling = nullptr;
   for (Value *V : VL) {
@@ -3927,6 +3928,7 @@ static bool needToScheduleSingleInstruction(ArrayRef<Value *> VL) {
   }
   return NeedsScheduling;
 }
+#endif
 
 void BoUpSLP::buildTree_rec(ArrayRef<Value *> VL, unsigned Depth,
                             const EdgeInfo &UserTreeIdx) {


        


More information about the llvm-commits mailing list