diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2022-11-25 11:01:49 +0100 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2022-11-25 11:02:16 +0100 |
commit | 7f06a5824cdb297a19b7c82bb191c22539f34070 (patch) | |
tree | 40a3207b46f9db7d8f7d9756468206425b378359 /llvm/lib | |
parent | 8bed59c7e7da2fea41a9167e15c15a8f58a5ede7 (diff) | |
download | llvm-7f06a5824cdb297a19b7c82bb191c22539f34070.zip llvm-7f06a5824cdb297a19b7c82bb191c22539f34070.tar.gz llvm-7f06a5824cdb297a19b7c82bb191c22539f34070.tar.bz2 |
[Hexagon] Put asserts in an !NDEBUG region. NFCI
Avoids unused variables in NDEBUG builds.
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp b/llvm/lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp index 0c7419f..6991926 100644 --- a/llvm/lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp +++ b/llvm/lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp @@ -2285,13 +2285,15 @@ SDValue HvxSelector::getVectorConstant(ArrayRef<uint8_t> Data, void HvxSelector::selectExtractSubvector(SDNode *N) { SDValue Inp = N->getOperand(0); MVT ResTy = N->getValueType(0).getSimpleVT(); + auto IdxN = cast<ConstantSDNode>(N->getOperand(1)); + unsigned Idx = IdxN->getZExtValue(); +#ifndef NDEBUG MVT InpTy = Inp.getValueType().getSimpleVT(); assert(InpTy.getVectorElementType() == ResTy.getVectorElementType()); unsigned ResLen = ResTy.getVectorNumElements(); assert(2 * ResLen == InpTy.getVectorNumElements()); - auto IdxN = cast<ConstantSDNode>(N->getOperand(1)); - unsigned Idx = IdxN->getZExtValue(); assert(Idx == 0 || Idx == ResLen); +#endif unsigned SubReg = Idx == 0 ? Hexagon::vsub_lo : Hexagon::vsub_hi; SDValue Ext = DAG.getTargetExtractSubreg(SubReg, SDLoc(N), ResTy, Inp); |