]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Add pass_oacc_ipa
authorvries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 16 Dec 2015 13:49:07 +0000 (13:49 +0000)
committervries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 16 Dec 2015 13:49:07 +0000 (13:49 +0000)
2015-12-16  Tom de Vries  <tom@codesourcery.com>

* opts.c (default_options_optimization): Set fipa-pta on by default for
fopenacc.
* passes.def: Move kernels pass group to pass_ipa_oacc.
* tree-pass.h (make_pass_oacc_kernels2): Remove.
(make_pass_ipa_oacc, make_pass_ipa_oacc_kernels): Declare.
* tree-ssa-loop.c (pass_oacc_kernels2, make_pass_oacc_kernels2): Remove.
(pass_ipa_oacc, pass_ipa_oacc_kernels): New pass.
(make_pass_ipa_oacc, make_pass_ipa_oacc_kernels): New function.
* tree-ssa-structalias.c (pass_ipa_pta::clone): New function.

* g++.dg/ipa/devirt-37.C: Update for new fre2 pass.
* g++.dg/ipa/devirt-40.C: Same.
* g++.dg/tree-ssa/pr61034.C: Same.
* gcc.dg/ipa/ipa-pta-1.c: Update for new pta1 pass.
* gcc.dg/ipa/ipa-pta-10.c: Same.
* gcc.dg/ipa/ipa-pta-11.c: Same.
* gcc.dg/ipa/ipa-pta-14.c: Same.
* gcc.dg/ipa/ipa-pta-16.c: Same.
* gcc.dg/ipa/ipa-pta-2.c: Same.
* gcc.dg/ipa/ipa-pta-5.c: Same.
* gcc.dg/ipa/ipa-pta-6.c: Same.
* gcc.dg/torture/ipa-pta-1.c: Same.
* gcc.dg/ipa/ipa-pta-13.c: Update for new fre2 and pta1 pass.
* gcc.dg/ipa/ipa-pta-3.c: Same.
* gcc.dg/ipa/ipa-pta-4.c: Same.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231690 138bc75d-0d04-0410-961f-82ee72b054a4

22 files changed:
gcc/ChangeLog
gcc/opts.c
gcc/passes.def
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ipa/devirt-37.C
gcc/testsuite/g++.dg/ipa/devirt-40.C
gcc/testsuite/g++.dg/tree-ssa/pr61034.C
gcc/testsuite/gcc.dg/ipa/ipa-pta-1.c
gcc/testsuite/gcc.dg/ipa/ipa-pta-10.c
gcc/testsuite/gcc.dg/ipa/ipa-pta-11.c
gcc/testsuite/gcc.dg/ipa/ipa-pta-13.c
gcc/testsuite/gcc.dg/ipa/ipa-pta-14.c
gcc/testsuite/gcc.dg/ipa/ipa-pta-16.c
gcc/testsuite/gcc.dg/ipa/ipa-pta-2.c
gcc/testsuite/gcc.dg/ipa/ipa-pta-3.c
gcc/testsuite/gcc.dg/ipa/ipa-pta-4.c
gcc/testsuite/gcc.dg/ipa/ipa-pta-5.c
gcc/testsuite/gcc.dg/ipa/ipa-pta-6.c
gcc/testsuite/gcc.dg/torture/ipa-pta-1.c
gcc/tree-pass.h
gcc/tree-ssa-loop.c
gcc/tree-ssa-structalias.c

index c74d25a5478e17fa7dbf120c45d4ee93796adf11..0f75f85b74e12c2e0b4e5825c144fbf480672e49 100644 (file)
@@ -1,3 +1,15 @@
+2015-12-16  Tom de Vries  <tom@codesourcery.com>
+
+       * opts.c (default_options_optimization): Set fipa-pta on by default for
+       fopenacc.
+       * passes.def: Move kernels pass group to pass_ipa_oacc.
+       * tree-pass.h (make_pass_oacc_kernels2): Remove.
+       (make_pass_ipa_oacc, make_pass_ipa_oacc_kernels): Declare.
+       * tree-ssa-loop.c (pass_oacc_kernels2, make_pass_oacc_kernels2): Remove.
+       (pass_ipa_oacc, pass_ipa_oacc_kernels): New pass.
+       (make_pass_ipa_oacc, make_pass_ipa_oacc_kernels): New function.
+       * tree-ssa-structalias.c (pass_ipa_pta::clone): New function.
+
 2015-12-16  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/68861
index 3d25f98c9e2a9d0541133a60b0c08f5f00d3fb90..d46f304d26229da08923d9f515c74d71fb30fafc 100644 (file)
@@ -560,6 +560,7 @@ default_options_optimization (struct gcc_options *opts,
 {
   unsigned int i;
   int opt2;
+  bool openacc_mode = false;
 
   /* Scan to see what optimization level has been specified.  That will
      determine the default value of many flags.  */
@@ -619,6 +620,11 @@ default_options_optimization (struct gcc_options *opts,
          opts->x_optimize_debug = 1;
          break;
 
+       case OPT_fopenacc:
+         if (opt->value)
+           openacc_mode = true;
+         break;
+
        default:
          /* Ignore other options in this prescan.  */
          break;
@@ -633,6 +639,10 @@ default_options_optimization (struct gcc_options *opts,
   /* -O2 param settings.  */
   opt2 = (opts->x_optimize >= 2);
 
+  if (openacc_mode
+      && !opts_set->x_flag_ipa_pta)
+    opts->x_flag_ipa_pta = true;
+
   /* Track fields in field-sensitive alias analysis.  */
   maybe_set_param_value
     (PARAM_MAX_FIELDS_FOR_FIELD_SENSITIVE,
index c72b38ba1e50b5882b1a489cceea2537cf4d9b0f..2ba8490b0573e1ba55ae74d39a7f28fbf5677214 100644 (file)
@@ -88,24 +88,7 @@ along with GCC; see the file COPYING3.  If not see
          /* pass_build_ealias is a dummy pass that ensures that we
             execute TODO_rebuild_alias at this point.  */
          NEXT_PASS (pass_build_ealias);
-         /* Pass group that runs when the function is an offloaded function
-            containing oacc kernels loops.  Part 1.  */
-         NEXT_PASS (pass_oacc_kernels);
-         PUSH_INSERT_PASSES_WITHIN (pass_oacc_kernels)
-             NEXT_PASS (pass_ch);
-         POP_INSERT_PASSES ()
          NEXT_PASS (pass_fre);
-         /* Pass group that runs when the function is an offloaded function
-            containing oacc kernels loops.  Part 2.  */
-         NEXT_PASS (pass_oacc_kernels2);
-         PUSH_INSERT_PASSES_WITHIN (pass_oacc_kernels2)
-             /* We use pass_lim to rewrite in-memory iteration and reduction
-                variable accesses in loops into local variables accesses.  */
-             NEXT_PASS (pass_lim);
-             NEXT_PASS (pass_dominator, false /* may_peel_loop_headers_p */);
-             NEXT_PASS (pass_dce);
-             NEXT_PASS (pass_expand_omp_ssa);
-         POP_INSERT_PASSES ()
          NEXT_PASS (pass_merge_phi);
           NEXT_PASS (pass_dse);
          NEXT_PASS (pass_cd_dce);
@@ -124,6 +107,30 @@ along with GCC; see the file COPYING3.  If not see
       NEXT_PASS (pass_rebuild_cgraph_edges);
       NEXT_PASS (pass_inline_parameters);
   POP_INSERT_PASSES ()
+
+  NEXT_PASS (pass_ipa_oacc);
+  PUSH_INSERT_PASSES_WITHIN (pass_ipa_oacc)
+      NEXT_PASS (pass_ipa_pta);
+      /* Pass group that runs when the function is an offloaded function
+        containing oacc kernels loops.  */
+      NEXT_PASS (pass_ipa_oacc_kernels);
+      PUSH_INSERT_PASSES_WITHIN (pass_ipa_oacc_kernels)
+         NEXT_PASS (pass_oacc_kernels);
+         PUSH_INSERT_PASSES_WITHIN (pass_oacc_kernels)
+             NEXT_PASS (pass_ch);
+             NEXT_PASS (pass_fre);
+             /* We use pass_lim to rewrite in-memory iteration and reduction
+                variable accesses in loops into local variables accesses.  */
+             NEXT_PASS (pass_lim);
+             NEXT_PASS (pass_dominator, false /* may_peel_loop_headers_p */);
+             NEXT_PASS (pass_dce);
+             /* pass_parallelize_loops_oacc_kernels */
+             NEXT_PASS (pass_expand_omp_ssa);
+             NEXT_PASS (pass_rebuild_cgraph_edges);
+         POP_INSERT_PASSES ()
+      POP_INSERT_PASSES ()
+  POP_INSERT_PASSES ()
+
   NEXT_PASS (pass_ipa_chkp_produce_thunks);
   NEXT_PASS (pass_ipa_auto_profile);
   NEXT_PASS (pass_ipa_free_inline_summary);
index ef28219f011a82eb139d46de2a41fa4b59ae2b94..4a058fb7a01780b048a07727e49aeed0fd14cd3b 100644 (file)
@@ -1,3 +1,21 @@
+2015-12-16  Tom de Vries  <tom@codesourcery.com>
+
+       * g++.dg/ipa/devirt-37.C: Update for new fre2 pass.
+       * g++.dg/ipa/devirt-40.C: Same.
+       * g++.dg/tree-ssa/pr61034.C: Same.
+       * gcc.dg/ipa/ipa-pta-1.c: Update for new pta1 pass.
+       * gcc.dg/ipa/ipa-pta-10.c: Same.
+       * gcc.dg/ipa/ipa-pta-11.c: Same.
+       * gcc.dg/ipa/ipa-pta-14.c: Same.
+       * gcc.dg/ipa/ipa-pta-16.c: Same.
+       * gcc.dg/ipa/ipa-pta-2.c: Same.
+       * gcc.dg/ipa/ipa-pta-5.c: Same.
+       * gcc.dg/ipa/ipa-pta-6.c: Same.
+       * gcc.dg/torture/ipa-pta-1.c: Same.
+       * gcc.dg/ipa/ipa-pta-13.c: Update for new fre2 and pta1 pass.
+       * gcc.dg/ipa/ipa-pta-3.c: Same.
+       * gcc.dg/ipa/ipa-pta-4.c: Same.
+
 2015-12-16  Richard Biener  <rguenther@suse.de>
 
        PR testsuite/68915
index 9c5287e8e6b7a80418e5c8246df2123d7b4496c7..b7f52a0a5e9d350b22d76a1cf8c85f24ac926d6f 100644 (file)
@@ -1,4 +1,4 @@
-/* { dg-options "-fpermissive -O2 -fno-indirect-inlining -fno-devirtualize-speculatively -fdump-tree-fre2-details -fno-early-inlining"  } */
+/* { dg-options "-fpermissive -O2 -fno-indirect-inlining -fno-devirtualize-speculatively -fdump-tree-fre3-details -fno-early-inlining"  } */
 #include <stdlib.h>
 struct A {virtual void test() {abort ();}};
 struct B:A
@@ -30,7 +30,7 @@ t()
 /* After inlining the call within constructor needs to be checked to not go into a basetype.
    We should see the vtbl store and we should notice extcall as possibly clobbering the
    type but ignore it because b is in static storage.  */
-/* { dg-final { scan-tree-dump "No dynamic type change found."  "fre2"  } } */
-/* { dg-final { scan-tree-dump "Checking vtbl store:"  "fre2"  } } */
-/* { dg-final { scan-tree-dump "Function call may change dynamic type:extcall"  "fre2"  } } */
-/* { dg-final { scan-tree-dump "converting indirect call to function virtual void"  "fre2"  } } */
+/* { dg-final { scan-tree-dump "No dynamic type change found."  "fre3"  } } */
+/* { dg-final { scan-tree-dump "Checking vtbl store:"  "fre3"  } } */
+/* { dg-final { scan-tree-dump "Function call may change dynamic type:extcall"  "fre3"  } } */
+/* { dg-final { scan-tree-dump "converting indirect call to function virtual void"  "fre3"  } } */
index 279a2286f2ac88b07880548636873d314cda3c51..5107c290c6363a4186139416d2772e4a80f21f3f 100644 (file)
@@ -1,4 +1,4 @@
-/* { dg-options "-O2 -fdump-tree-fre2-details"  } */
+/* { dg-options "-O2 -fdump-tree-fre3-details"  } */
 typedef enum
 {
 } UErrorCode;
@@ -19,4 +19,4 @@ A::m_fn1 (UnicodeString &, int &p2, UErrorCode &) const
   UnicodeString a[2];
 }
 
-/* { dg-final { scan-tree-dump-not "\\n  OBJ_TYPE_REF" "fre2"  } } */
+/* { dg-final { scan-tree-dump-not "\\n  OBJ_TYPE_REF" "fre3"  } } */
index cd4ee058bcefc49b8bae5fda4f3aabba49b91ff6..c06c5807da1cccca9c074c315e797b75235a8fb3 100644 (file)
@@ -1,5 +1,5 @@
 // { dg-do compile }
-// { dg-options "-O2 -fdump-tree-fre2 -fdump-tree-optimized" }
+// { dg-options "-O2 -fdump-tree-fre3 -fdump-tree-optimized" }
 
 #define assume(x) if(!(x))__builtin_unreachable()
 
@@ -42,13 +42,13 @@ bool f(I a, I b, I c, I d) {
 // a bunch of conditional free()s and unreachable()s.
 // This works only if everything is inlined into 'f'.
 
-// { dg-final { scan-tree-dump-times ";; Function" 1 "fre2" } }
-// { dg-final { scan-tree-dump-times "unreachable" 11 "fre2" } }
+// { dg-final { scan-tree-dump-times ";; Function" 1 "fre3" } }
+// { dg-final { scan-tree-dump-times "unreachable" 11 "fre3" } }
 
 // Note that depending on PUSH_ARGS_REVERSED we are presented with
 // a different initial CFG and thus the final outcome is different
 
-// { dg-final { scan-tree-dump-times "free" 10 "fre2" { target x86_64-*-* i?86-*-* } } }
+// { dg-final { scan-tree-dump-times "free" 10 "fre3" { target x86_64-*-* i?86-*-* } } }
 // { dg-final { scan-tree-dump-times "free" 3 "optimized" { target x86_64-*-* i?86-*-* } } }
-// { dg-final { scan-tree-dump-times "free" 14 "fre2" { target aarch64-*-* ia64-*-* arm-*-* hppa*-*-* sparc*-*-* powerpc*-*-* alpha*-*-* } } }
+// { dg-final { scan-tree-dump-times "free" 14 "fre3" { target aarch64-*-* ia64-*-* arm-*-* hppa*-*-* sparc*-*-* powerpc*-*-* alpha*-*-* } } }
 // { dg-final { scan-tree-dump-times "free" 4 "optimized" { target aarch64-*-* ia64-*-* arm-*-* hppa*-*-* sparc*-*-* powerpc*-*-* alpha*-*-* } } }
index c183fcb641c5e73b3e638c5c380fb0087b8289b0..bc631f8856de3a65794b47f0e211db8ccdec01d1 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-options "-O -fipa-pta -fdump-ipa-pta-details" } */
+/* { dg-options "-O -fipa-pta -fdump-ipa-pta2-details" } */
 
 static int __attribute__((noinline))
 foo (int *p, int *q)
@@ -45,8 +45,8 @@ int main()
    not seen by IPA PTA (if the address escapes the unit which we only compute
    during IPA PTA...).  Thus the solution also includes NONLOCAL.  */
 
-/* { dg-final { scan-ipa-dump "fn_1 = { bar foo }" "pta" } } */
-/* { dg-final { scan-ipa-dump "bar.arg0 = { NONLOCAL a }" "pta" } } */
-/* { dg-final { scan-ipa-dump "bar.arg1 = { NONLOCAL a }" "pta" } } */
-/* { dg-final { scan-ipa-dump "foo.arg0 = { NONLOCAL a }" "pta" } } */
-/* { dg-final { scan-ipa-dump "foo.arg1 = { NONLOCAL a }" "pta" } } */
+/* { dg-final { scan-ipa-dump "fn_1 = { bar foo }" "pta2" } } */
+/* { dg-final { scan-ipa-dump "bar.arg0 = { NONLOCAL a }" "pta2" } } */
+/* { dg-final { scan-ipa-dump "bar.arg1 = { NONLOCAL a }" "pta2" } } */
+/* { dg-final { scan-ipa-dump "foo.arg0 = { NONLOCAL a }" "pta2" } } */
+/* { dg-final { scan-ipa-dump "foo.arg1 = { NONLOCAL a }" "pta2" } } */
index 0a6c1663b664dd5439eead79cb66d52e49ead427..90b7bf8639d386ee921bf7d1552ef965f93e7a07 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-options "-O2 -fipa-pta -fdump-ipa-pta-details" } */
+/* { dg-options "-O2 -fipa-pta -fdump-ipa-pta2-details" } */
 
 #include <stdarg.h>
 
@@ -26,4 +26,4 @@ int main()
 /* Verify we properly handle variadic arguments and do not let escape
    stuff through it.  */
 
-/* { dg-final { scan-ipa-dump "ESCAPED = { (ESCAPED )?(NONLOCAL )?}" "pta" } } */
+/* { dg-final { scan-ipa-dump "ESCAPED = { (ESCAPED )?(NONLOCAL )?}" "pta2" } } */
index 84dd2542c42886aae5409460bea2fa2dd9506fc9..9857d7b58eee9c0ab835969ecf086ef754c11aba 100644 (file)
@@ -1,25 +1,25 @@
 /* { dg-do link } */
-/* { dg-options "-O2 -fipa-pta -fdump-ipa-pta-details" } */
+/* { dg-options "-O2 -fipa-pta -fdump-ipa-pta2-details" } */
 
 static int i;
 /* i should not escape here, p should point to i only.  */
-/* { dg-final { scan-ipa-dump "p = { i }" "pta" } } */
+/* { dg-final { scan-ipa-dump "p = { i }" "pta2" } } */
 static int *p = &i;
 
 int j;
 /* q should point to j only.  */
-/* { dg-final { scan-ipa-dump "q = { j }" "pta" } } */
+/* { dg-final { scan-ipa-dump "q = { j }" "pta2" } } */
 static int *q = &j;
 
 static int k;
 /* k should escape here, r should point to NONLOCAL, ESCAPED, k.  */
 int *r = &k;
-/* { dg-final { scan-ipa-dump "r = { ESCAPED NONLOCAL k }" "pta" } } */
+/* { dg-final { scan-ipa-dump "r = { ESCAPED NONLOCAL k }" "pta2" } } */
 
 int l;
 /* s should point to NONLOCAL, ESCAPED, l.  */
 int *s = &l;
-/* { dg-final { scan-ipa-dump "s = { ESCAPED NONLOCAL l }" "pta" } } */
+/* { dg-final { scan-ipa-dump "s = { ESCAPED NONLOCAL l }" "pta2" } } */
 
 /* Make p and q referenced so they do not get optimized out.  */
 int foo() { return &p < &q; }
@@ -32,4 +32,4 @@ int main()
 /* It isn't clear if the escape if l is strictly necessary, if it were
    we should have i, r and s in ESCAPED as well.  */
 
-/* { dg-final { scan-ipa-dump "ESCAPED = { ESCAPED NONLOCAL l k }" "pta" } } */
+/* { dg-final { scan-ipa-dump "ESCAPED = { ESCAPED NONLOCAL l k }" "pta2" } } */
index f558df305d0b2a1a1b3a9f20f13b738c71169147..93dd87107cc0a62812fbf2c58f8e0bbae5dfa268 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do link } */
-/* { dg-options "-O2 -fipa-pta -fdump-ipa-pta-details -fdump-tree-fre2 -fno-ipa-icf" } */
+/* { dg-options "-O2 -fipa-pta -fdump-ipa-pta2-details -fdump-tree-fre3 -fno-ipa-icf" } */
 
 static int x, y;
 
@@ -19,7 +19,7 @@ void *anyfn_global;
 
 /* Even though not referenced in this TU we should have added constraints
    for the initializer.  */
-/* { dg-final { scan-ipa-dump "ex = &local_address_taken" "pta" } } */
+/* { dg-final { scan-ipa-dump "ex = &local_address_taken" "pta2" } } */
 void (*ex)(int *) = local_address_taken;
 
 extern void link_error (void);
@@ -38,11 +38,11 @@ int main()
      uses to be messed up even further.  */
   /* ???  As we don't expand the ESCAPED solution we either get x printed here
      or not based on the phase of the moon.  */
-  /* { dg-final { scan-ipa-dump "local_address_taken.arg0 = { ESCAPED NONLOCAL y x }" "pta" { xfail *-*-* } } } */
-  /* { dg-final { scan-ipa-dump "local_address_taken.clobber = { ESCAPED NONLOCAL y x }" "pta" { xfail *-*-* } } } */
-  /* { dg-final { scan-ipa-dump "local_address_taken.use = { }" "pta" { xfail *-*-* } } } */
+  /* { dg-final { scan-ipa-dump "local_address_taken.arg0 = { ESCAPED NONLOCAL y x }" "pta2" { xfail *-*-* } } } */
+  /* { dg-final { scan-ipa-dump "local_address_taken.clobber = { ESCAPED NONLOCAL y x }" "pta2" { xfail *-*-* } } } */
+  /* { dg-final { scan-ipa-dump "local_address_taken.use = { }" "pta2" { xfail *-*-* } } } */
   /* ??? But make sure x really escaped.  */
-  /* { dg-final { scan-ipa-dump "ESCAPED = {\[^\n\}\]* x \[^\n\}\]*}" "pta" } } */
+  /* { dg-final { scan-ipa-dump "ESCAPED = {\[^\n\}\]* x \[^\n\}\]*}" "pta2" } } */
   (*anyfn) (&x);
   x = 0;
   local (&y);
@@ -54,7 +54,7 @@ int main()
   local_address_taken (&y);
   /* As we are computing flow- and context-insensitive we may not
      CSE the load of x here.  */
-  /* { dg-final { scan-tree-dump " = x;" "fre2" } } */
+  /* { dg-final { scan-tree-dump " = x;" "fre3" } } */
   return x;
 }
 
index e3333fae9fadf685f5a2169733b1b60a0a3bde00..cc2b9407dbaa719f782b5f51fef7523c9e4c059c 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-options "-O2 -fipa-pta -fno-tree-fre -fno-tree-sra -fdump-ipa-pta-details -fdelete-null-pointer-checks" } */
+/* { dg-options "-O2 -fipa-pta -fno-tree-fre -fno-tree-sra -fdump-ipa-pta2-details -fdelete-null-pointer-checks" } */
 
 struct X {
     int i;
@@ -21,8 +21,8 @@ int main()
   void *p;
   a.p = (void *)&c;
   p = foo(&a, &a);
-  /* { dg-final { scan-ipa-dump "foo.result = { NULL a\[^ \]* c\[^ \]* }" "pta" { target { ! keeps_null_pointer_checks } } } } */
-  /* { dg-final { scan-ipa-dump "foo.result = { NONLOCAL a\[^ \]* c\[^ \]* }" "pta" { target { keeps_null_pointer_checks } } } } */
+  /* { dg-final { scan-ipa-dump "foo.result = { NULL a\[^ \]* c\[^ \]* }" "pta2" { target { ! keeps_null_pointer_checks } } } } */
+  /* { dg-final { scan-ipa-dump "foo.result = { NONLOCAL a\[^ \]* c\[^ \]* }" "pta2" { target { keeps_null_pointer_checks } } } } */
   ((struct X *)p)->p = (void *)0;
   if (a.p != (void *)0)
     abort ();
index 5bd6596ef310e34e89197142553aeb982f3b5cc7..83b9cd8e1e37a4ab9d2f48e096b0e3906fa6eb80 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-options "-O2 -fno-tree-sra -fipa-pta -fdump-ipa-pta" } */
+/* { dg-options "-O2 -fno-tree-sra -fipa-pta -fdump-ipa-pta2" } */
 
 struct X
 {
@@ -29,4 +29,4 @@ int main()
   return 0;
 }
 
-/* { dg-final { scan-ipa-dump "y.\[0-9\]*\\\+\[0-9\]* = { i }" "pta" } } */
+/* { dg-final { scan-ipa-dump "y.\[0-9\]*\\\+\[0-9\]* = { i }" "pta2" } } */
index b77864d0b0c1b131b8595d46bf3c2df52486b3ab..0cf2adfddd0ce884f09626b9a5878953dfb3b9af 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O -fipa-pta -fdump-ipa-pta-details" } */
+/* { dg-options "-O -fipa-pta -fdump-ipa-pta2-details" } */
 
 int (*fn)(int *);
 
@@ -21,4 +21,4 @@ int main()
 /* Make sure that when a local function escapes its argument points-to sets
    are properly adjusted.  */
 
-/* { dg-final { scan-ipa-dump "foo.arg0 = { ESCAPED NONLOCAL }" "pta" } } */
+/* { dg-final { scan-ipa-dump "foo.arg0 = { ESCAPED NONLOCAL }" "pta2" } } */
index ff6fa57628b2bdcdd969fa2f3374b41c2dcabca1..68c214443f6e59337bbda89916f43aaa17f58b4c 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-options "-O2 -fipa-pta -fdump-ipa-pta-details -fdump-tree-fre2-details" } */
+/* { dg-options "-O2 -fipa-pta -fdump-ipa-pta2-details -fdump-tree-fre3-details" } */
 
 static int __attribute__((noinline,noclone))
 foo (int *p, int *q)
@@ -21,6 +21,6 @@ int main()
 
 /* Verify we can disambiguate *p and *q in foo.  */
 
-/* { dg-final { scan-ipa-dump "foo.arg0 = &a" "pta" } } */
-/* { dg-final { scan-ipa-dump "foo.arg1 = &b" "pta" } } */
-/* { dg-final { scan-tree-dump "Replaced \\\*p_2\\\(D\\\) with 1" "fre2" } } */
+/* { dg-final { scan-ipa-dump "foo.arg0 = &a" "pta2" } } */
+/* { dg-final { scan-ipa-dump "foo.arg1 = &b" "pta2" } } */
+/* { dg-final { scan-tree-dump "Replaced \\\*p_2\\\(D\\\) with 1" "fre3" } } */
index 106e325f202d31c58495144762bb7ac72287343e..2fc8ada72582dbbf6bb0189be3150005244648d0 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-options "-O2 -fipa-pta -fdump-ipa-pta-details -fdump-tree-fre2-details" } */
+/* { dg-options "-O2 -fipa-pta -fdump-ipa-pta2-details -fdump-tree-fre3-details" } */
 
 int a, b;
 
@@ -26,6 +26,6 @@ int main()
 
 /* Verify we can disambiguate *p and *q in foo.  */
 
-/* { dg-final { scan-ipa-dump "foo.arg0 = &a" "pta" } } */
-/* { dg-final { scan-ipa-dump "foo.arg1 = &b" "pta" } } */
-/* { dg-final { scan-tree-dump "Replaced \\\*p_2\\\(D\\\) with 1" "fre2" } } */
+/* { dg-final { scan-ipa-dump "foo.arg0 = &a" "pta2" } } */
+/* { dg-final { scan-ipa-dump "foo.arg1 = &b" "pta2" } } */
+/* { dg-final { scan-tree-dump "Replaced \\\*p_2\\\(D\\\) with 1" "fre3" } } */
index 625291b4de857b117e1c42872aa0519dcf75d048..ec12979375ccf0f6de6ff6c88745b627fd5c0065 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-options "-O2 -fipa-pta -fdump-ipa-pta-details" } */
+/* { dg-options "-O2 -fipa-pta -fdump-ipa-pta2-details" } */
 
 int **x;
 
index c1c82456479f2212e37802a750367f3ad8a7e62c..8fd5a4387b0dcae7fc634ec59d8abe61ab7b8edc 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-options "-O -fipa-pta -fdump-ipa-pta-details" } */
+/* { dg-options "-O -fipa-pta -fdump-ipa-pta2-details" } */
 
 static void __attribute__((noinline,noclone))
 foo (int *p)
@@ -21,4 +21,4 @@ int main()
 /* Verify we correctly compute the units ESCAPED set as empty but
    still properly account for the store via *p in foo.  */
 
-/* { dg-final { scan-ipa-dump "ESCAPED = { }" "pta" } } */
+/* { dg-final { scan-ipa-dump "ESCAPED = { }" "pta2" } } */
index c31d4089a60352a556fa5029d81852e86832f13a..1bf49974dac8b76606af18f19f830a0eb11e6a05 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile { target { nonpic } } } */
-/* { dg-options "-fipa-pta -fdump-ipa-pta -fno-ipa-icf" } */
+/* { dg-options "-fipa-pta -fdump-ipa-pta2 -fno-ipa-icf" } */
 /* { dg-skip-if "" { *-*-* } { "-O0" "-fno-fat-lto-objects" } { "" } } */
 
 struct X { char x; char y; };
@@ -42,4 +42,4 @@ void test4 (int a4, char b, char c, char d, char e, char f, char g, char h)
   bar (p);
 }
 
