]> granicus.if.org Git - clang/commit
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)
commit796e9cbfc30e8b86029a9d7cecff04b82478cbe5
tree69d3fe9c85387f9eabc7715f5299ae53df211dba
parent154ded6631fad385577dc21c0217100203a3d79c
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230971 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/TargetInfo.cpp
test/CodeGenCXX/x86_64-arguments-avx.cpp [new file with mode: 0644]