diff options
author | Kewen Lin <linkw@linux.ibm.com> | 2021-05-28 01:11:45 -0500 |
---|---|---|
committer | Kewen Lin <linkw@linux.ibm.com> | 2021-05-28 01:11:45 -0500 |
commit | 4a9f2306cb39a3cf265eeb6f8f3a8bbaf230c4c8 (patch) | |
tree | c37b0fcc9092378d662e6de5c0445ae8a9d8c617 /gcc/fortran/dump-parse-tree.c | |
parent | cd62d089f6021fd1ad4537b8182836d15b14514f (diff) | |
download | gcc-4a9f2306cb39a3cf265eeb6f8f3a8bbaf230c4c8.zip gcc-4a9f2306cb39a3cf265eeb6f8f3a8bbaf230c4c8.tar.gz gcc-4a9f2306cb39a3cf265eeb6f8f3a8bbaf230c4c8.tar.bz2 |
forwprop: Enhance vec perm fed by CTOR and CTOR/CST [PR99398]
VEC_PERM_EXPR requires the number of MASK elements must be the
same with the number of elements in operands V0 and V1. In
some cases, like with Power altivec built-in function vec_perm,
VIEW_CONVERT_EXPR has to be used to guarantee this requirement,
but it can prevent some simplifications which don't consider
this well.
For the cases that the permutated operands of vector
permutation are from two same type CTOR and CTOR, or one CTOR
and one VECTOR CST, this patch is to enhance forwprop to look
through intermediate VIEW_CONVERT_EXPR and further simplify
them if possible.
Bootstrapped/regtested on powerpc64le-linux-gnu P9,
powerpc64-linux-gnu P8, x86_64-redhat-linux and
aarch64-linux-gnu.
gcc/ChangeLog:
PR tree-optimization/99398
* tree-ssa-forwprop.c (simplify_permutation): Optimize some cases
where the fed operands are CTOR/CST and propagated through
VIEW_CONVERT_EXPR. Call vec_perm_indices::new_shrunk_vector.
* vec-perm-indices.c (vec_perm_indices::new_shrunk_vector): New
function.
* vec-perm-indices.h (vec_perm_indices::new_shrunk_vector): New
declare.
gcc/testsuite/ChangeLog:
PR tree-optimization/99398
* gcc.target/powerpc/vec-perm-ctor-run.c: New test.
* gcc.target/powerpc/vec-perm-ctor.c: New test.
* gcc.target/powerpc/vec-perm-ctor.h: New test.
Diffstat (limited to 'gcc/fortran/dump-parse-tree.c')
0 files changed, 0 insertions, 0 deletions