diff --git a/llvm/tools/llvm-stress/llvm-stress.cpp b/llvm/tools/llvm-stress/llvm-stress.cpp --- a/llvm/tools/llvm-stress/llvm-stress.cpp +++ b/llvm/tools/llvm-stress/llvm-stress.cpp @@ -632,7 +632,7 @@ // If the value type is a vector, and we allow vector select, then in 50% // of the cases generate a vector select. - if (isa(Val0->getType()) && (getRandom() % 1)) { + if (isa(Val0->getType()) && (getRandom() & 1)) { unsigned NumElem = cast(Val0->getType())->getNumElements(); CondTy = FixedVectorType::get(CondTy, NumElem);