From 8f6c9e95644e650fbaf063a678eb501724c8adee Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Mon, 27 Feb 2017 06:05:30 +0000 Subject: [PATCH] [X86] Check for less than 0 rather than explicit compare with -1. NFC llvm-svn: 296321 --- lib/Target/X86/X86ISelLowering.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 348f8308099..d27b53abe70 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -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; }