This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gomp4, committed] Add counter inits to zero_iter_bb in expand_omp_for_init_counts


[ was: Re: [patch] Add counter inits to zero_iter_bb in expand_omp_for_init_counts ]

On 01/10/15 15:37, Tom de Vries wrote:
On 01/10/15 14:49, Jakub Jelinek wrote:
On Thu, Oct 01, 2015 at 02:46:01PM +0200, Tom de Vries wrote:
this patch adds initialization in zero_iter_bb of counters introduced in
expand_omp_for_init_counts.

This removes the need to set TREE_NO_WARNING on those counters.

Why do you think it is a good idea?

In replace_ssa_name, I've recently added the assert:
...
           gcc_assert (!SSA_NAME_IS_DEFAULT_DEF (name));
...

On the gomp-4_0-branch, this assert triggers for a collapsed acc loop,
which uses expand_omp_for_generic for omp-expansion.  The assert
triggers because (some of) the counters added by
expand_omp_for_init_counts are not initialized on all paths.

On trunk, for the test-case in the patch, this assert doesn't trigger
because the omp function is split off before ssa.

I'd be afraid it slows things down unnecessarily.

I think zero_iter_bb is a block that is expected not to be executed
frequently.

I've attached an sdiff of x86_64 assembly for the test-case (before
left, after right). AFAICT, this patch has the effect that it speeds up
the frequent path with one instruction.

 Furthermore, I'd prefer not to change this area of code before
gomp-4_1-branch is merged, as it will be a nightmare for the merge
otherwise.

Committing to gomp-4_0-branch for now would work for me.


Committed to gomp-4_0-branch.

Thanks,
- Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]