1 2015-05-18 Tom de Vries <tom@codesourcery.com>
3 PR tree-optimization/65637
4 * omp-low.c (expand_omp_for_static_chunk): Handle case that fin_bb has 2
7 2015-05-18 Tom de Vries <tom@codesourcery.com>
9 PR tree-optimization/65637
10 * omp-low.c (find_phi_with_arg_on_edge): New function.
11 (expand_omp_for_static_chunk): Fix inner loop phi.
13 2015-05-18 Tom de Vries <tom@codesourcery.com>
15 PR tree-optimization/65637
16 * omp-low.c (expand_omp_for_static_chunk): Fix gcc_assert for the case
19 2015-05-15 Cesar Philippidis <cesar@codesourcery.com>
21 * omp-low.c (scan_omp_for): Remove check for nested parallel and
24 2015-05-13 Bernd Schmidt <bernds@codesourcery.com>
26 * config/nvptx/nvptx-opts.h: New file.
27 * config/nvptx/nvptx.c (nvptx_file_start): Print the correct .target.
28 * config/nvptx/nvptx.h: Include "nvptx-opts.h".
30 (TARGET_SM35): New macro.
31 * config/nvptx/nvptx.md (atomic_fetch_<logic><mode>): Enable with the
33 * config/nvptx/nvptx.opt (ptx_isa, sm_30, sm_35): New enum and its
37 2015-05-13 Cesar Philippidis <cesar@codesourcery.com>
39 * except.c (finish_eh_generation): Don't finalize exeception
40 handlers for functions containing the "oacc function" attribute.
41 * omp-low.c (create_omp_child_function): Add an "oacc function"
42 attribute to acc regions.
44 * langhooks-def.h (lhd_omp_mappable_type): Add bool argument.
45 * langhooks.c (lhd_omp_mappable_type): Likewise, for the
47 * langhooks.h (struct lang_hooks_for_types): Add bool oacc
49 * gimplify.c (omp_notice_variable): Use it when calling the
50 omp_mappable_type langhook.
52 2015-05-13 Thomas Schwinge <thomas@codesourcery.com>
53 Bernd Schmidt <bernds@codesourcery.com>
54 Cesar Philippidis <cesar@codesourcery.com>
55 Chung-Lin Tang <cltang@codesourcery.com>
56 James Norris <jnorris@codesourcery.com>
57 Joseph Myers <joseph@codesourcery.com>
58 Julian Brown <julian@codesourcery.com>
59 Tom de Vries <tom@codesourcery.com>
62 (BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_INT_INT_INT_INT_INT_VAR):
64 (BT_FN_INT_INT_INT_INT)
65 (BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_INT_INT_INT_SIZE_INT_INT_VAR):
67 * builtins.c (expand_oacc_builtin, expand_oacc_ganglocal_ptr): New
69 (expand_builtin, is_simple_builtin): Use them.
70 * config/nvptx/mkoffload.c (process): Protect
71 GOMP_offload_register prototype from C++ name mangling.
72 * config/nvptx/nvptx.c (nvptx_file_start): Print declaration of
74 * config/nvptx/nvptx.md (UNSPEC_NCTAID, UNSPEC_CTAID)
75 (UNSPEC_SHARED_DATA): New constants.
76 (oacc_nctaid_insn, oacc_nctaid, oacc_ctaid_insn, oacc_ctaid)
77 (ganglocal_ptr<mode>, ganglocal_ptr): New patterns.
78 * doc/md.texi (oacc_ntid, oacc_tid): Document.
79 * gimple.h (gimple_statement_omp_parallel_layout): Add
80 ganglocal_size member.
81 (gimple_omp_target_ganglocal_size)
82 (gimple_omp_target_set_ganglocal_size): New functions.
83 * gimplify.c (gimplify_omp_var_data): Add GOVD_USE_DEVICE,
84 GOVD_FORCE_MAP, GOVD_GANGLOCAL.
85 (omp_region_type): Add ORT_HOST_DATA.
86 (omp_region_kind, acc_region_kind): New enum types.
87 (gimplify_omp_ctx): Add region_kind, acc_region_kind members.
88 (new_omp_context, omp_add_variable, omp_notice_variable)
89 (gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses_1): Update
91 (gimplify_scan_omp_clauses): Add region_kind formal parameter.
93 (gimplify_oacc_host_data_1, gimplify_oacc_host_data): New
95 (gimplify_expr): Update handling of OACC_HOST_DATA.
96 * omp-builtins.def (BUILT_IN_GOACC_KERNELS_INTERNAL)
97 (BUILT_IN_GOACC_KERNELS, BUILT_IN_GOACC_PARALLEL): Change type
98 from BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_INT_INT_INT_INT_INT_VAR
100 BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_INT_INT_INT_SIZE_INT_INT_VAR.
102 (BUILT_IN_GOACC_GET_THREAD_NUM, BUILT_IN_GOACC_GET_NUM_THREADS):
103 Change type from from BT_FN_INT to BT_FN_INT_INT_INT_INT. Adjust
105 (BUILT_IN_GOACC_NTID, BUILT_IN_GOACC_TID, BUILT_IN_GOACC_NCTAID)
106 (BUILT_IN_GOACC_CTAID, BUILT_IN_GOACC_GET_GANGLOCAL_PTR)
107 (BUILT_IN_GOACC_DEVICEPTR): New builtins.
108 * omp-low.c (omp_context): Add oacc_reduction_set, ganglocal_init,
109 ganglocal_ptr, ganglocal_size, ganglocal_size_host members.
110 (new_omp_context, delete_omp_context): Initialize/deinitialize
112 (omp_for_data): Add gang, worker, vector members.
113 (extract_omp_for_data): Populate these.
114 (oacc_max_threads, oacc_finalize_reduction_data): Rewrite
116 (is_oacc_parallel, oacc_parallel_max_reduction_array_size)
117 (align_and_expand, alloc_var_ganglocal, install_var_ganglocal)
118 (install_array_var_ganglocal)
119 (oacc_outermost_parallel_kernels_context, oacc_inside_routine)
120 (is_oacc_multithreaded, oacc_needs_global_memory)
121 (is_atomic_compatible_reduction, oacc_serial_reduction)
122 (oacc_process_reduction_data_helper): New functions.
123 (build_outer_var_ref, fixup_remapped_decl, scan_sharing_clauses)
124 (check_omp_nesting_restrictions, lower_rec_input_clauses)
125 (lower_reduction_clauses, oacc_initialize_reduction_data)
126 (oacc_process_reduction_data, lower_omp_target)
127 (lower_omp_regimplify_p): Update for OpenACC.
128 * tree-parloops.c (create_parallel_loop): For OpenACC, switch from
129 vector to gang parallelism.
130 * tree-pretty-print.c (dump_omp_clause): Handle
131 GOMP_MAP_FORCE_TO_GANGLOCAL.
133 2015-05-13 Bernd Schmidt <bernds@codesourcery.com>
135 * config/nvptx/mkoffload.c (enum Kind, struct Token, enum Vis)
136 (struct Stmt): Remove.
137 (read_file, tokenize, write_token, write_tokens, alloc_stmt)
138 (alloc_comment, append_stmt, rev_stmts, write_stmt, write_stmts)
139 (parse_insn, parse_list_nosemi, parse_init, parse_file): Remove
140 functions and macros.
141 (decls, vars, fns): Remove variables.
142 (maybe_unlink): Use save_temps rather than debug to keep files.
143 (tool_cleanup): Unlink ptx_cfile_name and ptx_name.
144 (read_file): Accept a pointer to a length and store into it.
145 (process): Don't try to parse the input file, just write it out as a
146 string, but looking for maps. Also write out the length.
147 (main): Don't use -S to compile ptx code. Add -lgomp. Add
148 COLLECT_MKOFFLOAD_OPTIONS. Scan for -fopenacc and produce an empty
149 image if it is not set. Scan for -save-temps.
150 * gcc.c (mkoffload_options): New static variable.
151 (display_help): Mention -Xoffload
152 (driver_handle_option): Handle it.
153 (add_mkoffload_option): New static function.
154 (set_collect_gcc_options): If offloading, set
155 COLLECT_MKOFFLOAD_OPTIONS.
156 * doc/invoke.texi (-Xoffload): Document.
157 * common.opt (Xoffload): New option.
158 * gcc.c (process_command): Use spec_machine rather than
159 spec_host_machine to build tooldir_prefix2.
161 2015-05-11 Thomas Schwinge <thomas@codesourcery.com>
162 Bernd Schmidt <bernds@codesourcery.com>
163 Cesar Philippidis <cesar@codesourcery.com>
164 Chung-Lin Tang <cltang@codesourcery.com>
165 James Norris <jnorris@codesourcery.com>
166 Joseph Myers <joseph@codesourcery.com>
167 Julian Brown <julian@codesourcery.com>
168 Tom de Vries <tom@codesourcery.com>
170 * gimplify.c (gimplify_scan_omp_clauses)
171 (gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_TILE.
172 (gimplify_expr): Don't verify OACC_KERNELS_COMBINED, and
173 OACC_PARALLEL_COMBINED.
174 * omp-low.c (scan_sharing_clauses): Handle OMP_CLAUSE_BIND,
175 OMP_CLAUSE_NOHOST, OMP_CLAUSE_TILE.
176 (check_omp_nesting_restrictions): Support GIMPLE_OMP_ATOMIC_LOAD,
177 GIMPLE_OMP_ATOMIC_STORE inside OpenACC contexts.
178 * tree-core.h (omp_clause_code): Add OMP_CLAUSE_BIND,
179 OMP_CLAUSE_NOHOST, OMP_CLAUSE_TILE, OMP_CLAUSE_DEVICE_TYPE.
180 * tree.c (omp_clause_num_ops, omp_clause_code_name, walk_tree_1):
182 * tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE_TILE.
183 * tree.h (OACC_KERNELS_COMBINED, OACC_PARALLEL_COMBINED): Remove
185 (OMP_CLAUSE_BIND_NAME, OMP_CLAUSE_TILE_LIST)
186 (OMP_CLAUSE_DEVICE_TYPE_DEVICES, OMP_CLAUSE_DEVICE_TYPE_CLAUSES):
189 2015-04-21 Tom de Vries <tom@codesourcery.com>
191 * builtin-attrs.def (DOT_DOT_r_r_r): Add DEF_ATTR_FOR_STRING.
192 (ATTR_FNSPEC_DOT_DOT_r_r_r_NOTHROW_LIST): Add DEF_ATTR_TREE_LIST.
193 * omp-builtins.def (BUILT_IN_GOACC_DATA_START)
194 (BUILT_IN_GOACC_ENTER_EXIT_DATA, BUILT_IN_GOACC_UPDATE): Use
195 DEF_GOACC_BUILTIN_FNSPEC instead of DEF_GOACC_BUILTIN.
197 * passes.def: Add pass_fre after pass_ch_oacc_kernels.
199 * passes.def: Add pass_scev_cprop to pass_oacc_kernels.
200 * tree-ssa-loop.c (pass_scev_cprop::clone): New function.
202 * passes.def: Add pass_parallelize_loops_oacc_kernels in pass group
204 * tree-parloops.c (create_parallel_loop, gen_parallel_loop): Add
205 function parameters region_entry and bool oacc_kernels_p. Handle
207 Call create_parallel_loop with additional args.
208 (parallelize_loops): Add function parameter oacc_kernels_p. Calculate
209 dominance info. Skip loops that are not in a kernels region. Call
210 gen_parallel_loop with additional args.
211 (pass_parallelize_loops::execute): Call parallelize_loops with false
213 (pass_data_parallelize_loops_oacc_kernels): New pass_data.
214 (class pass_parallelize_loops_oacc_kernels): New pass.
215 (pass_parallelize_loops_oacc_kernels::execute)
216 (make_pass_parallelize_loops_oacc_kernels): New function.
217 * tree-pass.h (make_pass_parallelize_loops_oacc_kernels): Declare.
219 * passes.def: Add pass_copy_prop to pass group pass_oacc_kernels.
220 * tree-ssa-copy.c (stmt_may_generate_copy): Handle .omp_data_i init
223 * passes.def: Add pass_lim in pass group pass_ch_oacc_kernels.
225 * passes.def: Run pass_tree_loop_init and pass_tree_loop_done in pass
226 group pass_oacc_kernels.
227 * tree-ssa-loop.c (pass_tree_loop_init::clone)
228 (pass_tree_loop_done::clone): New function.
230 * omp-low.c (loop_in_oacc_kernels_region_p): New function.
231 * omp-low.h (loop_in_oacc_kernels_region_p): Declare.
232 * passes.def: Add pass_ch_oacc_kernels to pass group pass_oacc_kernels.
233 * tree-pass.h (make_pass_ch_oacc_kernels): Declare
234 * tree-ssa-loop-ch.c: Include omp-low.h.
235 (pass_ch_execute): Declare.
236 (pass_ch::execute): Factor out ...
237 (pass_ch_execute): ... this new function. If handling oacc kernels,
238 skip loops that are not in oacc kernels region.
239 (pass_ch_oacc_kernels::execute):
240 (pass_data_ch_oacc_kernels): New pass_data.
241 (class pass_ch_oacc_kernels): New pass.
242 (pass_ch_oacc_kernels::execute, make_pass_ch_oacc_kernels): New
245 * passes.def: Add pass group pass_oacc_kernels.
246 * tree-pass.h (make_pass_oacc_kernels): Declare.
247 * tree-ssa-loop.c (gate_oacc_kernels): New static function.
248 (pass_data_oacc_kernels): New pass_data.
249 (class pass_oacc_kernels): New pass.
250 (make_pass_oacc_kernels): New function.
252 * omp-low.c: Include gimple-pretty-print.h.
253 (release_first_vuse_in_edge_dest): New function.
254 (expand_omp_target): When not in ssa, don't split off oacc kernels
255 region, clear PROP_gimple_eomp in cfun->curr_properties to force later
256 expanssion, and add GOACC_kernels_internal call.
257 When in ssa, split off oacc kernels and convert GOACC_kernels_internal
258 into GOACC_kernels call. Handle ssa-code.
259 (pass_data_expand_omp): Don't set PROP_gimple_eomp unconditionally in
260 properties_provided field.
261 (pass_expand_omp::execute): Set PROP_gimple_eomp in
262 cfun->curr_properties tentatively.
263 (pass_data_expand_omp_ssa): Add TODO_remove_unused_locals to
264 todo_flags_finish field.
265 (pass_expand_omp_ssa::execute): Release dangling SSA_NAMEs after calling
267 (gimple_stmt_ssa_operand_references_var_p)
268 (gimple_stmt_omp_data_i_init_p): New function.
269 * omp-low.h (gimple_stmt_omp_data_i_init_p): Declare.
270 * passes.def: Add pass_expand_omp_ssa after pass_fre. Add
271 pass_expand_omp_ssa after pass_all_early_optimizations.
272 * tree-ssa-ccp.c: Include omp-low.h.
273 (surely_varying_stmt_p, ccp_visit_stmt): Handle .omp_data_i init
275 * tree-ssa-forwprop.c: Include omp-low.h.
276 (pass_forwprop::execute): Handle .omp_data_i init conservatively.
277 * tree-ssa-sccvn.c: Include omp-low.h.
278 (visit_use): Handle .omp_data_i init conservatively.
279 * cgraph.c (cgraph_node::release_body): Don't release offloadable
282 * builtin-attrs.def (DOT_DOT_DOT_r_r_r): Add DEF_ATTR_FOR_STRING.
283 (ATTR_FNSPEC_DOT_DOT_DOT_r_r_r_NOTHROW_LIST): Add
285 * omp-builtins.def (BUILT_IN_GOACC_KERNELS_INTERNAL): Add
286 DEF_GOACC_BUILTIN_FNSPEC.
288 * builtins.def (DEF_GOACC_BUILTIN_FNSPEC): Define.
290 2015-03-21 Tom de Vries <tom@codesourcery.com>
292 PR tree-optimization/65460
293 * omp-low.c (expand_omp_target): Set parallelized_function on
294 cgraph_node for child_fn.
296 2015-03-21 Tom de Vries <tom@codesourcery.com>
299 2015-03-21 Tom de Vries <tom@codesourcery.com>
301 PR tree-optimization/65458
302 * cgraph.c (cgraph_node::dump): Handle parallelized_function field.
303 * cgraph.h (cgraph_node): Add parallelized_function field.
304 * lto-cgraph.c (lto_output_node): Write parallelized_function field.
305 (input_overwrite_node): Read parallelized_function field.
306 * omp-low.c (expand_omp_taskreg, finalize_task_copyfn): Set
307 parallelized_function on cgraph_node for child_fn.
308 * tree-parloops.c: Add include of plugin-api.h, ipa-ref.h and cgraph.h.
309 Remove include of gt-tree-parloops.h.
310 (parallelized_functions): Remove static variable.
311 (parallelized_function_p): Rewrite using parallelized_function field of
313 (create_loop_fn): Remove adding to parallelized_functions.
314 * Makefile.in (GTFILES): Remove tree-parloops.c
316 2015-03-21 Tom de Vries <tom@codesourcery.com>
319 2015-03-18 Tom de Vries <tom@codesourcery.com>
321 * tree-parloops.c (parallelize_loops): Make static.
322 * tree-parloops.h (parallelize_loops): Remove extern declaration.
324 2015-01-13 Thomas Schwinge <thomas@codesourcery.com>
326 * tree-core.h: Don't include "gomp-constants.h".
327 (struct tree_omp_clause): Change type of map_kind member from enum
328 gomp_map_kind to unsigned char.
329 * tree.h (OMP_CLAUSE_MAP_KIND): Cast it to enum gomp_map_kind.
330 (OMP_CLAUSE_SET_MAP_KIND): New macro.
331 * gimplify.c (gimplify_adjust_omp_clauses_1)
332 (gimplify_adjust_omp_clauses): Use OMP_CLAUSE_SET_MAP_KIND.
333 * omp-low.c (oacc_initialize_reduction_data): Likewise.
334 * tree-nested.c (convert_nonlocal_reference_stmt)
335 (convert_local_reference_stmt, convert_gimple_call): Likewise.
336 * tree-streamer-in.c (unpack_ts_omp_clause_value_fields):
339 * lto-streamer-out.c: Include "gomp-constants.h".
340 * tree-streamer-in.c: Likewise.
341 * tree-streamer-out.c: Likewise.
343 2015-01-12 Thomas Schwinge <thomas@codesourcery.com>
345 * tree-core.h (OMP_CLAUSE_MAP_ALLOC, OMP_CLAUSE_MAP_TO)
346 (OMP_CLAUSE_MAP_FROM, OMP_CLAUSE_MAP_TOFROM)
347 (OMP_CLAUSE_MAP_POINTER, OMP_CLAUSE_MAP_TO_PSET)
348 (OMP_CLAUSE_MAP_FORCE_ALLOC, OMP_CLAUSE_MAP_FORCE_TO)
349 (OMP_CLAUSE_MAP_FORCE_FROM, OMP_CLAUSE_MAP_FORCE_TOFROM)
350 (OMP_CLAUSE_MAP_FORCE_PRESENT, OMP_CLAUSE_MAP_FORCE_DEALLOC)
351 (OMP_CLAUSE_MAP_FORCE_DEVICEPTR, OMP_CLAUSE_MAP_LAST): Remove from
352 enum omp_clause_map_kind. Change all users to
353 include/gomp-constants.h's enum gomp_map_kind.
354 (enum omp_clause_map_kind): Remove.
356 2014-12-18 Thomas Schwinge <thomas@codesourcery.com>
358 * builtins.c (expand_builtin_acc_on_device): Fix logic error.
360 * config/i386/intelmic-offload.h: New file.
361 * config/nvptx/offload.h: Likewise.
362 * config.gcc <*-intelmic-*, *-intelmicemul-*, nvptx-*>: Point to
365 2014-12-18 Thomas Schwinge <thomas@codesourcery.com>
366 Jakub Jelinek <jakub@redhat.com>
368 * builtins.c (expand_builtin_acc_on_device): Use
369 do_compare_rtx_and_jump instead of emit_cmp_and_jump_insns.
371 * builtins.c (expand_builtin_acc_on_device): Make more RTXy.
373 2014-12-17 Thomas Schwinge <thomas@codesourcery.com>
374 Bernd Schmidt <bernds@codesourcery.com>
376 * tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_AUTO, and
378 * tree.c (omp_clause_num_ops, omp_clause_code_name, walk_tree_1):
380 * gimplify.c (gimplify_scan_omp_clauses)
381 (gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_AUTO,
382 OMP_CLAUSE_GANG, OMP_CLAUSE_SEQ, OMP_CLAUSE_VECTOR, and
384 * tree-pretty-print.c (dump_omp_clause): Likewise.
385 * omp-low.c (scan_sharing_clauses): Likewise.
386 (struct omp_context): Add gwv_below, and gwv_this members.
387 (enclosing_target_ctx, oacc_loop_or_target_p): New functions.
388 (scan_omp_for, scan_omp_target): Use those.
390 2014-12-17 Thomas Schwinge <thomas@codesourcery.com>
392 * tree-nested.c (convert_nonlocal_reference_stmt)
393 (convert_local_reference_stmt, convert_tramp_reference_stmt)
394 (convert_gimple_call) <GIMPLE_OMP_TARGET>: Use
395 is_gimple_omp_offloaded.
397 * omp-low.c (lower_reduction_clauses): Simplify OpenACC handling.
399 * gimple.h: Rename is_gimple_omp_oacc_specifically to
400 is_gimple_omp_oacc. Update all users.
402 * gimplify.c (enum omp_region_type): Restore ORT_TARGET_DATA and
403 ORT_TARGET. Update all users.
405 * doc/generic.texi (OpenMP): Move OpenACC stuff into...
406 (OpenACC): ... this new subsection.
408 * builtin-types.def: Remove BT_FN_VOID_INT_PTR_INT.
410 * oacc-builtins.def: Merge into omp-builtins.def. Update all users.
412 * builtins.c (expand_builtin_acc_on_device): Use
413 include/gomp-constants.h.
414 * omp-low.c (expand_omp_target, oacc_process_reduction_data)
415 (lower_omp_target): Likewise.
416 * tree-core.h (enum omp_clause_map_kind): Likewise.
418 * omp-low.c (build_omp_regions_1, make_gimple_omp_edges): Simplify
419 multi-line if conditions.
421 2014-12-10 Thomas Schwinge <thomas@codesourcery.com>
423 * omp-low.c (scan_omp_target): Remove taskreg_nesting_level and
424 target_nesting_level assertions.
425 (check_omp_nesting_restrictions): Rework OpenACC constructs
426 handling. Update and extend the relevant test cases.
428 2014-12-10 Thomas Schwinge <thomas@codesourcery.com>
429 Bernd Schmidt <bernds@codesourcery.com>
431 * gimple.def (GIMPLE_OACC_KERNELS, GIMPLE_OACC_PARALLEL): Merge
432 into GIMPLE_OMP_TARGET. Update all users.
434 2014-12-10 Thomas Schwinge <thomas@codesourcery.com>
436 * cgraphbuild.c (pass_build_cgraph_edges::execute): Remove
437 handling of GIMPLE_OACC_PARALLEL.
438 * gimple-pretty-print.c (dump_gimple_omp_target): Dump a bit more
439 data, pretty-printing.
441 * omp-low.c (build_omp_regions_1, make_gimple_omp_edges)
442 <GIMPLE_OMP_TARGET>: Handle
443 GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA the same as
444 GF_OMP_TARGET_KIND_OACC_UPDATE.
446 2014-11-13 Cesar Philippidis <cesar@codesourcery.com>
448 * omp-low.c (oacc_get_reduction_array_id): Fix whitespace.
450 2014-11-13 Cesar Philippidis <cesar@codesourcery.com>
452 * omp-low.c (omp_get_id): Rename to...
453 (oacc_get_reduction_array_id): ... this.
454 (lookup_oacc_reduction): ... this.
455 (lookup_reduction): Rename to...
456 (maybe_lookup_reduction): Rename to...
457 (maybe_lookup_oacc_reduction): ... this.
458 (scan_sharing_clauses): Update calls to renamed fns.
459 (lower_reduction_var_helper): Rename to...
460 (oacc_lower_reduction_var_helper): ... this.
461 (lower_reduction_clauses): Rename to...
462 (oacc_lower_reduction_clauses): ... this.
463 (omp_gimple_assign_with_ops): Rename to...
464 (oacc_gimple_assign_with_ops): ... this.
465 (initialize_reduction_data): Rename to ...
466 (oacc_initialize_reduction_data): ... this.
467 (finalize_reduction_data): Rename to...
468 (oacc_finalize_reduction_data): ... this.
469 (process_reduction_data): Rename to...
470 (oacc_process_reduction_data): ... this.
471 (lower_omp_target): Update calls to renamed fns.
473 2014-11-13 Thomas Schwinge <thomas@codesourcery.com>
475 * gimplify.c (gimplify_omp_workshare) <OACC_DATA, OACC_KERNELS,
476 OACC_PARALLEL>: Don't request ORT_TARGET_MAP_FORCE.
477 (enum gimplify_omp_var_data, enum omp_region_type): Remove
478 GOVD_MAP_FORCE, and ORT_TARGET_MAP_FORCE, respectively. Update
481 * omp-low.c (scan_sharing_clauses) <OMP_CLAUSE_MAP>: Revert
484 2014-11-12 Cesar Philippidis <cesar@codesourcery.com>
486 * tree.c (omp_clause_code_name): Add missing comma
487 after "_Cilk_for_count_".
489 2014-11-12 Thomas Schwinge <thomas@codesourcery.com>
491 * gimplify.c (gimplify_omp_for): Eliminate govd_private; always
494 * omp-low.c (scan_oacc_offload, expand_oacc_offload)
495 (lower_oacc_offload): Merge into scan_omp_target,
496 expand_omp_target, lower_omp_target, respectively. Update all
499 2014-11-11 Thomas Schwinge <thomas@codesourcery.com>
501 * omp-low.c (scan_sharing_clauses): Remove bogus assertion.
503 * omp-low.c (delete_omp_context): Dispose of reduction_map.
505 * omp-low.c (maybe_lookup_reduction): Don't require an OpenACC
507 (lower_oacc_offload): Simplify use of maybe_lookup_reduction.
509 * omp-low.c (lower_omp_target): Restore two gcc_asserts.
511 2014-11-06 Thomas Schwinge <thomas@codesourcery.com>
513 * gimple.h (is_gimple_omp_oacc_specifically): Return true for
514 GIMPLE_OMP_TARGET's GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA.
516 * omp-low.c (lower_reduction_clauses): Initialize tid.
518 2014-11-05 Thomas Schwinge <thomas@codesourcery.com>
520 * tree-core.h (enum omp_clause_code): Remove OMP_CLAUSE_HOST and
521 OMP_CLAUSE_OACC_DEVICE. Update all users.
523 * gimplify.c (gimplify_oacc_cache): New function.
524 (gimplify_expr): Use it for OACC_CACHE.
525 (gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses): Handle
528 * tree-core.h (enum omp_clause_code): Move OMP_NO_CLAUSE_CACHE
529 next to, and handle it like a data clause. Rename it to
530 OMP_CLAUSE__CACHE_. Update all users.
532 * invoke.texi: Update for OpenACC.
533 * sourcebuild.texi: Likewise.
535 * tree.def (OACC_WAIT): Remove. Update all users.
537 * omp-builtins.def (BUILT_IN_OMP_SET_NUM_THREADS): Remove.
539 2014-11-03 Cesar Philippidis <cesar@codesourcery.com>
541 * builtins.def (DEF_GOACC_BUILTIN): Revert erroneous checkin.
543 2014-11-03 Cesar Philippidis <cesar@codesourcery.com>
545 * oacc-builtins.def (BUILT_IN_GOACC_GET_NUM_THREADS): New built-in
547 (BUILT_IN_ACC_GET_DEVICE_TYPE): Likewise.
548 * omp-low.c (oacc_max_threads): New function.
549 (lower_reduction_clauses): Use the GOACC thread builtin functions to
550 determine the thread count. Handle multiple reduction variables.
551 (expand_omp_for_static_nochunk): Likewise.
552 (expand_omp_for_static_chunk): Likewise.
553 (finalize_reduction_data): General cleanups.
554 (process_reduction_data): Use acc_get_device_type to determine nthreads
557 2014-11-03 Cesar Philippidis <cesar@codesourcery.com>
559 * gimple.h (enum gf_mask): Add GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA.
560 * gimple-pretty-print.c (dump_gimple_omp_target): Handle it.
561 * gimplify.c (gimplify_scan_omp_clauses): Remove switch stmt which
562 declared OMP_CLAUSE_MAP_FORCE_DEALLOC as unimplemented.
563 (gimplify_omp_target_update): Handle OACC_ENTER_DATA and
565 (gimplify_expr): Shuffle around OACC_ENTER_DATA, OACC_EXIT_DATA and
567 * oacc-builtins.def (BUILD_INT_GOACC_ENTER_EXIT_DATA): New built-in
569 * omp-low.c (expand_omp_target): Handle
570 GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA. Don't use quick_push when
571 there is an unknown number of wait args.
572 (lower_omp_target): Handle GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA.
574 2014-10-24 James Norris <jnorris@codesourcery.com>
576 * builtin-types.def (BT_FN_VOID_INT_INT_VAR,
577 BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR_INT_INT_INT_INT_INT_VAR,
578 BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR_INT_INT_VAR): Add.
579 (BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR_INT_INT_INT): Remove.
580 * c-family/c-common.c (enum c_builtin_type, c_define_builtins): Remove
581 unused FUNCTION_TYPE_10. Add new FUNCTION_TYPE_VAR_8 and
582 FUNCTION_TYPE_VAR_12.
583 * c-family/c-pragma.c (oacc_pragmas): Add entry for wait directive.
584 * c/c-parser.c (c_parser_omp_clause_name): Add handling of wait and
586 (c_parser_oacc_wait_list, c_parser_oacc_clause_async,
587 c_parser_oacc_clause_wait): New.
588 (c_parser_oacc_all_clauses): Handle async and wait clauses.
589 (OACC_KERNELS_CLAUSE_MASK, OACC_PARALLEL_CLAUSE_MASK,
590 OACC_UPDATE_CLAUSE_MASK): Add async and wait clauses.
591 (OACC_WAIT_CLAUSE_MASK): New.
592 (c_parser_oacc_wait): New.
593 (c_parser_omp_construct): Handle wait directive.
594 * c/c-typeck.c (c_finish_omp_clauses): Handle async and wait clauses.
595 * fortran/f95-lang.c (gfc_init_builtin_functions): Remove unused
596 FUNCTION_TYPE_10. Add new FUNCTION_TYPE_VAR_2, FUNCTION_TYPE_VAR_8,
597 and FUNCTION_TYPE_VAR_12.
598 * fortran/types.def (BT_FN_VOID_INT_INT_VAR,
599 BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR_INT_INT_INT_INT_INT_VAR,
600 BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR_INT_INT_VAR): Add.
601 (BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR_INT_INT_INT): Remove.
602 * lto/lto-lang.c (enum lto_builtin_type, lto_define_builtins): Remove
603 unsigned FUNCTION_TYPE_10. Add new FUNCTION_TYPE_VAR_8 and
604 FUNCTION_TYPE_VAR_12.
605 * oacc-builtins.def (BUILT_IN_GOACC_KERNELS BUILT_IN_GOACC_PARALLEL,
606 BUILT_IN_GOACC_UPDATE, BUILT_IN_GOACC_WAIT): Change type.
607 * omp-low.c (scan_sharing_clauses): Handle async and wait clauses.
608 (expand_oacc_offload): Lower kernel directive and async and wait
611 2014-10-23 Thomas Schwinge <thomas@codesourcery.com>
613 * omp-low.c (finalize_reduction_data): Don't skip the reduction
614 variable's original value.
616 2014-10-20 Cesar Philippidis <cesar@codesourcery.com>
618 * gimplify.c (gimplify_scan_omp_clauses): Remove switch stmt which
619 declared OMP_CLAUSE_MAP_FORCE_DEALLOC as unimplemented.
620 (gimplify_expr): Remove OACC_WAIT, since it handled directly by the
623 2014-10-15 James Norris <jnorris@codesourcery.com>
625 * builtin-types.def (BT_FN_VOID_INT_PTR_INT): New type.
626 * oacc-builtins.def (BUILT_IN_GOACC_WAIT): New builtin.
628 2014-10-09 Thomas Schwinge <thomas@codesourcery.com>
630 * omp-low.c (process_reduction_data): Initialize variable inner.
632 2014-10-08 Cesar Philippidis <cesar@codesourcery.com>
634 * omp-low.c (lower_reduction_clauses): Clarify comment.
635 (process_reduction_data): Scan for nonempty bind statements at
636 the beginning of parallel blocks.
638 2014-09-23 Thomas Schwinge <thomas@codesourcery.com>
640 * builtins.def (DEF_GOACC_BUILTIN_COMPILER): New macro.
641 * oacc-builtins.def (BUILT_IN_GOACC_UPDATE): New builtin.
642 * builtins.c (expand_builtin_acc_on_device): New function.
643 (expand_builtin): Use it to handle BUILT_IN_ACC_ON_DEVICE.
644 (is_inexpensive_builtin): Handle BUILT_IN_ACC_ON_DEVICE.
646 2014-09-08 Thomas Schwinge <thomas@codesourcery.com>
648 * configure.ac (offload_targets): Remove.
649 * configure: Regenerate.
651 2014-09-05 Bernd Schmidt <bernds@codesourcery.com>
653 * configure.ac (enable-accelerator): Remove option.
654 (enable_accelerator): Don't subst.
655 * configure: Regenerate.
657 2014-09-03 Thomas Schwinge <thomas@codesourcery.com>
659 * omp-low.c (expand_oacc_offload): Add child_fn to offload_funcs.
661 2014-08-19 Ilya Verbin <ilya.verbin@intel.com>
663 * Makefile.in (GTFILES): Add omp-low.h.
664 * cgraphunit.c: Include omp-low.h.
665 (init_offload_var_table): New function.
666 (ipa_passes): Run ipa_write_summaries for target only when
667 offload_funcs or offload_vars is not empty.
668 * gengtype.c (ifiles): Add omp-low.h.
669 * lto/lto.c (read_cgraph_and_symbols): Call input_offload_tables.
670 * lto-cgraph.c: Include omp-low.h.
671 (output_offload_tables): New function.
672 (input_offload_tables): Likewise.
673 * lto-section-in.c (lto_section_name): Add offload_table.
674 * lto-streamer-out.c (lto_output): Call output_offload_tables.
675 * lto-streamer.h: Declare output_offload_tables
676 and input_offload_tables.
677 (lto_section_type): Add LTO_section_offload_table.
678 * omp-low.c: Define offload_funcs and offload_vars.
679 (expand_omp_target): Add child_fn to offload_funcs.
680 (omp_finish_file): Remove obsolete code.
681 * omp-low.h: Declare offload_funcs and offload_vars.
683 2014-08-04 Bernd Schmidt <bernds@codesourcery.com>
685 * Makefile.in (tool_prefix): Remove.
686 (unlibsubdir): Change depending on enable_as_accelerator.
687 (GCC_TARGET_INSTALL_NAME): Revert previous change.
688 (install_driver): Rework offloading changes.
689 * configure.ac (tool_prefix): Remove.
690 (enable-as-accelerator-for): Don't require --enable-as-accelerator.
691 Update the program_transform_name.
692 (offload_targets): Add 'g' modifier to sed script.
693 * configure: Regenerate.
695 2014-07-28 Cesar Philippidis <cesar@codesourcery.com>
697 * omp-low.c (get_base_type): New function.
698 (scan_sharing_clauses): Replace TREE_TYPE with get_base_type.
699 (lower_reduction_clauses): Use it.
700 (initialize_reduction_data): Likewise.
701 (finalize_reduction_data): Likewise. Remove new_var.
703 2014-07-28 Tom de Vries <tom@codesourcery.com>
705 * omp-low.c (process_reduction_data): Remove unused variables.
707 2014-07-24 Thomas Schwinge <thomas@codesourcery.com>
709 * omp-low.c (extract_omp_for_data): Force OpenACC loop to use a
712 * omp-low.c (expand_omp_for_static_chunk): Merge changes
713 previously applied to expand_omp_for_static_nochunk.
715 2014-07-14 Cesar Philippidis <cesar@codesourcery.com>
717 * omp-low.c (extract_omp_for_data): Likewise.
718 (expand_omp_for_static_nochunk): Likewise.
720 2014-07-14 Cesar Philippidis <cesar@codesourcery.com>
722 * omp-low.c (process_reduction_data): Check for new
723 binding level and skip for-loops which don't have a
726 2014-07-08 Cesar Philippidis <cesar@codesourcery.com>
727 Thomas Schwinge <thomas@codesourcery.com>
729 * omp-low.c (omp_get_id): New function.
730 (lookup_reduction): New function.
731 (maybe_lookup_reduction): New function.
732 (build_outer_var_ref): Remove openacc assert.
733 (new_omp_context): Preserve ctx->reduction_map.
734 (scan_sharing_clauses): Handle OMP_CLAUSE_REDUCTION.
735 (scan_oacc_offload): Initialize ctx->reduction_map.
736 (lower_reduction_clauses): Handle OpenACC reductions.
737 (omp_gimple_assign_with_ops): New function.
738 (initialize_reduction_data): New function.
739 (finalize_reduction_data): New function.
740 (process_reduction_data): New function.
741 (lower_oacc_offload): Handle reductions.
742 * gcc/omp-builtins.def (BUILT_IN_OMP_SET_NUM_THREADS): New.
744 2014-06-13 Thomas Schwinge <thomas@codesourcery.com>
745 Ilmir Usmanov <i.usmanov@samsung.com>
747 * tree-pretty-print.c (dump_omp_clause): Instead of
748 OMP_CLAUSE_DECL, use more specific accessors for some clauses.
750 2014-06-13 Thomas Schwinge <thomas@codesourcery.com>
751 Cesar Philippidis <cesar@codesourcery.com>
753 * omp-low.c (extract_omp_for_data, scan_sharing_clauses): For
754 OpenACC directives, the collapse(1) clause is supported.
756 2014-06-13 Cesar Philippidis <cesar@codesourcery.com>
758 * omp-low.c (scan_sharing_clauses): Preliminary support for
759 OMP_CLAUSE_PRIVATE for OpenACC.
761 * omp-low.c (scan_sharing_clauses): For clauses currently not
762 supported with OpenACC directives, emit a sorry message instead of
765 2014-06-12 Thomas Schwinge <thomas@codesourcery.com>
766 James Norris <jnorris@codesourcery.com>
768 * omp-low.c (scan_sharing_clauses): Allow OMP_CLAUSE_IF.
769 (expand_oacc_offload, expand_omp_target): Handle it.
771 2014-06-06 Thomas Schwinge <thomas@codesourcery.com>
772 James Norris <jnorris@codesourcery.com>
774 * gimple.h (enum gf_mask): Add GF_OMP_TARGET_KIND_OACC_UPDATE, and
775 extend mask size, GF_OMP_TARGET_KIND_MASK.
776 (is_gimple_omp_oacc_specifically): Handle
777 GF_OMP_TARGET_KIND_OACC_UPDATE.
778 * gimplify.c (gimplify_omp_target_update, gimplify_expr):
780 * gimple-pretty-print.c (dump_gimple_omp_target): Likewise.
781 * omp-low.c (scan_omp_target, expand_omp_target)
782 (build_omp_regions_1, lower_omp_target, lower_omp_1)
783 (make_gimple_omp_edges): Likewise.
784 * oacc-builtins.def (BUILT_IN_GOACC_UPDATE): New builtin.
786 2014-06-05 Thomas Schwinge <thomas@codesourcery.com>
788 * gimplify.c (gimplify_scan_omp_clauses)
789 (gimplify_adjust_omp_clauses): Handle
790 OMP_CLAUSE_MAP_FORCE_DEVICEPTR.
791 * omp-low.c (scan_sharing_clauses, lower_oacc_offload)
792 (lower_omp_target): Likewise.
793 * tree-core.h (enum omp_clause_map_kind)
794 <OMP_CLAUSE_MAP_FORCE_DEVICEPTR>: Update comment.
796 * gimplify.c (gimplify_scan_omp_clauses) <case OMP_CLAUSE_MAP>:
797 Don't block OMP_CLAUSE_MAP_FORCE_PRESENT.
799 2014-06-04 Thomas Schwinge <thomas@codesourcery.com>
801 * cgraphunit.c (ipa_passes, compile): Handle flag_openacc next to
803 * ipa-inline-analysis.c (inline_generate_summary): Likewise.
804 * lto-streamer.c (lto_streamer_init, gate_lto_out): Likewise.
805 * passes.c (ipa_write_summaries): Likewise.
807 2014-05-12 Bernd Schmidt <bernds@codesourcery.com>
809 * lto-wrapper.c (ompbegin): New static variable.
810 (find_ompbeginend): Renamed from find_ompend. Also look for
812 (run_gcc): Also use ompbegin.
814 2014-05-08 Thomas Schwinge <thomas@codesourcery.com>
816 * omp-low.c (get_offload_symbol_decl): Mark __OPENMP_TARGET__ as
819 2014-04-04 Bernd Schmidt <bernds@codesourcery.com>
821 * lto-wrapper.c (replace_special_characters): Remove functions and
824 * lto-section-names.h (OFFLOAD_VAR_TABLE_SECTION_NAME,
825 OFFLOAD_FUNC_TABLE_SECTION_NAME): Define.
826 * lto-wrapper.c (OFFLOAD_FUNC_TABLE_SECTION_NAME): Don't define.
827 (ompend): New static variable.
828 (copy_file, find_ompend): New static functions.
829 (run_gcc): Call find_ompend if we have offload images. Add its
830 return value to the output.
831 * omp-low.c: Include "lto-section-names.h".
832 (omp_finish_file): Initialize section names from macros defined there.
834 * omp-low.c (offload_symbol_decl): New static variable.
835 (get_offload_symbol_decl): New static function.
836 (expand_oacc_offload, expand_omp_target): Use it.
838 2014-04-02 Thomas Schwinge <thomas@codesourcery.com>
840 * omp-low.c (omp_finish_file): Use num_vars instead of num_funcs
841 when recording offload symbols v_vars.
843 * omp-low.c (expand_oacc_offload): Handle __OPENMP_TARGET__
846 2014-03-20 Bernd Schmidt <bernds@codesourcery.com>
848 Mostly by Michael Zolotukhin:
849 * lto-wrapper.c (OFFLOAD_FUNC_TABLE_SECTION_NAME,
850 OFFLOAD_TARGET_NAMES_ENV): New defines.
851 (offload_names): New static variable.
852 (free_array_of_ptrs, parse_env_var, access_check,
853 prepare_target_image, replace_special_characters,
854 compile_images_for_openmp_targets): New static functions.
855 (run_gcc): Determine whether offload sections are present. If so,
856 run compile_images_for_openmp_targets and print the image names.
858 * Makefile.in (COLLECT2_OBJS): Add collect-utils.o.
859 (LTO_WRAPPER_OBJS): New variable.
860 (lto-wrapper$(exeext)): Use it.
861 * collect2.c: Include "collect-utils.h".
862 (vflag, debug): Remove variables. Rename all uses of vflag to
864 (at_file_supplied): No longer static.
865 (tool_name): New variable.
866 (do_wait, fork_execute, maybe_unlink): Don't declare.
867 (tool_cleanup): Renamed from collect_atexit. New arg from_signal.
868 (collect_atexit): New static function.
869 (notice): Remove function.
870 (handler): Just call tool_cleanup.
871 (maybe_run_lto_and_relink, main, do_dsymutil): Add new arg to
873 (collect_wait, do_wait, collect_execute): Remove functions.
874 (maybe_unlink): No longer static.
875 * collect2.h (vflag, debug): Don't declare.
876 (at_file_supplied): Declare.
877 * collect-utils.c (utils_cleanup): New arg from_signal. All callers
879 (collect_execute): Replace with implementation from collect2, plus a
880 new arg use_atfile. All callers changed.
881 (collect_wait): Replace with implementation from collect2.
882 (maybe_unlink_file): Remove function.
883 (fork_execute): Replace with implementation from collect2, plus a
884 new arg use_atfile. All callers changed.
885 (do_wait): Add call to utils_cleanup to the error path.
886 * collect-utils.h (collect_execute, fork_execute, utils_cleanup,
887 tool_cleanup): Adjust declarations.
888 * lto-wrapper.c (tool_cleanup): Add unused bool argument.
889 * tlink.c: Include "collect-utils.h".
890 (tlink_execute): New arg use_atfile. All callers changed.
891 (tlink_init, tlink_execute): Remove declarations.
893 * Makefile.in (ALL_HOST_BACKEND_OBJS): Add collect-utils.o.
894 (lto-wrapper$(exeext)): Link with collect-utils.o.
895 * collect-utils.c: New file.
896 * collect-utils.h: New file.
897 * lto-wrapper.c: Include "collect-utils.h".
898 (args_name): Delete variable.
899 (tool_name): New variable.
900 (tool_cleanup): New function.
901 (maybe_unlink): Renamed from maybe_unlink_file. All callers changed.
902 (lto_wrapper_cleanup, fatal_signal, fatal, fatal_perror,
903 collect_execute, collect_wait, fork_execute): Remove functions.
905 Mostly by Michael Zolotukhin:
906 * omp-low.c: Include "common/common-target.h".
907 (expand_omp_target): Pass in address of __OPENMP_TARGET__.
908 (add_decls_addresses_to_decl_constructor, omp_finish_file): New
910 * omp-low.h (omp_finish_file): Declare.
911 * toplev.c: Include "omp-low.h".
912 (compile_file): Call omp_finish_file.
913 * target.def (record_offload_symbol): New hook.
914 * doc/tm.texi.in (TARGET_RECORD_OFFLOAD_SYMBOL): Add.
915 * doc/tm.texi: Regenerate.
916 * configure.ac (ENABLE_OFFLOADING): Define if we have offload_targets.
917 * configure: Regenerate.
918 * config.in: Regenerate.
920 * config/darwin.c: Include "lto-section-names.h".
921 (LTO_SEGMENT_NAME): Don't define.
922 * config/i386/winnt.c: Include "lto-section-names.h".
923 * lto-streamer.c: Include "lto-section-names.h".
924 * lto-streamer.h (LTO_SECTION_NAME_PREFIX, OMP_SECTION_NAME_PREFIX):
926 (section_name_prefix): Don't declare.
927 * lto-wrapper.c: Include "lto-section-names.h".
928 (LTO_SECTION_NAME_PREFIX): Don't define.
929 * lto-section-names.h: New file.
930 * cgraphunit.c: Include "lto-section-names.h".
932 * configure.ac (real_target_noncanonical, tool_prefix,
933 accel_dir_suffix, offload_targets): Compute new variables.
934 (--enable-as-accelerator-for, --enable-as-accelerator,
935 --enable-offload-targets): New options.
936 * configure: Regenerate.
937 * config.in: Regenerate.
938 * Makefile.in (real_target_noncanonical, tool_prefix,
939 accel_dir_suffix, enable_as_accelerator): New variables substituted
941 (libsubdir, libexecsubdir, GCC_TARGET_INSTALL_NAME): Tweak for the
942 possibility of being configured as an offload compiler.
943 (install_driver): Likewise.
944 (DRIVER_DEFINES): Pass new defines DEFAULT_REAL_TARGET_MACHINE and
946 * gcc.c (spec_host_machine, accel_dir_suffix): New variables.
947 (process_command): Tweak path construction for the possibility
948 of being configured as an offload compiler.
949 (main): Likewise. Look up specs in just_machine_suffix only if not
950 ACCEL_COMPILER. Construct OFFLOAD_TARGET_NAMES environment variable
951 if we have OFFLOAD_TARGETS.
953 2014-03-20 Thomas Schwinge <thomas@codesourcery.com>
955 * gimple.h (enum gf_mask): Add GF_OMP_FOR_KIND_OACC_LOOP.
956 (is_gimple_omp_oacc_specifically): Handle it.
957 * gimple-pretty-print.c (dump_gimple_omp_for): Likewise.
958 * gimple.def (GIMPLE_OMP_FOR): Update for OpenACC loop.
959 * gimple.c (gimple_build_omp_for): Don't explicitly mention some
961 (gimple_copy) <GIMPLE_OMP_FOR>: Handle GF_OMP_FOR_KIND_OACC_LOOP.
962 * omp-low.c (extract_omp_for_data, scan_sharing_clauses)
963 (check_omp_nesting_restrictions, lower_rec_input_clauses)
964 (lower_lastprivate_clauses, lower_reduction_clauses)
965 (expand_omp_for_generic, expand_omp_for_static_nochunk)
966 (expand_omp_for_static_chunk, maybe_add_implicit_barrier_cancel)
967 (lower_omp_for): Likewise.
968 * tree-inline.c (remap_gimple_stmt): Likewise.
969 * tree-nested.c (walk_gimple_omp_for)
970 (convert_nonlocal_reference_stmt, convert_local_reference_stmt)
971 (convert_gimple_call): Likewise.
972 * doc/gimple.texi (GIMPLE_OMP_FOR): Don't explicitly mention some
974 * gimplify.c (gimplify_omp_for, gimplify_expr): Handle OACC_LOOP.
976 * tree.def (OACC_LOOP): Sort after OMP_DISTRIBUTE.
977 * tree.h (OMP_LOOP_CHECK): Update accordingly.
978 * gimplify.c (is_gimple_stmt): Sort OACC_LOOP after
980 * tree-pretty-print.c (dump_generic_node): Likewise.
981 * doc/generic.texi (OACC_LOOP): Sort after OACC_HOST_DATA.
982 (OMP_FOR): Fix and extend for OACC_LOOP.
984 * gimple.h (enum gf_mask): Add and use GF_OMP_FOR_SIMD.
985 * omp-low.c: Update accordingly.
987 * gimple.h (enum gf_mask): Rewrite "<< 0" shift expressions used
988 for GF_OMP_FOR_KIND_MASK, GF_OMP_FOR_KIND_FOR,
989 GF_OMP_FOR_KIND_DISTRIBUTE, GF_OMP_FOR_KIND_SIMD,
990 GF_OMP_FOR_KIND_CILKSIMD, GF_OMP_TARGET_KIND_MASK,
991 GF_OMP_TARGET_KIND_REGION, GF_OMP_TARGET_KIND_DATA,
992 GF_OMP_TARGET_KIND_UPDATE, GF_OMP_TARGET_KIND_OACC_DATA.
994 * omp-low.c (check_omp_nesting_restrictions): Allow nesting of
995 OpenACC constructs inside of OpenACC data constructs.
997 2014-03-18 Ilmir Usmanov <i.usmanov@samsung.com>
999 * tree.def (OACC_LOOP): New tree code.
1000 * tree-pretty-print.c (dump_generic_node): Show it.
1001 * tree.h (OACC_KERNELS_COMBINED, OACC_PARALLEL_COMBINED): New macros.
1002 * doc/generic.texi: Document loop directive.
1003 * gimplify.c (is_gimple_stmt, gimplify_expr): Stub gimplification of
1004 loop directive and combined directives.
1006 2014-03-18 Thomas Schwinge <thomas@codesourcery.com>
1009 (BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR_INT_INT_INT): New type.
1010 * oacc-builtins.def (BUILT_IN_GOACC_KERNELS)
1011 (BUILT_IN_GOACC_PARALLEL): Switch to that one.
1012 * gimplify.c (gimplify_scan_omp_clauses)
1013 (gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_NUM_GANGS,
1014 OMP_CLAUSE_NUM_WORKERS, OMP_CLAUSE_VECTOR_LENGTH.
1015 * omp-low.c (scan_sharing_clauses, expand_oacc_offload): Likewise.
1017 2014-03-13 Thomas Schwinge <thomas@codesourcery.com>
1019 * tree.h (OMP_CLAUSE_VECTOR_EXPR): Check for OMP_CLAUSE_VECTOR
1020 instead of OMP_CLAUSE_VECTOR_LENGTH.
1021 (OMP_WAIT_EXPR): Rename to OMP_CLAUSE_WAIT_EXPR. Change
1024 2014-03-13 Thomas Schwinge <thomas@codesourcery.com>
1026 * omp-low.c (create_omp_child_function): Use
1027 is_gimple_omp_offloaded when looking for offloaded regions.
1029 2014-03-12 Thomas Schwinge <thomas@codesourcery.com>
1031 * omp-low.c (scan_sharing_clauses): Move offloaded logic into...
1032 * gimple.h (is_gimple_omp_offloaded): ... this new static inline
1035 2014-02-28 Thomas Schwinge <thomas@codesourcery.com>
1037 * gimple.def (GIMPLE_OACC_KERNELS): New code.
1038 * doc/gimple.texi: Document it.
1039 * gimple.h (gimple_has_substatements, CASE_GIMPLE_OMP)
1040 (is_gimple_omp_oacc_specifically): Handle it.
1041 (gimple_statement_oacc_kernels): New struct.
1042 (gimple_build_oacc_kernels): New prototype.
1043 (gimple_oacc_kernels_clauses, gimple_oacc_kernels_clauses_ptr)
1044 (gimple_oacc_kernels_set_clauses, gimple_oacc_kernels_child_fn)
1045 (gimple_oacc_kernels_child_fn_ptr)
1046 (gimple_oacc_kernels_set_child_fn, gimple_oacc_kernels_data_arg)
1047 (gimple_oacc_kernels_data_arg_ptr)
1048 (gimple_oacc_kernels_set_data_arg): New inline functions.
1049 * gimple.c (gimple_build_oacc_kernels): New function.
1050 (gimple_copy): Handle GIMPLE_OACC_KERNELS.
1051 * gimple-low.c (lower_stmt): Likewise.
1052 * gimple-walk.c (walk_gimple_op, walk_gimple_stmt): Likewise.
1053 * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
1054 (dump_gimple_oacc_parallel): Rename to dump_gimple_oacc_offload.
1055 Also handle GIMPLE_OACC_KERNELS. Update all callers.
1056 * gimplify.c (gimplify_omp_workshare, gimplify_expr): Handle
1058 * oacc-builtins.def (BUILT_IN_GOACC_KERNELS): New builtin.
1059 * omp-low.c (scan_oacc_parallel, expand_oacc_parallel)
1060 (lower_oacc_parallel): Rename to scan_oacc_offload,
1061 expand_oacc_offload, and lower_oacc_offload. Also handle
1062 GIMPLE_OACC_KERNELS. Update all callers.
1063 (scan_sharing_clauses, scan_omp_1_stmt, expand_omp, lower_omp_1)
1064 (diagnose_sb_0, diagnose_sb_1, diagnose_sb_2)
1065 (make_gimple_omp_edges): Handle GIMPLE_OACC_KERNELS.
1066 * tree-inline.c (remap_gimple_stmt, estimate_num_insns): Likewise.
1067 * tree-nested.c (convert_nonlocal_reference_stmt)
1068 (convert_local_reference_stmt, convert_tramp_reference_stmt)
1069 (convert_gimple_call): Likewise.
1071 2014-02-27 Thomas Schwinge <thomas@codesourcery.com>
1073 * gimplify.c (gimplify_oacc_parallel): Merge into
1074 gimplify_omp_workshare. Update all callers.
1076 2014-02-27 Ilmir Usmanov <i.usmanov@samsung.com>
1078 Fix OpenACC ASYNC clause: it cannot contain integer-expression-list.
1081 * tree.h (OMP_CLAUSE_ASYNC_EXPR): Reorder.
1082 * tree.c (omp_clause_num_ops, omp_clause_code_name): Reorder clauses.
1083 * tree-core.h (enum omp_clause_code): Likewise.
1084 * omp-low.c (scan_sharing_clauses): Likewise.
1085 * gimplify.c (gimplify_scan_omp_clauses): Likewise.
1087 2014-02-21 Thomas Schwinge <thomas@codesourcery.com>
1089 * gimple.h (enum gf_mask): Add GF_OMP_TARGET_KIND_OACC_DATA.
1090 (is_gimple_omp_oacc_specifically): Handle it.
1091 * gimple-pretty-print.c (dump_gimple_omp_target): Likewise.
1092 * gimplify.c (gimplify_omp_workshare, gimplify_expr): Likewise.
1093 * omp-low.c (scan_sharing_clauses, scan_omp_target)
1094 (expand_omp_target, lower_omp_target, lower_omp_1): Likewise.
1095 * gimple.def (GIMPLE_OMP_TARGET): Update comment.
1096 * gimple.c (gimple_build_omp_target): Likewise.
1097 (gimple_copy): Catch unimplemented case.
1098 * tree-inline.c (remap_gimple_stmt): Likewise.
1099 * tree-nested.c (convert_nonlocal_reference_stmt)
1100 (convert_local_reference_stmt, convert_gimple_call): Likewise.
1101 * oacc-builtins.def (BUILT_IN_GOACC_DATA_START)
1102 (BUILT_IN_GOACC_DATA_END): New builtins.
1104 * omp-low.c (scan_sharing_clauses): Catch unexpected occurrences
1105 of OMP_CLAUSE_TO, OMP_CLAUSE_FROM, OMP_CLAUSE_MAP.
1107 * gimplify.c (enum omp_region_type): Make ORT_TARGET_OFFLOAD a
1108 flag for ORT_TARGET, in its negation replacing ORT_TARGET_DATA.
1111 * omp-low.c (gimple_code_is_oacc): Move to...
1112 * gimple.h (is_gimple_omp_oacc_specifically): ... here. Update
1113 users, and also use it in more places where currently we've only
1114 been checking for GIMPLE_OACC_PARALLEL.
1116 2014-02-18 Thomas Schwinge <thomas@codesourcery.com>
1118 * omp-low.c (diagnose_sb_0, diagnose_sb_1, diagnose_sb_2): Handle
1119 GIMPLE_OACC_PARALLEL.
1120 * gimplify.c (gimplify_case_label_expr): Update comment.
1122 * omp-low.c (diagnose_sb_0): Generalize detection which kind of
1123 structured block we're in.
1125 2014-02-17 Thomas Schwinge <thomas@codesourcery.com>
1127 * tree-core.h (omp_clause_code) <map>: Mention pcopy, pcopyin,
1128 pcopyout, pcreate OpenACC clauses.
1130 2014-02-14 Ilmir Usmanov <i.usmanov@samsung.com>
1131 Dmitry Bocharnikov <dmitry.b@samsung.com>
1132 Evgeny Gavrin <e.gavrin@samsung.com>
1134 Add OpenACC 1.0 support to GENERIC, except loop directive and subarrays.
1137 * gimplify.c (is_gimple_stmt, gimplify_scan_omp_clauses,
1138 implify_adjust_omp_clauses, gimplify_expr): Stub OpenACC directives
1140 * omp-low.c (scan_sharing_clauses): Likewise.
1141 (gimple_code_is_oacc): New helper function.
1142 (scan_sharing_clauses): Use it.
1143 * tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_HOST,
1144 OMP_CLAUSE_OACC_DEVICE, OMP_CLAUSE_DEVICE_RESIDENT,
1145 OMP_CLAUSE_USE_DEVICE, OMP_CLAUSE_GANG, OMP_CLAUSE_WAIT,
1146 OMP_NO_CLAUSE_CACHE, OMP_CLAUSE_INDEPENDENT, OMP_CLAUSE_ASYNC,
1147 OMP_CLAUSE_WORKER, OMP_CLAUSE_VECTOR, OMP_CLAUSE_NUM_GANGS,
1148 OMP_CLAUSE_NUM_WORKERS and OMP_CLAUSE_VECTOR_LENGTH clauses.
1149 * tree-pretty-print.c (dump_omp_clause): Print OpenACC clause.
1150 (dump_generic_node): Print OpenACC directives and its clauses.
1151 * tree.c (omp_clause_num_ops, omp_clause_code_name,
1152 walk_tree_1): Add OpenACC clauses.
1153 * tree.def (OACC_KERNELS, OACC_DATA, OACC_HOST_DATA, OACC_DECLARE,
1154 OACC_UPDATE, OACC_ENTER_DATA, OACC_EXIT_DATA, OACC_WAIT,
1155 OACC_CACHE): New tree node.
1156 * tree.h (OACC_KERNELS_BODY, OACC_KERNELS_CLAUSES,
1157 OACC_CLAUSE_NUM_GANGS_EXPR, OMP_CLAUSE_NUM_WORKERS_EXPR,
1158 OMP_CLAUSE_VECTOR_LENGTH_EXPR, OMP_CLAUSE_VECTOR_EXPR,
1159 OMP_CLAUSE_WORKER_EXPR, OMP_CLAUSE_GANG_EXPR, OMP_CLAUSE_ASYNC_EXPR,
1160 OMP_WAIT_EXPR, OACC_DATA_BODY, OACC_DATA_CLAUSES, OACC_DECLARE_CLAUSES,
1161 OACC_UPDATE_CLAUSES, OACC_WAIT_CLAUSES, OACC_CACHE_CLAUSES,
1162 OACC_HOST_DATA_BODY, OACC_HOST_DATA_CLAUSES): New macros.
1164 * generic.texi: Document OACC_KERNELS, OACC_DATA, OACC_HOST_DATA,
1165 OACC_DECLARE, OACC_UPDATE, OACC_ENTER_DATA, OACC_EXIT_DATA, OACC_WAIT,
1168 2014-02-07 Ilya Tocar <ilya.tocar@intel.com>
1170 * ipa-inline-analysis.c (inline_free_summary): Always remove
1173 2014-01-28 Thomas Schwinge <thomas@codesourcery.com>
1175 * tree-core.h (omp_clause_code): Update description for
1178 * tree-core.h (omp_clause_map_kind): Add OMP_CLAUSE_MAP_FORCE,
1179 OMP_CLAUSE_MAP_FORCE_ALLOC, OMP_CLAUSE_MAP_FORCE_TO,
1180 OMP_CLAUSE_MAP_FORCE_FROM, OMP_CLAUSE_MAP_FORCE_TOFROM,
1181 OMP_CLAUSE_MAP_FORCE_PRESENT, OMP_CLAUSE_MAP_FORCE_DEALLOC, and
1182 OMP_CLAUSE_MAP_FORCE_DEVICEPTR.
1183 * tree-pretty-print.c (dump_omp_clause): Handle these.
1184 * gimplify.c (gimplify_omp_var_data): Add GOVD_MAP_FORCE.
1185 (omp_region_type): Add ORT_TARGET_MAP_FORCE.
1186 (omp_add_variable, omp_notice_threadprivate_variable)
1187 (omp_notice_variable, gimplify_scan_omp_clauses)
1188 (gimplify_adjust_omp_clauses_1): Extend accordingly.
1189 (gimplify_oacc_parallel): Add ORT_TARGET_MAP_FORCE to ORT_TARGET
1191 * omp-low.c (install_var_field, scan_sharing_clauses)
1192 (lower_oacc_parallel, lower_omp_target): Extend accordingly.
1194 * tree-core.h (omp_clause_map_kind): Make the identifiers' bit
1195 patterns more obvious. Add comments.
1196 * omp-low.c (lower_oacc_parallel, lower_omp_target): Test for
1197 omp_clause_map_kind flags set instead of for values.
1199 * gimplify.c (gimplify_call_expr, gimplify_modify_expr)
1200 (omp_firstprivatize_variable, omp_notice_threadprivate_variable)
1201 (omp_notice_variable, gimplify_adjust_omp_clauses)
1202 (gimplify_omp_workshare): Treat ORT_TARGET as a flag, not as a
1205 2013-12-18 Thomas Schwinge <thomas@codesourcery.com>
1207 * omp-low.c (lower_oacc_parallel): Switch kinds array to unsigned
1208 short, and shift alignment description to begin at bit 8.
1210 2013-12-04 Thomas Schwinge <thomas@codesourcery.com>
1212 * gimple.h (is_a_helper): Handle GIMPLE_OACC_PARALLEL.
1214 2013-11-30 Balaji V. Iyer <balaji.v.iyer@intel.com>
1216 * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen):
1217 Removed a carriage return from the warning string.
1219 2013-11-21 Jakub Jelinek <jakub@redhat.com>
1221 * config/i386/i386.c (ix86_cilkplus_default_vecsize_mangle,
1222 ix86_cilkplus_vecsize_for_mangle): Remove.
1223 (ix86_simd_clone_compute_vecsize_and_simdlen,
1224 ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions.
1225 (TARGET_CILKPLUS_DEFAULT_VECSIZE_MANGLE,
1226 TARGET_CILKPLUS_VECSIZE_FOR_MANGLE): Remove.
1227 (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN,
1228 TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define.
1229 * omp-low.c (class argno_map): Remove.
1230 (argno_map::argno_map): Remove.
1231 (simd_clone_vector_of_formal_parm_types): New function.
1232 (simd_clone_struct_alloc): Use struct cgraph_simd_clone
1233 instead of struct simd_clone and struct cgraph_simd_clone_arg
1234 instead of struct simd_clone_arg.
1235 (simd_clone_struct_copy): Likewise.
1236 (simd_clone_clauses_extract): Likewise. Return struct
1237 cgraph_simd_clone *, don't change anything in node.
1238 Use simd_clone_vector_of_formal_parm_types instead of argno_map.
1239 Fail if ignoring linear step.
1240 (vecsize_mangle): Remove.
1241 (simd_clone_compute_base_data_type): Add clone_info argument.
1242 Use simd_clone_vector_of_formal_parm_types instead of argno_map.
1243 (simd_clone_compute_vecsize_and_simdlen): Remove.
1244 (simd_clone_mangle): Remove new_node argument, add clone_info
1245 argument, return the identifier rather than changing anything in
1246 node. If mangled name doesn't already exist among simd clones,
1248 (simd_clone_create): Handle !old_node->definition case, don't
1249 ICE if cgraph_function_versioning fails.
1250 (simd_clone_adjust_return_type): Handle simdlens larger than
1251 what can be returned or passed in hw register. Handle
1253 (simd_clone_adjust_argument_types): Likewise. Use
1254 ipa_get_vector_of_formal_parms or
1255 simd_clone_vector_of_formal_parm_types instead of argno_map.
1256 (simd_clone_init_simd_arrays): Handle simdlens larger than
1257 what can be passed in hw register.
1258 (ipa_simd_modify_function_body): Likewise. Call walk_gimple_op
1259 also on GIMPLE_RETURN.
1260 (simd_clone_adjust): Call targetm.simd_clone.adjust. Create
1261 PHI for the iter, rather than waiting for into ssa. Handle
1262 aligned clause on uniform pointer arguments. Handle linear
1264 (expand_simd_clones): Don't do anything if noclone attribute
1265 is present. Ignore non-prototype C declarations. Rewritten to
1266 only clone if it is possible and desirable to create the simd clone.
1267 Use new target simd_clone hooks to drive the process, allow
1268 creating more than two clones. Handle !node->definition cloning.
1269 (ipa_omp_simd_clone): Use FOR_EACH_FUNCTION instead of
1270 FOR_EACH_DEFINED_FUNCTION.
1271 (pass_omp_simd_clone::gate): Return true also for flag_openmp_simd.
1272 * ipa-cp.c (determine_versionability): Use simd_clones field instead
1273 of has_simd_clones. Also fail if node->simdclone is non-NULL.
1274 (initialize_node_lattices): Set disable = true for simd clones.
1275 * cgraph.c (get_simd_clone): Remove.
1276 * ipa.c (symtab_remove_unreachable_nodes): If node with simd clones
1277 is kept, keep also the simd clones.
1278 * ipa-prop.h (ipa_get_vector_of_formal_parm_types): New prototype.
1279 * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ...
1280 (ipa_get_vector_of_formal_parm_types): ... this. No longer static.
1281 (ipa_modify_formal_parameters): Adjust caller.
1282 * target.def (TARGET_CILKPLUS_DEFAULT_VECSIZE_MANGLE,
1283 TARGET_CILKPLUS_VECSIZE_FOR_MANGLE): Remove.
1284 (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN,
1285 TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target
1287 * tree-vect-data-refs.c (vect_analyze_data_refs): Use simd_clones
1288 field instead of has_simd_clones.
1289 * target.h (struct cgraph_node, struct cgraph_simd_node): Declare.
1290 * doc/tm.texi.in (TARGET_CILKPLUS_DEFAULT_VECSIZE_MANGLE,
1291 TARGET_CILKPLUS_VECSIZE_FOR_MANGLE): Remove.
1292 (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN,
1293 TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add.
1294 * doc/tm.texi: Regenerated.
1295 * cgraph.h (enum simd_clone_arg_type): Rename to ...
1296 (enum cgraph_simd_clone_arg_type): ... this. Add
1297 SIMD_CLONE_ARG_TYPE_MASK.
1298 (struct simd_clone_arg): Rename to ...
1299 (struct cgraph_simd_clone_arg): ... this. Add orig_type and
1300 vector_type fields. Adjust arg_type field's type.
1301 (struct simd_clone): Rename to ...
1302 (struct cgraph_simd_clone): ... this. Remove hw_vector_size
1303 field. Add vecsize_int, vecsize_float, prev_clone, next_clone
1304 and origin fields. Adjust args field's type.
1305 (struct cgraph_node): Adjust simdclone field's type. Remove
1306 simdclone_of and has_simd_clones fields. Add simd_clones field.
1307 (get_simd_clone): Remove prototype.
1308 * tree-vect-stmts.c (vectorizable_simd_clone_call): Use simd_clones
1309 field instead of has_simd_clones, improve walking of simd clones,
1310 handle arguments and/or return types larger than corresponding
1311 ISA hw vector size, use targetm.simd_clone.usable hook.
1313 2013-11-21 Ilya Tocar <ilya.tocar@intel.com>
1315 * cgraph.h (symtab_node): Add need_dump.
1316 * cgraphunit.c (ipa_passes): Run ipa_write_summaries for omp.
1317 (compile): Intialize streamer for omp.
1318 * ipa-inline-analysis.c (inline_generate_summary): Add flag_openmp.
1319 * lto-cgraph.c (lto_set_symtab_encoder_in_partition): Respect
1321 (select_what_to_dump): New.
1322 * lto-streamer.c (section_name_prefix): New.
1323 (lto_get_section_name): Use section_name_prefix.
1324 (lto_streamer_init): Add flag_openmp.
1325 * lto-streamer.h (OMP_SECTION_NAME_PREFIX): New.
1326 (section_name_prefix): Ditto.
1327 (select_what_to_dump): Ditto.
1328 * lto/lto-partition.c (add_symbol_to_partition_1): Set need_dump.
1329 (lto_promote_cross_file_statics): Dump everyhtinh.
1330 * passes.c (ipa_write_summaries): Add parameter,
1331 call select_what_to_dump.
1332 * tree-pass.h (void ipa_write_summaries): Add parameter.
1334 2013-11-15 Jakub Jelinek <jakub@redhat.com>
1336 * tree-vect-stmts.c (vectorizable_simd_clone_call): Avoid
1337 -Wsign-compare warning.
1339 2013-11-12 Aldy Hernandez <aldyh@redhat.com>
1341 * ipa-prop.h (enum ipa_parm_op): Adjust comment to IPA_PARM_OP_NEW
1344 2013-11-12 Aldy Hernandez <aldyh@redhat.com>
1346 * ipa-prop.c (ipa_modify_expr): Pass expr by address.
1347 (ipa_get_adjustment_candidate): Add another level of indirection
1348 to expr. Adjust comment.
1349 (ipa_get_adjustment_candidate): Add another level of indirection
1352 2013-11-11 Aldy Hernandez <aldyh@redhat.com>
1354 * ipa-prop.c (get_ssa_base_param): New.
1355 * ipa-prop.h (ipa_modify_expr): Rename from ipa_sra_modify_expr.
1356 Remove ipa_sra_modify_function_body.
1357 (ipa_get_adjustment_candidate): Rename from
1358 sra_ipa_get_adjustment_candidate.
1359 * omp-low.c (ipa_simd_modify_stmt_ops): Rename
1360 sra_ipa_get_adjustment_candidate to ipa_get_adjustment_candidate.
1361 * tree-sra.c (get_ssa_base_param): Remove default_def argument.
1362 (create_access): Remove lass argument to get_ssa_base_param.
1363 (disqualify_base_of_expr): Same.
1364 (sra_ipa_get_adjustment_candidate): Rename to
1365 ipa_get_adjustment_candidate and move to ipa-prop.c.
1366 (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to
1368 (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to
1370 (ipa_sra_modify_function_body): Same.
1372 2013-11-11 Jakub Jelinek <jakub@redhat.com>
1374 * tree-vect-data-refs.c (vect_analyze_data_refs): Check loop->safelen
1375 rather than loop->simdlen.
1376 * tree-vect-stmts.c (vectorizable_simd_clone_call): Likewise.
1378 2013-11-08 Aldy Hernandez <aldyh@redhat.com>
1380 * ipa-prop.c (ipa_modify_formal_parameters): Remove
1381 synth_parm_prefix argument.
1382 Use operator enum instead of bit fields.
1383 Add assert for properly handling vector of references.
1384 (ipa_modify_call_arguments): Use operator enum instead of bit
1386 (ipa_combine_adjustments): Same.
1387 Assert that IPA_PARM_OP_NEW is not used.
1388 (ipa_dump_param_adjustments): Rename reduction to new_decl.
1389 Use operator enum instead of bit fields.
1390 * ipa-prop.h (enum ipa_parm_op): New.
1391 (struct ipa_parm_adjustment): New field op.
1392 Rename reduction to new_decl.
1393 Rename new_arg_prefix to arg_prefix.
1394 Remove new_param, remove_param, copy_param.
1395 (ipa_modify_formal_parameters): Remove argument.
1396 * omp-low.c (simd_clone_adjust_argument_types): Set arg_prefix.
1397 Use operator enum instead of bit fields.
1398 (simd_clone_adjust_argument_types): Use operator enum instead of
1400 Remove last argument to ipa_modify_formal_parameters call.
1401 (simd_clone_init_simd_arrays): Use operator enum.
1402 (ipa_simd_modify_stmt_ops): Rename reduction to new_decl.
1403 (ipa_simd_modify_function_body): Same.
1404 * tree-sra.c (turn_representatives_into_adjustments): Use operator
1405 enum. Set arg_prefix.
1406 (get_adjustment_for_base): Use operator enum.
1407 (sra_ipa_get_adjustment_candidate): Same.
1408 (sra_ipa_modify_expr): Rename reduction to new_decl.
1409 (sra_ipa_reset_debug_stmts): Use operator enum.
1410 (modify_function): Do not pass prefix argument.
1412 2013-11-07 Jakub Jelinek <jakub@redhat.com>
1414 * tree-vectorizer.h (enum stmt_vec_info_type): Add
1415 call_simd_clone_vec_info_type.
1416 * expr.c (store_constructor): Allow CONSTRUCTOR with VECTOR_TYPE
1417 (same sized) elements even if the type of the CONSTRUCTOR has
1418 vector mode and target is a REG.
1419 * tree-vect-data-refs.c: Include cgraph.h.
1420 (vect_analyze_data_refs): Inline by hand find_data_references_in_loop
1421 and find_data_references_in_bb, if find_data_references_in_stmt
1422 fails, still allow calls to #pragma omp declare simd functions
1423 in #pragma omp simd loops unless they contain data references among
1424 the call arguments or in lhs.
1425 * tree-vect-loop.c (vect_determine_vectorization_factor): If a call
1426 doesn't have lhs, set STMT_VINFO_VECTYPE to vector type corresponding
1427 to any of the argument types and exclude it from adjustments of the
1428 vectorization factor.
1429 * tree-vect-stmts.c: Include tree-ssa-loop.h and
1430 tree-scalar-evolution.h.
1431 (vectorizable_function): Don't handle functions with simd clones here.
1432 (vectorizable_call): Nor here. Return early if call doesn't have lhs.
1433 (struct simd_call_arg_info): New type.
1434 (vectorizable_simd_clone_call): New function.
1435 (vect_analyze_stmt, vect_transform_stmt): Call it.
1437 2013-11-07 Thomas Schwinge <thomas@codesourcery.com>
1439 * gimple.def (GIMPLE_OACC_PARALLEL): New code.
1440 * doc/gimple.texi: Document it.
1441 * gimple.h (gimple_build_oacc_parallel): New declaration.
1442 (gimple_oacc_parallel_clauses, gimple_oacc_parallel_clauses_ptr)
1443 (gimple_oacc_parallel_set_clauses, gimple_oacc_parallel_child_fn)
1444 (gimple_oacc_parallel_child_fn_ptr)
1445 (gimple_oacc_parallel_set_child_fn, gimple_oacc_parallel_data_arg)
1446 (gimple_oacc_parallel_data_arg_ptr)
1447 (gimple_oacc_parallel_set_data_arg): New inline functions.
1448 (CASE_GIMPLE_OMP): Add GIMPLE_OACC_PARALLEL.
1449 * gimple.c (gimple_build_oacc_parallel): New function.
1450 (walk_gimple_op, walk_gimple_stmt, gimple_copy): Handle
1451 GIMPLE_OACC_PARALLEL.
1452 * gimplify.c (is_gimple_stmt): Handle GIMPLE_OACC_PARALLEL.
1453 (gimplify_oacc_parallel): New function.
1454 (gimplify_expr): Handle OACC_PARALLEL.
1455 * cgraphbuild.c (build_cgraph_edges): Handle GIMPLE_OACC_PARALLEL.
1456 * gimple-low.c (lower_stmt): Likewise.
1457 * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
1458 (dump_gimple_oacc_parallel): New function.
1459 * oacc-builtins.def (BUILT_IN_GOACC_PARALLEL): New macro.
1460 * omp-low.c (scan_oacc_parallel, expand_oacc_parallel)
1461 (lower_oacc_parallel): New functions.
1462 (use_pointer_for_field, build_outer_var_ref, scan_sharing_clauses)
1463 (create_omp_child_function, check_omp_nesting_restrictions)
1464 (scan_omp_1_stmt, lower_rec_simd_input_clauses)
1465 (lower_lastprivate_clauses, lower_reduction_clauses)
1466 (lower_copyprivate_clauses, lower_send_clauses)
1467 (lower_send_shared_vars, expand_omp)
1468 (maybe_add_implicit_barrier_cancel, create_task_copyfn)
1469 (lower_omp_1, make_gimple_omp_edges): Handle GIMPLE_OACC_PARALLEL,
1471 * tree-inline.c (remap_gimple_stmt): Likewise.
1472 * tree-nested.c (convert_nonlocal_reference_stmt)
1473 (convert_local_reference_stmt, convert_tramp_reference_stmt)
1474 (convert_gimple_call): Likewise.
1476 * tree.def (OACC_PARALLEL): New code.
1477 * doc/generic.texi (OpenMP): Document it.
1478 * tree.h (OMP_BODY, OMP_CLAUSES): Include it.
1479 (OACC_PARALLEL_BODY, OACC_PARALLEL_CLAUSES): New macros.
1480 * tree-pretty-print.c (dump_generic_node): Handle OACC_PARALLEL.
1482 * doc/invoke.texi (-fopenacc): Update.
1484 * gimplify.c (gimplify_body): Consider flag_openacc additionally
1486 * omp-low.c (execute_expand_omp, execute_lower_omp)
1487 (gate_diagnose_omp_blocks): Likewise.
1489 * oacc-builtins.def: New file.
1490 * Makefile.in (BUILTINS_DEF): Add oacc-builtins.def.
1491 * builtins.def (DEF_GOACC_BUILTIN): New macro.
1492 Include "oacc-builtins.def".
1494 * gcc.c (LINK_COMMAND_SPEC, GOMP_SELF_SPECS): For -fopenacc, link
1495 to libgomp and its dependencies.
1496 * config/arc/arc.h (LINK_COMMAND_SPEC): Likewise.
1497 * config/darwin.h (LINK_COMMAND_SPEC_A): Likewise.
1498 * config/i386/mingw32.h (GOMP_SELF_SPECS): Likewise.
1499 * config/ia64/hpux.h (LIB_SPEC): Likewise.
1500 * config/pa/pa-hpux11.h (LIB_SPEC): Likewise.
1501 * config/pa/pa64-hpux.h (LIB_SPEC): Likewise.
1502 * doc/invoke.texi (-fopenacc): Update.
1504 * doc/invoke.texi (-fopenacc): Document it.
1505 * doc/sourcebuild.texi (fopenacc): Document it.
1507 Backport from trunk, r204517:
1509 * config/arc/arc.h (LINK_COMMAND_SPEC): For
1510 -ftree-parallelize-loops=*, link to libgomp and its dependencies.
1511 * config/ia64/hpux.h (LIB_SPEC): Likewise.
1512 * config/pa/pa-hpux11.h (LIB_SPEC): Likewise.
1513 * config/pa/pa64-hpux.h (LIB_SPEC): Likewise.
1514 * gcc.c (GOMP_SELF_SPECS): Update comment about libgomp's
1517 2013-11-07 Aldy Hernandez <aldyh@redhat.com>
1519 * omp-low.c (ipa_simd_modify_function_body): Avoid
1520 regimplification of GIMPLE_RETURNs.
1522 2013-11-06 Aldy Hernandez <aldyh@redhat.com>
1524 * ipa-prop.h (sra_ipa_get_adjustment_candidate): Protoize.
1525 * omp-low.c (struct modify_stmt_info): New.
1526 (ipa_simd_modify_function_body_ops_1): Remove.
1527 (ipa_simd_modify_stmt_ops): New.
1528 (ipa_simd_modify_function_body_ops): Remove.
1529 (ipa_simd_modify_function_body): Set new callback info.
1530 Remove special casing. Handle all operators with walk_gimple_op.
1531 * tree-sra.c (get_ssa_base_param): Add new argument. Use it.
1532 (disqualify_base_of_expr): Pass new argument to
1534 (sra_ipa_modify_expr): Abstract candidate search into...
1535 (sra_ipa_get_adjustment_candidate): ...here.
1537 2013-11-06 Aldy Hernandez <aldyh@redhat.com>
1539 * omp-low.c (simd_clone_mangle): Linear step of 1 is mangled as
1542 2013-11-04 Aldy Hernandez <aldyh@redhat.com>
1544 * omp-low.c (ipa_simd_modify_function_body): Adjust tree operands
1545 on the LHS of an assign.
1546 (ipa_simd_modify_function_body_ops_1): New.
1547 (ipa_simd_modify_function_body_ops): New.
1549 2013-11-02 Aldy Hernandez <aldyh@redhat.com>
1551 * omp-low.c (ipa_simd_modify_function_body): Handle empty returns.
1553 2013-11-01 Jakub Jelinek <jakub@redhat.com>
1555 * cgraph.h (enum linear_stride_type): Remove.
1556 (enum simd_clone_arg_type): New.
1557 (struct simd_clone_arg): Remove linear_stride, linear_stride_num
1558 and uniform fields. Add arg_type and linear_step.
1559 * omp-low.c (simd_clone_struct_copy): Formatting.
1560 (simd_clone_struct_alloc): Likewise. Use size_t.
1561 (simd_clone_clauses_extract, simd_clone_compute_base_data_type,
1562 simd_clone_adjust_argument_types): Adjust for struct simd_clone_arg
1564 (simd_clone_mangle): Likewise. Handle negative linear step.
1566 2013-11-01 Aldy Hernandez <aldyh@redhat.com>
1568 * tree-vect-stmts.c: Include cgraph.h.
1569 (vectorizable_call): Allow > 3 arguments when a SIMD clone may be
1571 (vectorizable_function): Use SIMD clone if available.
1572 * ipa-cp.c (determine_versionability): Nodes with SIMD clones are
1574 * ggc.h (ggc_alloc_cleared_simd_clone_stat): New.
1575 * cgraph.h (enum linear_stride_type): New.
1576 (struct simd_clone_arg): New.
1577 (struct simd_clone): New.
1578 (struct cgraph_node): Add simdclone and simdclone_of fields.
1579 (get_simd_clone): Protoize.
1580 * cgraph.c (get_simd_clone): New.
1581 Add `has_simd_clones' field.
1582 * ipa-cp.c (determine_versionability): Disallow functions with
1584 * ipa-prop.h (ipa_sra_modify_function_body): Protoize.
1585 (sra_ipa_modify_expr): Same.
1586 (struct ipa_parm_adjustment): Add new_arg_prefix and new_param
1587 fields. Document their use.
1588 * ipa-prop.c (ipa_modify_formal_parameters): Handle creating brand
1589 new parameters and minor cleanups.
1590 * omp-low.c: Add new pass_omp_simd_clone support code.
1591 (make_pass_omp_simd_clone): New.
1592 (pass_data_omp_simd_clone): Declare.
1593 (class pass_omp_simd_clone): Declare.
1594 (vecsize_mangle): New.
1595 (ipa_omp_simd_clone): New.
1596 (simd_clone_clauses_extract): New.
1597 (simd_clone_compute_base_data_type): New.
1598 (simd_clone_compute_vecsize_and_simdlen): New.
1599 (simd_clone_create): New.
1600 (simd_clone_adjust_return_type): New.
1601 (simd_clone_adjust_return_types): New.
1602 (simd_clone_adjust): New.
1603 (simd_clone_init_simd_arrays): New.
1604 (ipa_simd_modify_function_body): New.
1605 (simd_clone_mangle): New.
1606 (simd_clone_struct_alloc): New.
1607 (simd_clone_struct_copy): New.
1608 (class argno_map): New.
1609 (argno_map::argno_map(tree)): New.
1610 (argno_map::~argno_map): New.
1611 (argno_map::operator []): New.
1612 (argno_map::length): New.
1613 (expand_simd_clones): New.
1614 (create_tmp_simd_array): New.
1615 * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): New.
1616 * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document.
1617 * tree-pass.h (make_pass_omp_simd_clone): New.
1618 * passes.def (pass_omp_simd_clone): New.
1619 * target.def: Define new hook prefix "TARGET_CILKPLUS_".
1620 (default_vecsize_mangle): New.
1621 (vecsize_for_mangle): New.
1622 * doc/tm.texi.in: Add placeholder for
1623 TARGET_CILKPLUS_DEFAULT_VECSIZE_MANGLE and
1624 TARGET_CILKPLUS_VECSIZE_FOR_MANGLE.
1625 * tree-sra.c (sra_ipa_modify_expr): Remove static modifier.
1626 (ipa_sra_modify_function_body): Same.
1627 * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define.
1628 * doc/tm.texi: Regenerate.
1629 * config/i386/i386.c (ix86_cilkplus_default_vecsize_mangle): New.
1630 (ix86_cilkplus_vecsize_for_mangle): New.
1631 (TARGET_CILKPLUS_DEFAULT_VECSIZE_MANGLE): New.
1632 (TARGET_CILKPLUS_VECSIZE_FOR_MANGLE): New.
1634 2013-10-10 Jakub Jelinek <jakub@redhat.com>
1636 * tree.c (omp_remove_redundant_declare_simd_attrs): Adjust
1637 for the clauses being stored into TREE_VALUE of an extra TREE_LIST
1638 pointed out by TREE_VALUE of the attribute.
1640 2013-10-04 Jakub Jelinek <jakub@redhat.com>
1642 * omp-low.c (expand_omp_target): When handling IF clause on
1643 #pragma omp target, split new_bb rather than entry_bb. If
1644 not GF_OMP_TARGET_KIND_REGION, split new_bb right before
1645 the GOMP_TARGET stmt, rather than after labels.
1647 2013-09-26 Jakub Jelinek <jakub@redhat.com>
1649 * omp-low.c (expand_task_call): If there are depend clauses,
1650 pass bit 8 in 7th argument and pass pointer to depend array
1652 (lower_depend_clauses): New function.
1653 (lower_omp_taskreg): Handle depend clauses.
1654 * omp-builtins.def (BUILT_IN_GOMP_TASK): Use
1655 BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR
1656 instead of BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT.
1658 (BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT): Remove.
1659 (BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR): New.
1661 2013-09-25 Jakub Jelinek <jakub@redhat.com>
1663 * omp-low.c (lower_omp_sections, lower_omp_for, lower_omp_taskreg):
1664 Emit ctx->cancel_label before destructors.
1666 * gimple-pretty-print.c (dump_gimple_omp_block,
1667 pp_gimple_stmt_1): Handle GIMPLE_OMP_TASKGROUP.
1668 * tree-nested.c (convert_nonlocal_reference_stmt,
1669 convert_local_reference_stmt, convert_gimple_call): Likewise.
1670 * tree-cfg.c (make_edges): Likewise.
1671 * gimple.h (gimple_build_omp_taskgroup): New prototype.
1672 (gimple_has_substatement): Handle GIMPLE_OMP_TASKGROUP.
1673 (CASE_GIMPLE_OMP): Likewise.
1674 * gimplify.c (is_gimple_stmt, gimplify_expr): Handle OMP_TASKGROUP.
1675 * omp-low.c (check_omp_nesting_restrictions): Warn if #pragma omp
1676 cancel is used in nowait loop or sections construct.
1677 (scan_omp_1_stmt, expand_omp_synch, expand_omp, lower_omp_1): Handle
1678 GIMPLE_OMP_TASKGROUP.
1679 (diagnose_sb_1, diagnose_sb_2): Likewise. Handle GIMPLE_OMP_TARGET
1680 and GIMPLE_OMP_TEAMS.
1681 (lower_omp_taskgroup): New function.
1682 * tree-inline.c (remap_gimple_stmt, estimate_num_insns): Handle
1683 GIMPLE_OMP_TASKGROUP.
1684 * gimple-low.c (lower_stmt): Likewise.
1685 * tree.h (OMP_TASKGROUP_BODY): Define.
1686 * tree.def (OMP_TASKGROUP): New tree.
1687 * tree-pretty-print.c (dump_generic_node): Handle OMP_TASKGROUP.
1688 * gimple.c (gimple_build_omp_taskgroup): New function.
1689 (walk_gimple_stmt, gimple_copy): Handle GIMPLE_OMP_TASKGROUP.
1690 * gimple.def (GIMPLE_OMP_TASKGROUP): New GIMPLE code.
1692 2013-09-19 Jakub Jelinek <jakub@redhat.com>
1694 * omp-builtins.def (BUILT_IN_GOMP_TARGET_DATA,
1695 BUILT_IN_GOMP_TARGET_UPDATE): Use BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR
1696 rather than BT_FN_VOID_INT_SIZE_PTR_PTR_PTR.
1697 * builtin-types.def (BT_FN_VOID_INT_SIZE_PTR_PTR_PTR): Remove.
1698 (BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR): New.
1699 * omp-low.c (expand_omp_target): Remove fnname argument from
1700 GOMP_target, add openmp_target argument to GOMP_target,
1701 GOMP_target_data and GOMP_target_update calls.
1703 2013-09-18 Jakub Jelinek <jakub@redhat.com>
1705 * tree.h (OMP_CLAUSE_REDUCTION_OMP_ORIG_REF): Define.
1706 * tree-core.h (OMP_CLAUSE_REDUCTION_OMP_ORIG_REF): Document.
1707 * omp-low.c (lower_rec_simd_input_clauses): Don't set DECL_VALUE_EXPR
1708 on new_var if it is not a DECL_P.
1709 (lower_rec_input_clauses): Don't force max_vf = 1
1710 if OMP_CLAUSE_REDUCTION_PLACEHOLDER. Add barrier also if any
1711 OMP_CLAUSE_REDUCTION_OMP_ORIG_REF is seen. For OMP_CLAUSE_PRIVATE
1712 in simd, fix last argument to omp_clause_default_ctor langhook.
1713 Handle OMP_CLAUSE_REDUCTION_PLACEHOLDER in simd loops, if
1714 OMP_CLAUSE_REDUCTION_GIMPLE_INIT is NULL, emit omp_clause_default_ctor
1715 if any and emit omp_clause_dtor if any. Handle C++ references in
1716 OMP_CLAUSE_REDUCTION clauses.
1717 (lower_reduction_clauses): Adjust comment for UDRs. Handle
1718 C++ references in OMP_CLAUSE_REDUCTION clauses.
1719 (lower_omp_taskreg): Emit reduction merges before destructors.
1720 * tree-pretty-print.c (dump_omp_clause): Don't emit any reduction
1721 operator name if OMP_CLAUSE_REDUCTION_CODE is ERROR_MARK.
1722 * gimplify.c (omp_add_variable): Ignore GOVD_LOCAL decls for which
1723 privatize_by_reference returns true.
1725 * tree-core.h (OMP_CLAUSE_DEPEND_KIND, OMP_CLAUSE_MAP_KIND,
1726 OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION, OMP_CLAUSE_PROC_BIND_KIND):
1728 * tree.h (OMP_CLAUSE_DEPEND_KIND, OMP_CLAUSE_MAP_KIND,
1729 OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION, OMP_CLAUSE_PROC_BIND_KIND):
1732 2013-09-16 Jakub Jelinek <jakub@redhat.com>
1734 * omp-low.c (install_var_field): Use (mask & 4) to request double
1736 (scan_sharing_clauses): For OMP_CLAUSE_MAP_POINTER arrays pass
1737 7 instead of 3 to install_var_field.
1738 (lower_omp_target): For OMP_CLAUSE_MAP_POINTER arrays add extra
1741 2013-09-06 Jakub Jelinek <jakub@redhat.com>
1743 * omp-low.c (scan_sharing_clauses): Handle VLAs in
1744 OMP_CLAUSE_{MAP,TO,FROM}. Set DECL_ALIGN (field) before
1745 calling insert_field_into_struct.
1746 (scan_omp_target): Reverse TYPE_FIELDS, verify that
1747 all field alignments are the same.
1748 (lower_omp_target): Use maybe_lookup_field instead of
1749 lookup_sfield to check if field is present. Handle VLAs.
1750 * tree-pretty-print.c (dump_omp_clause): Only check
1751 OMP_CLAUSE_MAP_KIND on OMP_CLAUSE_MAP clauses.
1752 * gimplify.c (enum gimplify_omp_var_data): Add GOVD_MAP_TO_ONLY.
1753 (omp_firstprivatize_variable, omp_add_variable,
1754 gimplify_adjust_omp_clauses_1, gimplify_adjust_omp_clauses): Handle
1755 VLAs in OMP_CLAUSE_{MAP,TO,FROM}.
1757 2013-09-05 Jakub Jelinek <jakub@redhat.com>
1759 * gimplify.c (gimplify_call_expr): Don't call fold_stmt
1760 inside of #pragma omp target construct.
1761 (gimplify_modify_expr): Likewise.
1762 * omp-low.c (target_nesting_level): New variable.
1763 (lower_omp_target): Increase/restore target_nesting_level
1764 around lowering #pragma omp target body. Use TYPE_SIZE_UNIT
1765 instead of TYPE_SIZE if OMP_CLAUSE_SIZE is missing.
1766 Or log2 of needed alignment into high 5 bits of kind.
1767 (lower_omp): Call fold_stmt on all stmts inside of
1768 #pragma omp target construct.
1770 * tree-cfg.c (make_edges): For GIMPLE_OMP_TARGET
1771 with GF_OMP_TARGET_KIND_UPDATE, don't look for
1772 GIMPLE_OMP_RETURN and immediately restore previous
1774 * langhooks.c (lhd_omp_mappable_type): New function.
1775 * omp-low.c (scan_sharing_clauses): Ignore OMP_CLAUSE_SHARED
1776 in GIMPLE_OMP_TEAMS constructs. Handle OMP_CLAUSE_NUM_TEAMS,
1777 OMP_CLAUSE_THREAD_LIMIT, OMP_CLAUSE_DEVICE, OMP_CLAUSE_MAP,
1778 OMP_CLAUSE_TO and OMP_CLAUSE_FROM.
1779 (create_omp_child_function): If current function has
1780 "omp declare target" attribute or if current region
1781 is OMP_TARGET or lexically nested in it, add that
1782 attribute to the omp child function.
1783 (scan_omp_target, scan_omp_teams): New functions.
1784 (check_omp_nesting_restrictions): Fix a typo in TEAMS nesting
1786 (scan_omp_1_stmt): Handle GIMPLE_OMP_TARGET and GIMPLE_OMP_TEAMS.
1787 (lower_rec_input_clauses): Ignore OMP_CLAUSE_SHARED
1788 in GIMPLE_OMP_TEAMS constructs.
1789 (expand_omp_synch): Handle GIMPLE_OMP_TEAMS.
1790 (expand_omp_target): New function.
1791 (expand_omp): Handle GIMPLE_OMP_TARGET and GIMPLE_OMP_TEAMS.
1792 (build_omp_regions_1): For GIMPLE_OMP_TARGET with
1793 GF_OMP_TARGET_KIND_UPDATE, don't look for GIMPLE_OMP_RETURN and
1794 immediately restore previous region.
1795 (lower_omp_single): Emit a CLOBBER stmt after GIMPLE_OMP_RETURN.
1796 (lower_omp_taskreg): Likewise.
1797 (lower_omp_target, lower_omp_teams): New functions.
1798 (lower_omp_1): Handle GIMPLE_OMP_TARGET and GIMPLE_OMP_TEAMS.
1799 * tree.h (enum omp_clause_map_kind): Improve description of
1800 OMP_CLAUSE_MAP_POINTER.
1801 (OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION): Define.
1802 * gimple.def (GIMPLE_OMP_TARGET): Use GSS_OMP_PARALLEL instead
1804 * langhooks.h (struct lang_hooks_for_types): Add
1805 omp_mappable_type hook.
1806 * langhooks-def.h (lhd_omp_mappable_type): New prototype.
1807 (LANG_HOOKS_OMP_MAPPABLE_TYPE): Define.
1808 (LANG_HOOKS_FOR_TYPES_INITIALIZER): Use it.
1809 * gimple.h (gimple_omp_target_clauses, gimple_omp_target_clauses_ptr,
1810 gimple_omp_target_set_clauses): Use gimple_omp_parallel
1811 instead of gimple_omp_single.
1812 (gimple_omp_target_child_fn, gimple_omp_target_child_fn_ptr,
1813 gimple_omp_target_set_child_fn, gimple_omp_target_data_arg,
1814 gimple_omp_target_data_arg_ptr, gimple_omp_target_set_data_arg): New
1816 * omp-builtins.def (BUILT_IN_GOMP_TARGET, BUILT_IN_GOMP_TARGET_DATA,
1817 BUILT_IN_GOMP_TARGET_END_DATA, BUILT_IN_GOMP_TARGET_UPDATE,
1818 BUILT_IN_GOMP_TEAMS): New builtins.
1819 * gimple-pretty-print.c (dump_gimple_omp_target): Print child_fn
1820 for #pragma omp target.
1821 * gimplify.c (omp_notice_variable): Diagnose if implicitly mapped
1822 decl doesn't have mappable type.
1823 (gimplify_scan_omp_clauses): For OMP_CLAUSE_MAP don't clear
1825 (gimplify_adjust_omp_clauses_1): Add OMP_CLAUSE_MAP even if the same
1826 decl is already referenced in target data construct surrounding it.
1827 (gimplify_adjust_omp_clauses): Likewise. Handle
1828 OMP_CLAUSE_THREAD_LIMIT.
1829 (gimplify_omp_workshare): Fix up gimplification of target or target
1830 data construct body. For target data add GOMP_target_end_data
1831 call in a try/finally cleanup.
1832 * builtin-types.def (BT_FN_VOID_UINT_UINT,
1833 BT_FN_VOID_INT_SIZE_PTR_PTR_PTR,
1834 BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR): New.
1836 2013-07-14 Jakub Jelinek <jakub@redhat.com>
1838 * tree.h (omp_declare_simd_clauses_equal): Remove prototype.
1839 (omp_remove_redundant_declare_simd_attrs): New prototype.
1840 * tree.c (omp_declare_simd_clauses_equal): Make static.
1841 (omp_remove_redundant_declare_simd_attrs): New function.
1843 2013-07-09 Jakub Jelinek <jakub@redhat.com>
1845 * gimple-pretty-print.c (dump_gimple_omp_return): Print
1846 gimple_omp_return_lhs if non-NULL.
1847 * tree-ssa-alias.c (ref_maybe_used_by_call_p_1,
1848 call_may_clobber_ref_p_1): Handle BUILT_IN_GOMP_BARRIER_CANCEL,
1849 BUILT_IN_GOMP_LOOP_END_CANCEL, BUILT_IN_GOMP_SECTIONS_END_CANCEL.
1850 * gimple.h (gimple_omp_return_set_lhs, gimple_omp_return_lhs,
1851 gimple_omp_return_lhs_ptr): New inlines.
1852 * gimple.def (GIMPLE_OMP_RETURN): Use GSS_OMP_ATOMIC_STORE
1853 instead of GSS_BASE.
1854 * gimple.c (walk_gimple_op) <case GIMPLE_OMP_RETURN>: Walk lhs.
1855 * builtin-types.def (BT_FN_BOOL_INT, BT_FN_BOOL_INT_BOOL): New.
1856 * omp-builtins.def (BUILT_IN_GOMP_CANCELLATION_POINT): Use
1857 ATTR_NOTHROW_LEAF_LIST instead of ATTR_NULL. Return type is now
1859 (BUILT_IN_GOMP_CANCEL): Likewise. Add second argument with bool type.
1860 (BUILT_IN_BARRIER_CANCEL, BUILT_IN_GOMP_LOOP_END_CANCEL,
1861 BUILT_IN_GOMP_SECTIONS_END_CANCEL): New builtins.
1862 * omp-low.c (struct omp_context): Add cancel_label and cancellable
1864 (extract_omp_for_data): Set have_nowait even for simd implicitly.
1865 (check_omp_nesting_restrictions): Verify nesting restrictions for
1866 #pragma omp cancel and #pragma omp cancellation point.
1867 Set ctx->cancellable for regions that can be cancelled or also
1868 for any task region that contains #pragma omp cancellation point.
1869 (scan_omp_1_stmt): Check nesting restrictions even if ctx == NULL.
1870 (build_omp_barrier): Return gimple instead of tree, add lhs argument,
1871 if non-NULL, build GOMP_barrier_cancel builtin instead and set its
1873 (lower_rec_input_clauses): Adjust build_omp_barrier caller.
1874 (expand_omp_for_static_nochunk, expand_omp_for_static_chunk,
1875 expand_omp_single): Likewise. If OMP_RETURN has lhs, pass it to
1877 (expand_omp_for_generic): If OMP_RETURN has lhs, use
1878 GOMP_loop_end_cancel libcall instead of GOMP_loop_end and set its
1879 lhs from OMP_RETURN's lhs.
1880 (expand_omp_sections): If OMP_RETURN has lhs, use
1881 GOMP_sections_end_cancel libcall instead of GOMP_sections_end and set
1882 its lhs from OMP_RETURN's lhs.
1883 (maybe_add_implicit_barrier_cancel): New function.
1884 (lower_omp_sections): If ctx->cancellable, emit cancel_label before
1885 OMP_RETURN. Call maybe_add_implicit_barrier_cancel.
1886 (lower_omp_for): Likewise.
1887 (lower_omp_single): Call maybe_add_implicit_barrier_cancel.
1888 (lower_omp_taskreg): If ctx->cancellable, emit cancel_label before
1890 (lower_omp_1): If ctx->cancellable, create ctx->cancel_label.
1891 Adjust GOMP_barrier libcalls to GOMP_barrier_cancel plus conditional
1892 branch in cancellable regions, adjust GOMP_cancel and
1893 GOMP_cancellation_point in cancellable regions or remove
1894 GOMP_cancellation_point in non-cancellable regions.
1896 2013-07-03 Jakub Jelinek <jakub@redhat.com>
1898 * omp-low.c (expand_omp_single): Don't force barrier for
1901 2013-06-28 Jakub Jelinek <jakub@redhat.com>
1902 Aldy Hernandez <aldyh@redhat.com>
1904 * internal-fn.def (GOMP_SIMD_LANE, GOMP_SIMD_VF,
1905 GOMP_SIMD_LAST_LANE): New internal functions.
1906 * omp-low.c (omp_max_vf, lower_rec_simd_input_clauses): New
1908 (lower_rec_input_clauses): Add fd argument. Enforce max_vf = 1
1909 if any data sharing clauses mention VLAs or for array reductions.
1910 Handle OMP_CLAUSE__LOOPTEMP_ clause. For
1911 OMP_CLAUSE_{{FIRST,LAST,}PRIVATE,LINEAR,REDUCTION} on SIMD
1912 constructs use "omp simd array" temporaries. For OMP_CLAUSE_LINEAR
1913 adjust initial value in combined constructs. Don't emit any
1914 barriers for #pragma omp distribute. If max_vf is lower than
1915 current safelen, prepend an OMP_CLAUSE_SAFELEN clause.
1916 (lower_lastprivate_clauses): Handle "omp simd array" temporaries.
1917 (lower_reduction_clauses): Exit early for #pragma omp simd.
1918 (expand_omp_simd): Set loop->simduid from OMP_CLAUSE__SIMDUID_
1919 and cfun->has_simduid_loops if set.
1920 If OMP_CLAUSE_SAFELEN (1) is present, don't set loop->safelen
1921 nor loop->force_vect.
1922 (lower_omp_sections, lower_omp_single, lower_omp_taskreg): Adjust
1923 lower_rec_input_clauses callers.
1924 (lower_omp_for_lastprivate): Unshare vinit.
1925 (lower_omp_for): Add OMP_CLAUSE__LOOPTEMP_ clauses before calling
1926 lower_rec_input_clauses. Adjust lower_rec_input_clauses caller.
1927 Always call lower_omp_for_lastprivate at the same place, even for
1929 * tree.h (enum clause_code): Add OMP_CLAUSE__SIMDUID_.
1930 (OMP_CLAUSE__SIMDUID__DECL): Define.
1931 * tree-vectorizer.c: Include hash-table.h and tree-ssa-propagate.h.
1932 (simduid_to_vf, decl_to_simduid): New classes.
1933 (simduid_to_vf::hash, simduid_to_vf::equal, decl_to_simduid::hash,
1934 decl_to_simduid::equal): New methods.
1935 (note_simd_array_uses_struct): New struct.
1936 (adjust_simduid_builtins, note_simd_array_uses_cb,
1937 note_simd_array_uses): New functions.
1938 (vectorize_loops): Adjust "omp simd array" temporary array sizes
1939 and fold GOMP_SIMD_{LANE,VF,LAST_LANE} builtins.
1940 * tree-vectorizer.h (struct _stmt_vec_info): Add simd_lane_access_p
1942 (STMT_VINFO_SIMD_LANE_ACCESS_P): Define.
1943 * tree-data-ref.c (get_references_in_stmt): Allow GOMP_SIMD_LANE
1944 builtins in their own loops.
1945 * tree-inline.c (copy_cfg_body): Propagate has_force_vect_loops
1946 and has_simduid_loops.
1947 * function.h (struct function): Add has_simduid_loops field.
1948 * tree-ssa-ccp.c (likely_value): For GOMP_SIMD_{LANE,LAST_LANE,VF}
1949 builtins ignore the undefined magic argument.
1950 * tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE__SIMDUID_
1952 * cfgloop.h (struct loop): Add simduid field.
1953 * Makefile.in (tree-vectorizer.o): Depend on $(HASH_TABLE_H)
1954 and tree-ssa-propagate.h.
1955 * tree-vect-data-refs.c (vect_analyze_data_refs): Check for SIMD
1957 * gimplify.c (omp_add_variable): Handle combination of aligned
1958 clause and some data sharing clause for the same decl.
1959 (gimplify_omp_for): For collapse (2) and above simd loops
1960 predetermine loop iteration vars as lastprivate instead of
1962 * tree.c (omp_clause_num_ops, omp_clause_code_name): Add
1963 entries for OMP_CLAUSE__SIMDUID_.
1964 (walk_tree_1): Handle OMP_CLAUSE__SIMDUID_.
1965 * tree-vect-loop.c (vectorizable_live_operation): Handle live
1966 GOMP_SIMD_LANE result.
1967 * tree-vect-stmts.c (vectorizable_call): Vectorize GOMP_SIMD_LANE
1969 (vectorizable_store, vectorizable_load): Handle
1970 STMT_VINFO_SIMD_LANE_ACCESS_P.
1971 * internal-fn.c (expand_GOMP_SIMD_LANE, expand_GOMP_SIMD_VF,
1972 expand_GOMP_SIMD_LAST_LANE): New functions.
1974 2013-06-21 Jakub Jelinek <jakub@redhat.com>
1976 * gimple.h (enum gf_mask): Adjust GF_OMP_FOR_COMBINED
1977 value representation, add GF_OMP_FOR_COMBINED_INTO.
1978 (gimple_omp_for_combined_into_p,
1979 gimple_omp_for_set_combined_into_p): New inlines.
1980 * gimplify.c (enum omp_region_type): Remove outdated
1982 (struct gimplify_omp_ctx): Add combined_loop field.
1983 (gimplify_omp_for): Call gimple_omp_for_set_combined_into_p
1984 for inner for/simd constructs combined with an outer
1985 loop construct (for or distribute).
1986 * tree.c (omp_clause_num_ops): Add OMP_CLAUSE__LOOPTEMP_
1988 (omp_clause_code_name): Likewise.
1989 (walk_tree_1): Handle OMP_CLAUSE__LOOPTEMP_.
1990 * tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE__LOOPTEMP_.
1991 * tree.h (enum omp_clause_code): Add OMP_CLAUSE__LOOPTEMP_.
1992 (OMP_CLAUSE_DECL): Allow also on OMP_CLAUSE__LOOPTEMP_.
1993 * omp-low.c (extract_omp_for_data): Rename non_ws to simd. Don't set
1994 fd->chunk_size for non-chunk OMP_CLAUSE_SCHEDULE_STATIC, unless
1995 fd->have_ordered. For OMP_CLAUSE_SCHEDULE_STATIC non-ordered loops
1996 compute fd->iter_type the same as for simd.
1997 (get_ws_args_for): Add par_stmt argument, if
1998 gimple_omp_for_combined_into_p, use first two _looptemp_ clauses
1999 temporaries instead of fd->loop.n{1,2}.
2000 (determine_parallel_type): Adjust caller.
2001 (scan_sharing_clauses): Handle OMP_CLAUSE__LOOPTEMP_.
2002 (find_combined_for): New function.
2003 (scan_omp_parallel): If gimple_omp_parallel_combined_p and
2004 it is combined with gimple_omp_for_combined_into_p OMP_FOR,
2005 add OMP_CLAUSE__LOOPTEMP_ clauses to the parallel.
2006 (check_omp_nesting_restrictions): Don't insist that the only construct
2007 nested in OMP_DISTRIBUTE must be OMP_PARALLEL.
2008 (lower_rec_input_clauses, lower_send_clauses): Handle
2009 OMP_CLAUSE__LOOPTEMP_.
2010 (expand_omp_for_init_counts, expand_omp_for_init_vars,
2011 extract_omp_for_update_vars): New functions.
2012 (expand_omp_for_generic): Add inner_stmt argument. Use
2013 expand_omp_for_{init,update}* helper functions. Handle combined loop
2015 (expand_omp_for_static_nochunk, expand_omp_for_static_chunk):
2016 Likewise. Handle fd->collapse > 1 and broken_loop cases.
2017 (expand_omp_simd): Use expand_omp_for_init* helper functions. Handle
2018 combined loop constructs.
2019 (expand_omp_for): Add inner_stmt argument. Pass it through to
2020 expand_omp_for_{generic,static_{,no}chunk}. Use
2021 expand_omp_for_static* even for fd->collapse > 1 and/or broken_loop
2022 cases, just not when fd->have_ordered.
2023 (expand_omp): Adjust expand_omp_for caller.
2024 (lower_omp_for): If gimple_omp_parallel_combined_p, add
2025 OMP_CLAUSE__LOOPTEMP_ clauses to the GIMPLE_FOR stmt.
2027 2013-06-14 Jakub Jelinek <jakub@redhat.com>
2029 * gimple-pretty-print.c (dump_gimple_omp_for): Don't handle
2030 GF_OMP_FOR_KIND_FOR_SIMD.
2031 * gimple.h (GF_OMP_FOR_KIND_FOR_SIMD): Remove.
2032 (GF_OMP_FOR_COMBINED): New.
2033 (gimple_omp_for_combined_p, gimple_omp_for_set_combined_p): New
2035 * gimplify.c (is_gimple_stmt): Don't handle OMP_FOR_SIMD.
2036 (find_combined_omp_for): New function.
2037 (gimplify_omp_for): Handle combined OMP_DISTRIBUTE and OMP_FOR
2039 * Makefile.in (c-family/c-omp.o): Depend on $(C_PRAGMA_H).
2040 * omp-low.c (build_outer_var_ref): Fix up simd handling.
2041 (check_omp_nesting_restrictions): Don't handle
2042 GF_OMP_FOR_KIND_FOR_SIMD.
2043 * tree.def (OMP_FOR_SIMD): Remove.
2044 * tree-pretty-print.c (dump_generic_node): Don't handle OMP_FOR_SIMD.
2045 Handle NULL OMP_FOR_INIT.
2047 2013-06-12 Jakub Jelinek <jakub@redhat.com>
2049 * gimplify.c (gimplify_scan_omp_clauses): Handle
2050 OMP_CLAUSE_THREAD_LIMIT.
2051 * tree-pretty-print.c (dump_omp_clause): Likewise.
2052 * tree.c (omp_clause_num_ops, omp_clause_code_name): Add entries for
2053 OMP_CLAUSE_THREAD_LIMIT.
2054 * tree.h (enum omp_clause_code): Add OMP_CLAUSE_THREAD_LIMIT.
2055 (OMP_CLAUSE_THREAD_LIMIT_EXPR): Define.
2057 2013-06-04 Jakub Jelinek <jakub@redhat.com>
2059 * gimplify.c (gimplify_scan_omp_clauses): Handle array
2060 sections on OMP_CLAUSE_{MAP,TO,FROM} clauses, handle
2061 OMP_CLAUSE_DEPEND clause.
2062 (gimplify_adjust_omp_clauses): Handle array sections on
2063 OMP_CLAUSE_MAP, handle OMP_CLAUSE_DEPEND clause.
2064 * tree.c (omp_clause_num_ops): OMP_CLAUSE_{MAP,TO,FROM}
2065 now have 2 arguments, move OMP_CLAUSE_UNIFORM before these
2067 (omp_clause_code_name): Adjust for OMP_CLAUSE_UNIFORM movement.
2068 (walk_tree_1): Adjust to handle 2 arguments of
2069 OMP_CLAUSE_{MAP,TO,FROM}.
2070 * tree-pretty-print.c (dump_omp_clause): For OMP_CLAUSE_{MAP,TO,FROM}
2071 print OMP_CLAUSE_SIZE, and for OMP_CLAUSE_MAP handle
2072 OMP_CLAUSE_MAP_POINTER.
2073 * tree.h (enum omp_clause_code): Move OMP_CLAUSE_UNIFORM before
2074 OMP_CLAUSE_{MAP,TO,FROM}.
2075 (OMP_CLAUSE_SIZE): Define.
2076 (enum omp_clause_map_kind): Add OMP_CLAUSE_MAP_POINTER.
2077 * omp-low.c (scan_sharing_clauses): Handle OMP_CLAUSE_DEPEND.
2079 2013-05-29 Jakub Jelinek <jakub@redhat.com>
2081 * omp-builtins.def (BUILT_IN_OMP_GET_TEAM_NUM,
2082 BUILT_IN_OMP_GET_NUM_TEAMS): New built-ins.
2083 * omp-low.c (extract_omp_for_data, expand_omp_for_static_nochunk,
2084 expand_omp_for_static_chunk): Handle #pragma omp distribute.
2085 (expand_omp_for): Add assertion for non-finished distribute collapse
2087 (check_omp_nesting_restrictions): Allow orphaned distribute construct.
2089 * omp-low.c (check_omp_nesting_restrictions): Add some
2090 accelerator related nesting restrictions.
2091 (scan_omp_1_stmt): Call check_omp_nesting_restrictions
2092 even for GOMP_taskgroup_{start,end}.
2093 * gimplify.c (omp_notice_threadprivate_variable): Fix a typo.
2094 (gimplify_body): For functions with "omp declare target" attribute
2095 add ORT_TARGET region around the body.
2097 2013-05-27 Jakub Jelinek <jakub@redhat.com>
2099 * tree.def (OMP_TEAMS, OMP_TARGET_DATA, OMP_TARGET,
2100 OMP_TARGET_UPDATE): New tree codes.
2101 * tree-cfg.c (make_edges): Handle GIMPLE_OMP_TARGET
2102 and GIMPLE_OMP_TEAMS.
2103 * omp-low.c (scan_sharing_clauses): Handle OMP_CLAUSE_DIST_SCHEDULE.
2104 * gimple-low.c (lower_stmt): Handle GIMPLE_OMP_TARGET
2105 and GIMPLE_OMP_TEAMS.
2106 * tree.h (OMP_TEAMS_BODY, OMP_TEAMS_CLAUSES, OMP_TARGET_DATA_BODY,
2107 OMP_TARGET_DATA_CLAUSES, OMP_TARGET_BODY, OMP_TARGET_CLAUSES,
2108 OMP_TARGET_UPDATE_CLAUSES): Define.
2109 * tree-nested.c (convert_nonlocal_reference_stmt,
2110 convert_local_reference_stmt, convert_gimple_call): Handle
2111 GIMPLE_OMP_TARGET and GIMPLE_OMP_TEAMS.
2112 * tree-inline.c (estimate_num_insns): Likewise.
2113 (remap_gimple_stmt): Likewise. Adjust gimple_build_omp_for
2115 * gimple.def: Adjust comments describing OMP_CLAUSEs.
2116 (GIMPLE_OMP_TARGET, GIMPLE_OMP_TEAMS): New GIMPLE stmts.
2117 * tree-parloops.c (create_parallel_loop): Adjust gimple_build_omp_for
2119 * tree-pretty-print.c (dump_generic_node): Handle OMP_TEAMS,
2120 OMP_TARGET, OMP_TARGET_DATA and OMP_TARGET_UPDATE.
2121 * gimple.h (GF_OMP_TARGET_KIND_MASK, GF_OMP_TARGET_KIND_REGION,
2122 GF_OMP_TARGET_KIND_DATA, GF_OMP_TARGET_KIND_UPDATE): New.
2123 (gimple_build_omp_for): Add kind argument to prototype.
2124 (gimple_build_omp_target, gimple_build_omp_teams): New prototypes.
2125 (gimple_has_substatements): Handle GIMPLE_OMP_TARGET and
2127 (gimple_omp_subcode): Change GIMPLE_OMP_SINGLE to GIMPLE_OMP_TEAMS.
2128 (gimple_omp_target_clauses, gimple_omp_target_clauses_ptr,
2129 gimple_omp_target_set_clauses, gimple_omp_target_kind,
2130 gimple_omp_target_set_kind, gimple_omp_teams_clauses,
2131 gimple_omp_teams_clauses_ptr, gimple_omp_teams_set_clauses): New
2133 (gimple_return_set_retval): Handle GIMPLE_OMP_TARGET and
2135 * gimple.c (gimple_build_omp_for): Add kind argument, call
2136 gimple_omp_for_set_kind.
2137 (gimple_build_omp_target, gimple_build_omp_teams): New functions.
2138 (walk_gimple_op, walk_gimple_stmt, gimple_copy): Handle
2139 GIMPLE_OMP_TARGET and GIMPLE_OMP_TEAMS.
2140 * gimple-pretty-print.c (dump_gimple_omp_target,
2141 dump_gimple_omp_teams): New functions.
2142 (pp_gimple_stmt_1): Handle GIMPLE_OMP_TARGET and GIMPLE_OMP_TEAMS.
2143 * gimplify.c (enum gimplify_omp_var_data): Add GOVD_MAP.
2144 (enum omp_region_type): Add ORT_TEAMS, ORT_TARGET and ORT_TARGET_DATA.
2145 (omp_add_variable): Add temporary assertions.
2146 (omp_notice_threadprivate_variable): Complain if threadprivate vars
2147 appear in target region.
2148 (omp_notice_variable): ORT_TARGET, ORT_TARGET_DATA and ORT_TEAMS
2150 (omp_check_private): Ignore ORT_TARGET and ORT_TARGET_DATA regions.
2151 (gimplify_scan_omp_clauses): Handle OMP_CLAUSE_MAP, OMP_CLAUSE_TO,
2152 OMP_CLAUSE_FROM, OMP_CLAUSE_NUM_TEAMS, OMP_CLAUSE_DIST_SCHEDULE
2153 and OMP_CLAUSE_DEVICE.
2154 (gimplify_adjust_omp_clauses): Likewise.
2155 (gimplify_adjust_omp_clauses_1): Handle GOVD_MAP. Fix up
2156 check for privatization by also testing for GOVD_LINEAR.
2157 (gimplify_omp_for): Adjust gimple_build_omp_for caller.
2159 (gimplify_omp_workshare): Handle also OMP_TARGET, OMP_TARGET_DATA
2160 and OMP_TEAMS. Clear *expr_p.
2161 (gimplify_omp_target_update): New function.
2162 (gimplify_expr): Handle OMP_TARGET, OMP_TARGET_DATA, OMP_TARGET_UPDATE
2165 2013-05-20 Jakub Jelinek <jakub@redhat.com>
2167 * omp-low.c (expand_omp_simd): For collapse > 1 loops,
2168 if some loop condition might be not true initially, add runtime
2169 test and skip the whole loop.
2171 2013-05-14 Jakub Jelinek <jakub@redhat.com>
2173 * cfgloop.h (struct loop): Add safelen and force_vect fields.
2174 * function.h (struct function): Add has_force_vect_loops field.
2175 * omp-low.c (expand_omp_simd): If !broken_loop, create loop for
2176 the simd region and set safelen and force_vect fields in it.
2177 * tree-vectorizer.c (vectorize_loops): If loop has force_vect set,
2178 vectorize it even if flag_vectorize isn't set. Clear loop->force_vect
2179 after vectorization.
2180 * tree-ssa-loop.c (gate_tree_vectorize): Return true even
2181 cfun->has_force_vect_loops.
2182 * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely_1): Don't
2183 unroll loops with loop->force_vect.
2184 * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): For
2185 unknown or bad data dependency, if loop->safelen is non-zero, just
2186 decrease *max_vf to loop->safelen if needed and return false.
2187 * tree-if-conv.c (main_tree_if_conversion): If-convert also loops with
2189 (gate_tree_if_conversion): Return true even if
2190 cfun->has_force_vect_loops.
2192 2013-05-09 Jakub Jelinek <jakub@redhat.com>
2194 * tree.c (omp_declare_simd_clauses_equal): New function.
2195 (attribute_value_equal): Call it for -fopenmp if
2196 TREE_VALUE of the attributes are both OMP_CLAUSEs.
2197 * tree.h (omp_declare_simd_clauses_equal): Declare.
2199 2013-04-30 Jakub Jelinek <jakub@redhat.com>
2201 * gimple-pretty-print.c (dump_gimple_omp_atomic_load,
2202 dump_gimple_omp_atomic_store): Handle gimple_omp_atomic_seq_cst_p.
2203 * gimple.h (enum gf_mask): Add GF_OMP_ATOMIC_SEQ_CST.
2204 (gimple_omp_atomic_set_seq_cst, gimple_omp_atomic_seq_cst_p): New
2206 * omp-low.c (expand_omp_atomic_load, expand_omp_atomic_store,
2207 expand_omp_atomic_fetch_op): If gimple_omp_atomic_seq_cst_p,
2208 pass MEMMODEL_SEQ_CST instead of MEMMODEL_RELAXED to the builtin.
2209 * gimplify.c (gimplify_omp_atomic): Handle OMP_ATOMIC_SEQ_CST.
2210 * tree-pretty-print.c (dump_generic_node): Handle OMP_ATOMIC_SEQ_CST.
2211 * tree.def (OMP_ATOMIC): Add comment that OMP_ATOMIC* must stay
2213 * tree.h (OMP_ATOMIC_SEQ_CST): Define.
2215 * omp-low.c (check_omp_nesting_restrictions): Diagnose
2216 OpenMP constructs nested inside simd region. Don't treat
2217 #pragma omp simd as work-sharing region. Disallow work-sharing
2218 constructs inside of critical region. Complain if ordered
2219 region is nested inside of parallel region without loop
2221 (scan_omp_1_stmt): Call check_omp_nesting_restrictions even
2222 for GOMP_{cancel{,lation_point},taskyield,taskwait} calls.
2224 2013-04-23 Jakub Jelinek <jakub@redhat.com>
2226 * Makefile.in (omp-low.o): Depend on $(TARGET_H).
2227 * gimplify.c (gimplify_adjust_omp_clauses): For linear clauses
2228 if outer_context is non-NULL, but not ORT_COMBINED_PARALLEL,
2229 call omp_notice_variable. Remove aligned clauses that can't
2231 * omp-low.c: Include target.h.
2232 (scan_sharing_clauses): For aligned clauses with global arrays
2233 register local replacement.
2234 (omp_clause_aligned_alignment): New function.
2235 (lower_rec_input_clauses): For aligned clauses for global
2236 arrays or automatic pointers emit __builtin_assume_aligned
2237 before the loop if possible.
2238 (expand_omp_regimplify_p, expand_omp_build_assign): New functions.
2239 (expand_omp_simd): Use them. Handle pointer iterators and broken
2241 (lower_omp_for): Call lower_omp on gimple_omp_body_ptr after
2242 calling lower_rec_input_clauses, not before it.
2244 2013-04-19 Jakub Jelinek <jakub@redhat.com>
2246 * tree.h (OMP_CLAUSE_LINEAR_NO_COPYIN,
2247 OMP_CLAUSE_LINEAR_NO_COPYOUT): Define.
2248 * omp-low.c (extract_omp_for_data): Handle #pragma omp simd.
2249 (build_outer_var_ref): For #pragma omp simd allow linear etc.
2250 clauses to bind even to private vars.
2251 (scan_sharing_clauses): Handle OMP_CLAUSE_LINEAR, OMP_CLAUSE_ALIGNED
2252 and OMP_CLAUSE_SAFELEN.
2253 (lower_rec_input_clauses): Handle OMP_CLAUSE_LINEAR. Don't emit
2254 a GOMP_barrier call for firstprivate/lastprivate in #pragma omp simd.
2255 (lower_lastprivate_clauses): Handle also OMP_CLAUSE_LINEAR.
2256 (expand_omp_simd): New function.
2257 (expand_omp_for): Handle #pragma omp simd.
2258 * gimplify.c (enum gimplify_omp_var_data): Add GOVD_LINEAR and
2259 GOVD_ALIGNED, add GOVD_LINEAR into GOVD_DATA_SHARE_CLASS.
2260 (enum omp_region_type): Add ORT_SIMD.
2261 (gimple_add_tmp_var, gimplify_var_or_parm_decl, omp_check_private,
2262 omp_firstprivatize_variable, omp_notice_variable): Handle ORT_SIMD
2264 (omp_is_private): Likewise. Add SIMD argument, tweak diagnostics
2265 and add extra errors in simd constructs.
2266 (gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses): Handle
2267 OMP_CLAUSE_LINEAR, OMP_CLAUSE_ALIGNED and OMP_CLAUSE_SAFELEN.
2268 (gimplify_adjust_omp_clauses_1): Handle GOVD_LASTPRIVATE and
2270 (gimplify_omp_for): Handle #pragma omp simd.
2272 2013-04-10 Jakub Jelinek <jakub@redhat.com>
2274 * builtin-types.def (DEF_FUNCTION_TYPE_8): Document.
2275 (BT_FN_VOID_OMPFN_PTR_UINT, BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG,
2276 BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG): Remove.
2277 (BT_FN_VOID_OMPFN_PTR_UINT_UINT_UINT,
2278 BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_UINT,
2279 BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG_UINT): New.
2280 * gimplify.c (gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses):
2281 Handle OMP_CLAUSE_PROC_BIND.
2282 * omp-builtins.def (BUILT_IN_GOMP_TASKGROUP_START,
2283 BUILT_IN_GOMP_TASKGROUP_END, BUILT_IN_GOMP_PARALLEL_LOOP_STATIC,
2284 BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC,
2285 BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED,
2286 BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME, BUILT_IN_GOMP_PARALLEL,
2287 BUILT_IN_GOMP_PARALLEL_SECTIONS): New built-ins.
2288 (BUILT_IN_GOMP_PARALLEL_LOOP_STATIC_START,
2289 BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC_START,
2290 BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED_START,
2291 BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME_START,
2292 BUILT_IN_GOMP_PARALLEL_START, BUILT_IN_GOMP_PARALLEL_END,
2293 BUILT_IN_GOMP_PARALLEL_SECTIONS_START): Remove.
2294 * omp-low.c (scan_sharing_clauses): Handle OMP_CLAUSE_PROC_BIND.
2295 (expand_parallel_call): Expand #pragma omp parallel* as
2296 calls to the new GOMP_parallel_* APIs without _start at the end,
2297 instead of GOMP_parallel_*_start followed by fn.omp_fn.N call,
2298 followed by GOMP_parallel_end. Handle OMP_CLAUSE_PROC_BIND.
2299 * tree-ssa-alias.c (ref_maybe_used_by_call_p_1,
2300 call_may_clobber_ref_p_1): Handle BUILT_IN_GOMP_TASKGROUP_END
2301 instead of BUILT_IN_GOMP_PARALLEL_END.
2303 2013-03-27 Jakub Jelinek <jakub@redhat.com>
2305 * gimple-pretty-print.c (dump_gimple_omp_for): Handle different
2306 GIMPLE_OMP_FOR kinds.
2307 * tree.def (OMP_SIMD, OMP_FOR_SIMD, OMP_DISTRIBUTE): New tree codes.
2308 * gimple.h (enum gf_mask): Add GF_OMP_FOR_KIND_MASK,
2309 GF_OMP_FOR_KIND_FOR, GF_OMP_FOR_KIND_SIMD, GF_OMP_FOR_KIND_FOR_SIMD
2310 and GF_OMP_FOR_KIND_DISTRIBUTE.
2311 (gimple_omp_for_kind, gimple_omp_for_set_kind): New inline functions.
2312 * gimplify.c (is_gimple_stmt, gimplify_omp_for, gimplify_expr): Handle
2313 OMP_SIMD, OMP_FOR_SIMD and OMP_DISTRIBUTE.
2314 * tree.c (omp_clause_num_ops, omp_clause_code_name, walk_tree_1):
2315 Handle new OpenMP 4.0 clauses.
2316 * tree-pretty-print.c (dump_omp_clause): Likewise.
2317 (dump_generic_node): Handle OMP_SIMD, OMP_FOR_SIMD and OMP_DISTRIBUTE.
2318 * tree.h (enum omp_clause_code): Add OMP_CLAUSE_LINEAR,
2319 OMP_CLAUSE_ALIGNED, OMP_CLAUSE_DEPEND, OMP_CLAUSE_FROM, OMP_CLAUSE_TO,
2320 OMP_CLAUSE_UNIFORM, OMP_CLAUSE_MAP, OMP_CLAUSE_DEVICE,
2321 OMP_CLAUSE_DIST_SCHEDULE, OMP_CLAUSE_INBRANCH, OMP_CLAUSE_NOTINBRANCH,
2322 OMP_CLAUSE_NUM_TEAMS, OMP_CLAUSE_PROC_BIND, OMP_CLAUSE_SAFELEN,
2323 OMP_CLAUSE_SIMDLEN, OMP_CLAUSE_FOR, OMP_CLAUSE_PARALLEL,
2324 OMP_CLAUSE_SECTIONS and OMP_CLAUSE_TASKGROUP.
2325 (OMP_LOOP_CHECK): Define.
2326 (OMP_FOR_BODY, OMP_FOR_CLAUSES, OMP_FOR_INIT, OMP_FOR_COND,
2327 OMP_FOR_INCR, OMP_FOR_PRE_BODY): Use OMP_LOOP_CHECK instead of
2329 (OMP_CLAUSE_DECL): Extend check range up to OMP_CLAUSE_MAP.
2330 (OMP_CLAUSE_LINEAR_STEP, OMP_CLAUSE_ALIGNED_ALIGNMENT,
2331 OMP_CLAUSE_NUM_TEAMS_EXPR, OMP_CLAUSE_DEVICE_ID,
2332 OMP_CLAUSE_DIST_SCHEDULE_CHUNK_EXPR, OMP_CLAUSE_SAFELEN_EXPR,
2333 OMP_CLAUSE_SIMDLEN_EXPR): Define.
2334 (enum omp_clause_depend_kind, enum omp_clause_map_kind,
2335 enum omp_clause_proc_bind_kind): New enums.
2336 (OMP_CLAUSE_DEPEND_KIND, OMP_CLAUSE_MAP_KIND,
2337 OMP_CLAUSE_PROC_BIND_KIND): Define.
2338 (struct tree_omp_clause): Add subcode.depend_kind, subcode.map_kind
2339 and subcode.proc_bind_kind.
2340 (find_omp_clause): New prototype.
2341 * omp-builtins.def (BUILT_IN_GOMP_CANCEL,
2342 BUILT_IN_GOMP_CANCELLATION_POINT): New built-ins.
2343 * tree-flow.h (find_omp_clause): Remove prototype.
2345 Copyright (C) 2013-2015 Free Software Foundation, Inc.
2347 Copying and distribution of this file, with or without modification,
2348 are permitted in any medium without royalty provided the copyright
2349 notice and this notice are preserved.