diff options
-rw-r--r-- | lib/VMCore/Type.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp index 4eb744d..9b9ca4f 100644 --- a/lib/VMCore/Type.cpp +++ b/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); |