aboutsummaryrefslogtreecommitdiff
path: root/tools/llvm-stress
diff options
context:
space:
mode:
authorDylan Noblesmith <nobled@dreamwidth.org>2012-04-10 22:44:49 +0000
committerDylan Noblesmith <nobled@dreamwidth.org>2012-04-10 22:44:49 +0000
commit701de8fafc8db86a0a7df61b177720b1f681c60c (patch)
treec868d67c320ef89ca35e24e473205d3fd3cfd812 /tools/llvm-stress
parentcff60c1409e36079b4bc6ecbda84565143bf00af (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154445 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-stress')
-rw-r--r--tools/llvm-stress/llvm-stress.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/llvm-stress/llvm-stress.cpp b/tools/llvm-stress/llvm-stress.cpp
index c0950591b1..7da80bcff9 100644
--- a/tools/llvm-stress/llvm-stress.cpp
+++ b/tools/llvm-stress/llvm-stress.cpp
@@ -202,11 +202,17 @@ protected:
/// 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);