-/* { dg-final { scan-ipa-dump "bar.arg0 = { test4.arg0 test3.arg0 test2.arg0 test1.arg0 }" "pta" } } */
+/* { dg-final { scan-ipa-dump "bar.arg0 = { test4.arg0 test3.arg0 test2.arg0 test1.arg0 }" "pta2" } } */
index a13a8653f23c010bce630ba176fc0133b6329571..c14217710304b5ab6fad239b7a946436ed3b4106 100644 (file)
@@ -469,7 +469,8 @@ extern gimple_opt_pass *make_pass_vtable_verify (gcc::context *ctxt);
 extern gimple_opt_pass *make_pass_ubsan (gcc::context *ctxt);
 extern gimple_opt_pass *make_pass_sanopt (gcc::context *ctxt);
 extern gimple_opt_pass *make_pass_oacc_kernels (gcc::context *ctxt);
-extern gimple_opt_pass *make_pass_oacc_kernels2 (gcc::context *ctxt);
+extern simple_ipa_opt_pass *make_pass_ipa_oacc (gcc::context *ctxt);
+extern simple_ipa_opt_pass *make_pass_ipa_oacc_kernels (gcc::context *ctxt);
 
 /* IPA Passes */
 extern simple_ipa_opt_pass *make_pass_ipa_lower_emutls (gcc::context *ctxt);
