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

This commit is contained in:
Krzysztof Parzyszek 2021-01-06 09:11:04 -06:00
parent 25c78de6d2
commit 46975b5b29
1 changed files with 6 additions and 1 deletions

View File

@ -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<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,