diff options
author | Chris Lattner <sabre@nondot.org> | 2005-11-10 01:40:59 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-11-10 01:40:59 +0000 |
commit | d7dbb856b9b047c2d9c6e11cc5c7d3376555700f (patch) | |
tree | 7f063415d3a38717c2c8c056f2df14e126781819 /llvm/lib | |
parent | bf4f233214b5b07929a9a863823209ba398c0760 (diff) | |
download | bcm5719-llvm-d7dbb856b9b047c2d9c6e11cc5c7d3376555700f.tar.gz bcm5719-llvm-d7dbb856b9b047c2d9c6e11cc5c7d3376555700f.zip |
Force packed vectors to be a power of two in length.
llvm-svn: 24264
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/VMCore/Type.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Type.cpp b/llvm/lib/VMCore/Type.cpp index 4eb744db2fa..9b9ca4f0ba0 100644 --- a/llvm/lib/VMCore/Type.cpp +++ b/llvm/lib/VMCore/Type.cpp @@ -19,6 +19,7 @@ #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/SCCIterator.h" #include "llvm/ADT/STLExtras.h" +#include "llvm/Support/MathExtras.h" #include <algorithm> #include <iostream> using namespace llvm; @@ -1005,6 +1006,7 @@ static TypeMap<PackedValType, PackedType> PackedTypes; PackedType *PackedType::get(const Type *ElementType, unsigned NumElements) { assert(ElementType && "Can't get packed of null types!"); + assert(isPowerOf2_32(NumElements) && "Vector length should be a power of 2!"); PackedValType PVT(ElementType, NumElements); PackedType *PT = PackedTypes.get(PVT); |