aboutsummaryrefslogtreecommitdiff
path: root/libcpp/include
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2018-07-03 10:03:17 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2018-07-03 10:03:17 +0000
commit4ef79c960aa0967cf0298dc496a30a40d86ebd3c (patch)
tree0ae63c6c6dc83b6cd7647a38c2a0757969ef2439 /libcpp/include
parent370c2ebe8fa20e0812cd2d533d4ed38ee2d37c85 (diff)
downloadgcc-4ef79c960aa0967cf0298dc496a30a40d86ebd3c.zip
gcc-4ef79c960aa0967cf0298dc496a30a40d86ebd3c.tar.gz
gcc-4ef79c960aa0967cf0298dc496a30a40d86ebd3c.tar.bz2
[15/n] PR85694: Try to split existing casts in widened patterns
The main over-widening patch can introduce quite a few extra casts, and in many cases those casts simply "tap into" an intermediate point in an existing extension. E.g. if we have: unsigned char a; int ax = (int) a; and a later operation using ax is shortened to "unsigned short", we would need: unsigned short ax' = (unsigned short) a; The a->ax extension requires one set of unpacks to get to unsigned short and another set of unpacks to get to int. The first set are then duplicated for ax'. If both ax and ax' are needed, the a->ax' extension would end up counting twice during cost calculations. This patch rewrites the original: int ax = (int) a; into a pattern: unsigned short ax' = (unsigned short) a; int ax = (int) ax'; so that each extension only counts once. 2018-07-03 Richard Sandiford <richard.sandiford@arm.com> gcc/ * tree-vect-patterns.c (vect_split_statement): New function. (vect_convert_input): Use it to try to split an existing cast. gcc/testsuite/ * gcc.dg/vect/vect-over-widen-5.c: Test that the extensions get split into two for use by the over-widening pattern. * gcc.dg/vect/vect-over-widen-6.c: Likewise. * gcc.dg/vect/vect-over-widen-7.c: Likewise. * gcc.dg/vect/vect-over-widen-8.c: Likewise. * gcc.dg/vect/vect-over-widen-9.c: Likewise. * gcc.dg/vect/vect-over-widen-10.c: Likewise. * gcc.dg/vect/vect-over-widen-11.c: Likewise. * gcc.dg/vect/vect-over-widen-12.c: Likewise. * gcc.dg/vect/vect-over-widen-13.c: Likewise. * gcc.dg/vect/vect-over-widen-14.c: Likewise. * gcc.dg/vect/vect-over-widen-15.c: Likewise. * gcc.dg/vect/vect-over-widen-16.c: Likewise. * gcc.dg/vect/vect-over-widen-22.c: New test. From-SVN: r262334
Diffstat (limited to 'libcpp/include')
0 files changed, 0 insertions, 0 deletions