From: Richard Sandiford Date: Wed, 3 Jan 2018 21:42:01 +0000 (+0000) Subject: poly_int: vect_permute_load/store_chain X-Git-Tag: upstream/12.2.0~34459 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=edab8e10e3cc127335ae4fa7a5935a28acfae0a9;p=platform%2Fupstream%2Fgcc.git poly_int: vect_permute_load/store_chain The GET_MODE_NUNITS patch made vect_grouped_store_supported and vect_grouped_load_supported check for a constant number of elements, so vect_permute_store_chain and vect_permute_load_chain can assert for that. This patch adds commentary to that effect; the actual asserts will be added by a later, more mechanical, patch. The patch also reorganises the function so that the asserts are linked specifically to code that builds permute vectors element-by-element. This allows a later patch to add support for some variable-length permutes. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood gcc/ * tree-vect-data-refs.c (vect_permute_store_chain): Reorganize so that both the length == 3 and length != 3 cases set up their own permute vectors. Add comments explaining why we know the number of elements is constant. (vect_permute_load_chain): Likewise. Co-Authored-By: Alan Hayward Co-Authored-By: David Sherwood From-SVN: r256196 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7a96624..f17884d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -2,6 +2,16 @@ Alan Hayward David Sherwood + * tree-vect-data-refs.c (vect_permute_store_chain): Reorganize + so that both the length == 3 and length != 3 cases set up their + own permute vectors. Add comments explaining why we know the + number of elements is constant. + (vect_permute_load_chain): Likewise. + +2018-01-03 Richard Sandiford + Alan Hayward + David Sherwood + * machmode.h (mode_nunits): Change from unsigned char to poly_uint16_pod. (ONLY_FIXED_SIZE_MODES): New macro. diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index 4de0864..2fad890 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -4763,8 +4763,7 @@ vect_permute_store_chain (vec dr_chain, tree perm_mask_low, perm_mask_high; tree data_ref; tree perm3_mask_low, perm3_mask_high; - unsigned int i, n, log_length = exact_log2 (length); - unsigned int j, nelt = TYPE_VECTOR_SUBPARTS (vectype); + unsigned int i, j, n, log_length = exact_log2 (length); result_chain->quick_grow (length); memcpy (result_chain->address (), dr_chain.address (), @@ -4772,6 +4771,8 @@ vect_permute_store_chain (vec dr_chain, if (length == 3) { + /* vect_grouped_store_supported ensures that this is constant. */ + unsigned int nelt = TYPE_VECTOR_SUBPARTS (vectype); unsigned int j0 = 0, j1 = 0, j2 = 0; vec_perm_builder sel (nelt, nelt, 1); @@ -4838,6 +4839,7 @@ vect_permute_store_chain (vec dr_chain, gcc_assert (pow2p_hwi (length)); /* The encoding has 2 interleaved stepped patterns. */ + unsigned int nelt = TYPE_VECTOR_SUBPARTS (vectype); vec_perm_builder sel (nelt, 2, 3); sel.quick_grow (6); for (i = 0; i < 3; i++) @@ -5375,7 +5377,6 @@ vect_permute_load_chain (vec dr_chain, gimple *perm_stmt; tree vectype = STMT_VINFO_VECTYPE (vinfo_for_stmt (stmt)); unsigned int i, j, log_length = exact_log2 (length); - unsigned nelt = TYPE_VECTOR_SUBPARTS (vectype); result_chain->quick_grow (length); memcpy (result_chain->address (), dr_chain.address (), @@ -5383,6 +5384,8 @@ vect_permute_load_chain (vec dr_chain, if (length == 3) { + /* vect_grouped_load_supported ensures that this is constant. */ + unsigned nelt = TYPE_VECTOR_SUBPARTS (vectype); unsigned int k; vec_perm_builder sel (nelt, nelt, 1); @@ -5435,6 +5438,7 @@ vect_permute_load_chain (vec dr_chain, gcc_assert (pow2p_hwi (length)); /* The encoding has a single stepped pattern. */ + unsigned int nelt = TYPE_VECTOR_SUBPARTS (vectype); vec_perm_builder sel (nelt, 1, 3); sel.quick_grow (3); for (i = 0; i < 3; ++i)