Check against >= 0 instead of != -1 in getSplatIndex because it generally compiles to better code and is equivalent for shuffle indices.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187774 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Craig Topper 2013-08-06 05:07:37 +00:00
parent 2c136f8120
commit 6e95b4c6ce

View File

@ -1202,7 +1202,7 @@ public:
assert(isSplat() && "Cannot get splat index for non-splat!");
EVT VT = getValueType(0);
for (unsigned i = 0, e = VT.getVectorNumElements(); i != e; ++i) {
if (Mask[i] != -1)
if (Mask[i] >= 0)
return Mask[i];
}
return -1;