Skip to content

Commit

Permalink
Fix 'unsigned variable can never be negative' cppcheck warning. NFCI.
Browse files Browse the repository at this point in the history
  • Loading branch information
RKSimon committed Mar 2, 2020
1 parent c112e94 commit 2b624e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
Expand Up @@ -1826,7 +1826,7 @@ static bool foldMaskAndShiftToScale(SelectionDAG &DAG, SDValue N,

// There is nothing we can do here unless the mask is removing some bits.
// Also, the addressing mode can only represent shifts of 1, 2, or 3 bits.
if (AMShiftAmt <= 0 || AMShiftAmt > 3) return true;
if (AMShiftAmt == 0 || AMShiftAmt > 3) return true;

// We also need to ensure that mask is a continuous run of bits.
if (countTrailingOnes(Mask >> MaskTZ) + MaskTZ + MaskLZ != 64) return true;
Expand Down Expand Up @@ -1921,7 +1921,7 @@ static bool foldMaskedShiftToBEXTR(SelectionDAG &DAG, SDValue N,

// There is nothing we can do here unless the mask is removing some bits.
// Also, the addressing mode can only represent shifts of 1, 2, or 3 bits.
if (AMShiftAmt <= 0 || AMShiftAmt > 3) return true;
if (AMShiftAmt == 0 || AMShiftAmt > 3) return true;

MVT VT = N.getSimpleValueType();
SDLoc DL(N);
Expand Down

0 comments on commit 2b624e0

Please sign in to comment.