[llvm] r296321 - [X86] Check for less than 0 rather than explicit compare with -1. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 26 22:05:31 PST 2017
Author: ctopper
Date: Mon Feb 27 00:05:30 2017
New Revision: 296321
URL: http://llvm.org/viewvc/llvm-project?rev=296321&view=rev
Log:
[X86] Check for less than 0 rather than explicit compare with -1. NFC
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=296321&r1=296320&r2=296321&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Feb 27 00:05:30 2017
@@ -8141,12 +8141,13 @@ static bool isNonZeroElementsInOrder(con
// 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;
}
More information about the llvm-commits
mailing list