diff options
author | Andrew Stubbs <ams@codesourcery.com> | 2018-11-15 17:14:15 +0000 |
---|---|---|
committer | Andrew Stubbs <ams@gcc.gnu.org> | 2018-11-15 17:14:15 +0000 |
commit | 1ec7f4929a286da7aa03d413a0fe99c9c36be915 (patch) | |
tree | 8b4f15e343837ad357e3109beffa90c0c88fc487 /gcc | |
parent | 2bd652d265f8158e9deed8715e5d1972bf8cd7c4 (diff) | |
download | gcc-1ec7f4929a286da7aa03d413a0fe99c9c36be915.zip gcc-1ec7f4929a286da7aa03d413a0fe99c9c36be915.tar.gz gcc-1ec7f4929a286da7aa03d413a0fe99c9c36be915.tar.bz2 |
Handle vectors that don't fit in an integer.
GCN vector sizes range between 64 and 512 bytes, none of which have
correspondingly sized integer modes. This breaks a number of assumptions
throughout the compiler, but I don't really want to create modes just for this
purpose.
Instead, this patch fixes up the cases that I've found, so far, such that the
compiler tries something else, or fails to optimize, rather than just ICE.
2018-11-15 Andrew Stubbs <ams@codesourcery.com>
Kwok Cheung Yeung <kcy@codesourcery.com>
gcc/
* tree-vect-stmts.c (vectorizable_store): Don't ICE when
int_mode_for_size fails.
(vectorizable_load): Likewise.
Co-Authored-By: Kwok Cheung Yeung <kcy@codesourcery.com>
From-SVN: r266190
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/tree-vect-stmts.c | 8 |
2 files changed, 11 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 45fbfe1..7b46b67 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-11-15 Andrew Stubbs <ams@codesourcery.com> + Kwok Cheung Yeung <kcy@codesourcery.com> + + * tree-vect-stmts.c (vectorizable_store): Don't ICE when + int_mode_for_size fails. + (vectorizable_load): Likewise. + 2018-11-15 David Malcolm <dmalcolm@redhat.com> * doc/ux.texi (Group logically-related diagnostics): Move diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index a67a7f4..764810b 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -6654,12 +6654,12 @@ vectorizable_store (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi, supported. */ unsigned lsize = group_size * GET_MODE_BITSIZE (elmode); - elmode = int_mode_for_size (lsize, 0).require (); unsigned int lnunits = const_nunits / group_size; /* If we can't construct such a vector fall back to element extracts from the original vector type and element size stores. */ - if (mode_for_vector (elmode, lnunits).exists (&vmode) + if (int_mode_for_size (lsize, 0).exists (&elmode) + && mode_for_vector (elmode, lnunits).exists (&vmode) && VECTOR_MODE_P (vmode) && targetm.vector_mode_supported_p (vmode) && (convert_optab_handler (vec_extract_optab, @@ -7789,11 +7789,11 @@ vectorizable_load (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi, to a larger load. */ unsigned lsize = group_size * TYPE_PRECISION (TREE_TYPE (vectype)); - elmode = int_mode_for_size (lsize, 0).require (); unsigned int lnunits = const_nunits / group_size; /* If we can't construct such a vector fall back to element loads of the original vector type. */ - if (mode_for_vector (elmode, lnunits).exists (&vmode) + if (int_mode_for_size (lsize, 0).exists (&elmode) + && mode_for_vector (elmode, lnunits).exists (&vmode) && VECTOR_MODE_P (vmode) && targetm.vector_mode_supported_p (vmode) && (convert_optab_handler (vec_init_optab, vmode, elmode) |