]> granicus.if.org Git - llvm/commitdiff
[X86] Check for less than 0 rather than explicit compare with -1. NFC
authorCraig Topper <craig.topper@gmail.com>
Mon, 27 Feb 2017 06:05:30 +0000 (06:05 +0000)
committerCraig Topper <craig.topper@gmail.com>
Mon, 27 Feb 2017 06:05:30 +0000 (06:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296321 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86ISelLowering.cpp

index 348f830809940f7e7a4e626fdf0a14fe4c6e5774..d27b53abe7087c60b5c416f306ddf117ae4fe2a6 100644 (file)
@@ -8141,12 +8141,13 @@ static bool isNonZeroElementsInOrder(const SmallBitVector &Zeroable,
   // Check if the Mask's nonzero elements are in increasing order.
   for (int i = 0, e = Zeroable.size(); i < e; i++) {
     // Checks if the mask's zeros elements are built from only zeros.
-    if (Mask[i] == -1)
+    assert(Mask[i] >= -1 && "Out of bound mask element!");
+    if (Mask[i] < 0)
       return false;
     if (Zeroable[i])
       continue;
     // Find the lowest non zero element
-    if (NextElement == -1) {
+    if (NextElement < 0) {
       NextElement = Mask[i] != 0 ? VectorType.getVectorNumElements() : 0;
       IsZeroSideLeft = NextElement != 0;
     }