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