<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">On 22 Aug 2016, at 16:34, Craig Topper <<a href="mailto:craig.topper@gmail.com" class="">craig.topper@gmail.com</a>> wrote:<br class=""><div><blockquote type="cite" class=""><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Checking for any negative number results in slightly less code than an explicit comparison with -1 as it doesn't require an immediate.</div></div></blockquote><div><br class=""></div><div>True, but we need to make this only match the -1 Undef sentinel so we can safely use it target shuffle masks that include the -2 Zero sentinel as well.</div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_extra"><div class="gmail_quote">On Mon, Aug 22, 2016 at 6:18 AM, Simon Pilgrim via llvm-commits <span dir="ltr" class=""><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class="">llvm-commits@lists.llvm.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: rksimon<br class="">
Date: Mon Aug 22 08:18:56 2016<br class="">
New Revision: 279435<br class="">
<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=279435&view=rev" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-<wbr class="">project?rev=279435&view=rev</a><br class="">
Log:<br class="">
[X86] Only accept SM_SentinelUndef (-1) as an undefined shuffle mask in range<br class="">
<br class="">
As discussed on D23027 we should be trying to be more strict on what is an undefined mask value.<br class="">
<br class="">
Modified:<br class="">
    llvm/trunk/lib/Target/X86/<wbr class="">X86ISelLowering.cpp<br class="">
<br class="">
Modified: llvm/trunk/lib/Target/X86/<wbr class="">X86ISelLowering.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=279435&r1=279434&r2=279435&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-<wbr class="">project/llvm/trunk/lib/Target/<wbr class="">X86/X86ISelLowering.cpp?rev=<wbr class="">279435&r1=279434&r2=279435&<wbr class="">view=diff</a><br class="">
==============================<wbr class="">==============================<wbr class="">==================<br class="">
--- llvm/trunk/lib/Target/X86/<wbr class="">X86ISelLowering.cpp (original)<br class="">
+++ llvm/trunk/lib/Target/X86/<wbr class="">X86ISelLowering.cpp Mon Aug 22 08:18:56 2016<br class="">
@@ -4201,7 +4201,7 @@ bool X86TargetLowering::<wbr class="">hasAndNotCompare<br class="">
   return true;<br class="">
 }<br class="">
<br class="">
-/// Val is either less than zero (undef) or equal to the specified value.<br class="">
+/// Val is the undef sentinel value or equal to the specified value.<br class="">
 static bool isUndefOrEqual(int Val, int CmpVal) {<br class="">
   return ((Val == SM_SentinelUndef) || (Val == CmpVal));<br class="">
 }<br class="">
@@ -4212,10 +4212,10 @@ static bool isUndefOrZero(int Val) {<br class="">
 }<br class="">
<br class="">
 /// Return true if every element in Mask, beginning<br class="">
-/// from position Pos and ending in Pos+Size is undef.<br class="">
+/// from position Pos and ending in Pos+Size is the undef sentinel value.<br class="">
 static bool isUndefInRange(ArrayRef<int> Mask, unsigned Pos, unsigned Size) {<br class="">
   for (unsigned i = Pos, e = Pos + Size; i != e; ++i)<br class="">
-    if (0 <= Mask[i])<br class="">
+    if (Mask[i] != SM_SentinelUndef)<br class="">
       return false;<br class="">
   return true;<br class="">
 }<br class=""></blockquote></div></div>
</div></blockquote></div><br class=""></body></html>