diff options
author | Mark Seaborn <mseaborn@chromium.org> | 2013-06-10 09:45:12 -0700 |
---|---|---|
committer | Mark Seaborn <mseaborn@chromium.org> | 2013-06-10 09:45:12 -0700 |
commit | 33ef5440926e633c189d3bcf4c12d6decc6c4836 (patch) | |
tree | f998f74a695e641fcd19d15615605aab2ead905a /tools | |
parent | b47210ff3386b2763757ea73ec739bb918b8c29e (diff) |
PNaCl: Extend ExpandStructRegs to handle "insertvalue" instructions
Previously, the pass could expand out struct_load+extractvalue
combinations (via ReplaceUsesOfStructWithFields()). This change makes
the pass more general by converting struct_loads to
scalar_load+insertvalue combinations and then by expanding out
insertvalue+extractvalue combinations.
This means the pass can now handle the insertvalue instructions that
are sometimes generated by the SROA pass. (Clang compiles ScummVM's
use of C++ method pointers to struct loads+stores which SROA generates
insertvalue instructions from.)
To make the pass more general, we also extend it to be able to handle
phi nodes of struct type. These are split into
extractvalue+scalar_phi+insertvalue combinations.
However, the pass is not yet fully general, because it doesn't handle:
* nested struct types
* array types
Change ExpandArithWithOverflow to rely on ExpandStructRegs'
insertvalue handling rather than the less general
ReplaceUsesOfStructWithFields() helper function, which can now be
removed.
SplitUpStore() no longer needs to handle Constants, because this case
is handled by ExpandExtractValue().
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3476
TEST=*.ll tests + PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/16448006
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions