When computing the alignof value for a vector type, ensure that
the alignment is a power of 2, even in the esoteric case of a vector element which does not have a power-of-2 sizeof value. llvm-svn: 102036
This commit is contained in:
parent
6b7f12c039
commit
ef78c8ebd7
|
@ -515,7 +515,7 @@ ASTContext::getTypeInfo(const Type *T) {
|
|||
Align = Width;
|
||||
// If the alignment is not a power of 2, round up to the next power of 2.
|
||||
// This happens for non-power-of-2 length vectors.
|
||||
if (VT->getNumElements() & (VT->getNumElements()-1)) {
|
||||
if (Align & (Align-1)) {
|
||||
Align = llvm::NextPowerOf2(Align);
|
||||
Width = llvm::RoundUpToAlignment(Width, Align);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue