]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
if-conv: Restore MASK_CALL conversion [PR108888]
authorAndre Vieira <andre.simoesdiasvieira@arm.com>
Tue, 11 Apr 2023 09:07:43 +0000 (10:07 +0100)
committerAndrew Stubbs <ams@codesourcery.com>
Thu, 13 Apr 2023 14:13:55 +0000 (15:13 +0100)
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)

gcc/ChangeLog.omp
gcc/testsuite/ChangeLog.omp
gcc/testsuite/gcc.dg/vect/vect-simd-clone-16.c
gcc/testsuite/gcc.dg/vect/vect-simd-clone-17.c
gcc/testsuite/gcc.dg/vect/vect-simd-clone-18.c
gcc/tree-if-conv.cc

index 9b57f00db7ce9635f91ce521b36d4fe4da60e333..566643d62feff1e20b9545b7096f14aded3f268d 100644 (file)
@@ -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.
index 612ff287c558d331504f857c51d19af0d7aa5f27..b7611bd6a13b6c3fad737c3a1f57402a0392ed0f 100644 (file)
@@ -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.
index ce9a6dad1b7882665a2e97e1eb327268f0fbe8e2..fbabd6005c24f989d4030b8c37aee104853d196d 100644 (file)
@@ -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)
 {
index 756225e4306f16c745e7ec6b119804e803084ffe..a9d10807a77cd6fee344fd38ef926cb411a30df0 100644 (file)
@@ -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)
 {
index febf9fdf85ee0be63f242311f402bf377386a1e7..5ad92e3ad866afc4d80670901d95ae43f801bdc7 100644 (file)
@@ -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)
 {
index 16da1dc8df289eb5d71fd31e3e5a94d2d1b5535a..337a298e8598cfb8d2ac2816327ce63350bec207 100644 (file)
@@ -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"