CodeGen: Fix passing of classes with only one AVX vector member in AVX registers
authorBenjamin Kramer <benny.kra@googlemail.com>
Mon, 2 Mar 2015 16:09:24 +0000 (16:09 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Mon, 2 Mar 2015 16:09:24 +0000 (16:09 +0000)
commit83b1bf3a27e9a93038f4508492acf8497c6101e7
treed9e4348f0ab09b58532d248eaa537b28a2a6629e
parent9d0d374c5bf7072814caf9c153b12010f115367b
CodeGen: Fix passing of classes with only one AVX vector member in AVX registers

isSingleElementStruct was a bit too tight in its definition of struct
so we got a mismatch between classify() and the actual code generation.
To make matters worse the code in GetByteVectorType still defaulted to
<2 x double> if it encountered a type it didn't know, making this a
silent miscompilation (PR22753).

Completely remove the "preferred type" stuff from GetByteVectorType and
make it fail an assertion if someone tries to use it with a type not
suitable for a vector register.

llvm-svn: 230971
clang/lib/CodeGen/TargetInfo.cpp
clang/test/CodeGenCXX/x86_64-arguments-avx.cpp [new file with mode: 0644]