aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2023-08-30 11:57:47 +0200
committerRichard Biener <rguenther@suse.de>2023-08-30 13:55:02 +0200
commitcaa7a99a052929d5970677c5b639e1fa5166e334 (patch)
tree308c2ea05998b100ab60279df08ad4d8fdbd49c2 /gcc/testsuite
parentf7bff24905a6959f85f866390db2fff1d6f95520 (diff)
downloadgcc-caa7a99a052929d5970677c5b639e1fa5166e334.zip
gcc-caa7a99a052929d5970677c5b639e1fa5166e334.tar.gz
gcc-caa7a99a052929d5970677c5b639e1fa5166e334.tar.bz2
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.
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/forwprop-42.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-42.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-42.c
new file mode 100644
index 0000000..f3dbc3e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-42.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-cddce1" } */
+
+typedef unsigned long v2di __attribute__((vector_size(16)));
+
+v2di g;
+void test (v2di *v)
+{
+ v2di lo = v[0];
+ v2di hi = v[1];
+ v2di res;
+ res[1] = hi[1];
+ res[0] = lo[0];
+ g = res;
+}
+
+/* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR <\[^>\]*, { 0, 3 }>" 1 "cddce1" } } */