mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-20 08:54:08 +00:00
Support alignment queries for degenerate (length 1) vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36352 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
007ce3b336
commit
a7f0d3ce22
@ -493,9 +493,15 @@ unsigned char TargetData::getAlignment(const Type *Ty, bool abi_or_pref) const {
|
|||||||
case Type::DoubleTyID:
|
case Type::DoubleTyID:
|
||||||
AlignType = FLOAT_ALIGN;
|
AlignType = FLOAT_ALIGN;
|
||||||
break;
|
break;
|
||||||
case Type::VectorTyID:
|
case Type::VectorTyID: {
|
||||||
AlignType = VECTOR_ALIGN;
|
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;
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
assert(0 && "Bad type for getAlignment!!!");
|
assert(0 && "Bad type for getAlignment!!!");
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user