diff options
Diffstat (limited to 'lib/CodeGen/TargetInfo.cpp')
-rw-r--r-- | lib/CodeGen/TargetInfo.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp index 34a6d37726..f1da3c3903 100644 --- a/lib/CodeGen/TargetInfo.cpp +++ b/lib/CodeGen/TargetInfo.cpp @@ -2272,6 +2272,17 @@ ABIArgInfo ARMABIInfo::classifyArgumentType(QualType Ty) const { if (isRecordWithNonTrivialDestructorOrCopyConstructor(Ty)) return ABIArgInfo::getIndirect(0, /*ByVal=*/false); + // NEON vectors are implemented as (theoretically) opaque structures wrapping + // the underlying vector type. We trust the backend to pass the underlying + // vectors appropriately, so we can unwrap the structs which generally will + // lead to much cleaner IR. + if (const Type *SeltTy = isSingleElementStruct(Ty, getContext())) { + if (SeltTy->isVectorType()) + return ABIArgInfo::getDirect(CGT.ConvertType(QualType(SeltTy, 0))); + } + + // Otherwise, pass by coercing to a structure of the appropriate size. + // // FIXME: This is kind of nasty... but there isn't much choice because the ARM // backend doesn't support byval. // FIXME: This doesn't handle alignment > 64 bits. |