diff options
author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2011-07-12 00:30:27 +0000 |
---|---|---|
committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2011-07-12 00:30:27 +0000 |
commit | 7a266810923547967773368f7b19468d47857e3e (patch) | |
tree | 03d280b5497ebc8e0529fde580271a005ac9b9d1 /clang/lib/CodeGen/TargetInfo.cpp | |
parent | e9bb9a0baa81349fcb119eac9326948ca81d298e (diff) | |
download | bcm5719-llvm-7a266810923547967773368f7b19468d47857e3e.tar.gz bcm5719-llvm-7a266810923547967773368f7b19468d47857e3e.zip |
Fix one x86_64 abi issue and the test to actually look for the right thing,
which is: { <4 x float>, <4 x float> } should continue to go through memory.
llvm-svn: 134946
Diffstat (limited to 'clang/lib/CodeGen/TargetInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/TargetInfo.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp index 0c070a19d8b..7c850afbf8f 100644 --- a/clang/lib/CodeGen/TargetInfo.cpp +++ b/clang/lib/CodeGen/TargetInfo.cpp @@ -1228,6 +1228,13 @@ void X86_64ABIInfo::classify(QualType Ty, uint64_t OffsetBase, const RecordDecl *RD = RT->getDecl(); + // The only case a 256-bit wide vector could be used is when the struct + // contains a single 256-bit element. Since Lo and Hi logic isn't extended + // to work for sizes wider than 128, early check and fallback to memory. + RecordDecl::field_iterator FirstElt = RD->field_begin(); + if (Size > 128 && getContext().getTypeSize(FirstElt->getType()) != 256) + return; + // Assume variable sized types are passed in memory. if (RD->hasFlexibleArrayMember()) return; @@ -1263,7 +1270,7 @@ void X86_64ABIInfo::classify(QualType Ty, uint64_t OffsetBase, // Classify the fields one at a time, merging the results. unsigned idx = 0; - for (RecordDecl::field_iterator i = RD->field_begin(), e = RD->field_end(); + for (RecordDecl::field_iterator i = FirstElt, e = RD->field_end(); i != e; ++i, ++idx) { uint64_t Offset = OffsetBase + Layout.getFieldOffset(idx); bool BitField = i->isBitField(); |