[llvm-branch-commits] [llvm] 46975b5 - [Hexagon] Wrap functions only used in asserts in ifndef NDEBUG

Krzysztof Parzyszek via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Jan 6 07:45:53 PST 2021


Author: Krzysztof Parzyszek
Date: 2021-01-06T09:40:38-06:00
New Revision: 46975b5b29e2ecbf97eb7be2b124d94f0ce4b45e

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

LOG: [Hexagon] Wrap functions only used in asserts in ifndef NDEBUG

Added: 
    

Modified: 
    llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp b/llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp
index 05269d37f812..01fd8a9ef9ce 100644
--- a/llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp
@@ -117,8 +117,11 @@ class HexagonVectorCombine {
   const HexagonSubtarget &HST;
 
 private:
+#ifndef NDEBUG
+  // These two functions are only used for assertions at the moment.
   bool isByteVecTy(Type *Ty) const;
-  bool isSectorTy(Type *Ty) const LLVM_ATTRIBUTE_UNUSED;
+  bool isSectorTy(Type *Ty) const;
+#endif
   Value *getElementRange(IRBuilder<> &Builder, Value *Lo, Value *Hi, int Start,
                          int Length) const;
 };
@@ -1406,6 +1409,7 @@ auto HexagonVectorCombine::isSafeToMoveBeforeInBB(const Instruction &In,
   return true;
 }
 
+#ifndef NDEBUG
 auto HexagonVectorCombine::isByteVecTy(Type *Ty) const -> bool {
   if (auto *VecTy = dyn_cast<VectorType>(Ty))
     return VecTy->getElementType() == getByteTy();
@@ -1420,6 +1424,7 @@ auto HexagonVectorCombine::isSectorTy(Type *Ty) const -> bool {
     return Size == static_cast<int>(HST.getVectorLength());
   return Size == 4 || Size == 8;
 }
+#endif
 
 auto HexagonVectorCombine::getElementRange(IRBuilder<> &Builder, Value *Lo,
                                            Value *Hi, int Start,


        


More information about the llvm-branch-commits mailing list