From 46975b5b29e2ecbf97eb7be2b124d94f0ce4b45e Mon Sep 17 00:00:00 2001 From: Krzysztof Parzyszek Date: Wed, 6 Jan 2021 09:11:04 -0600 Subject: [PATCH] [Hexagon] Wrap functions only used in asserts in ifndef NDEBUG --- llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp b/llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp index 05269d37f81..01fd8a9ef9c 100644 --- a/llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp +++ b/llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp @@ -117,8 +117,11 @@ public: 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(Ty)) return VecTy->getElementType() == getByteTy(); @@ -1420,6 +1424,7 @@ auto HexagonVectorCombine::isSectorTy(Type *Ty) const -> bool { return Size == static_cast(HST.getVectorLength()); return Size == 4 || Size == 8; } +#endif auto HexagonVectorCombine::getElementRange(IRBuilder<> &Builder, Value *Lo, Value *Hi, int Start, -- 2.11.0