Simplify subreg of vec_merge of vec_duplicate
authorH.J. Lu <hongjiu.lu@intel.com>
Thu, 18 Oct 2018 08:18:42 +0000 (08:18 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Thu, 18 Oct 2018 08:18:42 +0000 (01:18 -0700)
commit294973a49751a7fc2d6a7a9f2749ce851a368c04
tree3a5176da419a68ba632eb29ab9f43065afcc053e
parent7702ab653a903d5131bf72244ae22424ffd2e6c7
Simplify subreg of vec_merge of vec_duplicate

We can simplify

  (subreg (vec_merge (vec_duplicate X)
     (vector)
     (const_int ((1 << N) | M)))
  (N * sizeof (X)))

to X when mode of X is the same as of mode of subreg.

gcc/

PR target/87537
* simplify-rtx.c (simplify_subreg): Simplify subreg of vec_merge
of vec_duplicate.
(test_vector_ops_duplicate): Add test for a scalar subreg of a
VEC_MERGE of a VEC_DUPLICATE.

gcc/testsuite/

PR target/87537
* gcc.target/i386/pr87537-1.c: New test.

From-SVN: r265260
gcc/ChangeLog
gcc/simplify-rtx.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr87537-1.c [new file with mode: 0644]