Support for OpenACC acc_on_device in offloading configurations.
[official-gcc.git] / gcc / ChangeLog.gomp
bloba744ebfb06402069c5d58be314eac7cc491da9da
1 2014-12-18  Thomas Schwinge  <thomas@codesourcery.com>
3         * config/i386/intelmic-offload.h: New file.
4         * config/nvptx/offload.h: Likewise.
5         * config.gcc <*-intelmic-*, *-intelmicemul-*, nvptx-*>: Point to
6         them via tm_file.
8 2014-12-18  Thomas Schwinge  <thomas@codesourcery.com>
9             Jakub Jelinek  <jakub@redhat.com>
11         * builtins.c (expand_builtin_acc_on_device): Use
12         do_compare_rtx_and_jump instead of emit_cmp_and_jump_insns.
14         * builtins.c (expand_builtin_acc_on_device): Make more RTXy.
16 2014-12-17  Thomas Schwinge  <thomas@codesourcery.com>
17             Bernd Schmidt  <bernds@codesourcery.com>
19         * tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_AUTO, and
20         OMP_CLAUSE_SEQ.
21         * tree.c (omp_clause_num_ops, omp_clause_code_name, walk_tree_1):
22         Update accordingly.
23         * gimplify.c (gimplify_scan_omp_clauses)
24         (gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_AUTO,
25         OMP_CLAUSE_GANG, OMP_CLAUSE_SEQ, OMP_CLAUSE_VECTOR, and
26         OMP_CLAUSE_WORKER.
27         * tree-pretty-print.c (dump_omp_clause): Likewise.
28         * omp-low.c (scan_sharing_clauses): Likewise.
29         (struct omp_context): Add gwv_below, and gwv_this members.
30         (enclosing_target_ctx, oacc_loop_or_target_p): New functions.
31         (scan_omp_for, scan_omp_target): Use those.
33 2014-12-17  Thomas Schwinge  <thomas@codesourcery.com>
35         * tree-nested.c (convert_nonlocal_reference_stmt)
36         (convert_local_reference_stmt, convert_tramp_reference_stmt)
37         (convert_gimple_call) <GIMPLE_OMP_TARGET>: Use
38         is_gimple_omp_offloaded.
40         * omp-low.c (lower_reduction_clauses): Simplify OpenACC handling.
42         * gimple.h: Rename is_gimple_omp_oacc_specifically to
43         is_gimple_omp_oacc.  Update all users.
45         * gimplify.c (enum omp_region_type): Restore ORT_TARGET_DATA and
46         ORT_TARGET.  Update all users.
48         * doc/generic.texi (OpenMP): Move OpenACC stuff into...
49         (OpenACC): ... this new subsection.
51         * builtin-types.def: Remove BT_FN_VOID_INT_PTR_INT.
53         * oacc-builtins.def: Merge into omp-builtins.def.  Update all users.
55         * builtins.c (expand_builtin_acc_on_device): Use
56         include/gomp-constants.h.
57         * omp-low.c (expand_omp_target, oacc_process_reduction_data)
58         (lower_omp_target): Likewise.
59         * tree-core.h (enum omp_clause_map_kind): Likewise.
61         * omp-low.c (build_omp_regions_1, make_gimple_omp_edges): Simplify
62         multi-line if conditions.
64 2014-12-10  Thomas Schwinge  <thomas@codesourcery.com>
66         * omp-low.c (scan_omp_target): Remove taskreg_nesting_level and
67         target_nesting_level assertions.
68         (check_omp_nesting_restrictions): Rework OpenACC constructs
69         handling.  Update and extend the relevant test cases.
71 2014-12-10  Thomas Schwinge  <thomas@codesourcery.com>
72             Bernd Schmidt  <bernds@codesourcery.com>
74         * gimple.def (GIMPLE_OACC_KERNELS, GIMPLE_OACC_PARALLEL): Merge
75         into GIMPLE_OMP_TARGET.  Update all users.
77 2014-12-10  Thomas Schwinge  <thomas@codesourcery.com>
79         * cgraphbuild.c (pass_build_cgraph_edges::execute): Remove
80         handling of GIMPLE_OACC_PARALLEL.
81         * gimple-pretty-print.c (dump_gimple_omp_target): Dump a bit more
82         data, pretty-printing.
84         * omp-low.c (build_omp_regions_1, make_gimple_omp_edges)
85         <GIMPLE_OMP_TARGET>: Handle
86         GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA the same as
87         GF_OMP_TARGET_KIND_OACC_UPDATE.
89 2014-11-13  Cesar Philippidis  <cesar@codesourcery.com>
91         * omp-low.c (oacc_get_reduction_array_id): Fix whitespace.
93 2014-11-13  Cesar Philippidis  <cesar@codesourcery.com>
95         * omp-low.c (omp_get_id): Rename to...
96         (oacc_get_reduction_array_id): ... this.
97         (lookup_oacc_reduction): ... this.
98         (lookup_reduction): Rename to...
99         (maybe_lookup_reduction): Rename to...
100         (maybe_lookup_oacc_reduction): ... this.
101         (scan_sharing_clauses): Update calls to renamed fns.
102         (lower_reduction_var_helper): Rename to...
103         (oacc_lower_reduction_var_helper): ... this.
104         (lower_reduction_clauses): Rename to...
105         (oacc_lower_reduction_clauses): ... this.
106         (omp_gimple_assign_with_ops): Rename to...
107         (oacc_gimple_assign_with_ops): ... this.
108         (initialize_reduction_data): Rename to ...
109         (oacc_initialize_reduction_data): ... this.
110         (finalize_reduction_data): Rename to...
111         (oacc_finalize_reduction_data): ... this.
112         (process_reduction_data): Rename to...
113         (oacc_process_reduction_data): ... this.
114         (lower_omp_target): Update calls to renamed fns.
116 2014-11-13  Thomas Schwinge  <thomas@codesourcery.com>
118         * gimplify.c (gimplify_omp_workshare) <OACC_DATA, OACC_KERNELS,
119         OACC_PARALLEL>: Don't request ORT_TARGET_MAP_FORCE.
120         (enum gimplify_omp_var_data, enum omp_region_type): Remove
121         GOVD_MAP_FORCE, and ORT_TARGET_MAP_FORCE, respectively.  Update
122         all users.
124         * omp-low.c (scan_sharing_clauses) <OMP_CLAUSE_MAP>: Revert
125         earlier change.
127 2014-11-12  Cesar Philippidis  <cesar@codesourcery.com>
129         * tree.c (omp_clause_code_name): Add missing comma
130         after "_Cilk_for_count_".
132 2014-11-12  Thomas Schwinge  <thomas@codesourcery.com>
134         * gimplify.c (gimplify_omp_for): Eliminate govd_private; always
135         use GOVD_PRIVATE.
137         * omp-low.c (scan_oacc_offload, expand_oacc_offload)
138         (lower_oacc_offload): Merge into scan_omp_target,
139         expand_omp_target, lower_omp_target, respectively.  Update all
140         users.
142 2014-11-11  Thomas Schwinge  <thomas@codesourcery.com>
144         * omp-low.c (scan_sharing_clauses): Remove bogus assertion.
146         * omp-low.c (delete_omp_context): Dispose of reduction_map.
148         * omp-low.c (maybe_lookup_reduction): Don't require an OpenACC
149         context.
150         (lower_oacc_offload): Simplify use of maybe_lookup_reduction.
152         * omp-low.c (lower_omp_target): Restore two gcc_asserts.
154 2014-11-06  Thomas Schwinge  <thomas@codesourcery.com>
156         * gimple.h (is_gimple_omp_oacc_specifically): Return true for
157         GIMPLE_OMP_TARGET's GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA.
159         * omp-low.c (lower_reduction_clauses): Initialize tid.
161 2014-11-05  Thomas Schwinge  <thomas@codesourcery.com>
163         * tree-core.h (enum omp_clause_code): Remove OMP_CLAUSE_HOST and
164         OMP_CLAUSE_OACC_DEVICE.  Update all users.
166         * gimplify.c (gimplify_oacc_cache): New function.
167         (gimplify_expr): Use it for OACC_CACHE.
168         (gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses): Handle
169         OMP_CLAUSE__CACHE_.
171         * tree-core.h (enum omp_clause_code): Move OMP_NO_CLAUSE_CACHE
172         next to, and handle it like a data clause.  Rename it to
173         OMP_CLAUSE__CACHE_.  Update all users.
175         * invoke.texi: Update for OpenACC.
176         * sourcebuild.texi: Likewise.
178         * tree.def (OACC_WAIT): Remove.  Update all users.
180         * omp-builtins.def (BUILT_IN_OMP_SET_NUM_THREADS): Remove.
182 2014-11-03  Cesar Philippidis  <cesar@codesourcery.com>
184         * builtins.def (DEF_GOACC_BUILTIN): Revert erroneous checkin.
186 2014-11-03  Cesar Philippidis  <cesar@codesourcery.com>
188         * oacc-builtins.def (BUILT_IN_GOACC_GET_NUM_THREADS): New built-in
189         function.
190         (BUILT_IN_ACC_GET_DEVICE_TYPE): Likewise.
191         * omp-low.c (oacc_max_threads): New function.
192         (lower_reduction_clauses): Use the GOACC thread builtin functions to
193         determine the thread count. Handle multiple reduction variables.
194         (expand_omp_for_static_nochunk): Likewise.
195         (expand_omp_for_static_chunk): Likewise.
196         (finalize_reduction_data): General cleanups.
197         (process_reduction_data): Use acc_get_device_type to determine nthreads
198         at runtime.
200 2014-11-03  Cesar Philippidis  <cesar@codesourcery.com>
202         * gimple.h (enum gf_mask): Add GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA.
203         * gimple-pretty-print.c (dump_gimple_omp_target): Handle it.
204         * gimplify.c (gimplify_scan_omp_clauses): Remove switch stmt which
205         declared OMP_CLAUSE_MAP_FORCE_DEALLOC as unimplemented.
206         (gimplify_omp_target_update): Handle OACC_ENTER_DATA and
207         OACC_EXIT_DATA.
208         (gimplify_expr): Shuffle around OACC_ENTER_DATA, OACC_EXIT_DATA and
209         OACC_WAIT.
210         * oacc-builtins.def (BUILD_INT_GOACC_ENTER_EXIT_DATA): New built-in
211         function.
212         * omp-low.c (expand_omp_target): Handle
213         GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA. Don't use quick_push when
214         there is an unknown number of wait args.
215         (lower_omp_target): Handle GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA.
217 2014-10-24  James Norris  <jnorris@codesourcery.com>
219         * builtin-types.def (BT_FN_VOID_INT_INT_VAR,
220         BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR_INT_INT_INT_INT_INT_VAR,
221         BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR_INT_INT_VAR): Add.
222         (BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR_INT_INT_INT): Remove.
223         * c-family/c-common.c (enum c_builtin_type, c_define_builtins): Remove
224         unused FUNCTION_TYPE_10. Add new FUNCTION_TYPE_VAR_8 and
225         FUNCTION_TYPE_VAR_12.
226         * c-family/c-pragma.c (oacc_pragmas): Add entry for wait directive.
227         * c/c-parser.c (c_parser_omp_clause_name): Add handling of wait and
228         async clauses.
229         (c_parser_oacc_wait_list, c_parser_oacc_clause_async,
230         c_parser_oacc_clause_wait): New.
231         (c_parser_oacc_all_clauses): Handle async and wait clauses.
232         (OACC_KERNELS_CLAUSE_MASK, OACC_PARALLEL_CLAUSE_MASK,
233         OACC_UPDATE_CLAUSE_MASK): Add async and wait clauses.
234         (OACC_WAIT_CLAUSE_MASK): New.
235         (c_parser_oacc_wait): New.
236         (c_parser_omp_construct): Handle wait directive.
237         * c/c-typeck.c (c_finish_omp_clauses): Handle async and wait clauses.
238         * fortran/f95-lang.c (gfc_init_builtin_functions): Remove unused
239         FUNCTION_TYPE_10. Add new FUNCTION_TYPE_VAR_2, FUNCTION_TYPE_VAR_8,
240         and FUNCTION_TYPE_VAR_12.
241         * fortran/types.def (BT_FN_VOID_INT_INT_VAR,
242         BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR_INT_INT_INT_INT_INT_VAR,
243         BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR_INT_INT_VAR): Add.
244         (BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR_INT_INT_INT): Remove.
245         * lto/lto-lang.c (enum lto_builtin_type, lto_define_builtins): Remove
246         unsigned FUNCTION_TYPE_10. Add new FUNCTION_TYPE_VAR_8 and
247         FUNCTION_TYPE_VAR_12.
248         * oacc-builtins.def (BUILT_IN_GOACC_KERNELS BUILT_IN_GOACC_PARALLEL,
249         BUILT_IN_GOACC_UPDATE, BUILT_IN_GOACC_WAIT): Change type.
250         * omp-low.c (scan_sharing_clauses): Handle async and wait clauses.
251         (expand_oacc_offload): Lower kernel directive and async and wait
252         clauses.
254 2014-10-23  Thomas Schwinge  <thomas@codesourcery.com>
256         * omp-low.c (finalize_reduction_data): Don't skip the reduction
257         variable's original value.
259 2014-10-20  Cesar Philippidis  <cesar@codesourcery.com>
261         * gimplify.c (gimplify_scan_omp_clauses): Remove switch stmt which
262         declared OMP_CLAUSE_MAP_FORCE_DEALLOC as unimplemented.
263         (gimplify_expr): Remove OACC_WAIT, since it handled directly by the
264         front ends.
266 2014-10-15  James Norris  <jnorris@codesourcery.com>
268         * builtin-types.def (BT_FN_VOID_INT_PTR_INT): New type.
269         * oacc-builtins.def (BUILT_IN_GOACC_WAIT): New builtin.
271 2014-10-09  Thomas Schwinge  <thomas@codesourcery.com>
273         * omp-low.c (process_reduction_data): Initialize variable inner.
275 2014-10-08  Cesar Philippidis  <cesar@codesourcery.com>
277         * omp-low.c (lower_reduction_clauses): Clarify comment.
278         (process_reduction_data): Scan for nonempty bind statements at
279         the beginning of parallel blocks.
281 2014-09-23  Thomas Schwinge  <thomas@codesourcery.com>
283         * builtins.def (DEF_GOACC_BUILTIN_COMPILER): New macro.
284         * oacc-builtins.def (BUILT_IN_GOACC_UPDATE): New builtin.
285         * builtins.c (expand_builtin_acc_on_device): New function.
286         (expand_builtin): Use it to handle BUILT_IN_ACC_ON_DEVICE.
287         (is_inexpensive_builtin): Handle BUILT_IN_ACC_ON_DEVICE.
289 2014-09-08  Thomas Schwinge  <thomas@codesourcery.com>
291         * configure.ac (offload_targets): Remove.
292         * configure: Regenerate.
294 2014-09-05  Bernd Schmidt  <bernds@codesourcery.com>
296         * configure.ac (enable-accelerator): Remove option.
297         (enable_accelerator): Don't subst.
298         * configure: Regenerate.
300 2014-09-03  Thomas Schwinge  <thomas@codesourcery.com>
302         * omp-low.c (expand_oacc_offload): Add child_fn to offload_funcs.
304 2014-08-19  Ilya Verbin  <ilya.verbin@intel.com>
306         * Makefile.in (GTFILES): Add omp-low.h.
307         * cgraphunit.c: Include omp-low.h.
308         (init_offload_var_table): New function.
309         (ipa_passes): Run ipa_write_summaries for target only when
310         offload_funcs or offload_vars is not empty.
311         * gengtype.c (ifiles): Add omp-low.h.
312         * lto/lto.c (read_cgraph_and_symbols): Call input_offload_tables.
313         * lto-cgraph.c: Include omp-low.h.
314         (output_offload_tables): New function.
315         (input_offload_tables): Likewise.
316         * lto-section-in.c (lto_section_name): Add offload_table.
317         * lto-streamer-out.c (lto_output): Call output_offload_tables.
318         * lto-streamer.h: Declare output_offload_tables
319         and input_offload_tables.
320         (lto_section_type): Add LTO_section_offload_table.
321         * omp-low.c: Define offload_funcs and offload_vars.
322         (expand_omp_target): Add child_fn to offload_funcs.
323         (omp_finish_file): Remove obsolete code.
324         * omp-low.h: Declare offload_funcs and offload_vars.
326 2014-08-04  Bernd Schmidt  <bernds@codesourcery.com>
328         * Makefile.in (tool_prefix): Remove.
329         (unlibsubdir): Change depending on enable_as_accelerator.
330         (GCC_TARGET_INSTALL_NAME): Revert previous change.
331         (install_driver): Rework offloading changes.
332         * configure.ac (tool_prefix): Remove.
333         (enable-as-accelerator-for): Don't require --enable-as-accelerator.
334         Update the program_transform_name.
335         (offload_targets): Add 'g' modifier to sed script.
336         * configure: Regenerate.
338 2014-07-28  Cesar Philippidis  <cesar@codesourcery.com>
340         * omp-low.c (get_base_type): New function.
341         (scan_sharing_clauses): Replace TREE_TYPE with get_base_type.
342         (lower_reduction_clauses): Use it.
343         (initialize_reduction_data): Likewise.
344         (finalize_reduction_data): Likewise. Remove new_var.
346 2014-07-28  Tom de Vries  <tom@codesourcery.com>
348         * omp-low.c (process_reduction_data): Remove unused variables.
350 2014-07-24  Thomas Schwinge  <thomas@codesourcery.com>
352         * omp-low.c (extract_omp_for_data): Force OpenACC loop to use a
353         chunk size of one.
355         * omp-low.c (expand_omp_for_static_chunk): Merge changes
356         previously applied to expand_omp_for_static_nochunk.
358 2014-07-14  Cesar Philippidis  <cesar@codesourcery.com>
360         * omp-low.c (extract_omp_for_data): Likewise.
361         (expand_omp_for_static_nochunk): Likewise.
363 2014-07-14  Cesar Philippidis  <cesar@codesourcery.com>
365         * omp-low.c (process_reduction_data): Check for new
366         binding level and skip for-loops which don't have a
367         reduction clause.
369 2014-07-08  Cesar Philippidis  <cesar@codesourcery.com>
370             Thomas Schwinge  <thomas@codesourcery.com>
372         * omp-low.c (omp_get_id): New function.
373         (lookup_reduction): New function.
374         (maybe_lookup_reduction): New function.
375         (build_outer_var_ref): Remove openacc assert.
376         (new_omp_context): Preserve ctx->reduction_map.
377         (scan_sharing_clauses): Handle OMP_CLAUSE_REDUCTION.
378         (scan_oacc_offload): Initialize ctx->reduction_map.
379         (lower_reduction_clauses): Handle OpenACC reductions.
380         (omp_gimple_assign_with_ops): New function.
381         (initialize_reduction_data): New function.
382         (finalize_reduction_data): New function.
383         (process_reduction_data): New function.
384         (lower_oacc_offload): Handle reductions.
385         * gcc/omp-builtins.def (BUILT_IN_OMP_SET_NUM_THREADS): New.
387 2014-06-13  Thomas Schwinge  <thomas@codesourcery.com>
388             Ilmir Usmanov  <i.usmanov@samsung.com>
390         * tree-pretty-print.c (dump_omp_clause): Instead of
391         OMP_CLAUSE_DECL, use more specific accessors for some clauses.
393 2014-06-13  Thomas Schwinge  <thomas@codesourcery.com>
394             Cesar Philippidis  <cesar@codesourcery.com>
396         * omp-low.c (extract_omp_for_data, scan_sharing_clauses): For
397         OpenACC directives, the collapse(1) clause is supported.
399 2014-06-13  Cesar Philippidis  <cesar@codesourcery.com>
401         * omp-low.c (scan_sharing_clauses): Preliminary support for
402         OMP_CLAUSE_PRIVATE for OpenACC.
404         * omp-low.c (scan_sharing_clauses): For clauses currently not
405         supported with OpenACC directives, emit a sorry message instead of
406         aborting.
408 2014-06-12  Thomas Schwinge  <thomas@codesourcery.com>
409             James Norris  <jnorris@codesourcery.com>
411         * omp-low.c (scan_sharing_clauses): Allow OMP_CLAUSE_IF.
412         (expand_oacc_offload, expand_omp_target): Handle it.
414 2014-06-06  Thomas Schwinge  <thomas@codesourcery.com>
415             James Norris  <jnorris@codesourcery.com>
417         * gimple.h (enum gf_mask): Add GF_OMP_TARGET_KIND_OACC_UPDATE, and
418         extend mask size, GF_OMP_TARGET_KIND_MASK.
419         (is_gimple_omp_oacc_specifically): Handle
420         GF_OMP_TARGET_KIND_OACC_UPDATE.
421         * gimplify.c (gimplify_omp_target_update, gimplify_expr):
422         Likewise.
423         * gimple-pretty-print.c (dump_gimple_omp_target): Likewise.
424         * omp-low.c (scan_omp_target, expand_omp_target)
425         (build_omp_regions_1, lower_omp_target, lower_omp_1)
426         (make_gimple_omp_edges): Likewise.
427         * oacc-builtins.def (BUILT_IN_GOACC_UPDATE): New builtin.
429 2014-06-05  Thomas Schwinge  <thomas@codesourcery.com>
431         * gimplify.c (gimplify_scan_omp_clauses)
432         (gimplify_adjust_omp_clauses): Handle
433         OMP_CLAUSE_MAP_FORCE_DEVICEPTR.
434         * omp-low.c (scan_sharing_clauses, lower_oacc_offload)
435         (lower_omp_target): Likewise.
436         * tree-core.h (enum omp_clause_map_kind)
437         <OMP_CLAUSE_MAP_FORCE_DEVICEPTR>: Update comment.
439         * gimplify.c (gimplify_scan_omp_clauses) <case OMP_CLAUSE_MAP>:
440         Don't block OMP_CLAUSE_MAP_FORCE_PRESENT.
442 2014-06-04  Thomas Schwinge  <thomas@codesourcery.com>
444         * cgraphunit.c (ipa_passes, compile): Handle flag_openacc next to
445         flag_openmp.
446         * ipa-inline-analysis.c (inline_generate_summary): Likewise.
447         * lto-streamer.c (lto_streamer_init, gate_lto_out): Likewise.
448         * passes.c (ipa_write_summaries): Likewise.
450 2014-05-12  Bernd Schmidt  <bernds@codesourcery.com>
452         * lto-wrapper.c (ompbegin): New static variable.
453         (find_ompbeginend): Renamed from find_ompend.  Also look for
454         crtompbegin.o.
455         (run_gcc): Also use ompbegin.
457 2014-05-08  Thomas Schwinge  <thomas@codesourcery.com>
459         * omp-low.c (get_offload_symbol_decl): Mark __OPENMP_TARGET__ as
460         addressable.
462 2014-04-04  Bernd Schmidt  <bernds@codesourcery.com>
464         * lto-wrapper.c (replace_special_characters): Remove functions and
465         all calls to it.
467         * lto-section-names.h (OFFLOAD_VAR_TABLE_SECTION_NAME,
468         OFFLOAD_FUNC_TABLE_SECTION_NAME): Define.
469         * lto-wrapper.c (OFFLOAD_FUNC_TABLE_SECTION_NAME): Don't define.
470         (ompend): New static variable.
471         (copy_file, find_ompend): New static functions.
472         (run_gcc): Call find_ompend if we have offload images.  Add its
473         return value to the output.
474         * omp-low.c: Include "lto-section-names.h".
475         (omp_finish_file): Initialize section names from macros defined there.
477         * omp-low.c (offload_symbol_decl): New static variable.
478         (get_offload_symbol_decl): New static function.
479         (expand_oacc_offload, expand_omp_target): Use it.
481 2014-04-02  Thomas Schwinge  <thomas@codesourcery.com>
483         * omp-low.c (omp_finish_file): Use num_vars instead of num_funcs
484         when recording offload symbols v_vars.
486         * omp-low.c (expand_oacc_offload): Handle __OPENMP_TARGET__
487         symbol.
489 2014-03-20  Bernd Schmidt  <bernds@codesourcery.com>
491         Mostly by Michael Zolotukhin:
492         * lto-wrapper.c (OFFLOAD_FUNC_TABLE_SECTION_NAME,
493         OFFLOAD_TARGET_NAMES_ENV): New defines.
494         (offload_names): New static variable.
495         (free_array_of_ptrs, parse_env_var, access_check,
496         prepare_target_image, replace_special_characters,
497         compile_images_for_openmp_targets): New static functions.
498         (run_gcc): Determine whether offload sections are present.  If so,
499         run compile_images_for_openmp_targets and print the image names.
501         * Makefile.in (COLLECT2_OBJS): Add collect-utils.o.
502         (LTO_WRAPPER_OBJS): New variable.
503         (lto-wrapper$(exeext)): Use it.
504         * collect2.c: Include "collect-utils.h".
505         (vflag, debug): Remove variables.  Rename all uses of vflag to
506         verbose.
507         (at_file_supplied): No longer static.
508         (tool_name): New variable.
509         (do_wait, fork_execute, maybe_unlink): Don't declare.
510         (tool_cleanup): Renamed from collect_atexit.  New arg from_signal.
511         (collect_atexit): New static function.
512         (notice): Remove function.
513         (handler): Just call tool_cleanup.
514         (maybe_run_lto_and_relink, main, do_dsymutil): Add new arg to
515         fork_execute calls.
516         (collect_wait, do_wait, collect_execute): Remove functions.
517         (maybe_unlink): No longer static.
518         * collect2.h (vflag, debug): Don't declare.
519         (at_file_supplied): Declare.
520         * collect-utils.c (utils_cleanup): New arg from_signal.  All callers
521         changed.
522         (collect_execute): Replace with implementation from collect2, plus a
523         new arg use_atfile.  All callers changed.
524         (collect_wait): Replace with implementation from collect2.
525         (maybe_unlink_file): Remove function.
526         (fork_execute): Replace with implementation from collect2, plus a
527         new arg use_atfile.  All callers changed.
528         (do_wait): Add call to utils_cleanup to the error path.
529         * collect-utils.h (collect_execute, fork_execute, utils_cleanup,
530         tool_cleanup): Adjust declarations.
531         * lto-wrapper.c (tool_cleanup): Add unused bool argument.
532         * tlink.c: Include "collect-utils.h".
533         (tlink_execute): New arg use_atfile.  All callers changed.
534         (tlink_init, tlink_execute): Remove declarations.
536         * Makefile.in (ALL_HOST_BACKEND_OBJS): Add collect-utils.o.
537         (lto-wrapper$(exeext)): Link with collect-utils.o.
538         * collect-utils.c: New file.
539         * collect-utils.h: New file.
540         * lto-wrapper.c: Include "collect-utils.h".
541         (args_name): Delete variable.
542         (tool_name): New variable.
543         (tool_cleanup): New function.
544         (maybe_unlink): Renamed from maybe_unlink_file.  All callers changed.
545         (lto_wrapper_cleanup, fatal_signal, fatal, fatal_perror,
546         collect_execute, collect_wait, fork_execute): Remove functions.
548         Mostly by Michael Zolotukhin:
549         * omp-low.c: Include "common/common-target.h".
550         (expand_omp_target): Pass in address of __OPENMP_TARGET__.
551         (add_decls_addresses_to_decl_constructor, omp_finish_file): New
552         functions.
553         * omp-low.h (omp_finish_file): Declare.
554         * toplev.c: Include "omp-low.h".
555         (compile_file): Call omp_finish_file.
556         * target.def (record_offload_symbol): New hook.
557         * doc/tm.texi.in (TARGET_RECORD_OFFLOAD_SYMBOL): Add.
558         * doc/tm.texi: Regenerate.
559         * configure.ac (ENABLE_OFFLOADING): Define if we have offload_targets.
560         * configure: Regenerate.
561         * config.in: Regenerate.
563         * config/darwin.c: Include "lto-section-names.h".
564         (LTO_SEGMENT_NAME): Don't define.
565         * config/i386/winnt.c: Include "lto-section-names.h".
566         * lto-streamer.c: Include "lto-section-names.h".
567         * lto-streamer.h (LTO_SECTION_NAME_PREFIX, OMP_SECTION_NAME_PREFIX):
568         Don't define.
569         (section_name_prefix): Don't declare.
570         * lto-wrapper.c: Include "lto-section-names.h".
571         (LTO_SECTION_NAME_PREFIX): Don't define.
572         * lto-section-names.h: New file.
573         * cgraphunit.c: Include "lto-section-names.h".
575         * configure.ac (real_target_noncanonical, tool_prefix,
576         accel_dir_suffix, offload_targets): Compute new variables.
577         (--enable-as-accelerator-for, --enable-as-accelerator,
578         --enable-offload-targets): New options.
579         * configure: Regenerate.
580         * config.in: Regenerate.
581         * Makefile.in (real_target_noncanonical, tool_prefix,
582         accel_dir_suffix, enable_as_accelerator): New variables substituted
583         by configure.
584         (libsubdir, libexecsubdir, GCC_TARGET_INSTALL_NAME): Tweak for the
585         possibility of being configured as an offload compiler.
586         (install_driver): Likewise.
587         (DRIVER_DEFINES): Pass new defines DEFAULT_REAL_TARGET_MACHINE and
588         ACCEL_DIR_SUFFIX.
589         * gcc.c (spec_host_machine, accel_dir_suffix): New variables.
590         (process_command): Tweak path construction for the possibility
591         of being configured as an offload compiler.
592         (main): Likewise. Look up specs in just_machine_suffix only if not
593         ACCEL_COMPILER.  Construct OFFLOAD_TARGET_NAMES environment variable
594         if we have OFFLOAD_TARGETS.
596 2014-03-20  Thomas Schwinge  <thomas@codesourcery.com>
598         * gimple.h (enum gf_mask): Add GF_OMP_FOR_KIND_OACC_LOOP.
599         (is_gimple_omp_oacc_specifically): Handle it.
600         * gimple-pretty-print.c (dump_gimple_omp_for): Likewise.
601         * gimple.def (GIMPLE_OMP_FOR): Update for OpenACC loop.
602         * gimple.c (gimple_build_omp_for): Don't explicitly mention some
603         clauses.
604         (gimple_copy) <GIMPLE_OMP_FOR>: Handle GF_OMP_FOR_KIND_OACC_LOOP.
605         * omp-low.c (extract_omp_for_data, scan_sharing_clauses)
606         (check_omp_nesting_restrictions, lower_rec_input_clauses)
607         (lower_lastprivate_clauses, lower_reduction_clauses)
608         (expand_omp_for_generic, expand_omp_for_static_nochunk)
609         (expand_omp_for_static_chunk, maybe_add_implicit_barrier_cancel)
610         (lower_omp_for): Likewise.
611         * tree-inline.c (remap_gimple_stmt): Likewise.
612         * tree-nested.c (walk_gimple_omp_for)
613         (convert_nonlocal_reference_stmt, convert_local_reference_stmt)
614         (convert_gimple_call): Likewise.
615         * doc/gimple.texi (GIMPLE_OMP_FOR): Don't explicitly mention some
616         clauses.
617         * gimplify.c (gimplify_omp_for, gimplify_expr): Handle OACC_LOOP.
619         * tree.def (OACC_LOOP): Sort after OMP_DISTRIBUTE.
620         * tree.h (OMP_LOOP_CHECK): Update accordingly.
621         * gimplify.c (is_gimple_stmt): Sort OACC_LOOP after
622         OMP_DISTRIBUTE.
623         * tree-pretty-print.c (dump_generic_node): Likewise.
624         * doc/generic.texi (OACC_LOOP): Sort after OACC_HOST_DATA.
625         (OMP_FOR): Fix and extend for OACC_LOOP.
627         * gimple.h (enum gf_mask): Add and use GF_OMP_FOR_SIMD.
628         * omp-low.c: Update accordingly.
630         * gimple.h (enum gf_mask): Rewrite "<< 0" shift expressions used
631         for GF_OMP_FOR_KIND_MASK, GF_OMP_FOR_KIND_FOR,
632         GF_OMP_FOR_KIND_DISTRIBUTE, GF_OMP_FOR_KIND_SIMD,
633         GF_OMP_FOR_KIND_CILKSIMD, GF_OMP_TARGET_KIND_MASK,
634         GF_OMP_TARGET_KIND_REGION, GF_OMP_TARGET_KIND_DATA,
635         GF_OMP_TARGET_KIND_UPDATE, GF_OMP_TARGET_KIND_OACC_DATA.
637         * omp-low.c (check_omp_nesting_restrictions): Allow nesting of
638         OpenACC constructs inside of OpenACC data constructs.
640 2014-03-18  Ilmir Usmanov  <i.usmanov@samsung.com>
642         * tree.def (OACC_LOOP): New tree code.
643         * tree-pretty-print.c (dump_generic_node): Show it.
644         * tree.h (OACC_KERNELS_COMBINED, OACC_PARALLEL_COMBINED): New macros.
645         * doc/generic.texi: Document loop directive.
646         * gimplify.c (is_gimple_stmt, gimplify_expr): Stub gimplification of 
647         loop directive and combined directives.
649 2014-03-18  Thomas Schwinge  <thomas@codesourcery.com>
651         * builtin-types.def
652         (BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR_INT_INT_INT): New type.
653         * oacc-builtins.def (BUILT_IN_GOACC_KERNELS)
654         (BUILT_IN_GOACC_PARALLEL): Switch to that one.
655         * gimplify.c (gimplify_scan_omp_clauses)
656         (gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_NUM_GANGS,
657         OMP_CLAUSE_NUM_WORKERS, OMP_CLAUSE_VECTOR_LENGTH.
658         * omp-low.c (scan_sharing_clauses, expand_oacc_offload): Likewise.
660 2014-03-13  Thomas Schwinge  <thomas@codesourcery.com>
662         * tree.h (OMP_CLAUSE_VECTOR_EXPR): Check for OMP_CLAUSE_VECTOR
663         instead of OMP_CLAUSE_VECTOR_LENGTH.
664         (OMP_WAIT_EXPR): Rename to OMP_CLAUSE_WAIT_EXPR.  Change
665         all users.
667 2014-03-13  Thomas Schwinge  <thomas@codesourcery.com>
669         * omp-low.c (create_omp_child_function): Use
670         is_gimple_omp_offloaded when looking for offloaded regions.
672 2014-03-12  Thomas Schwinge  <thomas@codesourcery.com>
674         * omp-low.c (scan_sharing_clauses): Move offloaded logic into...
675         * gimple.h (is_gimple_omp_offloaded): ... this new static inline
676         function.
678 2014-02-28  Thomas Schwinge  <thomas@codesourcery.com>
680         * gimple.def (GIMPLE_OACC_KERNELS): New code.
681         * doc/gimple.texi: Document it.
682         * gimple.h (gimple_has_substatements, CASE_GIMPLE_OMP)
683         (is_gimple_omp_oacc_specifically): Handle it.
684         (gimple_statement_oacc_kernels): New struct.
685         (gimple_build_oacc_kernels): New prototype.
686         (gimple_oacc_kernels_clauses, gimple_oacc_kernels_clauses_ptr)
687         (gimple_oacc_kernels_set_clauses, gimple_oacc_kernels_child_fn)
688         (gimple_oacc_kernels_child_fn_ptr)
689         (gimple_oacc_kernels_set_child_fn, gimple_oacc_kernels_data_arg)
690         (gimple_oacc_kernels_data_arg_ptr)
691         (gimple_oacc_kernels_set_data_arg): New inline functions.
692         * gimple.c (gimple_build_oacc_kernels): New function.
693         (gimple_copy): Handle GIMPLE_OACC_KERNELS.
694         * gimple-low.c (lower_stmt): Likewise.
695         * gimple-walk.c (walk_gimple_op, walk_gimple_stmt): Likewise.
696         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
697         (dump_gimple_oacc_parallel): Rename to dump_gimple_oacc_offload.
698         Also handle GIMPLE_OACC_KERNELS.  Update all callers.
699         * gimplify.c (gimplify_omp_workshare, gimplify_expr): Handle
700         OACC_KERNELS.
701         * oacc-builtins.def (BUILT_IN_GOACC_KERNELS): New builtin.
702         * omp-low.c (scan_oacc_parallel, expand_oacc_parallel)
703         (lower_oacc_parallel): Rename to scan_oacc_offload,
704         expand_oacc_offload, and lower_oacc_offload.  Also handle
705         GIMPLE_OACC_KERNELS.  Update all callers.
706         (scan_sharing_clauses, scan_omp_1_stmt, expand_omp, lower_omp_1)
707         (diagnose_sb_0, diagnose_sb_1, diagnose_sb_2)
708         (make_gimple_omp_edges): Handle GIMPLE_OACC_KERNELS.
709         * tree-inline.c (remap_gimple_stmt, estimate_num_insns): Likewise.
710         * tree-nested.c (convert_nonlocal_reference_stmt)
711         (convert_local_reference_stmt, convert_tramp_reference_stmt)
712         (convert_gimple_call): Likewise.
714 2014-02-27  Thomas Schwinge  <thomas@codesourcery.com>
716         * gimplify.c (gimplify_oacc_parallel): Merge into
717         gimplify_omp_workshare.  Update all callers.
719 2014-02-27  Ilmir Usmanov  <i.usmanov@samsung.com>
721         Fix OpenACC ASYNC clause: it cannot contain integer-expression-list.
723         gcc/
724         * tree.h (OMP_CLAUSE_ASYNC_EXPR): Reorder.
725         * tree.c (omp_clause_num_ops, omp_clause_code_name): Reorder clauses.
726         * tree-core.h (enum omp_clause_code): Likewise.
727         * omp-low.c (scan_sharing_clauses): Likewise.
728         * gimplify.c (gimplify_scan_omp_clauses): Likewise.
730 2014-02-21  Thomas Schwinge  <thomas@codesourcery.com>
732         * gimple.h (enum gf_mask): Add GF_OMP_TARGET_KIND_OACC_DATA.
733         (is_gimple_omp_oacc_specifically): Handle it.
734         * gimple-pretty-print.c (dump_gimple_omp_target): Likewise.
735         * gimplify.c (gimplify_omp_workshare, gimplify_expr): Likewise.
736         * omp-low.c (scan_sharing_clauses, scan_omp_target)
737         (expand_omp_target, lower_omp_target, lower_omp_1): Likewise.
738         * gimple.def (GIMPLE_OMP_TARGET): Update comment.
739         * gimple.c (gimple_build_omp_target): Likewise.
740         (gimple_copy): Catch unimplemented case.
741         * tree-inline.c (remap_gimple_stmt): Likewise.
742         * tree-nested.c (convert_nonlocal_reference_stmt)
743         (convert_local_reference_stmt, convert_gimple_call): Likewise.
744         * oacc-builtins.def (BUILT_IN_GOACC_DATA_START)
745         (BUILT_IN_GOACC_DATA_END): New builtins.
747         * omp-low.c (scan_sharing_clauses): Catch unexpected occurrences
748         of OMP_CLAUSE_TO, OMP_CLAUSE_FROM, OMP_CLAUSE_MAP.
750         * gimplify.c (enum omp_region_type): Make ORT_TARGET_OFFLOAD a
751         flag for ORT_TARGET, in its negation replacing ORT_TARGET_DATA.
752         Update all users.
754         * omp-low.c (gimple_code_is_oacc): Move to...
755         * gimple.h (is_gimple_omp_oacc_specifically): ... here.  Update
756         users, and also use it in more places where currently we've only
757         been checking for GIMPLE_OACC_PARALLEL.
759 2014-02-18  Thomas Schwinge  <thomas@codesourcery.com>
761         * omp-low.c (diagnose_sb_0, diagnose_sb_1, diagnose_sb_2): Handle
762         GIMPLE_OACC_PARALLEL.
763         * gimplify.c (gimplify_case_label_expr): Update comment.
765         * omp-low.c (diagnose_sb_0): Generalize detection which kind of
766         structured block we're in.
768 2014-02-17  Thomas Schwinge  <thomas@codesourcery.com>
770         * tree-core.h (omp_clause_code) <map>: Mention pcopy, pcopyin,
771         pcopyout, pcreate OpenACC clauses.
773 2014-02-14  Ilmir Usmanov  <i.usmanov@samsung.com>
774             Dmitry Bocharnikov  <dmitry.b@samsung.com>
775             Evgeny Gavrin  <e.gavrin@samsung.com>
777         Add OpenACC 1.0 support to GENERIC, except loop directive and subarrays.
779         gcc/
780         * gimplify.c (is_gimple_stmt, gimplify_scan_omp_clauses,
781         implify_adjust_omp_clauses, gimplify_expr): Stub OpenACC directives
782         and clauses.
783         * omp-low.c (scan_sharing_clauses): Likewise.
784         (gimple_code_is_oacc): New helper function.
785         (scan_sharing_clauses): Use it.
786         * tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_HOST,
787         OMP_CLAUSE_OACC_DEVICE, OMP_CLAUSE_DEVICE_RESIDENT,
788         OMP_CLAUSE_USE_DEVICE, OMP_CLAUSE_GANG, OMP_CLAUSE_WAIT,
789         OMP_NO_CLAUSE_CACHE, OMP_CLAUSE_INDEPENDENT, OMP_CLAUSE_ASYNC,
790         OMP_CLAUSE_WORKER, OMP_CLAUSE_VECTOR, OMP_CLAUSE_NUM_GANGS,
791         OMP_CLAUSE_NUM_WORKERS and OMP_CLAUSE_VECTOR_LENGTH clauses.
792         * tree-pretty-print.c (dump_omp_clause): Print OpenACC clause.
793         (dump_generic_node): Print OpenACC directives and its clauses.
794         * tree.c (omp_clause_num_ops, omp_clause_code_name,
795         walk_tree_1): Add OpenACC clauses.
796         * tree.def (OACC_KERNELS, OACC_DATA, OACC_HOST_DATA, OACC_DECLARE,
797         OACC_UPDATE, OACC_ENTER_DATA, OACC_EXIT_DATA, OACC_WAIT,
798         OACC_CACHE): New tree node.
799         * tree.h (OACC_KERNELS_BODY, OACC_KERNELS_CLAUSES,
800         OACC_CLAUSE_NUM_GANGS_EXPR, OMP_CLAUSE_NUM_WORKERS_EXPR,
801         OMP_CLAUSE_VECTOR_LENGTH_EXPR, OMP_CLAUSE_VECTOR_EXPR,
802         OMP_CLAUSE_WORKER_EXPR, OMP_CLAUSE_GANG_EXPR, OMP_CLAUSE_ASYNC_EXPR,
803         OMP_WAIT_EXPR, OACC_DATA_BODY, OACC_DATA_CLAUSES, OACC_DECLARE_CLAUSES,
804         OACC_UPDATE_CLAUSES, OACC_WAIT_CLAUSES, OACC_CACHE_CLAUSES,
805         OACC_HOST_DATA_BODY, OACC_HOST_DATA_CLAUSES): New macros.
806         gcc/doc/
807         * generic.texi: Document OACC_KERNELS, OACC_DATA, OACC_HOST_DATA,
808         OACC_DECLARE, OACC_UPDATE, OACC_ENTER_DATA, OACC_EXIT_DATA, OACC_WAIT,
809         OACC_CACHE.
811 2014-02-07  Ilya Tocar  <ilya.tocar@intel.com>
813         * ipa-inline-analysis.c (inline_free_summary): Always remove
814         hooks.
816 2014-01-28  Thomas Schwinge  <thomas@codesourcery.com>
818         * tree-core.h (omp_clause_code): Update description for
819         OMP_CLAUSE_MAP.
821         * tree-core.h (omp_clause_map_kind): Add OMP_CLAUSE_MAP_FORCE,
822         OMP_CLAUSE_MAP_FORCE_ALLOC, OMP_CLAUSE_MAP_FORCE_TO,
823         OMP_CLAUSE_MAP_FORCE_FROM, OMP_CLAUSE_MAP_FORCE_TOFROM,
824         OMP_CLAUSE_MAP_FORCE_PRESENT, OMP_CLAUSE_MAP_FORCE_DEALLOC, and
825         OMP_CLAUSE_MAP_FORCE_DEVICEPTR.
826         * tree-pretty-print.c (dump_omp_clause): Handle these.
827         * gimplify.c (gimplify_omp_var_data): Add GOVD_MAP_FORCE.
828         (omp_region_type): Add ORT_TARGET_MAP_FORCE.
829         (omp_add_variable, omp_notice_threadprivate_variable)
830         (omp_notice_variable, gimplify_scan_omp_clauses)
831         (gimplify_adjust_omp_clauses_1): Extend accordingly.
832         (gimplify_oacc_parallel): Add ORT_TARGET_MAP_FORCE to ORT_TARGET
833         usage.
834         * omp-low.c (install_var_field, scan_sharing_clauses)
835         (lower_oacc_parallel, lower_omp_target): Extend accordingly.
837         * tree-core.h (omp_clause_map_kind): Make the identifiers' bit
838         patterns more obvious.  Add comments.
839         * omp-low.c (lower_oacc_parallel, lower_omp_target): Test for
840         omp_clause_map_kind flags set instead of for values.
842         * gimplify.c (gimplify_call_expr, gimplify_modify_expr)
843         (omp_firstprivatize_variable, omp_notice_threadprivate_variable)
844         (omp_notice_variable, gimplify_adjust_omp_clauses)
845         (gimplify_omp_workshare): Treat ORT_TARGET as a flag, not as a
846         value.
848 2013-12-18  Thomas Schwinge  <thomas@codesourcery.com>
850         * omp-low.c (lower_oacc_parallel): Switch kinds array to unsigned
851         short, and shift alignment description to begin at bit 8.
853 2013-12-04  Thomas Schwinge  <thomas@codesourcery.com>
855         * gimple.h (is_a_helper): Handle GIMPLE_OACC_PARALLEL.
857 2013-11-30  Balaji V. Iyer  <balaji.v.iyer@intel.com>
859         * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen):
860         Removed a carriage return from the warning string.
862 2013-11-21  Jakub Jelinek  <jakub@redhat.com>
864         * config/i386/i386.c (ix86_cilkplus_default_vecsize_mangle,
865         ix86_cilkplus_vecsize_for_mangle): Remove.
866         (ix86_simd_clone_compute_vecsize_and_simdlen,
867         ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions.
868         (TARGET_CILKPLUS_DEFAULT_VECSIZE_MANGLE,
869         TARGET_CILKPLUS_VECSIZE_FOR_MANGLE): Remove.
870         (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN,
871         TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define.
872         * omp-low.c (class argno_map): Remove.
873         (argno_map::argno_map): Remove.
874         (simd_clone_vector_of_formal_parm_types): New function.
875         (simd_clone_struct_alloc): Use struct cgraph_simd_clone
876         instead of struct simd_clone and struct cgraph_simd_clone_arg
877         instead of struct simd_clone_arg.
878         (simd_clone_struct_copy): Likewise.
879         (simd_clone_clauses_extract): Likewise.  Return struct
880         cgraph_simd_clone *, don't change anything in node.
881         Use simd_clone_vector_of_formal_parm_types instead of argno_map.
882         Fail if ignoring linear step.
883         (vecsize_mangle): Remove.
884         (simd_clone_compute_base_data_type): Add clone_info argument.
885         Use simd_clone_vector_of_formal_parm_types instead of argno_map.
886         (simd_clone_compute_vecsize_and_simdlen): Remove.
887         (simd_clone_mangle): Remove new_node argument, add clone_info
888         argument, return the identifier rather than changing anything in
889         node.  If mangled name doesn't already exist among simd clones,
890         fail.
891         (simd_clone_create): Handle !old_node->definition case, don't
892         ICE if cgraph_function_versioning fails.
893         (simd_clone_adjust_return_type): Handle simdlens larger than
894         what can be returned or passed in hw register.  Handle
895         !node->definition.
896         (simd_clone_adjust_argument_types): Likewise.  Use
897         ipa_get_vector_of_formal_parms or
898         simd_clone_vector_of_formal_parm_types instead of argno_map.
899         (simd_clone_init_simd_arrays): Handle simdlens larger than
900         what can be passed in hw register.
901         (ipa_simd_modify_function_body): Likewise.  Call walk_gimple_op
902         also on GIMPLE_RETURN.
903         (simd_clone_adjust): Call targetm.simd_clone.adjust.  Create
904         PHI for the iter, rather than waiting for into ssa.  Handle
905         aligned clause on uniform pointer arguments.  Handle linear
906         arguments properly.
907         (expand_simd_clones): Don't do anything if noclone attribute
908         is present.  Ignore non-prototype C declarations.  Rewritten to
909         only clone if it is possible and desirable to create the simd clone.
910         Use new target simd_clone hooks to drive the process, allow
911         creating more than two clones.  Handle !node->definition cloning.
912         (ipa_omp_simd_clone): Use FOR_EACH_FUNCTION instead of
913         FOR_EACH_DEFINED_FUNCTION.
914         (pass_omp_simd_clone::gate): Return true also for flag_openmp_simd.
915         * ipa-cp.c (determine_versionability): Use simd_clones field instead
916         of has_simd_clones.  Also fail if node->simdclone is non-NULL.
917         (initialize_node_lattices): Set disable = true for simd clones.
918         * cgraph.c (get_simd_clone): Remove.
919         * ipa.c (symtab_remove_unreachable_nodes): If node with simd clones
920         is kept, keep also the simd clones.
921         * ipa-prop.h (ipa_get_vector_of_formal_parm_types): New prototype.
922         * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ...
923         (ipa_get_vector_of_formal_parm_types): ... this.  No longer static.
924         (ipa_modify_formal_parameters): Adjust caller.
925         * target.def (TARGET_CILKPLUS_DEFAULT_VECSIZE_MANGLE,
926         TARGET_CILKPLUS_VECSIZE_FOR_MANGLE): Remove.
927         (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN,
928         TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target
929         hooks.
930         * tree-vect-data-refs.c (vect_analyze_data_refs): Use simd_clones
931         field instead of has_simd_clones.
932         * target.h (struct cgraph_node, struct cgraph_simd_node): Declare.
933         * doc/tm.texi.in (TARGET_CILKPLUS_DEFAULT_VECSIZE_MANGLE,
934         TARGET_CILKPLUS_VECSIZE_FOR_MANGLE): Remove.
935         (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN,
936         TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add.
937         * doc/tm.texi: Regenerated.
938         * cgraph.h (enum simd_clone_arg_type): Rename to ...
939         (enum cgraph_simd_clone_arg_type): ... this.  Add
940         SIMD_CLONE_ARG_TYPE_MASK.
941         (struct simd_clone_arg): Rename to ...
942         (struct cgraph_simd_clone_arg): ... this.  Add orig_type and
943         vector_type fields.  Adjust arg_type field's type.
944         (struct simd_clone): Rename to ...
945         (struct cgraph_simd_clone): ... this.  Remove hw_vector_size
946         field.  Add vecsize_int, vecsize_float, prev_clone, next_clone
947         and origin fields.  Adjust args field's type.
948         (struct cgraph_node): Adjust simdclone field's type.  Remove
949         simdclone_of and has_simd_clones fields.  Add simd_clones field.
950         (get_simd_clone): Remove prototype.
951         * tree-vect-stmts.c (vectorizable_simd_clone_call): Use simd_clones
952         field instead of has_simd_clones, improve walking of simd clones,
953         handle arguments and/or return types larger than corresponding
954         ISA hw vector size, use targetm.simd_clone.usable hook.
956 2013-11-21  Ilya Tocar  <ilya.tocar@intel.com>
958         * cgraph.h (symtab_node): Add need_dump.
959         * cgraphunit.c (ipa_passes): Run ipa_write_summaries for omp.
960         (compile): Intialize streamer for omp.
961         * ipa-inline-analysis.c (inline_generate_summary): Add flag_openmp.
962         * lto-cgraph.c (lto_set_symtab_encoder_in_partition): Respect
963         need_dump flag.
964         (select_what_to_dump): New.
965         * lto-streamer.c (section_name_prefix): New.
966         (lto_get_section_name): Use section_name_prefix.
967         (lto_streamer_init): Add flag_openmp.
968         * lto-streamer.h (OMP_SECTION_NAME_PREFIX): New.
969         (section_name_prefix): Ditto.
970         (select_what_to_dump): Ditto.
971         * lto/lto-partition.c (add_symbol_to_partition_1): Set need_dump.
972         (lto_promote_cross_file_statics): Dump everyhtinh.
973         * passes.c (ipa_write_summaries): Add parameter,
974         call select_what_to_dump.
975         * tree-pass.h (void ipa_write_summaries): Add parameter.
977 2013-11-15  Jakub Jelinek  <jakub@redhat.com>
979         * tree-vect-stmts.c (vectorizable_simd_clone_call): Avoid
980         -Wsign-compare warning.
982 2013-11-12  Aldy Hernandez  <aldyh@redhat.com>
984         * ipa-prop.h (enum ipa_parm_op): Adjust comment to IPA_PARM_OP_NEW
985         entry.
987 2013-11-12  Aldy Hernandez  <aldyh@redhat.com>
989         * ipa-prop.c (ipa_modify_expr): Pass expr by address.
990         (ipa_get_adjustment_candidate): Add another level of indirection
991         to expr.  Adjust comment.
992         (ipa_get_adjustment_candidate): Add another level of indirection
993         to first argument.
995 2013-11-11  Aldy Hernandez  <aldyh@redhat.com>
997         * ipa-prop.c (get_ssa_base_param): New.
998         * ipa-prop.h (ipa_modify_expr): Rename from ipa_sra_modify_expr.
999         Remove ipa_sra_modify_function_body.
1000         (ipa_get_adjustment_candidate): Rename from
1001         sra_ipa_get_adjustment_candidate.
1002         * omp-low.c (ipa_simd_modify_stmt_ops): Rename
1003         sra_ipa_get_adjustment_candidate to ipa_get_adjustment_candidate.
1004         * tree-sra.c (get_ssa_base_param): Remove default_def argument.
1005         (create_access): Remove lass argument to get_ssa_base_param.
1006         (disqualify_base_of_expr): Same.
1007         (sra_ipa_get_adjustment_candidate): Rename to
1008         ipa_get_adjustment_candidate and move to ipa-prop.c.
1009         (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to
1010         ipa-prop.c.
1011         (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to
1012         ipa_modify_expr.
1013         (ipa_sra_modify_function_body): Same.
1015 2013-11-11  Jakub Jelinek  <jakub@redhat.com>
1017         * tree-vect-data-refs.c (vect_analyze_data_refs): Check loop->safelen
1018         rather than loop->simdlen.
1019         * tree-vect-stmts.c (vectorizable_simd_clone_call): Likewise.
1021 2013-11-08  Aldy Hernandez  <aldyh@redhat.com>
1023         * ipa-prop.c (ipa_modify_formal_parameters): Remove
1024         synth_parm_prefix argument.
1025         Use operator enum instead of bit fields.
1026         Add assert for properly handling vector of references.
1027         (ipa_modify_call_arguments): Use operator enum instead of bit
1028         fields.
1029         (ipa_combine_adjustments): Same.
1030         Assert that IPA_PARM_OP_NEW is not used.
1031         (ipa_dump_param_adjustments): Rename reduction to new_decl.
1032         Use operator enum instead of bit fields.
1033         * ipa-prop.h (enum ipa_parm_op): New.
1034         (struct ipa_parm_adjustment): New field op.
1035         Rename reduction to new_decl.
1036         Rename new_arg_prefix to arg_prefix.
1037         Remove new_param, remove_param, copy_param.
1038         (ipa_modify_formal_parameters): Remove argument.
1039         * omp-low.c (simd_clone_adjust_argument_types): Set arg_prefix.
1040         Use operator enum instead of bit fields.
1041         (simd_clone_adjust_argument_types): Use operator enum instead of
1042         bit fields.
1043         Remove last argument to ipa_modify_formal_parameters call.
1044         (simd_clone_init_simd_arrays): Use operator enum.
1045         (ipa_simd_modify_stmt_ops): Rename reduction to new_decl.
1046         (ipa_simd_modify_function_body): Same.
1047         * tree-sra.c (turn_representatives_into_adjustments): Use operator
1048         enum.  Set arg_prefix.
1049         (get_adjustment_for_base): Use operator enum.
1050         (sra_ipa_get_adjustment_candidate): Same.
1051         (sra_ipa_modify_expr): Rename reduction to new_decl.
1052         (sra_ipa_reset_debug_stmts): Use operator enum.
1053         (modify_function): Do not pass prefix argument.
1055 2013-11-07  Jakub Jelinek  <jakub@redhat.com>
1057         * tree-vectorizer.h (enum stmt_vec_info_type): Add
1058         call_simd_clone_vec_info_type.
1059         * expr.c (store_constructor): Allow CONSTRUCTOR with VECTOR_TYPE
1060         (same sized) elements even if the type of the CONSTRUCTOR has
1061         vector mode and target is a REG.
1062         * tree-vect-data-refs.c: Include cgraph.h.
1063         (vect_analyze_data_refs): Inline by hand find_data_references_in_loop
1064         and find_data_references_in_bb, if find_data_references_in_stmt
1065         fails, still allow calls to #pragma omp declare simd functions
1066         in #pragma omp simd loops unless they contain data references among
1067         the call arguments or in lhs.
1068         * tree-vect-loop.c (vect_determine_vectorization_factor): If a call
1069         doesn't have lhs, set STMT_VINFO_VECTYPE to vector type corresponding
1070         to any of the argument types and exclude it from adjustments of the
1071         vectorization factor.
1072         * tree-vect-stmts.c: Include tree-ssa-loop.h and
1073         tree-scalar-evolution.h.
1074         (vectorizable_function): Don't handle functions with simd clones here.
1075         (vectorizable_call): Nor here.  Return early if call doesn't have lhs.
1076         (struct simd_call_arg_info): New type.
1077         (vectorizable_simd_clone_call): New function.
1078         (vect_analyze_stmt, vect_transform_stmt): Call it.
1080 2013-11-07  Thomas Schwinge  <thomas@codesourcery.com>
1082         * gimple.def (GIMPLE_OACC_PARALLEL): New code.
1083         * doc/gimple.texi: Document it.
1084         * gimple.h (gimple_build_oacc_parallel): New declaration.
1085         (gimple_oacc_parallel_clauses, gimple_oacc_parallel_clauses_ptr)
1086         (gimple_oacc_parallel_set_clauses, gimple_oacc_parallel_child_fn)
1087         (gimple_oacc_parallel_child_fn_ptr)
1088         (gimple_oacc_parallel_set_child_fn, gimple_oacc_parallel_data_arg)
1089         (gimple_oacc_parallel_data_arg_ptr)
1090         (gimple_oacc_parallel_set_data_arg): New inline functions.
1091         (CASE_GIMPLE_OMP): Add GIMPLE_OACC_PARALLEL.
1092         * gimple.c (gimple_build_oacc_parallel): New function.
1093         (walk_gimple_op, walk_gimple_stmt, gimple_copy): Handle
1094         GIMPLE_OACC_PARALLEL.
1095         * gimplify.c (is_gimple_stmt): Handle GIMPLE_OACC_PARALLEL.
1096         (gimplify_oacc_parallel): New function.
1097         (gimplify_expr): Handle OACC_PARALLEL.
1098         * cgraphbuild.c (build_cgraph_edges): Handle GIMPLE_OACC_PARALLEL.
1099         * gimple-low.c (lower_stmt): Likewise.
1100         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
1101         (dump_gimple_oacc_parallel): New function.
1102         * oacc-builtins.def (BUILT_IN_GOACC_PARALLEL): New macro.
1103         * omp-low.c (scan_oacc_parallel, expand_oacc_parallel)
1104         (lower_oacc_parallel): New functions.
1105         (use_pointer_for_field, build_outer_var_ref, scan_sharing_clauses)
1106         (create_omp_child_function, check_omp_nesting_restrictions)
1107         (scan_omp_1_stmt, lower_rec_simd_input_clauses)
1108         (lower_lastprivate_clauses, lower_reduction_clauses)
1109         (lower_copyprivate_clauses, lower_send_clauses)
1110         (lower_send_shared_vars, expand_omp)
1111         (maybe_add_implicit_barrier_cancel, create_task_copyfn)
1112         (lower_omp_1, make_gimple_omp_edges): Handle GIMPLE_OACC_PARALLEL,
1113         or catch it.
1114         * tree-inline.c (remap_gimple_stmt): Likewise.
1115         * tree-nested.c (convert_nonlocal_reference_stmt)
1116         (convert_local_reference_stmt, convert_tramp_reference_stmt)
1117         (convert_gimple_call): Likewise.
1119         * tree.def (OACC_PARALLEL): New code.
1120         * doc/generic.texi (OpenMP): Document it.
1121         * tree.h (OMP_BODY, OMP_CLAUSES): Include it.
1122         (OACC_PARALLEL_BODY, OACC_PARALLEL_CLAUSES): New macros.
1123         * tree-pretty-print.c (dump_generic_node): Handle OACC_PARALLEL.
1125         * doc/invoke.texi (-fopenacc): Update.
1127         * gimplify.c (gimplify_body): Consider flag_openacc additionally
1128         to flag_openmp.
1129         * omp-low.c (execute_expand_omp, execute_lower_omp)
1130         (gate_diagnose_omp_blocks): Likewise.
1132         * oacc-builtins.def: New file.
1133         * Makefile.in (BUILTINS_DEF): Add oacc-builtins.def.
1134         * builtins.def (DEF_GOACC_BUILTIN): New macro.
1135         Include "oacc-builtins.def".
1137         * gcc.c (LINK_COMMAND_SPEC, GOMP_SELF_SPECS): For -fopenacc, link
1138         to libgomp and its dependencies.
1139         * config/arc/arc.h (LINK_COMMAND_SPEC): Likewise.
1140         * config/darwin.h (LINK_COMMAND_SPEC_A): Likewise.
1141         * config/i386/mingw32.h (GOMP_SELF_SPECS): Likewise.
1142         * config/ia64/hpux.h (LIB_SPEC): Likewise.
1143         * config/pa/pa-hpux11.h (LIB_SPEC): Likewise.
1144         * config/pa/pa64-hpux.h (LIB_SPEC): Likewise.
1145         * doc/invoke.texi (-fopenacc): Update.
1147         * doc/invoke.texi (-fopenacc): Document it.
1148         * doc/sourcebuild.texi (fopenacc): Document it.
1150         Backport from trunk, r204517:
1152         * config/arc/arc.h (LINK_COMMAND_SPEC): For
1153         -ftree-parallelize-loops=*, link to libgomp and its dependencies.
1154         * config/ia64/hpux.h (LIB_SPEC): Likewise.
1155         * config/pa/pa-hpux11.h (LIB_SPEC): Likewise.
1156         * config/pa/pa64-hpux.h (LIB_SPEC): Likewise.
1157         * gcc.c (GOMP_SELF_SPECS): Update comment about libgomp's
1158         dependencies.
1160 2013-11-07  Aldy Hernandez  <aldyh@redhat.com>
1162         * omp-low.c (ipa_simd_modify_function_body): Avoid
1163         regimplification of GIMPLE_RETURNs.
1165 2013-11-06  Aldy Hernandez  <aldyh@redhat.com>
1167         * ipa-prop.h (sra_ipa_get_adjustment_candidate): Protoize.
1168         * omp-low.c (struct modify_stmt_info): New.
1169         (ipa_simd_modify_function_body_ops_1): Remove.
1170         (ipa_simd_modify_stmt_ops): New.
1171         (ipa_simd_modify_function_body_ops): Remove.
1172         (ipa_simd_modify_function_body): Set new callback info.
1173         Remove special casing.  Handle all operators with walk_gimple_op.
1174         * tree-sra.c (get_ssa_base_param): Add new argument.  Use it.
1175         (disqualify_base_of_expr): Pass new argument to
1176         get_ssa_base_param.
1177         (sra_ipa_modify_expr): Abstract candidate search into...
1178         (sra_ipa_get_adjustment_candidate): ...here.
1180 2013-11-06  Aldy Hernandez  <aldyh@redhat.com>
1182         * omp-low.c (simd_clone_mangle): Linear step of 1 is mangled as
1183         'l'.
1185 2013-11-04  Aldy Hernandez  <aldyh@redhat.com>
1187         * omp-low.c (ipa_simd_modify_function_body): Adjust tree operands
1188         on the LHS of an assign.
1189         (ipa_simd_modify_function_body_ops_1): New.
1190         (ipa_simd_modify_function_body_ops): New.
1192 2013-11-02  Aldy Hernandez  <aldyh@redhat.com>
1194         * omp-low.c (ipa_simd_modify_function_body): Handle empty returns.
1196 2013-11-01  Jakub Jelinek  <jakub@redhat.com>
1198         * cgraph.h (enum linear_stride_type): Remove.
1199         (enum simd_clone_arg_type): New.
1200         (struct simd_clone_arg): Remove linear_stride, linear_stride_num
1201         and uniform fields.  Add arg_type and linear_step.
1202         * omp-low.c (simd_clone_struct_copy): Formatting.
1203         (simd_clone_struct_alloc): Likewise.  Use size_t.
1204         (simd_clone_clauses_extract, simd_clone_compute_base_data_type,
1205         simd_clone_adjust_argument_types): Adjust for struct simd_clone_arg
1206         changes.
1207         (simd_clone_mangle): Likewise.  Handle negative linear step.
1209 2013-11-01  Aldy Hernandez  <aldyh@redhat.com>
1211         * tree-vect-stmts.c: Include cgraph.h.
1212         (vectorizable_call): Allow > 3 arguments when a SIMD clone may be
1213         available.
1214         (vectorizable_function): Use SIMD clone if available.
1215         * ipa-cp.c (determine_versionability): Nodes with SIMD clones are
1216         not versionable.
1217         * ggc.h (ggc_alloc_cleared_simd_clone_stat): New.
1218         * cgraph.h (enum linear_stride_type): New.
1219         (struct simd_clone_arg): New.
1220         (struct simd_clone): New.
1221         (struct cgraph_node): Add simdclone and simdclone_of fields.
1222         (get_simd_clone): Protoize.
1223         * cgraph.c (get_simd_clone): New.
1224         Add `has_simd_clones' field.
1225         * ipa-cp.c (determine_versionability): Disallow functions with
1226         simd clones.
1227         * ipa-prop.h (ipa_sra_modify_function_body): Protoize.
1228         (sra_ipa_modify_expr): Same.
1229         (struct ipa_parm_adjustment): Add new_arg_prefix and new_param
1230         fields.  Document their use.
1231         * ipa-prop.c (ipa_modify_formal_parameters): Handle creating brand
1232         new parameters and minor cleanups.
1233         * omp-low.c: Add new pass_omp_simd_clone support code.
1234         (make_pass_omp_simd_clone): New.
1235         (pass_data_omp_simd_clone): Declare.
1236         (class pass_omp_simd_clone): Declare.
1237         (vecsize_mangle): New.
1238         (ipa_omp_simd_clone): New.
1239         (simd_clone_clauses_extract): New.
1240         (simd_clone_compute_base_data_type): New.
1241         (simd_clone_compute_vecsize_and_simdlen): New.
1242         (simd_clone_create): New.
1243         (simd_clone_adjust_return_type): New.
1244         (simd_clone_adjust_return_types): New.
1245         (simd_clone_adjust): New.
1246         (simd_clone_init_simd_arrays): New.
1247         (ipa_simd_modify_function_body): New.
1248         (simd_clone_mangle): New.
1249         (simd_clone_struct_alloc): New.
1250         (simd_clone_struct_copy): New.
1251         (class argno_map): New.
1252         (argno_map::argno_map(tree)): New.
1253         (argno_map::~argno_map): New.
1254         (argno_map::operator []): New.
1255         (argno_map::length): New.
1256         (expand_simd_clones): New.
1257         (create_tmp_simd_array): New.
1258         * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): New.
1259         * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document.
1260         * tree-pass.h (make_pass_omp_simd_clone): New.
1261         * passes.def (pass_omp_simd_clone): New.
1262         * target.def: Define new hook prefix "TARGET_CILKPLUS_".
1263         (default_vecsize_mangle): New.
1264         (vecsize_for_mangle): New.
1265         * doc/tm.texi.in: Add placeholder for
1266         TARGET_CILKPLUS_DEFAULT_VECSIZE_MANGLE and
1267         TARGET_CILKPLUS_VECSIZE_FOR_MANGLE.
1268         * tree-sra.c (sra_ipa_modify_expr): Remove static modifier.
1269         (ipa_sra_modify_function_body): Same.
1270         * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define.
1271         * doc/tm.texi: Regenerate.
1272         * config/i386/i386.c (ix86_cilkplus_default_vecsize_mangle): New.
1273         (ix86_cilkplus_vecsize_for_mangle): New.
1274         (TARGET_CILKPLUS_DEFAULT_VECSIZE_MANGLE): New.
1275         (TARGET_CILKPLUS_VECSIZE_FOR_MANGLE): New.
1277 2013-10-10  Jakub Jelinek  <jakub@redhat.com>
1279         * tree.c (omp_remove_redundant_declare_simd_attrs): Adjust
1280         for the clauses being stored into TREE_VALUE of an extra TREE_LIST
1281         pointed out by TREE_VALUE of the attribute.
1283 2013-10-04  Jakub Jelinek  <jakub@redhat.com>
1285         * omp-low.c (expand_omp_target): When handling IF clause on
1286         #pragma omp target, split new_bb rather than entry_bb.  If
1287         not GF_OMP_TARGET_KIND_REGION, split new_bb right before
1288         the GOMP_TARGET stmt, rather than after labels.
1290 2013-09-26  Jakub Jelinek  <jakub@redhat.com>
1292         * omp-low.c (expand_task_call): If there are depend clauses,
1293         pass bit 8 in 7th argument and pass pointer to depend array
1294         as 8th argument.
1295         (lower_depend_clauses): New function.
1296         (lower_omp_taskreg): Handle depend clauses.
1297         * omp-builtins.def (BUILT_IN_GOMP_TASK): Use
1298         BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR
1299         instead of BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT.
1300         * builtin-types.def
1301         (BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT): Remove.
1302         (BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR): New.
1304 2013-09-25  Jakub Jelinek  <jakub@redhat.com>
1306         * omp-low.c (lower_omp_sections, lower_omp_for, lower_omp_taskreg):
1307         Emit ctx->cancel_label before destructors.
1309         * gimple-pretty-print.c (dump_gimple_omp_block,
1310         pp_gimple_stmt_1): Handle GIMPLE_OMP_TASKGROUP.
1311         * tree-nested.c (convert_nonlocal_reference_stmt,
1312         convert_local_reference_stmt, convert_gimple_call): Likewise.
1313         * tree-cfg.c (make_edges): Likewise.
1314         * gimple.h (gimple_build_omp_taskgroup): New prototype.
1315         (gimple_has_substatement): Handle GIMPLE_OMP_TASKGROUP.
1316         (CASE_GIMPLE_OMP): Likewise.
1317         * gimplify.c (is_gimple_stmt, gimplify_expr): Handle OMP_TASKGROUP.
1318         * omp-low.c (check_omp_nesting_restrictions): Warn if #pragma omp
1319         cancel is used in nowait loop or sections construct.
1320         (scan_omp_1_stmt, expand_omp_synch, expand_omp, lower_omp_1): Handle
1321         GIMPLE_OMP_TASKGROUP.
1322         (diagnose_sb_1, diagnose_sb_2): Likewise.  Handle GIMPLE_OMP_TARGET
1323         and GIMPLE_OMP_TEAMS.
1324         (lower_omp_taskgroup): New function.
1325         * tree-inline.c (remap_gimple_stmt, estimate_num_insns): Handle
1326         GIMPLE_OMP_TASKGROUP.
1327         * gimple-low.c (lower_stmt): Likewise.
1328         * tree.h (OMP_TASKGROUP_BODY): Define.
1329         * tree.def (OMP_TASKGROUP): New tree.
1330         * tree-pretty-print.c (dump_generic_node): Handle OMP_TASKGROUP.
1331         * gimple.c (gimple_build_omp_taskgroup): New function.
1332         (walk_gimple_stmt, gimple_copy): Handle GIMPLE_OMP_TASKGROUP.
1333         * gimple.def (GIMPLE_OMP_TASKGROUP): New GIMPLE code.
1335 2013-09-19  Jakub Jelinek  <jakub@redhat.com>
1337         * omp-builtins.def (BUILT_IN_GOMP_TARGET_DATA,
1338         BUILT_IN_GOMP_TARGET_UPDATE): Use BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR
1339         rather than BT_FN_VOID_INT_SIZE_PTR_PTR_PTR.
1340         * builtin-types.def (BT_FN_VOID_INT_SIZE_PTR_PTR_PTR): Remove.
1341         (BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR): New.
1342         * omp-low.c (expand_omp_target): Remove fnname argument from
1343         GOMP_target, add openmp_target argument to GOMP_target,
1344         GOMP_target_data and GOMP_target_update calls.
1346 2013-09-18  Jakub Jelinek  <jakub@redhat.com>
1348         * tree.h (OMP_CLAUSE_REDUCTION_OMP_ORIG_REF): Define.
1349         * tree-core.h (OMP_CLAUSE_REDUCTION_OMP_ORIG_REF): Document.
1350         * omp-low.c (lower_rec_simd_input_clauses): Don't set DECL_VALUE_EXPR
1351         on new_var if it is not a DECL_P.
1352         (lower_rec_input_clauses): Don't force max_vf = 1
1353         if OMP_CLAUSE_REDUCTION_PLACEHOLDER.  Add barrier also if any
1354         OMP_CLAUSE_REDUCTION_OMP_ORIG_REF is seen.  For OMP_CLAUSE_PRIVATE
1355         in simd, fix last argument to omp_clause_default_ctor langhook.
1356         Handle OMP_CLAUSE_REDUCTION_PLACEHOLDER in simd loops, if
1357         OMP_CLAUSE_REDUCTION_GIMPLE_INIT is NULL, emit omp_clause_default_ctor
1358         if any and emit omp_clause_dtor if any.  Handle C++ references in
1359         OMP_CLAUSE_REDUCTION clauses.
1360         (lower_reduction_clauses): Adjust comment for UDRs.  Handle
1361         C++ references in OMP_CLAUSE_REDUCTION clauses.
1362         (lower_omp_taskreg): Emit reduction merges before destructors.
1363         * tree-pretty-print.c (dump_omp_clause): Don't emit any reduction
1364         operator name if OMP_CLAUSE_REDUCTION_CODE is ERROR_MARK.
1365         * gimplify.c (omp_add_variable): Ignore GOVD_LOCAL decls for which
1366         privatize_by_reference returns true.
1368         * tree-core.h (OMP_CLAUSE_DEPEND_KIND, OMP_CLAUSE_MAP_KIND,
1369         OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION, OMP_CLAUSE_PROC_BIND_KIND):
1370         Move definitions...
1371         * tree.h (OMP_CLAUSE_DEPEND_KIND, OMP_CLAUSE_MAP_KIND,
1372         OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION, OMP_CLAUSE_PROC_BIND_KIND):
1373         ... here.
1375 2013-09-16  Jakub Jelinek  <jakub@redhat.com>
1377         * omp-low.c (install_var_field): Use (mask & 4) to request double
1378         indirection.
1379         (scan_sharing_clauses): For OMP_CLAUSE_MAP_POINTER arrays pass
1380         7 instead of 3 to install_var_field.
1381         (lower_omp_target): For OMP_CLAUSE_MAP_POINTER arrays add extra
1382         indirection.
1384 2013-09-06  Jakub Jelinek  <jakub@redhat.com>
1386         * omp-low.c (scan_sharing_clauses): Handle VLAs in
1387         OMP_CLAUSE_{MAP,TO,FROM}.  Set DECL_ALIGN (field) before
1388         calling insert_field_into_struct.
1389         (scan_omp_target): Reverse TYPE_FIELDS, verify that
1390         all field alignments are the same.
1391         (lower_omp_target): Use maybe_lookup_field instead of
1392         lookup_sfield to check if field is present.  Handle VLAs.
1393         * tree-pretty-print.c (dump_omp_clause): Only check
1394         OMP_CLAUSE_MAP_KIND on OMP_CLAUSE_MAP clauses.
1395         * gimplify.c (enum gimplify_omp_var_data): Add GOVD_MAP_TO_ONLY.
1396         (omp_firstprivatize_variable, omp_add_variable,
1397         gimplify_adjust_omp_clauses_1, gimplify_adjust_omp_clauses): Handle
1398         VLAs in OMP_CLAUSE_{MAP,TO,FROM}.
1400 2013-09-05  Jakub Jelinek  <jakub@redhat.com>
1402         * gimplify.c (gimplify_call_expr): Don't call fold_stmt
1403         inside of #pragma omp target construct.
1404         (gimplify_modify_expr): Likewise.
1405         * omp-low.c (target_nesting_level): New variable.
1406         (lower_omp_target): Increase/restore target_nesting_level
1407         around lowering #pragma omp target body.  Use TYPE_SIZE_UNIT
1408         instead of TYPE_SIZE if OMP_CLAUSE_SIZE is missing.
1409         Or log2 of needed alignment into high 5 bits of kind.
1410         (lower_omp): Call fold_stmt on all stmts inside of
1411         #pragma omp target construct.
1413         * tree-cfg.c (make_edges): For GIMPLE_OMP_TARGET
1414         with GF_OMP_TARGET_KIND_UPDATE, don't look for
1415         GIMPLE_OMP_RETURN and immediately restore previous
1416         region.
1417         * langhooks.c (lhd_omp_mappable_type): New function.
1418         * omp-low.c (scan_sharing_clauses): Ignore OMP_CLAUSE_SHARED
1419         in GIMPLE_OMP_TEAMS constructs.  Handle OMP_CLAUSE_NUM_TEAMS,
1420         OMP_CLAUSE_THREAD_LIMIT, OMP_CLAUSE_DEVICE, OMP_CLAUSE_MAP,
1421         OMP_CLAUSE_TO and OMP_CLAUSE_FROM.
1422         (create_omp_child_function): If current function has
1423         "omp declare target" attribute or if current region
1424         is OMP_TARGET or lexically nested in it, add that
1425         attribute to the omp child function.
1426         (scan_omp_target, scan_omp_teams): New functions.
1427         (check_omp_nesting_restrictions): Fix a typo in TEAMS nesting
1428         check.
1429         (scan_omp_1_stmt): Handle GIMPLE_OMP_TARGET and GIMPLE_OMP_TEAMS.
1430         (lower_rec_input_clauses): Ignore OMP_CLAUSE_SHARED
1431         in GIMPLE_OMP_TEAMS constructs.
1432         (expand_omp_synch): Handle GIMPLE_OMP_TEAMS.
1433         (expand_omp_target): New function.
1434         (expand_omp): Handle GIMPLE_OMP_TARGET and GIMPLE_OMP_TEAMS.
1435         (build_omp_regions_1): For GIMPLE_OMP_TARGET with
1436         GF_OMP_TARGET_KIND_UPDATE, don't look for GIMPLE_OMP_RETURN and
1437         immediately restore previous region.
1438         (lower_omp_single): Emit a CLOBBER stmt after GIMPLE_OMP_RETURN.
1439         (lower_omp_taskreg): Likewise.
1440         (lower_omp_target, lower_omp_teams): New functions.
1441         (lower_omp_1): Handle GIMPLE_OMP_TARGET and GIMPLE_OMP_TEAMS.
1442         * tree.h (enum omp_clause_map_kind): Improve description of
1443         OMP_CLAUSE_MAP_POINTER.
1444         (OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION): Define.
1445         * gimple.def (GIMPLE_OMP_TARGET): Use GSS_OMP_PARALLEL instead
1446         of GSS_OMP_SINGLE.
1447         * langhooks.h (struct lang_hooks_for_types): Add
1448         omp_mappable_type hook.
1449         * langhooks-def.h (lhd_omp_mappable_type): New prototype.
1450         (LANG_HOOKS_OMP_MAPPABLE_TYPE): Define.
1451         (LANG_HOOKS_FOR_TYPES_INITIALIZER): Use it.
1452         * gimple.h (gimple_omp_target_clauses, gimple_omp_target_clauses_ptr,
1453         gimple_omp_target_set_clauses): Use gimple_omp_parallel
1454         instead of gimple_omp_single.
1455         (gimple_omp_target_child_fn, gimple_omp_target_child_fn_ptr,
1456         gimple_omp_target_set_child_fn, gimple_omp_target_data_arg,
1457         gimple_omp_target_data_arg_ptr, gimple_omp_target_set_data_arg): New
1458         inlines.
1459         * omp-builtins.def (BUILT_IN_GOMP_TARGET, BUILT_IN_GOMP_TARGET_DATA,
1460         BUILT_IN_GOMP_TARGET_END_DATA, BUILT_IN_GOMP_TARGET_UPDATE,
1461         BUILT_IN_GOMP_TEAMS): New builtins.
1462         * gimple-pretty-print.c (dump_gimple_omp_target): Print child_fn
1463         for #pragma omp target.
1464         * gimplify.c (omp_notice_variable): Diagnose if implicitly mapped
1465         decl doesn't have mappable type.
1466         (gimplify_scan_omp_clauses): For OMP_CLAUSE_MAP don't clear
1467         notice_outer.
1468         (gimplify_adjust_omp_clauses_1): Add OMP_CLAUSE_MAP even if the same
1469         decl is already referenced in target data construct surrounding it.
1470         (gimplify_adjust_omp_clauses): Likewise.  Handle
1471         OMP_CLAUSE_THREAD_LIMIT.
1472         (gimplify_omp_workshare): Fix up gimplification of target or target
1473         data construct body.  For target data add GOMP_target_end_data
1474         call in a try/finally cleanup.
1475         * builtin-types.def (BT_FN_VOID_UINT_UINT,
1476         BT_FN_VOID_INT_SIZE_PTR_PTR_PTR,
1477         BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR): New.
1479 2013-07-14  Jakub Jelinek  <jakub@redhat.com>
1481         * tree.h (omp_declare_simd_clauses_equal): Remove prototype.
1482         (omp_remove_redundant_declare_simd_attrs): New prototype.
1483         * tree.c (omp_declare_simd_clauses_equal): Make static.
1484         (omp_remove_redundant_declare_simd_attrs): New function.
1486 2013-07-09  Jakub Jelinek  <jakub@redhat.com>
1488         * gimple-pretty-print.c (dump_gimple_omp_return): Print
1489         gimple_omp_return_lhs if non-NULL.
1490         * tree-ssa-alias.c (ref_maybe_used_by_call_p_1,
1491         call_may_clobber_ref_p_1): Handle BUILT_IN_GOMP_BARRIER_CANCEL,
1492         BUILT_IN_GOMP_LOOP_END_CANCEL, BUILT_IN_GOMP_SECTIONS_END_CANCEL.
1493         * gimple.h (gimple_omp_return_set_lhs, gimple_omp_return_lhs,
1494         gimple_omp_return_lhs_ptr): New inlines.
1495         * gimple.def (GIMPLE_OMP_RETURN): Use GSS_OMP_ATOMIC_STORE
1496         instead of GSS_BASE.
1497         * gimple.c (walk_gimple_op) <case GIMPLE_OMP_RETURN>: Walk lhs.
1498         * builtin-types.def (BT_FN_BOOL_INT, BT_FN_BOOL_INT_BOOL): New.
1499         * omp-builtins.def (BUILT_IN_GOMP_CANCELLATION_POINT): Use
1500         ATTR_NOTHROW_LEAF_LIST instead of ATTR_NULL.  Return type is now
1501         bool.
1502         (BUILT_IN_GOMP_CANCEL): Likewise.  Add second argument with bool type.
1503         (BUILT_IN_BARRIER_CANCEL, BUILT_IN_GOMP_LOOP_END_CANCEL,
1504         BUILT_IN_GOMP_SECTIONS_END_CANCEL): New builtins.
1505         * omp-low.c (struct omp_context): Add cancel_label and cancellable
1506         fields.
1507         (extract_omp_for_data): Set have_nowait even for simd implicitly.
1508         (check_omp_nesting_restrictions): Verify nesting restrictions for
1509         #pragma omp cancel and #pragma omp cancellation point.
1510         Set ctx->cancellable for regions that can be cancelled or also
1511         for any task region that contains #pragma omp cancellation point.
1512         (scan_omp_1_stmt): Check nesting restrictions even if ctx == NULL.
1513         (build_omp_barrier): Return gimple instead of tree, add lhs argument,
1514         if non-NULL, build GOMP_barrier_cancel builtin instead and set its 
1515         call lhs to lhs.
1516         (lower_rec_input_clauses): Adjust build_omp_barrier caller.
1517         (expand_omp_for_static_nochunk, expand_omp_for_static_chunk,
1518         expand_omp_single): Likewise.  If OMP_RETURN has lhs, pass it to
1519         build_omp_barrier.
1520         (expand_omp_for_generic): If OMP_RETURN has lhs, use
1521         GOMP_loop_end_cancel libcall instead of GOMP_loop_end and set its
1522         lhs from OMP_RETURN's lhs.
1523         (expand_omp_sections): If OMP_RETURN has lhs, use
1524         GOMP_sections_end_cancel libcall instead of GOMP_sections_end and set
1525         its lhs from OMP_RETURN's lhs.
1526         (maybe_add_implicit_barrier_cancel): New function.
1527         (lower_omp_sections): If ctx->cancellable, emit cancel_label before
1528         OMP_RETURN.  Call maybe_add_implicit_barrier_cancel.
1529         (lower_omp_for): Likewise.
1530         (lower_omp_single): Call maybe_add_implicit_barrier_cancel.
1531         (lower_omp_taskreg): If ctx->cancellable, emit cancel_label before
1532         OMP_RETURN.
1533         (lower_omp_1): If ctx->cancellable, create ctx->cancel_label.
1534         Adjust GOMP_barrier libcalls to GOMP_barrier_cancel plus conditional
1535         branch in cancellable regions, adjust GOMP_cancel and
1536         GOMP_cancellation_point in cancellable regions or remove
1537         GOMP_cancellation_point in non-cancellable regions.
1539 2013-07-03  Jakub Jelinek  <jakub@redhat.com>
1541         * omp-low.c (expand_omp_single): Don't force barrier for
1542         copyprivate.
1544 2013-06-28  Jakub Jelinek  <jakub@redhat.com>
1545             Aldy Hernandez  <aldyh@redhat.com>
1547         * internal-fn.def (GOMP_SIMD_LANE, GOMP_SIMD_VF,
1548         GOMP_SIMD_LAST_LANE): New internal functions.
1549         * omp-low.c (omp_max_vf, lower_rec_simd_input_clauses): New
1550         functions.
1551         (lower_rec_input_clauses): Add fd argument.  Enforce max_vf = 1
1552         if any data sharing clauses mention VLAs or for array reductions.
1553         Handle OMP_CLAUSE__LOOPTEMP_ clause.  For
1554         OMP_CLAUSE_{{FIRST,LAST,}PRIVATE,LINEAR,REDUCTION} on SIMD
1555         constructs use "omp simd array" temporaries.  For OMP_CLAUSE_LINEAR
1556         adjust initial value in combined constructs.  Don't emit any
1557         barriers for #pragma omp distribute.  If max_vf is lower than
1558         current safelen, prepend an OMP_CLAUSE_SAFELEN clause.
1559         (lower_lastprivate_clauses): Handle "omp simd array" temporaries.
1560         (lower_reduction_clauses): Exit early for #pragma omp simd.
1561         (expand_omp_simd): Set loop->simduid from OMP_CLAUSE__SIMDUID_
1562         and cfun->has_simduid_loops if set.
1563         If OMP_CLAUSE_SAFELEN (1) is present, don't set loop->safelen
1564         nor loop->force_vect.
1565         (lower_omp_sections, lower_omp_single, lower_omp_taskreg): Adjust
1566         lower_rec_input_clauses callers.
1567         (lower_omp_for_lastprivate): Unshare vinit.
1568         (lower_omp_for): Add OMP_CLAUSE__LOOPTEMP_ clauses before calling
1569         lower_rec_input_clauses.  Adjust lower_rec_input_clauses caller.
1570         Always call lower_omp_for_lastprivate at the same place, even for
1571         #pragma omp simd.
1572         * tree.h (enum clause_code): Add OMP_CLAUSE__SIMDUID_.
1573         (OMP_CLAUSE__SIMDUID__DECL): Define.
1574         * tree-vectorizer.c: Include hash-table.h and tree-ssa-propagate.h.
1575         (simduid_to_vf, decl_to_simduid): New classes.
1576         (simduid_to_vf::hash, simduid_to_vf::equal, decl_to_simduid::hash,
1577         decl_to_simduid::equal): New methods.
1578         (note_simd_array_uses_struct): New struct.
1579         (adjust_simduid_builtins, note_simd_array_uses_cb,
1580         note_simd_array_uses): New functions.
1581         (vectorize_loops): Adjust "omp simd array" temporary array sizes
1582         and fold GOMP_SIMD_{LANE,VF,LAST_LANE} builtins.
1583         * tree-vectorizer.h (struct _stmt_vec_info): Add simd_lane_access_p
1584         field.
1585         (STMT_VINFO_SIMD_LANE_ACCESS_P): Define.
1586         * tree-data-ref.c (get_references_in_stmt): Allow GOMP_SIMD_LANE
1587         builtins in their own loops.
1588         * tree-inline.c (copy_cfg_body): Propagate has_force_vect_loops
1589         and has_simduid_loops.
1590         * function.h (struct function): Add has_simduid_loops field.
1591         * tree-ssa-ccp.c (likely_value): For GOMP_SIMD_{LANE,LAST_LANE,VF}
1592         builtins ignore the undefined magic argument.
1593         * tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE__SIMDUID_
1594         clause.
1595         * cfgloop.h (struct loop): Add simduid field.
1596         * Makefile.in (tree-vectorizer.o): Depend on $(HASH_TABLE_H)
1597         and tree-ssa-propagate.h.
1598         * tree-vect-data-refs.c (vect_analyze_data_refs): Check for SIMD
1599         lane access.
1600         * gimplify.c (omp_add_variable): Handle combination of aligned
1601         clause and some data sharing clause for the same decl.
1602         (gimplify_omp_for): For collapse (2) and above simd loops
1603         predetermine loop iteration vars as lastprivate instead of
1604         linear.
1605         * tree.c (omp_clause_num_ops, omp_clause_code_name): Add
1606         entries for OMP_CLAUSE__SIMDUID_.
1607         (walk_tree_1): Handle OMP_CLAUSE__SIMDUID_.
1608         * tree-vect-loop.c (vectorizable_live_operation): Handle live
1609         GOMP_SIMD_LANE result.
1610         * tree-vect-stmts.c (vectorizable_call): Vectorize GOMP_SIMD_LANE
1611         builtin.
1612         (vectorizable_store, vectorizable_load): Handle
1613         STMT_VINFO_SIMD_LANE_ACCESS_P.
1614         * internal-fn.c (expand_GOMP_SIMD_LANE, expand_GOMP_SIMD_VF,
1615         expand_GOMP_SIMD_LAST_LANE): New functions.
1617 2013-06-21  Jakub Jelinek  <jakub@redhat.com>
1619         * gimple.h (enum gf_mask): Adjust GF_OMP_FOR_COMBINED
1620         value representation, add GF_OMP_FOR_COMBINED_INTO.
1621         (gimple_omp_for_combined_into_p,
1622         gimple_omp_for_set_combined_into_p): New inlines.
1623         * gimplify.c (enum omp_region_type): Remove outdated
1624         ORT_SIMD comment.
1625         (struct gimplify_omp_ctx): Add combined_loop field.
1626         (gimplify_omp_for): Call gimple_omp_for_set_combined_into_p
1627         for inner for/simd constructs combined with an outer
1628         loop construct (for or distribute).
1629         * tree.c (omp_clause_num_ops): Add OMP_CLAUSE__LOOPTEMP_
1630         entry.
1631         (omp_clause_code_name): Likewise.
1632         (walk_tree_1): Handle OMP_CLAUSE__LOOPTEMP_.
1633         * tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE__LOOPTEMP_.
1634         * tree.h (enum omp_clause_code): Add OMP_CLAUSE__LOOPTEMP_.
1635         (OMP_CLAUSE_DECL): Allow also on OMP_CLAUSE__LOOPTEMP_.
1636         * omp-low.c (extract_omp_for_data): Rename non_ws to simd.  Don't set
1637         fd->chunk_size for non-chunk OMP_CLAUSE_SCHEDULE_STATIC, unless
1638         fd->have_ordered.  For OMP_CLAUSE_SCHEDULE_STATIC non-ordered loops
1639         compute fd->iter_type the same as for simd.
1640         (get_ws_args_for): Add par_stmt argument, if
1641         gimple_omp_for_combined_into_p, use first two _looptemp_ clauses
1642         temporaries instead of fd->loop.n{1,2}.
1643         (determine_parallel_type): Adjust caller.
1644         (scan_sharing_clauses): Handle OMP_CLAUSE__LOOPTEMP_.
1645         (find_combined_for): New function.
1646         (scan_omp_parallel): If gimple_omp_parallel_combined_p and
1647         it is combined with gimple_omp_for_combined_into_p OMP_FOR,
1648         add OMP_CLAUSE__LOOPTEMP_ clauses to the parallel.
1649         (check_omp_nesting_restrictions): Don't insist that the only construct
1650         nested in OMP_DISTRIBUTE must be OMP_PARALLEL.
1651         (lower_rec_input_clauses, lower_send_clauses): Handle
1652         OMP_CLAUSE__LOOPTEMP_.
1653         (expand_omp_for_init_counts, expand_omp_for_init_vars,
1654         extract_omp_for_update_vars): New functions.
1655         (expand_omp_for_generic): Add inner_stmt argument.  Use
1656         expand_omp_for_{init,update}* helper functions.  Handle combined loop
1657         constructs.
1658         (expand_omp_for_static_nochunk, expand_omp_for_static_chunk):
1659         Likewise.  Handle fd->collapse > 1 and broken_loop cases.
1660         (expand_omp_simd): Use expand_omp_for_init* helper functions.  Handle
1661         combined loop constructs.
1662         (expand_omp_for): Add inner_stmt argument.  Pass it through to
1663         expand_omp_for_{generic,static_{,no}chunk}.  Use
1664         expand_omp_for_static* even for fd->collapse > 1 and/or broken_loop
1665         cases, just not when fd->have_ordered.
1666         (expand_omp): Adjust expand_omp_for caller.
1667         (lower_omp_for): If gimple_omp_parallel_combined_p, add
1668         OMP_CLAUSE__LOOPTEMP_ clauses to the GIMPLE_FOR stmt.
1670 2013-06-14  Jakub Jelinek  <jakub@redhat.com>
1672         * gimple-pretty-print.c (dump_gimple_omp_for): Don't handle
1673         GF_OMP_FOR_KIND_FOR_SIMD.
1674         * gimple.h (GF_OMP_FOR_KIND_FOR_SIMD): Remove.
1675         (GF_OMP_FOR_COMBINED): New.
1676         (gimple_omp_for_combined_p, gimple_omp_for_set_combined_p): New
1677         inline functions.
1678         * gimplify.c (is_gimple_stmt): Don't handle OMP_FOR_SIMD.
1679         (find_combined_omp_for): New function.
1680         (gimplify_omp_for): Handle combined OMP_DISTRIBUTE and OMP_FOR
1681         loops.
1682         * Makefile.in (c-family/c-omp.o): Depend on $(C_PRAGMA_H).
1683         * omp-low.c (build_outer_var_ref): Fix up simd handling.
1684         (check_omp_nesting_restrictions): Don't handle
1685         GF_OMP_FOR_KIND_FOR_SIMD.
1686         * tree.def (OMP_FOR_SIMD): Remove.
1687         * tree-pretty-print.c (dump_generic_node): Don't handle OMP_FOR_SIMD.
1688         Handle NULL OMP_FOR_INIT.
1690 2013-06-12  Jakub Jelinek  <jakub@redhat.com>
1692         * gimplify.c (gimplify_scan_omp_clauses): Handle
1693         OMP_CLAUSE_THREAD_LIMIT.
1694         * tree-pretty-print.c (dump_omp_clause): Likewise.
1695         * tree.c (omp_clause_num_ops, omp_clause_code_name): Add entries for
1696         OMP_CLAUSE_THREAD_LIMIT.
1697         * tree.h (enum omp_clause_code): Add OMP_CLAUSE_THREAD_LIMIT.
1698         (OMP_CLAUSE_THREAD_LIMIT_EXPR): Define.
1700 2013-06-04  Jakub Jelinek  <jakub@redhat.com>
1702         * gimplify.c (gimplify_scan_omp_clauses): Handle array
1703         sections on OMP_CLAUSE_{MAP,TO,FROM} clauses, handle
1704         OMP_CLAUSE_DEPEND clause.
1705         (gimplify_adjust_omp_clauses): Handle array sections on
1706         OMP_CLAUSE_MAP, handle OMP_CLAUSE_DEPEND clause.
1707         * tree.c (omp_clause_num_ops): OMP_CLAUSE_{MAP,TO,FROM}
1708         now have 2 arguments, move OMP_CLAUSE_UNIFORM before these
1709         3.
1710         (omp_clause_code_name): Adjust for OMP_CLAUSE_UNIFORM movement.
1711         (walk_tree_1): Adjust to handle 2 arguments of
1712         OMP_CLAUSE_{MAP,TO,FROM}.
1713         * tree-pretty-print.c (dump_omp_clause): For OMP_CLAUSE_{MAP,TO,FROM}
1714         print OMP_CLAUSE_SIZE, and for OMP_CLAUSE_MAP handle
1715         OMP_CLAUSE_MAP_POINTER.
1716         * tree.h (enum omp_clause_code): Move OMP_CLAUSE_UNIFORM before
1717         OMP_CLAUSE_{MAP,TO,FROM}.
1718         (OMP_CLAUSE_SIZE): Define.
1719         (enum omp_clause_map_kind): Add OMP_CLAUSE_MAP_POINTER.
1720         * omp-low.c (scan_sharing_clauses): Handle OMP_CLAUSE_DEPEND.
1722 2013-05-29  Jakub Jelinek  <jakub@redhat.com>
1724         * omp-builtins.def (BUILT_IN_OMP_GET_TEAM_NUM,
1725         BUILT_IN_OMP_GET_NUM_TEAMS): New built-ins.
1726         * omp-low.c (extract_omp_for_data, expand_omp_for_static_nochunk,
1727         expand_omp_for_static_chunk): Handle #pragma omp distribute.
1728         (expand_omp_for): Add assertion for non-finished distribute collapse
1729         > 1 support.
1730         (check_omp_nesting_restrictions): Allow orphaned distribute construct.
1732         * omp-low.c (check_omp_nesting_restrictions): Add some
1733         accelerator related nesting restrictions.
1734         (scan_omp_1_stmt): Call check_omp_nesting_restrictions
1735         even for GOMP_taskgroup_{start,end}.
1736         * gimplify.c (omp_notice_threadprivate_variable): Fix a typo.
1737         (gimplify_body): For functions with "omp declare target" attribute
1738         add ORT_TARGET region around the body.
1740 2013-05-27  Jakub Jelinek  <jakub@redhat.com>
1742         * tree.def (OMP_TEAMS, OMP_TARGET_DATA, OMP_TARGET,
1743         OMP_TARGET_UPDATE): New tree codes.
1744         * tree-cfg.c (make_edges): Handle GIMPLE_OMP_TARGET
1745         and GIMPLE_OMP_TEAMS.
1746         * omp-low.c (scan_sharing_clauses): Handle OMP_CLAUSE_DIST_SCHEDULE.
1747         * gimple-low.c (lower_stmt): Handle GIMPLE_OMP_TARGET
1748         and GIMPLE_OMP_TEAMS.
1749         * tree.h (OMP_TEAMS_BODY, OMP_TEAMS_CLAUSES, OMP_TARGET_DATA_BODY,
1750         OMP_TARGET_DATA_CLAUSES, OMP_TARGET_BODY, OMP_TARGET_CLAUSES,
1751         OMP_TARGET_UPDATE_CLAUSES): Define.
1752         * tree-nested.c (convert_nonlocal_reference_stmt,
1753         convert_local_reference_stmt, convert_gimple_call): Handle
1754         GIMPLE_OMP_TARGET and GIMPLE_OMP_TEAMS.
1755         * tree-inline.c (estimate_num_insns): Likewise.
1756         (remap_gimple_stmt): Likewise.  Adjust gimple_build_omp_for
1757         caller.
1758         * gimple.def: Adjust comments describing OMP_CLAUSEs.
1759         (GIMPLE_OMP_TARGET, GIMPLE_OMP_TEAMS): New GIMPLE stmts.
1760         * tree-parloops.c (create_parallel_loop): Adjust gimple_build_omp_for
1761         caller.
1762         * tree-pretty-print.c (dump_generic_node): Handle OMP_TEAMS,
1763         OMP_TARGET, OMP_TARGET_DATA and OMP_TARGET_UPDATE.
1764         * gimple.h (GF_OMP_TARGET_KIND_MASK, GF_OMP_TARGET_KIND_REGION,
1765         GF_OMP_TARGET_KIND_DATA, GF_OMP_TARGET_KIND_UPDATE): New.
1766         (gimple_build_omp_for): Add kind argument to prototype.
1767         (gimple_build_omp_target, gimple_build_omp_teams): New prototypes.
1768         (gimple_has_substatements): Handle GIMPLE_OMP_TARGET and
1769         GIMPLE_OMP_TEAMS.
1770         (gimple_omp_subcode): Change GIMPLE_OMP_SINGLE to GIMPLE_OMP_TEAMS.
1771         (gimple_omp_target_clauses, gimple_omp_target_clauses_ptr,
1772         gimple_omp_target_set_clauses, gimple_omp_target_kind,
1773         gimple_omp_target_set_kind, gimple_omp_teams_clauses,
1774         gimple_omp_teams_clauses_ptr, gimple_omp_teams_set_clauses): New
1775         inline functions.
1776         (gimple_return_set_retval): Handle GIMPLE_OMP_TARGET and
1777         GIMPLE_OMP_TEAMS.
1778         * gimple.c (gimple_build_omp_for): Add kind argument, call
1779         gimple_omp_for_set_kind.
1780         (gimple_build_omp_target, gimple_build_omp_teams): New functions.
1781         (walk_gimple_op, walk_gimple_stmt, gimple_copy): Handle
1782         GIMPLE_OMP_TARGET and GIMPLE_OMP_TEAMS.
1783         * gimple-pretty-print.c (dump_gimple_omp_target,
1784         dump_gimple_omp_teams): New functions.
1785         (pp_gimple_stmt_1): Handle GIMPLE_OMP_TARGET and GIMPLE_OMP_TEAMS.
1786         * gimplify.c (enum gimplify_omp_var_data): Add GOVD_MAP.
1787         (enum omp_region_type): Add ORT_TEAMS, ORT_TARGET and ORT_TARGET_DATA.
1788         (omp_add_variable): Add temporary assertions.
1789         (omp_notice_threadprivate_variable): Complain if threadprivate vars
1790         appear in target region.
1791         (omp_notice_variable): ORT_TARGET, ORT_TARGET_DATA and ORT_TEAMS
1792         handling.
1793         (omp_check_private): Ignore ORT_TARGET and ORT_TARGET_DATA regions.
1794         (gimplify_scan_omp_clauses): Handle OMP_CLAUSE_MAP, OMP_CLAUSE_TO,
1795         OMP_CLAUSE_FROM, OMP_CLAUSE_NUM_TEAMS, OMP_CLAUSE_DIST_SCHEDULE
1796         and OMP_CLAUSE_DEVICE.
1797         (gimplify_adjust_omp_clauses): Likewise.
1798         (gimplify_adjust_omp_clauses_1): Handle GOVD_MAP.  Fix up
1799         check for privatization by also testing for GOVD_LINEAR.
1800         (gimplify_omp_for): Adjust gimple_build_omp_for caller.
1801         Clear *expr_p.
1802         (gimplify_omp_workshare): Handle also OMP_TARGET, OMP_TARGET_DATA
1803         and OMP_TEAMS.  Clear *expr_p.
1804         (gimplify_omp_target_update): New function.
1805         (gimplify_expr): Handle OMP_TARGET, OMP_TARGET_DATA, OMP_TARGET_UPDATE
1806         and OMP_TEAMS.
1808 2013-05-20  Jakub Jelinek  <jakub@redhat.com>
1810         * omp-low.c (expand_omp_simd): For collapse > 1 loops,
1811         if some loop condition might be not true initially, add runtime
1812         test and skip the whole loop.
1814 2013-05-14  Jakub Jelinek  <jakub@redhat.com>
1816         * cfgloop.h (struct loop): Add safelen and force_vect fields.
1817         * function.h (struct function): Add has_force_vect_loops field.
1818         * omp-low.c (expand_omp_simd): If !broken_loop, create loop for
1819         the simd region and set safelen and force_vect fields in it.
1820         * tree-vectorizer.c (vectorize_loops): If loop has force_vect set,
1821         vectorize it even if flag_vectorize isn't set.  Clear loop->force_vect
1822         after vectorization.
1823         * tree-ssa-loop.c (gate_tree_vectorize): Return true even
1824         cfun->has_force_vect_loops.
1825         * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely_1): Don't
1826         unroll loops with loop->force_vect.
1827         * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): For
1828         unknown or bad data dependency, if loop->safelen is non-zero, just
1829         decrease *max_vf to loop->safelen if needed and return false.
1830         * tree-if-conv.c (main_tree_if_conversion): If-convert also loops with
1831         loop->force_vect.
1832         (gate_tree_if_conversion): Return true even if
1833         cfun->has_force_vect_loops.
1835 2013-05-09  Jakub Jelinek  <jakub@redhat.com>
1837         * tree.c (omp_declare_simd_clauses_equal): New function.
1838         (attribute_value_equal): Call it for -fopenmp if
1839         TREE_VALUE of the attributes are both OMP_CLAUSEs.
1840         * tree.h (omp_declare_simd_clauses_equal): Declare.
1842 2013-04-30  Jakub Jelinek  <jakub@redhat.com>
1844         * gimple-pretty-print.c (dump_gimple_omp_atomic_load,
1845         dump_gimple_omp_atomic_store): Handle gimple_omp_atomic_seq_cst_p.
1846         * gimple.h (enum gf_mask): Add GF_OMP_ATOMIC_SEQ_CST.
1847         (gimple_omp_atomic_set_seq_cst, gimple_omp_atomic_seq_cst_p): New
1848         inline functions.
1849         * omp-low.c (expand_omp_atomic_load, expand_omp_atomic_store,
1850         expand_omp_atomic_fetch_op): If gimple_omp_atomic_seq_cst_p,
1851         pass MEMMODEL_SEQ_CST instead of MEMMODEL_RELAXED to the builtin.
1852         * gimplify.c (gimplify_omp_atomic): Handle OMP_ATOMIC_SEQ_CST.
1853         * tree-pretty-print.c (dump_generic_node): Handle OMP_ATOMIC_SEQ_CST.
1854         * tree.def (OMP_ATOMIC): Add comment that OMP_ATOMIC* must stay
1855         consecutive.
1856         * tree.h (OMP_ATOMIC_SEQ_CST): Define.
1858         * omp-low.c (check_omp_nesting_restrictions): Diagnose
1859         OpenMP constructs nested inside simd region.  Don't treat
1860         #pragma omp simd as work-sharing region.  Disallow work-sharing
1861         constructs inside of critical region.  Complain if ordered
1862         region is nested inside of parallel region without loop
1863         region in between.
1864         (scan_omp_1_stmt): Call check_omp_nesting_restrictions even
1865         for GOMP_{cancel{,lation_point},taskyield,taskwait} calls.
1867 2013-04-23  Jakub Jelinek  <jakub@redhat.com>
1869         * Makefile.in (omp-low.o): Depend on $(TARGET_H).
1870         * gimplify.c (gimplify_adjust_omp_clauses): For linear clauses
1871         if outer_context is non-NULL, but not ORT_COMBINED_PARALLEL,
1872         call omp_notice_variable.  Remove aligned clauses that can't
1873         be handled yet.
1874         * omp-low.c: Include target.h.
1875         (scan_sharing_clauses): For aligned clauses with global arrays
1876         register local replacement.
1877         (omp_clause_aligned_alignment): New function.
1878         (lower_rec_input_clauses): For aligned clauses for global
1879         arrays or automatic pointers emit __builtin_assume_aligned
1880         before the loop if possible.
1881         (expand_omp_regimplify_p, expand_omp_build_assign): New functions.
1882         (expand_omp_simd): Use them.  Handle pointer iterators and broken
1883         loops.
1884         (lower_omp_for): Call lower_omp on gimple_omp_body_ptr after
1885         calling lower_rec_input_clauses, not before it.
1887 2013-04-19  Jakub Jelinek  <jakub@redhat.com>
1889         * tree.h (OMP_CLAUSE_LINEAR_NO_COPYIN,
1890         OMP_CLAUSE_LINEAR_NO_COPYOUT): Define.
1891         * omp-low.c (extract_omp_for_data): Handle #pragma omp simd.
1892         (build_outer_var_ref): For #pragma omp simd allow linear etc.
1893         clauses to bind even to private vars.
1894         (scan_sharing_clauses): Handle OMP_CLAUSE_LINEAR, OMP_CLAUSE_ALIGNED
1895         and OMP_CLAUSE_SAFELEN.
1896         (lower_rec_input_clauses): Handle OMP_CLAUSE_LINEAR.  Don't emit
1897         a GOMP_barrier call for firstprivate/lastprivate in #pragma omp simd.
1898         (lower_lastprivate_clauses): Handle also OMP_CLAUSE_LINEAR.
1899         (expand_omp_simd): New function.
1900         (expand_omp_for): Handle #pragma omp simd.
1901         * gimplify.c (enum gimplify_omp_var_data): Add GOVD_LINEAR and
1902         GOVD_ALIGNED, add GOVD_LINEAR into GOVD_DATA_SHARE_CLASS.
1903         (enum omp_region_type): Add ORT_SIMD.
1904         (gimple_add_tmp_var, gimplify_var_or_parm_decl, omp_check_private,
1905         omp_firstprivatize_variable, omp_notice_variable): Handle ORT_SIMD
1906         like ORT_WORKSHARE.
1907         (omp_is_private): Likewise.  Add SIMD argument, tweak diagnostics
1908         and add extra errors in simd constructs.
1909         (gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses): Handle
1910         OMP_CLAUSE_LINEAR, OMP_CLAUSE_ALIGNED and OMP_CLAUSE_SAFELEN.
1911         (gimplify_adjust_omp_clauses_1): Handle GOVD_LASTPRIVATE and
1912         GOVD_ALIGNED.
1913         (gimplify_omp_for): Handle #pragma omp simd.
1915 2013-04-10  Jakub Jelinek  <jakub@redhat.com>
1917         * builtin-types.def (DEF_FUNCTION_TYPE_8): Document.
1918         (BT_FN_VOID_OMPFN_PTR_UINT, BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG,
1919         BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG): Remove.
1920         (BT_FN_VOID_OMPFN_PTR_UINT_UINT_UINT,
1921         BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_UINT,
1922         BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG_UINT): New.
1923         * gimplify.c (gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses):
1924         Handle OMP_CLAUSE_PROC_BIND.
1925         * omp-builtins.def (BUILT_IN_GOMP_TASKGROUP_START,
1926         BUILT_IN_GOMP_TASKGROUP_END, BUILT_IN_GOMP_PARALLEL_LOOP_STATIC,
1927         BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC,
1928         BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED,
1929         BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME, BUILT_IN_GOMP_PARALLEL,
1930         BUILT_IN_GOMP_PARALLEL_SECTIONS): New built-ins.
1931         (BUILT_IN_GOMP_PARALLEL_LOOP_STATIC_START,
1932         BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC_START,
1933         BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED_START,
1934         BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME_START,
1935         BUILT_IN_GOMP_PARALLEL_START, BUILT_IN_GOMP_PARALLEL_END,
1936         BUILT_IN_GOMP_PARALLEL_SECTIONS_START): Remove.
1937         * omp-low.c (scan_sharing_clauses): Handle OMP_CLAUSE_PROC_BIND.
1938         (expand_parallel_call): Expand #pragma omp parallel* as
1939         calls to the new GOMP_parallel_* APIs without _start at the end,
1940         instead of GOMP_parallel_*_start followed by fn.omp_fn.N call,
1941         followed by GOMP_parallel_end.  Handle OMP_CLAUSE_PROC_BIND.
1942         * tree-ssa-alias.c (ref_maybe_used_by_call_p_1,
1943         call_may_clobber_ref_p_1): Handle BUILT_IN_GOMP_TASKGROUP_END
1944         instead of BUILT_IN_GOMP_PARALLEL_END.
1946 2013-03-27  Jakub Jelinek  <jakub@redhat.com>
1948         * gimple-pretty-print.c (dump_gimple_omp_for): Handle different
1949         GIMPLE_OMP_FOR kinds.
1950         * tree.def (OMP_SIMD, OMP_FOR_SIMD, OMP_DISTRIBUTE): New tree codes.
1951         * gimple.h (enum gf_mask): Add GF_OMP_FOR_KIND_MASK,
1952         GF_OMP_FOR_KIND_FOR, GF_OMP_FOR_KIND_SIMD, GF_OMP_FOR_KIND_FOR_SIMD
1953         and GF_OMP_FOR_KIND_DISTRIBUTE.
1954         (gimple_omp_for_kind, gimple_omp_for_set_kind): New inline functions.
1955         * gimplify.c (is_gimple_stmt, gimplify_omp_for, gimplify_expr): Handle
1956         OMP_SIMD, OMP_FOR_SIMD and OMP_DISTRIBUTE.
1957         * tree.c (omp_clause_num_ops, omp_clause_code_name, walk_tree_1):
1958         Handle new OpenMP 4.0 clauses.
1959         * tree-pretty-print.c (dump_omp_clause): Likewise.
1960         (dump_generic_node): Handle OMP_SIMD, OMP_FOR_SIMD and OMP_DISTRIBUTE.
1961         * tree.h (enum omp_clause_code): Add OMP_CLAUSE_LINEAR,
1962         OMP_CLAUSE_ALIGNED, OMP_CLAUSE_DEPEND, OMP_CLAUSE_FROM, OMP_CLAUSE_TO,
1963         OMP_CLAUSE_UNIFORM, OMP_CLAUSE_MAP, OMP_CLAUSE_DEVICE,
1964         OMP_CLAUSE_DIST_SCHEDULE, OMP_CLAUSE_INBRANCH, OMP_CLAUSE_NOTINBRANCH,
1965         OMP_CLAUSE_NUM_TEAMS, OMP_CLAUSE_PROC_BIND, OMP_CLAUSE_SAFELEN,
1966         OMP_CLAUSE_SIMDLEN, OMP_CLAUSE_FOR, OMP_CLAUSE_PARALLEL,
1967         OMP_CLAUSE_SECTIONS and OMP_CLAUSE_TASKGROUP.
1968         (OMP_LOOP_CHECK): Define.
1969         (OMP_FOR_BODY, OMP_FOR_CLAUSES, OMP_FOR_INIT, OMP_FOR_COND,
1970         OMP_FOR_INCR, OMP_FOR_PRE_BODY): Use OMP_LOOP_CHECK instead of
1971         OMP_FOR_CHECK.
1972         (OMP_CLAUSE_DECL): Extend check range up to OMP_CLAUSE_MAP.
1973         (OMP_CLAUSE_LINEAR_STEP, OMP_CLAUSE_ALIGNED_ALIGNMENT,
1974         OMP_CLAUSE_NUM_TEAMS_EXPR, OMP_CLAUSE_DEVICE_ID,
1975         OMP_CLAUSE_DIST_SCHEDULE_CHUNK_EXPR, OMP_CLAUSE_SAFELEN_EXPR,
1976         OMP_CLAUSE_SIMDLEN_EXPR): Define.
1977         (enum omp_clause_depend_kind, enum omp_clause_map_kind,
1978         enum omp_clause_proc_bind_kind): New enums.
1979         (OMP_CLAUSE_DEPEND_KIND, OMP_CLAUSE_MAP_KIND,
1980         OMP_CLAUSE_PROC_BIND_KIND): Define.
1981         (struct tree_omp_clause): Add subcode.depend_kind, subcode.map_kind
1982         and subcode.proc_bind_kind.
1983         (find_omp_clause): New prototype.
1984         * omp-builtins.def (BUILT_IN_GOMP_CANCEL,
1985         BUILT_IN_GOMP_CANCELLATION_POINT): New built-ins.
1986         * tree-flow.h (find_omp_clause): Remove prototype.
1988 Copyright (C) 2013-2014 Free Software Foundation, Inc.
1990 Copying and distribution of this file, with or without modification,
1991 are permitted in any medium without royalty provided the copyright
1992 notice and this notice are preserved.