diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2018-01-03 21:39:33 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2018-01-03 21:39:33 +0000 |
commit | 16c78b665aa4ce64af71b6ac7ebaa96c9807be4c (patch) | |
tree | 24617e60f1700c494a8be6af770f30443951f7f7 /gcc/expmed.c | |
parent | 4bfb8e1143f4626e12df348a1bde34030c0fb2e7 (diff) | |
download | gcc-16c78b665aa4ce64af71b6ac7ebaa96c9807be4c.zip gcc-16c78b665aa4ce64af71b6ac7ebaa96c9807be4c.tar.gz gcc-16c78b665aa4ce64af71b6ac7ebaa96c9807be4c.tar.bz2 |
Directly operate on CONST_VECTOR encoding
This patch makes some pieces of code operate directly on the new
CONST_VECTOR encoding.
2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
gcc/
* cse.c (hash_rtx_cb): Hash only the encoded elements.
* cselib.c (cselib_hash_rtx): Likewise.
* expmed.c (make_tree): Build VECTOR_CSTs directly from the
CONST_VECTOR encoding.
From-SVN: r256192
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r-- | gcc/expmed.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c index 60848fa..be6a138 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -5273,13 +5273,14 @@ make_tree (tree type, rtx x) case CONST_VECTOR: { - int units = CONST_VECTOR_NUNITS (x); + unsigned int npatterns = CONST_VECTOR_NPATTERNS (x); + unsigned int nelts_per_pattern = CONST_VECTOR_NELTS_PER_PATTERN (x); tree itype = TREE_TYPE (type); - int i; /* Build a tree with vector elements. */ - tree_vector_builder elts (type, units, 1); - for (i = 0; i < units; ++i) + tree_vector_builder elts (type, npatterns, nelts_per_pattern); + unsigned int count = elts.encoded_nelts (); + for (unsigned int i = 0; i < count; ++i) { rtx elt = CONST_VECTOR_ELT (x, i); elts.quick_push (make_tree (itype, elt)); |