index cf7d94ef1cdc574b034c24d0d0bdca5e33971d59..1fe27162bd24f6b3b00a7da6f8eeb9108066245b 100644 (file)
@@ -36,6 +36,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-scalar-evolution.h"
 #include "tree-vectorizer.h"
 #include "omp-low.h"
+#include "diagnostic-core.h"
 
 
 /* A pass making sure loops are fixed up.  */
@@ -206,12 +207,14 @@ make_pass_oacc_kernels (gcc::context *ctxt)
   return new pass_oacc_kernels (ctxt);
 }
 
+/* The ipa oacc superpass.  */
+
 namespace {
 
-const pass_data pass_data_oacc_kernels2 =
+const pass_data pass_data_ipa_oacc =
 {
-  GIMPLE_PASS, /* type */
-  "oacc_kernels2", /* name */
+  SIMPLE_IPA_PASS, /* type */
+  "ipa_oacc", /* name */
   OPTGROUP_LOOP, /* optinfo_flags */
   TV_TREE_LOOP, /* tv_id */
   PROP_cfg, /* properties_required */
@@ -221,34 +224,65 @@ const pass_data pass_data_oacc_kernels2 =
   0, /* todo_flags_finish */
 };
 
-class pass_oacc_kernels2 : public gimple_opt_pass
+class pass_ipa_oacc : public simple_ipa_opt_pass
 {
 public:
-  pass_oacc_kernels2 (gcc::context *ctxt)
-    : gimple_opt_pass (pass_data_oacc_kernels2, ctxt)
+  pass_ipa_oacc (gcc::context *ctxt)
+    : simple_ipa_opt_pass (pass_data_ipa_oacc, ctxt)
   {}
 
   /* opt_pass methods: */
-  virtual bool gate (function *fn) { return gate_oacc_kernels (fn); }
-  virtual unsigned int execute (function *fn)
-    {
-      /* Rather than having a copy of the previous dump, get some use out of
-        this dump, and try to minimize differences with the following pass
-        (pass_lim), which will initizalize the loop optimizer with
-        LOOPS_NORMAL.  */
-      loop_optimizer_init (LOOPS_NORMAL);
-      loop_optimizer_finalize (fn);
-      return 0;
-    }
+  virtual bool gate (function *)
+  {
+    return (optimize
+           /* Don't bother doing anything if the program has errors.  */
+           && !seen_error ()
+           && flag_openacc
+           && flag_tree_parallelize_loops > 1);
+  }
 
-}; // class pass_oacc_kernels2
+}; // class pass_ipa_oacc
 
 } // anon namespace
 
