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