public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tom de Vries <Tom_deVries@mentor.com>
To: Richard Biener <rguenther@suse.de>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>, Jakub Jelinek <jakub@redhat.com>
Subject: Re: [gomp4, committed] Fix parallelization for fortran oacc kernels tests
Date: Thu, 18 Jun 2015 11:35:00 -0000	[thread overview]
Message-ID: <5582AC24.4050108@mentor.com> (raw)
In-Reply-To: <alpine.LSU.2.11.1506181246420.31770@zhemvz.fhfr.qr>

On 18/06/15 12:48, Richard Biener wrote:
> On Thu, 18 Jun 2015, Tom de Vries wrote:
>
>> Hi,
>>
>> I ran into a problem with fortran loops in oacc kernels regions not being
>> parallelized, after introducting transform_to_exit_first_loop_alt.
>>
>> For gfortran.dg/goacc/kernels-loop.f95, we get:
>> ...
>> #pragma omp target oacc_parallel num_gangs(1)
>> ...
>> instead of the desired num_gangs (32).
>>
>> transform_to_exit_first_loop_alt fails because nit is _135, where nit is
>> defined by:
>> ...
>> *_105 = 0;
>> D__lsm.27_50 = *_105;
>> _32 = (unsigned int) D__lsm.27_50;
>> _135 = 1023 - _32;
>> ...
>>
>> pass_fre would manage to propagate the '*105 = 0' assignment. But in the
>> current pass order, pass_fre is run before pass_lim, where this pattern is
>> introduced:
>> ...
>>                NEXT_PASS (pass_ch_oacc_kernels);
>>                NEXT_PASS (pass_fre);
>>                NEXT_PASS (pass_tree_loop_init);
>>                NEXT_PASS (pass_lim);
>>                NEXT_PASS (pass_copy_prop);
>>                NEXT_PASS (pass_scev_cprop);
>>                NEXT_PASS (pass_parallelize_loops_oacc_kernels);
>>                NEXT_PASS (pass_expand_omp_ssa);
>>                NEXT_PASS (pass_tree_loop_done);
>> ...
>>
>> The patch moves pass_fre to the location of pass_copy_prop, and replaces it.
>> Furthermore, it adds scans to the fortran test-cases to make sure they get
>> properly parallelized.
>
> You may now figure out that LIM needs FRE to detect equal memory
> references to apply store-motion.  But maybe the issues oacc
> lowering introduces are limited and under your control.
>

To show the context of the pass group, after this commit the pass group 
looks like this:
...
           NEXT_PASS (pass_sra_early);
           NEXT_PASS (pass_build_ealias);
           NEXT_PASS (pass_fre);
           NEXT_PASS (pass_oacc_kernels);
           PUSH_INSERT_PASSES_WITHIN (pass_oacc_kernels)
               NEXT_PASS (pass_ch_oacc_kernels);
               NEXT_PASS (pass_tree_loop_init);
               NEXT_PASS (pass_lim);
               NEXT_PASS (pass_tree_loop_done);
               NEXT_PASS (pass_fre);
               NEXT_PASS (pass_tree_loop_init);
               NEXT_PASS (pass_scev_cprop);
               NEXT_PASS (pass_parallelize_loops_oacc_kernels);
               NEXT_PASS (pass_expand_omp_ssa);
               NEXT_PASS (pass_tree_loop_done);
           POP_INSERT_PASSES ()
           NEXT_PASS (pass_merge_phi);
           NEXT_PASS (pass_dse);
           NEXT_PASS (pass_cd_dce);
...
In other words, the pass group is run directly after pass_fre.

When I move pass_fre before the pass group to directly after the pass 
group, I start seeing the failure mode you describe.

Thanks,
- Tom

  reply	other threads:[~2015-06-18 11:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-18 10:48 Tom de Vries
2015-06-18 10:55 ` Richard Biener
2015-06-18 11:35   ` Tom de Vries [this message]
2015-06-18 11:50     ` Richard Biener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5582AC24.4050108@mentor.com \
    --to=tom_devries@mentor.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=rguenther@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).