summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/TargetInfo.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-09-23 01:54:28 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-09-23 01:54:28 +0000
commitb34b08098c71789401f9dd9f37815d41d0dfcafa (patch)
tree4808d74bf8543d621fabd9ae5f404f37ca7d1062 /clang/lib/CodeGen/TargetInfo.cpp
parenta51ed9bb496ce6101468fe9a1027e3aa1c19c143 (diff)
downloadbcm5719-llvm-b34b08098c71789401f9dd9f37815d41d0dfcafa.tar.gz
bcm5719-llvm-b34b08098c71789401f9dd9f37815d41d0dfcafa.zip
IRgen/ABI/ARM: Trust the backend to pass vectors correctly for the given ABI.
- Therefore, we can lower out the NEON wrapper structs and pass the vectors directly. This makes a huge difference in the cleanliness of the IR after optimization. - I will trust, but verify, via future ABITest testing (for APCS-GNU, at least). llvm-svn: 114618
Diffstat (limited to 'clang/lib/CodeGen/TargetInfo.cpp')
-rw-r--r--clang/lib/CodeGen/TargetInfo.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp
index 34a6d37726b..f1da3c39035 100644
--- a/clang/lib/CodeGen/TargetInfo.cpp
+++ b/clang/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.
OpenPOWER on IntegriCloud