1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00

Support alignment queries for degenerate (length 1) vectors.

llvm-svn: 36352
This commit is contained in:
Christopher Lamb 2007-04-22 21:54:13 +00:00
parent 5de8804b02
commit 4bc6053376

View File

@ -493,9 +493,15 @@ unsigned char TargetData::getAlignment(const Type *Ty, bool abi_or_pref) const {
case Type::DoubleTyID:
AlignType = FLOAT_ALIGN;
break;
case Type::VectorTyID:
AlignType = VECTOR_ALIGN;
case Type::VectorTyID: {
const VectorType *VTy = cast<VectorType>(Ty);
// Degenerate vectors are assumed to be scalar-ized
if (VTy->getNumElements() == 1)
return getAlignment(VTy->getElementType(), abi_or_pref);
else
AlignType = VECTOR_ALIGN;
break;
}
default:
assert(0 && "Bad type for getAlignment!!!");
break;