diff options
author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2011-07-13 21:58:55 +0000 |
---|---|---|
committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2011-07-13 21:58:55 +0000 |
commit | 98154a76fd5e5427410cd1f8690e34f7a9c02a61 (patch) | |
tree | f964eb278402f7c591adf8c9a44e304924f80a5b /clang/lib/CodeGen/TargetInfo.cpp | |
parent | ad69e65a3943824644c4d2e53ebccc9cd2a2e6c5 (diff) | |
download | bcm5719-llvm-98154a76fd5e5427410cd1f8690e34f7a9c02a61.tar.gz bcm5719-llvm-98154a76fd5e5427410cd1f8690e34f7a9c02a61.zip |
Reapply r134946 with fixes. Tested on Benjamin testcase and other test-suite failures.
llvm-svn: 135091
Diffstat (limited to 'clang/lib/CodeGen/TargetInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/TargetInfo.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp index 199ce251a10..a1a1412ea1e 100644 --- a/clang/lib/CodeGen/TargetInfo.cpp +++ b/clang/lib/CodeGen/TargetInfo.cpp @@ -1275,9 +1275,17 @@ void X86_64ABIInfo::classify(QualType Ty, uint64_t OffsetBase, uint64_t Offset = OffsetBase + Layout.getFieldOffset(idx); bool BitField = i->isBitField(); - // AMD64-ABI 3.2.3p2: Rule 1. If ..., or it contains unaligned - // fields, it has class MEMORY. + // AMD64-ABI 3.2.3p2: Rule 1. If the size of an object is larger than + // four eightbytes, or it contains unaligned fields, it has class MEMORY. // + // 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. + // + if (Size > 128 && getContext().getTypeSize(i->getType()) != 256) { + Lo = Memory; + return; + } // Note, skip this test for bit-fields, see below. if (!BitField && Offset % getContext().getTypeAlign(i->getType())) { Lo = Memory; |