<div class="gmail_quote">On Sun, Feb 26, 2012 at 4:00 AM, Nadav Rotem <span dir="ltr"><<a href="mailto:nadav.rotem@intel.com">nadav.rotem@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: nadav<br>
Date: Sun Feb 26 06:00:22 2012<br>
New Revision: 151487<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=151487&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=151487&view=rev</a><br>
Log:<br>
Fix a bug in the code that checks if a store value is a vector of i1s<br>
<br>
Modified:<br>
    llvm/trunk/tools/llvm-stress/llvm-stress.cpp<br>
<br>
Modified: llvm/trunk/tools/llvm-stress/llvm-stress.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-stress/llvm-stress.cpp?rev=151487&r1=151486&r2=151487&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-stress/llvm-stress.cpp?rev=151487&r1=151486&r2=151487&view=diff</a><br>

==============================================================================<br>
--- llvm/trunk/tools/llvm-stress/llvm-stress.cpp (original)<br>
+++ llvm/trunk/tools/llvm-stress/llvm-stress.cpp Sun Feb 26 06:00:22 2012<br>
@@ -224,10 +224,11 @@<br>
     Value *Ptr = getRandomPointerValue();<br>
     Type  *Tp = Ptr->getType();<br>
     Value *Val = getRandomValue(Tp->getContainedType(0));<br>
+    Type  *ValTy = Val->getType();<br>
<br>
     // Do not store vectors of i1s because they are unsupported<br>
     //by the codegen.<br>
-    if (Tp->isVectorTy() && Tp->getScalarSizeInBits() == 1)<br>
+    if (ValTy->isVectorTy() && (ValTy->getScalarSizeInBits() == 1))<br></blockquote><div><br></div><div>Style nit: don't wrap '==' (or other equality / relational operators) in parentheses unless needed for precedence. We use the parentheses in '(foo = x)' to signify the assignment is intended, and to reliably get that signal we need to write 'foo == x' w/o parentheses.</div>
</div>