store-merging: Handle vector CONSTRUCTORs using bswap [PR96239]
authorJakub Jelinek <jakub@redhat.com>
Tue, 5 Jan 2021 15:16:06 +0000 (16:16 +0100)
committerJakub Jelinek <jakub@redhat.com>
Tue, 5 Jan 2021 15:16:06 +0000 (16:16 +0100)
commita7553ad60bebc419d510564b8b9f9e5e03725ff5
tree95629feb493724078551a23567e7dbbb69fc61e3
parentf70289378721d970ea1cfc39a30565f88cedc788
store-merging: Handle vector CONSTRUCTORs using bswap [PR96239]

I've tried to add such helper, but handling over just analysis and letting
each pass handle it differently seems complicated given the limitations of
the bswap infrastructure.

So, this patch just hooks the optimization also into store-merging so that
the original testcase from the PR can be fixed.

2021-01-05  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/96239
* gimple-ssa-store-merging.c (maybe_optimize_vector_constructor): New
function.
(get_status_for_store_merging): Don't return BB_INVALID for blocks
with potential bswap optimizable CONSTRUCTORs.
(pass_store_merging::execute): Optimize vector CONSTRUCTORs with bswap
if possible.

* gcc.dg/tree-ssa/pr96239.c: New test.
gcc/gimple-ssa-store-merging.c
gcc/testsuite/gcc.dg/tree-ssa/pr96239.c [new file with mode: 0644]