]> granicus.if.org Git - llvm/commitdiff
[X86][SSE] Fix -Wsign-compare problems introduced in r314658
authorBjorn Pettersson <bjorn.a.pettersson@ericsson.com>
Mon, 2 Oct 2017 12:46:38 +0000 (12:46 +0000)
committerBjorn Pettersson <bjorn.a.pettersson@ericsson.com>
Mon, 2 Oct 2017 12:46:38 +0000 (12:46 +0000)
The refactoring in
"[X86][SSE] Add createPackShuffleMask helper function. NFCI."
resulted in warning when compiling the code (seen in build bots).

This patch restores some types from int to unsigned to avoid
those warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314667 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86ISelLowering.cpp

index 7e5e709aa3b500412abd7117c12e795bffcd24e8..7dada542d38b58b59764fe558f877f5c269a9bbb 100644 (file)
@@ -5449,10 +5449,10 @@ static bool getTargetShuffleMaskIndices(SDValue MaskNode,
 static void createPackShuffleMask(MVT VT, SmallVectorImpl<int> &Mask,
                                   bool Unary) {
   assert(Mask.empty() && "Expected an empty shuffle mask vector");
-  int NumElts = VT.getVectorNumElements();
-  int NumLanes = VT.getSizeInBits() / 128;
-  int NumEltsPerLane = 128 / VT.getScalarSizeInBits();
-  int Offset = Unary ? 0 : NumElts;
+  unsigned NumElts = VT.getVectorNumElements();
+  unsigned NumLanes = VT.getSizeInBits() / 128;
+  unsigned NumEltsPerLane = 128 / VT.getScalarSizeInBits();
+  unsigned Offset = Unary ? 0 : NumElts;
 
   for (unsigned Lane = 0; Lane != NumLanes; ++Lane) {
     for (unsigned Elt = 0; Elt != NumEltsPerLane; Elt += 2)