-gimple_opt_pass *
-make_pass_oacc_kernels2 (gcc::context *ctxt)
+simple_ipa_opt_pass *
+make_pass_ipa_oacc (gcc::context *ctxt)
+{
+  return new pass_ipa_oacc (ctxt);
+}
+
+/* The ipa oacc kernels pass.  */
+
+namespace {
+
+const pass_data pass_data_ipa_oacc_kernels =
+{
+  SIMPLE_IPA_PASS, /* type */
+  "ipa_oacc_kernels", /* name */
+  OPTGROUP_LOOP, /* optinfo_flags */
+  TV_TREE_LOOP, /* tv_id */
+  PROP_cfg, /* properties_required */
+  0, /* properties_provided */
+  0, /* properties_destroyed */
+  0, /* todo_flags_start */
+  0, /* todo_flags_finish */
+};
+
+class pass_ipa_oacc_kernels : public simple_ipa_opt_pass
+{
+public:
+  pass_ipa_oacc_kernels (gcc::context *ctxt)
+    : simple_ipa_opt_pass (pass_data_ipa_oacc_kernels, ctxt)
+  {}
+
+}; // class pass_ipa_oacc_kernels
+
+} // anon namespace
+
+simple_ipa_opt_pass *
+make_pass_ipa_oacc_kernels (gcc::context *ctxt)
 {
-  return new pass_oacc_kernels2 (ctxt);
+  return new pass_ipa_oacc_kernels (ctxt);
 }
 
 /* The no-loop superpass.  */
index b34c955146d0677d76c74481641efe43e7faa6df..5f8c0b680322317b1bfaa9214d4016f0d064185d 100644 (file)
@@ -7821,6 +7821,8 @@ public:
              && !seen_error ());
     }
 
+  opt_pass * clone () { return new pass_ipa_pta (m_ctxt); }
+
   virtual unsigned int execute (function *) { return ipa_pta_execute (); }
 
 }; // class pass_ipa_pta