[llvm-commits] [llvm] r154445 - /llvm/trunk/tools/llvm-stress/llvm-stress.cpp
Dylan Noblesmith
nobled at dreamwidth.org
Tue Apr 10 15:44:49 PDT 2012
Author: nobled
Date: Tue Apr 10 17:44:49 2012
New Revision: 154445
URL: http://llvm.org/viewvc/llvm-project?rev=154445&view=rev
Log:
llvm-stress: don't make vectors of x86_mmx type
LangRef.html says:
"There are no arrays, vectors or constants of this type."
This was hitting assertions when passing the -generate-x86-mmx
option.
PR12452.
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=154445&r1=154444&r2=154445&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-stress/llvm-stress.cpp (original)
+++ llvm/trunk/tools/llvm-stress/llvm-stress.cpp Tue Apr 10 17:44:49 2012
@@ -202,11 +202,17 @@
/// Pick a random vector type.
Type *pickVectorType(unsigned len = (unsigned)-1) {
- Type *Ty = pickScalarType();
// Pick a random vector width in the range 2**0 to 2**4.
// by adding two randoms we are generating a normal-like distribution
// around 2**3.
unsigned width = 1<<((Ran->Rand() % 3) + (Ran->Rand() % 3));
+ Type *Ty;
+
+ // Vectors of x86mmx are illegal; keep trying till we get something else.
+ do {
+ Ty = pickScalarType();
+ } while (Ty->isX86_MMXTy());
+
if (len != (unsigned)-1)
width = len;
return VectorType::get(Ty, width);
More information about the llvm-commits
mailing list