On Tue, 4 Dec 2018 16:55:04 +0100 Tom de Vries wrote: > On 04-12-18 13:29, Jakub Jelinek wrote: > > On Fri, Jun 29, 2018 at 11:19:53AM -0700, Cesar Philippidis wrote: > >> The attached patch includes the nvptx and GCC ME reductions > >> enhancements. > >> > >> Is this patch OK for trunk? It bootstrapped / regression tested > >> cleanly for x86_64 with nvptx offloading. > > This is all OpenACC specific code not really shareable with OpenMP, > > if Thomas (for middle-end) and Tom (for NVPTX backend) are ok with > > it, it is ok for trunk. > > > > Formatting needs to be fixed: > ... > There should be exactly one space between function name and > parenthesis. 160:+ unsigned old_shift = DIM_SIZE(VECTOR); > ... > > Also, the updated patch does not address my comment about > probabilities here > ( https://gcc.gnu.org/ml/gcc-patches/2018-10/msg00325.html ): ... > > + /* Create the loop. */ > > + post_edge->flags ^= EDGE_TRUE_VALUE | EDGE_FALLTHRU; > > Edges need probabilities, as in nvptx_lockless_update, > nvptx_lockfull_update and nvptx_goacc_reduction_init. > ... Something like the attached? Tested alongside other revised patches in the series: https://gcc.gnu.org/ml/gcc-patches/2018-12/msg00930.html https://gcc.gnu.org/ml/gcc-patches/2018-12/msg00931.html (except the lines adding edge probabilities, which I've smoke-tested but haven't yet gone through a full test cycle). Thanks, Julian ChangeLog gcc/ * config/nvptx/nvptx.c (nvptx_propagate_unified): New. (nvptx_split_blocks): Call it for cond_uni insn. (nvptx_expand_cond_uni): New. (enum nvptx_builtins): Add NVPTX_BUILTIN_COND_UNI. (nvptx_init_builtins): Initialize it. (nvptx_expand_builtin): (nvptx_generate_vector_shuffle): Change integral SHIFT operand to tree BITS operand. (nvptx_vector_reduction): New. (nvptx_adjust_reduction_type): New. (nvptx_goacc_reduction_setup): Use it to adjust the type of ref_to_res. (nvptx_goacc_reduction_init): Don't update LHS if it doesn't exist. (nvptx_goacc_reduction_fini): Call nvptx_vector_reduction for vector. Use it to adjust the type of ref_to_res. (nvptx_goacc_reduction_teardown): * config/nvptx/nvptx.md (cond_uni): New pattern.