rs6000: Remove useless insns fed into lvx/stvx [PR97019]
This patch is to extend the existing function find_alignment_op to
check all defintions of base_reg are AND operations with mask -16B
to force the alignment. If all are satifised, it passes all AND
operations and instructions to function recombine_lvx_pattern
and recombine_stvx_pattern, they can remove all useless ANDs
further.
Bootstrapped/regtested on powerpc64le-linux-gnu P8.
gcc/ChangeLog:
PR target/97019
* config/rs6000/rs6000-p8swap.c (find_alignment_op): Adjust to
support multiple defintions which are all AND operations with
the mask -16B.
(recombine_lvx_pattern): Adjust to handle multiple AND operations
from find_alignment_op.
(recombine_stvx_pattern): Likewise.
gcc/testsuite/ChangeLog:
PR target/97019
* gcc.target/powerpc/pr97019.c: New test.