diff options
author | Tim Northover <tnorthover@apple.com> | 2016-05-03 19:22:41 +0000 |
---|---|---|
committer | Tim Northover <tnorthover@apple.com> | 2016-05-03 19:22:41 +0000 |
commit | 360d2b3325f79f1a4c32656e9dc849ab4c1bc331 (patch) | |
tree | ceff9a34093554b637a91394f763ff36a18afee7 /clang/lib/CodeGen/TargetInfo.cpp | |
parent | 430e2c2140285e09c52cd4ec774f41e0742b9834 (diff) | |
download | bcm5719-llvm-360d2b3325f79f1a4c32656e9dc849ab4c1bc331.tar.gz bcm5719-llvm-360d2b3325f79f1a4c32656e9dc849ab4c1bc331.zip |
AArch64: simplify illegal vector check. NFC.
Use a utility function to check whether the number of elements is a power of 2
and drop the redundant upper limit (a 128-bit vector with more than 16 elements
would have each element < 8 bits, not possible).
llvm-svn: 268422
Diffstat (limited to 'clang/lib/CodeGen/TargetInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/TargetInfo.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp index db7c1f0e7ee..0777ba46c91 100644 --- a/clang/lib/CodeGen/TargetInfo.cpp +++ b/clang/lib/CodeGen/TargetInfo.cpp @@ -4614,7 +4614,7 @@ bool AArch64ABIInfo::isIllegalVectorType(QualType Ty) const { unsigned NumElements = VT->getNumElements(); uint64_t Size = getContext().getTypeSize(VT); // NumElements should be power of 2 between 1 and 16. - if ((NumElements & (NumElements - 1)) != 0 || NumElements > 16) + if (!llvm::isPowerOf2_32(NumElements)) return true; return Size != 64 && (Size != 128 || NumElements == 1); } |