aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAndre Vieira <andre.simoesdiasvieira@arm.com>2023-04-11 10:07:43 +0100
committerAndrew Stubbs <ams@codesourcery.com>2023-04-13 15:13:55 +0100
commit74c492ea1299d1d6a35d135f4ddd3fe0ea072e40 (patch)
tree3c0e1ed5b430a8ec86765aad07c061c46baadd91 /gcc
parent6a1d873d3555d73072a01729d67fcd1f1db8df1d (diff)
downloadgcc-74c492ea1299d1d6a35d135f4ddd3fe0ea072e40.zip
gcc-74c492ea1299d1d6a35d135f4ddd3fe0ea072e40.tar.gz
gcc-74c492ea1299d1d6a35d135f4ddd3fe0ea072e40.tar.bz2
if-conv: Restore MASK_CALL conversion [PR108888]
The original patch to fix this PR broke the if-conversion of calls into IFN_MASK_CALL. This patch restores that original behaviour and makes sure the tests added earlier specifically test inbranch SIMD clones. gcc/ChangeLog: PR tree-optimization/108888 * tree-if-conv.cc (predicate_statements): Fix gimple call check. gcc/testsuite/ChangeLog: * gcc.dg/vect/vect-simd-clone-16.c: Make simd clone inbranch only. * gcc.dg/vect/vect-simd-clone-17.c: Likewise. * gcc.dg/vect/vect-simd-clone-18.c: Likewise. (cherry picked from commit 58c8c1b383bc3c286d6527fc6e8fb62463f9a877)
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog.omp8
-rw-r--r--gcc/testsuite/ChangeLog.omp10
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-simd-clone-16.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-simd-clone-17.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-simd-clone-18.c2
-rw-r--r--gcc/tree-if-conv.cc5
6 files changed, 24 insertions, 5 deletions
diff --git a/gcc/ChangeLog.omp b/gcc/ChangeLog.omp
index 9b57f00..566643d 100644
--- a/gcc/ChangeLog.omp
+++ b/gcc/ChangeLog.omp
@@ -1,3 +1,11 @@
+2023-04-13 Andrew Stubbs <ams@codesourcery.com>
+
+ Backport from mainline:
+ Andre Vieira <andre.simoesdiasvieira@arm.com>
+
+ PR tree-optimization/108888
+ * tree-if-conv.cc (predicate_statements): Fix gimple call check.
+
2023-04-03 Andrew Stubbs <ams@codesourcery.com>
* config/gcn/gcn-valu.md (one_cmpl<mode>2<exec>): New.
diff --git a/gcc/testsuite/ChangeLog.omp b/gcc/testsuite/ChangeLog.omp
index 612ff28..b7611bd 100644
--- a/gcc/testsuite/ChangeLog.omp
+++ b/gcc/testsuite/ChangeLog.omp
@@ -1,3 +1,13 @@
+2023-04-13 Andrew Stubbs <ams@codesourcery.com>
+
+ Backport from mainline:
+ Andre Vieira <andre.simoesdiasvieira@arm.com>
+
+ PR tree-optimization/108888
+ * gcc.dg/vect/vect-simd-clone-16.c: Make simd clone inbranch only.
+ * gcc.dg/vect/vect-simd-clone-17.c: Likewise.
+ * gcc.dg/vect/vect-simd-clone-18.c: Likewise.
+
2023-03-27 Frederik Harwath <frederik@codesourcery.com>
* c-c++-common/gomp/loop-transforms/unroll-inner-1.c: New test.
diff --git a/gcc/testsuite/gcc.dg/vect/vect-simd-clone-16.c b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-16.c
index ce9a6da..fbabd60 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-simd-clone-16.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-16.c
@@ -9,7 +9,7 @@
#endif
/* A simple function that will be cloned. */
-#pragma omp declare simd
+#pragma omp declare simd inbranch
TYPE __attribute__((noinline))
foo (TYPE a)
{
diff --git a/gcc/testsuite/gcc.dg/vect/vect-simd-clone-17.c b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-17.c
index 756225e..a9d1080 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-simd-clone-17.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-17.c
@@ -9,7 +9,7 @@
#endif
/* A simple function that will be cloned. */
-#pragma omp declare simd uniform(b)
+#pragma omp declare simd inbranch uniform(b)
TYPE __attribute__((noinline))
foo (TYPE a, TYPE b)
{
diff --git a/gcc/testsuite/gcc.dg/vect/vect-simd-clone-18.c b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-18.c
index febf9fd..5ad92e3 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-simd-clone-18.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-18.c
@@ -9,7 +9,7 @@
#endif
/* A simple function that will be cloned. */
-#pragma omp declare simd uniform(b)
+#pragma omp declare simd inbranch uniform(b)
TYPE __attribute__((noinline))
foo (TYPE b, TYPE a)
{
diff --git a/gcc/tree-if-conv.cc b/gcc/tree-if-conv.cc
index 16da1dc..337a298 100644
--- a/gcc/tree-if-conv.cc
+++ b/gcc/tree-if-conv.cc
@@ -2646,8 +2646,9 @@ predicate_statements (loop_p loop)
gimple_assign_set_rhs1 (stmt, ifc_temp_var (type, rhs, &gsi));
update_stmt (stmt);
}
- else if (gimple_plf (stmt, GF_PLF_2)
- && is_gimple_call (stmt))
+
+ if (gimple_plf (gsi_stmt (gsi), GF_PLF_2)
+ && is_gimple_call (gsi_stmt (gsi)))
{
/* Convert functions that have a SIMD clone to IFN_MASK_CALL.
This will cause the vectorizer to match the "in branch"