This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, 10/16] Add pass_oacc_kernels pass group in passes.def
- From: Tom de Vries <Tom_deVries at mentor dot com>
- To: Richard Biener <rguenther at suse dot de>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, "gcc-patches at gnu dot org" <gcc-patches at gnu dot org>, Jakub Jelinek <jakub at redhat dot com>
- Date: Tue, 17 Nov 2015 16:38:30 +0100
- Subject: Re: [PATCH, 10/16] Add pass_oacc_kernels pass group in passes.def
- Authentication-results: sourceware.org; auth=none
- References: <5640BD31 dot 2060602 at mentor dot com> <5640FB07 dot 6010008 at mentor dot com> <alpine dot LSU dot 2 dot 11 dot 1511111159040 dot 4884 at t29 dot fhfr dot qr> <5649C41A dot 40403 at mentor dot com> <alpine dot LSU dot 2 dot 11 dot 1511161341420 dot 4884 at t29 dot fhfr dot qr> <564A64B3 dot 7080305 at mentor dot com> <CAFiYyc0i3BX=9Ae1w-a=ySUwLbXNLE-TbKLOjqYRGExPJJ_A_Q at mail dot gmail dot com> <564B3F69 dot 50600 at mentor dot com> <alpine dot LSU dot 2 dot 11 dot 1511171618210 dot 4884 at t29 dot fhfr dot qr>
On 17/11/15 16:18, Richard Biener wrote:
IMHO autopar needs to handle induction itself.
>
>I'm not sure what you mean. Could you elaborate? Autopar handles induction
>variables, but it doesn't handle exit phis reading the final value of the
>induction variable. Is that what you want fixed? How?
Yes. Perform final value replacement.
I see. Calling scev_const_prop in pass_parallelize_loops_oacc_kernels
seems to work fine.
Doing the same for pass_parallelize_loops like this:
...
diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c
index 17415a8..d944395 100644
--- a/gcc/tree-parloops.c
+++ b/gcc/tree-parloops.c
@@ -2787,6 +2787,9 @@ pass_parallelize_loops::execute (function *fun)
if (number_of_loops (fun) <= 1)
return 0;
+ unsigned int sccp_todo = scev_const_prop ();
+ gcc_assert (sccp_todo == 0);
+
if (parallelize_loops ())
{
fun->curr_properties &= ~(PROP_gimple_eomp);
...
seems to fix PR 68373 - "autopar fails on loop exit phi with argument
defined outside loop".
The new scev_const_prop call in autopar rewrites this phi into an
assignment, and that allows parloops to succeed:
...
final value replacement:
n_2 = PHI <n_4(D)(4)>
with
n_2 = n_4(D);
...
Thanks,
- Tom