Clean up some signedness oddities in this code noticed by clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100599 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
John McCall 2010-04-07 01:49:15 +00:00
parent 343b42e428
commit b1fb4497b0

View File

@ -3440,7 +3440,7 @@ unsigned getNumOfConsecutiveZeros(ShuffleVectorSDNode *SVOp, int NumElems,
/// FIXME: split into pslldqi, psrldqi, palignr variants.
static bool isVectorShift(ShuffleVectorSDNode *SVOp, SelectionDAG &DAG,
bool &isLeft, SDValue &ShVal, unsigned &ShAmt) {
int NumElems = SVOp->getValueType(0).getVectorNumElements();
unsigned NumElems = SVOp->getValueType(0).getVectorNumElements();
isLeft = true;
unsigned NumZeros = getNumOfConsecutiveZeros(SVOp, NumElems, true, DAG);
@ -3452,11 +3452,12 @@ static bool isVectorShift(ShuffleVectorSDNode *SVOp, SelectionDAG &DAG,
}
bool SeenV1 = false;
bool SeenV2 = false;
for (int i = NumZeros; i < NumElems; ++i) {
int Val = isLeft ? (i - NumZeros) : i;
int Idx = SVOp->getMaskElt(isLeft ? i : (i - NumZeros));
if (Idx < 0)
for (unsigned i = NumZeros; i < NumElems; ++i) {
unsigned Val = isLeft ? (i - NumZeros) : i;
int Idx_ = SVOp->getMaskElt(isLeft ? i : (i - NumZeros));
if (Idx_ < 0)
continue;
unsigned Idx = (unsigned) Idx_;
if (Idx < NumElems)
SeenV1 = true;
else {