diff options
author | John McCall <rjmccall@apple.com> | 2010-04-07 01:49:15 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-04-07 01:49:15 +0000 |
commit | 6ac5cc973caa455fe16da66ae2e801d35ae1820f (patch) | |
tree | 8f65b40aa13792faf73d2fe5948cdd35ccc6f88f | |
parent | 5d7f0a0fdde8c9f12895fc18f054d784b01807c2 (diff) | |
download | bcm5719-llvm-6ac5cc973caa455fe16da66ae2e801d35ae1820f.tar.gz bcm5719-llvm-6ac5cc973caa455fe16da66ae2e801d35ae1820f.zip |
Clean up some signedness oddities in this code noticed by clang.
llvm-svn: 100599
-rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 64702f1d5c9..411dd32124b 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -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 { |