]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/111228 - combine two VEC_PERM_EXPRs
authorRichard Biener <rguenther@suse.de>
Wed, 30 Aug 2023 09:57:47 +0000 (11:57 +0200)
committerRichard Biener <rguenther@suse.de>
Wed, 30 Aug 2023 11:55:02 +0000 (13:55 +0200)
commitcaa7a99a052929d5970677c5b639e1fa5166e334
tree308c2ea05998b100ab60279df08ad4d8fdbd49c2
parentf7bff24905a6959f85f866390db2fff1d6f95520
tree-optimization/111228 - combine two VEC_PERM_EXPRs

The following adds simplification of two VEC_PERM_EXPRs where
the later one replaces all elements from either the first or the
second input of the earlier permute.  This allows a three input
permute to be simplified to a two input one.

I'm following the existing two input simplification case and only
allow non-VLA permutes.  The now existing three cases and the
single case in tree-ssa-forwprop.cc somehow ask for merging,
I'm not doing this as part of this change though.

PR tree-optimization/111228
* match.pd ((vec_perm (vec_perm ..) @5 ..) -> (vec_perm @x @5 ..)):
New simplifications.

* gcc.dg/tree-ssa/forwprop-42.c: New testcase.
gcc/match.pd
gcc/testsuite/gcc.dg/tree-ssa/forwprop-42.c [new file with mode: 0644]