diff options
author | Mark Seaborn <mseaborn@chromium.org> | 2013-06-03 09:58:02 -0700 |
---|---|---|
committer | Mark Seaborn <mseaborn@chromium.org> | 2013-06-03 09:58:02 -0700 |
commit | 4358dd390dc7f621a5ce427a2d1fc3577ac70ef5 (patch) | |
tree | 9c740162953d324221efec50b213407c62950e4a /lib/Bitcode/NaCl/Reader/NaClBitcodeHeader.cpp | |
parent | 0abed14b33c90a8622edda000e4443aa00068b5a (diff) |
PNaCl: ExpandVarArgs: Use memcpy() instead of struct load+store for struct args
Although PNaCl doesn't fully support struct types as varargs
arguments, there is a test in Spec2k (255.vortex) that passes a struct
as a varargs argument but never reads the argument using va_arg (which
is legal, but strange).
ExpandVarArgs was handling the struct argument by copying it with a
struct load+store. This is undesirable because currently SROA
converts that into code that uses extractvalue, which was rejected by
the PNaCl ABI checker. Struct load/store will soon be rejected by the
ABI checker too.
We could fix this by running ExpandStructRegs after ExpandVarArgs, but
it's cleaner for ExpandVarArgs to use memcpy() instead of struct
load+store. memcpy() is potentially more efficient because it avoids
having a temporary copy of the struct, and using memcpy() avoids
dependencies between IR passes.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3338
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3343
TEST=*.ll tests + built 255.vortex from Spec2k
Review URL: https://codereview.chromium.org/16232021
Diffstat (limited to 'lib/Bitcode/NaCl/Reader/NaClBitcodeHeader.cpp')
0 files changed, 0 insertions, 0 deletions