[llvm-commits] [llvm] r151487 - /llvm/trunk/tools/llvm-stress/llvm-stress.cpp

Chandler Carruth chandlerc at google.com
Sun Feb 26 04:17:30 PST 2012


On Sun, Feb 26, 2012 at 4:00 AM, Nadav Rotem <nadav.rotem at intel.com> wrote:

> Author: nadav
> Date: Sun Feb 26 06:00:22 2012
> New Revision: 151487
>
> URL: http://llvm.org/viewvc/llvm-project?rev=151487&view=rev
> Log:
> Fix a bug in the code that checks if a store value is a vector of i1s
>
> Modified:
>    llvm/trunk/tools/llvm-stress/llvm-stress.cpp
>
> Modified: llvm/trunk/tools/llvm-stress/llvm-stress.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-stress/llvm-stress.cpp?rev=151487&r1=151486&r2=151487&view=diff
>
> ==============================================================================
> --- llvm/trunk/tools/llvm-stress/llvm-stress.cpp (original)
> +++ llvm/trunk/tools/llvm-stress/llvm-stress.cpp Sun Feb 26 06:00:22 2012
> @@ -224,10 +224,11 @@
>     Value *Ptr = getRandomPointerValue();
>     Type  *Tp = Ptr->getType();
>     Value *Val = getRandomValue(Tp->getContainedType(0));
> +    Type  *ValTy = Val->getType();
>
>     // Do not store vectors of i1s because they are unsupported
>     //by the codegen.
> -    if (Tp->isVectorTy() && Tp->getScalarSizeInBits() == 1)
> +    if (ValTy->isVectorTy() && (ValTy->getScalarSizeInBits() == 1))
>

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120226/8f7496d1/attachment.html>


More information about the llvm-commits mailing list