Skip to content

Commit

Permalink
[Hexagon] Put asserts in an !NDEBUG region. NFCI
Browse files Browse the repository at this point in the history
Avoids unused variables in NDEBUG builds.
  • Loading branch information
d0k committed Nov 25, 2022
1 parent 8bed59c commit 7f06a58
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions llvm/lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp
Expand Up @@ -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);

Expand Down

0 comments on commit 7f06a58

Please sign in to comment.