1 2018-01-24 Jakub Jelinek <jakub@redhat.com>
4 * tree.c (free_lang_data_in_decl): Don't clear DECL_ABSTRACT_ORIGIN
6 * omp-low.c (create_omp_child_function): Remove "omp declare simd"
7 attributes from DECL_ATTRIBUTES (decl) without affecting
8 DECL_ATTRIBUTES (current_function_decl).
9 * omp-simd-clone.c (expand_simd_clones): Ignore DECL_ARTIFICIAL
10 functions with non-NULL DECL_ABSTRACT_ORIGIN.
12 2018-01-24 Richard Sandiford <richard.sandiford@linaro.org>
14 PR tree-optimization/83979
15 * fold-const.c (fold_comparison): Use constant_boolean_node
16 instead of boolean_{true,false}_node.
18 2018-01-24 Jan Hubicka <hubicka@ucw.cz>
20 * ipa-profile.c (ipa_propagate_frequency_1): Fix logic skipping calls
23 2018-01-24 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
25 * config/rs6000/rs6000.md (*call_indirect_nonlocal_sysv<mode>):
26 Simplify the clause that sets the length attribute.
27 (*call_value_indirect_nonlocal_sysv<mode>): Likewise.
28 (*sibcall_nonlocal_sysv<mode>): Clean up code block; simplify the
29 clause that sets the length attribute.
30 (*sibcall_value_nonlocal_sysv<mode>): Likewise.
32 2018-01-24 Tom de Vries <tom@codesourcery.com>
35 * config/nvptx/nvptx.c (WORKAROUND_PTXJIT_BUG_2): Define to 1.
36 (nvptx_pc_set, nvptx_condjump_label): New function. Copy from jump.c.
38 (prevent_branch_around_nothing): Insert dummy insn between branch to
39 label and label with no ptx insn inbetween.
40 * config/nvptx/nvptx.md (define_insn "fake_nop"): New insn.
42 2018-01-24 Tom de Vries <tom@codesourcery.com>
45 * config/nvptx/nvptx.c (nvptx_single): Add exit insn after noreturn call
46 for neutered threads in warp.
47 * config/nvptx/nvptx.md (define_insn "exit"): New insn.
49 2018-01-24 Richard Biener <rguenther@suse.de>
51 PR tree-optimization/83176
52 * tree-chrec.c (chrec_fold_plus_1): Handle (signed T){(T) .. }
55 2018-01-24 Richard Biener <rguenther@suse.de>
57 PR tree-optimization/82819
58 * graphite-isl-ast-to-gimple.c (binary_op_to_tree): Avoid
59 code generating pluses that are no-ops in the target precision.
61 2018-01-24 Richard Biener <rguenther@suse.de>
64 * tree-cfg.c (replace_loop_annotate): Handle annot_expr_parallel_kind.
66 2018-01-23 Jan Hubicka <hubicka@ucw.cz>
68 * cfgcleanup.c (try_crossjump_to_edge): Use combine_with_count
69 to merge probabilities.
70 * predict.c (probably_never_executed): Also mark as cold functions
71 with global 0 profile and guessed local profile.
72 * profile-count.c (profile_probability::combine_with_count): New
74 * profile-count.h (profile_probability::operator*,
75 profile_probability::operator*=, profile_probability::operator/,
76 profile_probability::operator/=): Reduce precision to adjusted
77 and set value to guessed on contradictory divisions.
78 (profile_probability::combine_with_freq): Remove.
79 (profile_probability::combine_wiht_count): Declare.
80 (profile_count::force_nonzero):: Set to adjusted.
81 (profile_count::probability_in):: Set quality to adjusted.
82 * tree-ssa-tail-merge.c (replace_block_by): Use
85 2018-01-23 Andrew Waterman <andrew@sifive.com>
86 Jim Wilson <jimw@sifive.com>
88 * config/riscv/riscv.c (riscv_stack_boundary): New.
89 (riscv_option_override): Set riscv_stack_boundary. Handle
90 riscv_preferred_stack_boundary_arg.
91 * config/riscv/riscv.h (MIN_STACK_BOUNDARY, ABI_STACK_BOUNDARY): New.
92 (BIGGEST_ALIGNMENT): Set to STACK_BOUNDARY.
93 (STACK_BOUNDARY): Set to riscv_stack_boundary.
94 (RISCV_STACK_ALIGN): Use STACK_BOUNDARY.
95 * config/riscv/riscv.opt (mpreferred-stack-boundary): New.
96 * doc/invoke.tex (RISC-V Options): Add -mpreferred-stack-boundary.
98 2018-01-23 H.J. Lu <hongjiu.lu@intel.com>
101 * config/i386/i386.c (ix86_expand_prologue): Use cost reference
102 of struct ix86_frame.
103 (ix86_expand_epilogue): Likewise. Add a local variable for
104 the reg_save_offset field in struct ix86_frame.
106 2018-01-23 Bin Cheng <bin.cheng@arm.com>
108 PR tree-optimization/82604
109 * tree-loop-distribution.c (enum partition_kind): New enum item
110 PKIND_PARTIAL_MEMSET.
111 (partition_builtin_p): Support above new enum item.
112 (generate_code_for_partition): Ditto.
113 (compute_access_range): Differentiate cases that equality can be
114 proven at all loops, the innermost loops or no loops.
115 (classify_builtin_st, classify_builtin_ldst): Adjust call to above
116 function. Set PKIND_PARTIAL_MEMSET for partition appropriately.
117 (finalize_partitions, distribute_loop): Don't fuse partition of
118 PKIND_PARTIAL_MEMSET kind when distributing 3-level loop nest.
119 (prepare_perfect_loop_nest): Distribute 3-level loop nest only if
122 2018-01-23 Martin Liska <mliska@suse.cz>
124 * predict.def (PRED_INDIR_CALL): Set probability to PROB_EVEN in
125 order to ignore the predictor.
126 (PRED_POLYMORPHIC_CALL): Likewise.
127 (PRED_RECURSIVE_CALL): Likewise.
129 2018-01-23 Martin Liska <mliska@suse.cz>
131 * tree-profile.c (tree_profiling): Print function header to
132 aware reader which function we are working on.
133 * value-prof.c (gimple_find_values_to_profile): Do not print
134 not interesting value histograms.
136 2018-01-23 Martin Liska <mliska@suse.cz>
138 * profile-count.h (enum profile_quality): Add
139 profile_uninitialized as the first value. Do not number values
140 as they are zero based.
141 (profile_count::verify): Update sanity check.
142 (profile_probability::verify): Likewise.
144 2018-01-23 Nathan Sidwell <nathan@acm.org>
146 * doc/invoke.texi (ffor-scope): Deprecate.
148 2018-01-23 David Malcolm <dmalcolm@redhat.com>
150 PR tree-optimization/83510
151 * domwalk.c (set_all_edges_as_executable): New function.
152 (dom_walker::dom_walker): Convert bool param
153 "skip_unreachable_blocks" to enum reachability. Move setup of
154 edge flags to set_all_edges_as_executable and only do it when
155 reachability is REACHABLE_BLOCKS.
156 * domwalk.h (enum dom_walker::reachability): New enum.
157 (dom_walker::dom_walker): Convert bool param
158 "skip_unreachable_blocks" to enum reachability.
159 (set_all_edges_as_executable): New decl.
160 * graphite-scop-detection.c (gather_bbs::gather_bbs): Convert
161 from false for "skip_unreachable_blocks" to ALL_BLOCKS for
163 * tree-ssa-dom.c (dom_opt_dom_walker::dom_opt_dom_walker): Likewise,
164 but converting true to REACHABLE_BLOCKS.
165 * tree-ssa-sccvn.c (sccvn_dom_walker::sccvn_dom_walker): Likewise.
167 (check_array_bounds_dom_walker::check_array_bounds_dom_walker):
168 Likewise, but converting it to REACHABLE_BLOCKS_PRESERVING_FLAGS.
169 (vrp_dom_walker::vrp_dom_walker): Likewise, but converting it to
171 (vrp_prop::vrp_finalize): Call set_all_edges_as_executable
172 if check_all_array_refs will be called.
174 2018-01-23 David Malcolm <dmalcolm@redhat.com>
176 * tree.c (selftest::test_location_wrappers): Add more test
179 2018-01-23 David Malcolm <dmalcolm@redhat.com>
181 * sbitmap.c (selftest::test_set_range): Fix memory leaks.
182 (selftest::test_bit_in_range): Likewise.
184 2018-01-23 Richard Sandiford <richard.sandiford@linaro.org>
187 * doc/sourcebuild.texi (vect_float): Say that the selector
188 only describes the situation when -funsafe-math-optimizations is on.
189 (vect_float_strict): Document.
191 2018-01-23 Richard Sandiford <richard.sandiford@linaro.org>
193 PR tree-optimization/83965
194 * tree-vect-patterns.c (vect_reassociating_reduction_p): New function.
195 (vect_recog_dot_prod_pattern, vect_recog_sad_pattern): Use it
196 instead of checking only for a reduction.
197 (vect_recog_widen_sum_pattern): Likewise.
199 2018-01-23 Jan Hubicka <hubicka@ucw.cz>
201 * predict.c (probably_never_executed): Only use precise profile info.
202 (compute_function_frequency): Skip after inlining hack since we now
203 have quality checking.
205 2018-01-23 Jan Hubicka <hubicka@ucw.cz>
207 * profile-count.h (profile_probability::very_unlikely,
208 profile_probability::unlikely, profile_probability::even): Set
209 precision to guessed.
211 2018-01-23 Richard Biener <rguenther@suse.de>
213 PR tree-optimization/83963
214 * graphite-scop-detection.c (scop_detection::harmful_loop_in_region):
215 Properly terminate dominator walk when crossing the exit edge not
216 when visiting its source block.
218 2018-01-23 Jakub Jelinek <jakub@redhat.com>
221 * tree.c (maybe_wrap_with_location): Use NON_LVALUE_EXPR rather than
222 VIEW_CONVERT_EXPR to wrap CONST_DECLs.
224 2018-01-22 Jakub Jelinek <jakub@redhat.com>
226 PR tree-optimization/83957
227 * omp-expand.c (expand_omp_for_generic): Ignore virtual PHIs. Remove
228 semicolon after for body surrounded by braces.
230 PR tree-optimization/83081
231 * profile-count.h (profile_probability::split): New method.
232 * dojump.c (do_jump_1) <case TRUTH_ANDIF_EXPR, case TRUTH_ORIF_EXPR>:
233 Use profile_probability::split.
234 (do_compare_rtx_and_jump): Fix adjustment of probabilities
235 when splitting a single conditional jump into 2.
237 2018-01-22 David Malcolm <dmalcolm@redhat.com>
239 PR tree-optimization/69452
240 * tree-ssa-loop-im.c (class move_computations_dom_walker): Remove
243 2018-01-22 Sebastian Perta <sebastian.perta@renesas.com>
245 * config/rl78/rl78-expand.md: New define_expand "bswaphi2"
246 * config/rl78/rl78-virt.md: New define_insn "*bswaphi2_virt"
247 * config/rl78/rl78-real.md: New define_insn "*bswaphi2_real"
249 2018-01-22 Sebastian Perta <sebastian.perta@renesas.com>
251 * config/rl78/rl78-protos.h: New function declaration rl78_split_movdi
252 * config/rl78/rl78.md: New define_expand "movdi"
253 * config/rl78/rl78.c: New function definition rl78_split_movdi
255 2018-01-22 Michael Meissner <meissner@linux.vnet.ibm.com>
258 * config/rs6000/rs6000-protos.h (rs6000_split_signbit): Delete,
260 * config/rs6000/rs6000.c (rs6000_split_signbit): Likewise.
261 * config/rs6000/rs6000.md (signbit<mode>2): Change code for IEEE
262 128-bit to produce an UNSPEC move to get the double word with the
263 signbit and then a shift directly to do signbit.
264 (signbit<mode>2_dm): Replace old IEEE 128-bit signbit
265 implementation with a new version that just does either a direct
266 move or a regular move. Move memory interface to separate insns.
267 Move insns so they are next to the expander.
268 (signbit<mode>2_dm_mem_be): New combiner insns to combine load
269 with signbit move. Split big and little endian case.
270 (signbit<mode>2_dm_mem_le): Likewise.
271 (signbit<mode>2_dm_<su>ext): Delete, no longer used.
272 (signbit<mode>2_dm2): Likewise.
274 2018-01-22 Sebastian Perta <sebastian.perta@renesas.com>
276 * config/rl78/rl78.md: New define_expand "anddi3".
278 2018-01-22 Sebastian Perta <sebastian.perta@renesas.com>
280 * config/rl78/rl78.md: New define_expand "umindi3".
282 2018-01-22 Sebastian Perta <sebastian.perta@renesas.com>
284 * config/rl78/rl78.md: New define_expand "smindi3".
286 2018-01-22 Sebastian Perta <sebastian.perta@renesas.com>
288 * config/rl78/rl78.md: New define_expand "smaxdi3".
290 2018-01-22 Carl Love <cel@us.ibm.com>
292 * config/rs6000/rs6000-builtin.def (ST_ELEMREV_V1TI, LD_ELEMREV_V1TI,
293 LVX_V1TI): Add macro expansion.
294 * config/rs6000/rs6000-c.c (altivec_builtin_types): Add argument
295 definitions for VSX_BUILTIN_VEC_XST_BE, VSX_BUILTIN_VEC_ST,
296 VSX_BUILTIN_VEC_XL, LD_ELEMREV_V1TI builtins.
297 * config/rs6000/rs6000-p8swap.c (insn_is_swappable_p);
298 Change check to determine if the instruction is a byte reversing
299 entry. Fix typo in comment.
300 * config/rs6000/rs6000.c (altivec_expand_builtin): Add case entry
301 for VSX_BUILTIN_ST_ELEMREV_V1TI and VSX_BUILTIN_LD_ELEMREV_V1TI.
302 Add def_builtin calls for new builtins.
303 * config/rs6000/vsx.md (vsx_st_elemrev_v1ti, vsx_ld_elemrev_v1ti):
304 Add define_insn expansion.
306 2018-01-22 Sebastian Perta <sebastian.perta@renesas.com>
308 * config/rl78/rl78.md: New define_expand "umaxdi3".
310 2018-01-22 Sebastian Perta <sebastian.perta@renesas.com>
312 * config/rl78/rl78.c (rl78_note_reg_set): fixed dead reg check
313 for non-QImode registers
315 2018-01-22 Richard Biener <rguenther@suse.de>
317 PR tree-optimization/83963
318 * graphite-scop-detection.c (scop_detection::get_sese): Delay
319 including the loop exit block.
320 (scop_detection::merge_sese): Likewise.
321 (scop_detection::add_scop): Do it here instead.
323 2018-01-22 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
325 * doc/sourcebuild.texi (arm_softfloat): Document.
327 2018-01-21 John David Anglin <danglin@gcc.gnu.org>
330 * config/pa/pa.c (pa_function_ok_for_sibcall): Use
331 targetm.binds_local_p instead of TREE_PUBLIC to check local binding.
332 Move TARGET_PORTABLE_RUNTIME check after TARGET_64BIT check.
334 2018-01-21 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
335 David Edelsohn <dje.gcc@gmail.com>
338 * config/rs6000/rs6000.md (*call_indirect_nonlocal_sysv<mode>):
339 Change "crset eq" to "crset 2".
340 (*call_value_indirect_nonlocal_sysv<mode>): Likewise.
341 (*call_indirect_aix<mode>_nospec): Likewise.
342 (*call_value_indirect_aix<mode>_nospec): Likewise.
343 (*call_indirect_elfv2<mode>_nospec): Likewise.
344 (*call_value_indirect_elfv2<mode>_nospec): Likewise.
345 (*sibcall_nonlocal_sysv<mode>): Change "crset eq" to "crset 2";
346 change assembly output from . to $.
347 (*sibcall_value_nonlocal_sysv<mode>): Likewise.
348 (indirect_jump<mode>_nospec): Change assembly output from . to $.
349 (*tablejump<mode>_internal1_nospec): Likewise.
351 2018-01-21 Oleg Endo <olegendo@gcc.gnu.org>
354 * config/sh/sh_optimize_sett_clrt.cc:
355 Use INCLUDE_ALGORITHM and INCLUDE_VECTOR instead of direct includes.
357 2018-01-20 Richard Sandiford <richard.sandiford@linaro.org>
359 PR tree-optimization/83940
360 * tree-vect-stmts.c (vect_truncate_gather_scatter_offset): Set
361 offset_dt to vect_constant_def rather than vect_unknown_def_type.
362 (vect_check_load_store_mask): Add a mask_dt_out parameter and
363 use it to pass back the definition type.
364 (vect_check_store_rhs): Likewise rhs_dt_out.
365 (vect_build_gather_load_calls): Add a mask_dt argument and use
366 it instead of a call to vect_is_simple_use.
367 (vectorizable_store): Update calls to vect_check_load_store_mask
368 and vect_check_store_rhs. Use the dt returned by the latter instead
369 of scatter_src_dt. Use the cached mask_dt and gs_info.offset_dt
370 instead of calls to vect_is_simple_use. Pass the scalar rather
371 than the vector operand to vect_is_simple_use when handling
372 second and subsequent copies of an rhs value.
373 (vectorizable_load): Update calls to vect_check_load_store_mask
374 and vect_build_gather_load_calls. Use the cached mask_dt and
375 gs_info.offset_dt instead of calls to vect_is_simple_use.
377 2018-01-20 Jakub Jelinek <jakub@redhat.com>
380 * tree-emutls.c: Include gimplify.h.
381 (lower_emutls_2): New function.
382 (lower_emutls_1): If ADDR_EXPR is a gimple invariant and walk_tree
383 with lower_emutls_2 callback finds some TLS decl in it, unshare_expr
384 it before further processing.
387 * simplify-rtx.c (simplify_binary_operation_1) <case UMOD>: Use
388 UINTVAL (trueop1) instead of INTVAL (op1).
390 2018-01-19 Jakub Jelinek <jakub@redhat.com>
394 * dwarf2cfi.c (DEFAULT_INCOMING_FRAME_SP_OFFSET): Define to
395 INCOMING_FRAME_SP_OFFSET if not defined.
396 (scan_trace): Add ENTRY argument. If true and
397 DEFAULT_INCOMING_FRAME_SP_OFFSET != INCOMING_FRAME_SP_OFFSET,
398 emit a note to adjust the CFA offset.
399 (create_cfi_notes): Adjust scan_trace callers.
400 (create_cie_data): Use DEFAULT_INCOMING_FRAME_SP_OFFSET rather than
401 INCOMING_FRAME_SP_OFFSET in the CIE.
402 * config/i386/i386.h (DEFAULT_INCOMING_FRAME_SP_OFFSET): Define.
403 * config/stormy16/stormy16.h (DEFAULT_INCOMING_FRAME_SP_OFFSET):
405 * doc/tm.texi.in (DEFAULT_INCOMING_FRAME_SP_OFFSET): Document.
406 * doc/tm.texi: Regenerated.
408 2018-01-19 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
410 PR rtl-optimization/83147
411 * lra-constraints.c (remove_inheritance_pseudos): Use
412 lra_substitute_pseudo_within_insn.
414 2018-01-19 Tom de Vries <tom@codesourcery.com>
415 Cesar Philippidis <cesar@codesourcery.com>
418 * config/nvptx/nvptx.c (nvptx_single): Fix jit workaround.
420 2018-01-19 Cesar Philippidis <cesar@codesourcery.com>
423 * config/nvptx/nvptx.c (output_init_frag): Don't use generic address
424 spaces for function labels.
426 2018-01-19 Martin Liska <mliska@suse.cz>
428 * predict.def (PRED_LOOP_EXIT): Change from 85 to 89.
429 (PRED_LOOP_EXIT_WITH_RECURSION): Change from 72 to 78.
430 (PRED_LOOP_EXTRA_EXIT): Change from 83 to 67.
431 (PRED_OPCODE_POSITIVE): Change from 64 to 59.
432 (PRED_TREE_OPCODE_POSITIVE): Change from 64 to 59.
433 (PRED_CONST_RETURN): Change from 69 to 65.
434 (PRED_NULL_RETURN): Change from 91 to 71.
435 (PRED_LOOP_IV_COMPARE_GUESS): Change from 98 to 64.
436 (PRED_LOOP_GUARD): Change from 66 to 73.
438 2018-01-19 Martin Liska <mliska@suse.cz>
440 * predict.c (predict_insn_def): Add new assert.
441 (struct branch_predictor): Change type to signed integer.
442 (test_prediction_value_range): Amend test to cover
444 * predict.def (PRED_LOOP_ITERATIONS): Use the new constant.
445 (PRED_LOOP_ITERATIONS_GUESSED): Likewise.
446 (PRED_LOOP_ITERATIONS_MAX): Likewise.
447 (PRED_LOOP_IV_COMPARE): Likewise.
448 * predict.h (PROB_UNINITIALIZED): Define new constant.
450 2018-01-19 Martin Liska <mliska@suse.cz>
452 * predict.c (dump_prediction): Add new format for
453 analyze_brprob.py script which is enabled with -details
455 * profile-count.h (precise_p): New function.
457 2018-01-19 Richard Sandiford <richard.sandiford@linaro.org>
459 PR tree-optimization/83922
460 * tree-vect-loop.c (vect_verify_full_masking): Return false if
461 there are no statements that need masking.
462 (vect_active_double_reduction_p): New function.
463 (vect_analyze_loop_operations): Use it when handling phis that
464 are not in the loop header.
466 2018-01-19 Richard Sandiford <richard.sandiford@linaro.org>
468 PR tree-optimization/83914
469 * tree-vect-loop.c (vectorizable_induction): Don't convert
470 init_expr or apply the peeling adjustment for inductions
471 that are nested within the vectorized loop.
473 2018-01-19 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
475 * config/arm/thumb2.md (*thumb2_negsi2_short): Use RSB mnemonic
478 2018-01-18 Jakub Jelinek <jakub@redhat.com>
482 * function.h (gimplify_parameters): Add gimple_seq * argument.
483 * function.c: Include gimple.h and options.h.
484 (gimplify_parameters): Add cleanup argument, add CLOBBER stmts
485 for the added local temporaries if needed.
486 * gimplify.c (gimplify_body): Adjust gimplify_parameters caller,
487 if there are any parameter cleanups, wrap whole body into a
488 try/finally with the cleanups.
490 2018-01-18 Wilco Dijkstra <wdijkstr@arm.com>
493 * config/aarch64/aarch64.c (aarch64_legitimate_constant_p):
494 Use GET_MODE_CLASS for scalar floating point.
496 2018-01-18 Jan Hubicka <hubicka@ucw.cz>
500 * cgraphclones.c (cgraph_node::create_version_clone_with_body):
501 Fix call of call_cgraph_insertion_hooks.
503 2018-01-18 Martin Sebor <msebor@redhat.com>
505 * doc/invoke.texi (-Wclass-memaccess): Tweak text.
507 2018-01-18 Jan Hubicka <hubicka@ucw.cz>
510 * cgraph.c (cgraph_edge::redirect_call_stmt_to_callee): Update edge
513 2018-01-18 Boris Kolpackov <boris@codesynthesis.com>
516 * common.opt: (-ffile-prefix-map): New option.
517 * opts.c (common_handle_option): Defer it.
518 * opts-global.c (handle_common_deferred_options): Handle it.
519 * debug.h (remap_debug_filename, add_debug_prefix_map): Move to...
520 * file-prefix-map.h: New file.
521 (remap_debug_filename, add_debug_prefix_map): ...here.
522 (add_macro_prefix_map, add_file_prefix_map, remap_macro_filename): New.
523 * final.c (debug_prefix_map, add_debug_prefix_map
524 remap_debug_filename): Move to...
525 * file-prefix-map.c: New file.
526 (file_prefix_map, add_prefix_map, remap_filename) ...here and rename,
527 generalize, get rid of alloca(), use strrchr() instead of strchr().
528 (add_macro_prefix_map, add_debug_prefix_map, add_file_prefix_map):
529 Implement in terms of add_prefix_map().
530 (remap_macro_filename, remap_debug_filename): Implement in term of
532 * Makefile.in (OBJS, PLUGIN_HEADERS): Add new files.
533 * builtins.c (fold_builtin_FILE): Call remap_macro_filename().
534 * dbxout.c: Include file-prefix-map.h.
535 * varasm.c: Likewise.
536 * vmsdbgout.c: Likewise.
537 * xcoffout.c: Likewise.
538 * dwarf2out.c: Likewise plus omit new options from DW_AT_producer.
539 * doc/cppopts.texi (-fmacro-prefix-map): Document.
540 * doc/invoke.texi (-ffile-prefix-map): Document.
541 (-fdebug-prefix-map): Update description.
543 2018-01-18 Martin Liska <mliska@suse.cz>
545 * config/i386/i386.c (indirect_thunk_name): Document that also
547 (output_indirect_thunk): Document why both instructions
548 (pause and lfence) are generated.
550 2018-01-18 Richard Biener <rguenther@suse.de>
552 PR tree-optimization/83887
553 * graphite-scop-detection.c
554 (scop_detection::get_nearest_dom_with_single_entry): Remove.
555 (scop_detection::get_nearest_pdom_with_single_exit): Likewise.
556 (scop_detection::merge_sese): Re-implement with a flood-fill
557 algorithm that properly finds a SESE region if it exists.
559 2018-01-18 Jakub Jelinek <jakub@redhat.com>
562 * match.pd ((P + A) - P, P - (P + A), (P + A) - (P + B)): For
563 pointer_diff optimizations use view_convert instead of convert.
565 2018-01-17 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
567 * config/rs6000/rs6000.md (*call_indirect_nonlocal_sysv<mode>):
568 Generate different code for -mno-speculate-indirect-jumps.
569 (*call_value_indirect_nonlocal_sysv<mode>): Likewise.
570 (*call_indirect_aix<mode>): Disable for
571 -mno-speculate-indirect-jumps.
572 (*call_indirect_aix<mode>_nospec): New define_insn.
573 (*call_value_indirect_aix<mode>): Disable for
574 -mno-speculate-indirect-jumps.
575 (*call_value_indirect_aix<mode>_nospec): New define_insn.
576 (*sibcall_nonlocal_sysv<mode>): Generate different code for
577 -mno-speculate-indirect-jumps.
578 (*sibcall_value_nonlocal_sysv<mode>): Likewise.
580 2018-01-17 Michael Meissner <meissner@linux.vnet.ibm.com>
582 * config/rs6000/rs6000.c (rs6000_emit_move): If we load or store a
583 long double type, set the flags for noting the default long double
584 type, even if we don't pass or return a long double type.
586 2018-01-17 Jan Hubicka <hubicka@ucw.cz>
589 * ipa-inline.c (flatten_function): Do not overwrite final inlining
592 2018-01-17 Will Schmidt <will_schmidt@vnet.ibm.com>
594 * config/rs6000/rs6000.c (rs6000_gimple_builtin): Add gimple folding
595 support for merge[hl].
596 (fold_mergehl_helper): New helper function.
597 (tree-vector-builder.h): New #include for tree_vector_builder usage.
598 * config/rs6000/altivec.md (altivec_vmrghw_direct): Add xxmrghw insn.
599 (altivec_vmrglw_direct): Add xxmrglw insn.
601 2018-01-17 Andrew Waterman <andrew@sifive.com>
603 * config/riscv/riscv.c (riscv_conditional_register_usage): If
604 UNITS_PER_FP_ARG is 0, set call_used_regs to 1 for all FP regs.
606 2018-01-17 David Malcolm <dmalcolm@redhat.com>
609 * ipa-devirt.c (add_type_duplicate): When comparing memory layout,
610 call the lto_location_cache before reading the
611 DECL_SOURCE_LOCATION of the types.
613 2018-01-17 Wilco Dijkstra <wdijkstr@arm.com>
614 Richard Sandiford <richard.sandiford@linaro.org>
616 * config/aarch64/aarch64.md (movti_aarch64): Use Uti constraint.
617 * config/aarch64/aarch64.c (aarch64_mov128_immediate): New function.
618 (aarch64_legitimate_constant_p): Just support CONST_DOUBLE
619 SF/DF/TF mode to avoid creating illegal CONST_WIDE_INT immediates.
620 * config/aarch64/aarch64-protos.h (aarch64_mov128_immediate):
622 * config/aarch64/constraints.md (aarch64_movti_operand):
624 * config/aarch64/predicates.md (Uti): Add new constraint.
626 2018-01-17 Carl Love <cel@us.ibm.com>
627 * config/rs6000/vsx.md (define_expand xl_len_r,
628 define_expand stxvl, define_expand *stxvl): Add match_dup argument.
629 (define_insn): Add, match_dup 1 argument to define_insn stxvll and
631 (define_expand, define_insn): Move the shift left from the
632 define_insn to the define_expand for lxvl and stxvl instructions.
633 * config/rs6000/rs6000-builtin.def (BU_P9V_64BIT_VSX_2): Change LXVL
634 and XL_LEN_R definitions to PURE.
636 2018-01-17 Uros Bizjak <ubizjak@gmail.com>
638 * config/i386/i386.c (indirect_thunk_name): Declare regno
639 as unsigned int. Compare regno with INVALID_REGNUM.
640 (output_indirect_thunk): Ditto.
641 (output_indirect_thunk_function): Ditto.
642 (ix86_code_end): Declare regno as unsigned int. Use INVALID_REGNUM
643 in the call to output_indirect_thunk_function.
645 2018-01-17 Richard Sandiford <richard.sandiford@linaro.org>
648 * expr.c (expand_expr_real_1): Use the size of GET_MODE (op0)
649 rather than the size of inner_type to determine the stack slot size
650 when handling VIEW_CONVERT_EXPRs on strict-alignment targets.
652 2018-01-16 Sebastian Peryt <sebastian.peryt@intel.com>
655 * config/i386/i386.c (ix86_option_override_internal): Add PTA_RDRND
658 2018-01-16 Michael Meissner <meissner@linux.vnet.ibm.com>
660 * config.gcc (powerpc*-linux*-*): Add support for 64-bit little
661 endian Linux systems to optionally enable multilibs for selecting
662 the long double type if the user configured an explicit type.
663 * config/rs6000/rs6000.h (TARGET_IEEEQUAD_MULTILIB): Indicate we
664 have no long double multilibs if not defined.
665 * config/rs6000/rs6000.c (rs6000_option_override_internal): Do not
666 warn if the user used -mabi={ieee,ibm}longdouble and we built
667 multilibs for long double.
668 * config/rs6000/linux64.h (MULTILIB_DEFAULTS_IEEE): Define as the
669 appropriate multilib option.
670 (MULTILIB_DEFAULTS): Add MULTILIB_DEFAULTS_IEEE to the default
672 * config/rs6000/t-ldouble-linux64le-ibm: New configuration files
673 for building long double multilibs.
674 * config/rs6000/t-ldouble-linux64le-ieee: Likewise.
676 2018-01-16 John David Anglin <danglin@gcc.gnu.org>
678 * config.gcc (hppa*-*-linux*): Change callee copies ABI to caller
681 * config/pa.h (MALLOC_ABI_ALIGNMENT): Set 32-bit alignment default to
683 * config/pa/pa32-linux.h (MALLOC_ABI_ALIGNMENT): Set alignment to
686 * config/pa/som.h (ASM_DECLARE_FUNCTION_NAME): Cleanup type and mode
689 * config/pa/pa.c (pa_function_arg_size): Apply CEIL to GET_MODE_SIZE
692 2018-01-16 Eric Botcazou <ebotcazou@adacore.com>
694 * gimple-ssa-warn-restrict.c (builtin_memref::builtin_memref): For an
695 ADDR_EXPR, do not count the offset of a COMPONENT_REF twice.
697 2018-01-16 Kelvin Nilsen <kelvin@gcc.gnu.org>
699 * config/rs6000/rs6000-p8swap.c (rs6000_gen_stvx): Generate
700 different rtl trees depending on TARGET_64BIT.
701 (rs6000_gen_lvx): Likewise.
703 2018-01-16 Eric Botcazou <ebotcazou@adacore.com>
705 * config/visium/visium.md (nop): Tweak comment.
706 (hazard_nop): Likewise.
708 2018-01-16 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
710 * config/rs6000/rs6000.c (rs6000_opt_vars): Add entry for
711 -mspeculate-indirect-jumps.
712 * config/rs6000/rs6000.md (*call_indirect_elfv2<mode>): Disable
713 for -mno-speculate-indirect-jumps.
714 (*call_indirect_elfv2<mode>_nospec): New define_insn.
715 (*call_value_indirect_elfv2<mode>): Disable for
716 -mno-speculate-indirect-jumps.
717 (*call_value_indirect_elfv2<mode>_nospec): New define_insn.
718 (indirect_jump): Emit different RTL for
719 -mno-speculate-indirect-jumps.
720 (*indirect_jump<mode>): Disable for
721 -mno-speculate-indirect-jumps.
722 (*indirect_jump<mode>_nospec): New define_insn.
723 (tablejump): Emit different RTL for
724 -mno-speculate-indirect-jumps.
725 (tablejumpsi): Disable for -mno-speculate-indirect-jumps.
726 (tablejumpsi_nospec): New define_expand.
727 (tablejumpdi): Disable for -mno-speculate-indirect-jumps.
728 (tablejumpdi_nospec): New define_expand.
729 (*tablejump<mode>_internal1): Disable for
730 -mno-speculate-indirect-jumps.
731 (*tablejump<mode>_internal1_nospec): New define_insn.
732 * config/rs6000/rs6000.opt (mspeculate-indirect-jumps): New
735 2018-01-16 Artyom Skrobov tyomitch@gmail.com
737 * caller-save.c (insert_save): Drop unnecessary parameter. All
740 2018-01-16 Jakub Jelinek <jakub@redhat.com>
741 Richard Biener <rguenth@suse.de>
744 * gimplify.c (gimplify_one_sizepos): For is_gimple_constant (expr)
745 return early, inline manually is_gimple_sizepos. Make sure if we
746 call gimplify_expr we don't end up with a gimple constant.
747 * tree.c (variably_modified_type_p): Don't return true for
748 is_gimple_constant (_t). Inline manually is_gimple_sizepos.
749 * gimplify.h (is_gimple_sizepos): Remove.
751 2018-01-16 Richard Sandiford <richard.sandiford@linaro.org>
753 PR tree-optimization/83857
754 * tree-vect-loop.c (vect_analyze_loop_operations): Don't call
755 vectorizable_live_operation for pure SLP statements.
756 (vectorizable_live_operation): Handle PHIs.
758 2018-01-16 Richard Biener <rguenther@suse.de>
760 PR tree-optimization/83867
761 * tree-vect-stmts.c (vect_transform_stmt): Precompute
762 nested_in_vect_loop_p since the scalar stmt may get invalidated.
764 2018-01-16 Jakub Jelinek <jakub@redhat.com>
767 * stor-layout.c (handle_warn_if_not_align): Use byte_position and
768 multiple_of_p instead of unchecked tree_to_uhwi and UHWI check.
769 If off is not INTEGER_CST, issue a may not be aligned warning
770 rather than isn't aligned. Use isn%'t rather than isn't.
771 * fold-const.c (multiple_of_p) <case BIT_AND_EXPR>: Don't fall through
773 <case MULT_EXPR>: Improve the case when bottom and one of the
774 MULT_EXPR operands are INTEGER_CSTs and bottom is multiple of that
775 operand, in that case check if the other operand is multiple of
776 bottom divided by the INTEGER_CST operand.
778 2018-01-16 Richard Sandiford <richard.sandiford@linaro.org>
781 * config/pa/pa.h (FUNCTION_ARG_SIZE): Delete.
782 * config/pa/pa-protos.h (pa_function_arg_size): Declare.
783 * config/pa/som.h (ASM_DECLARE_FUNCTION_NAME): Use
784 pa_function_arg_size instead of FUNCTION_ARG_SIZE.
785 * config/pa/pa.c (pa_function_arg_advance): Likewise.
786 (pa_function_arg, pa_arg_partial_bytes): Likewise.
787 (pa_function_arg_size): New function.
789 2018-01-16 Richard Sandiford <richard.sandiford@linaro.org>
791 * fold-const.c (fold_ternary_loc): Construct the vec_perm_indices
792 in a separate statement.
794 2018-01-16 Richard Sandiford <richard.sandiford@linaro.org>
796 PR tree-optimization/83847
797 * tree-vect-data-refs.c (vect_analyze_data_ref_accesses): Don't
798 group gathers and scatters.
800 2018-01-16 Jakub Jelinek <jakub@redhat.com>
802 PR rtl-optimization/86620
803 * params.def (max-sched-ready-insns): Bump minimum value to 1.
805 PR rtl-optimization/83213
806 * recog.c (peep2_attempt): Copy over CROSSING_JUMP_P from peepinsn
807 to last if both are JUMP_INSNs.
809 PR tree-optimization/83843
810 * gimple-ssa-store-merging.c
811 (imm_store_chain_info::output_merged_store): Handle bit_not_p on
812 store_immediate_info for bswap/nop orig_stores.
814 2018-01-15 Andrew Waterman <andrew@sifive.com>
816 * config/riscv/riscv.c (riscv_rtx_costs) <MULT>: Increase cost if
818 <UDIV>: Increase cost if !TARGET_DIV.
820 2018-01-15 Segher Boessenkool <segher@kernel.crashing.org>
822 * config/rs6000/rs6000.md (define_attr "type"): Remove delayed_cr.
823 (define_attr "cr_logical_3op"): New.
824 (cceq_ior_compare): Adjust.
825 (cceq_ior_compare_complement): Adjust.
826 (*cceq_rev_compare): Adjust.
827 * config/rs6000/rs6000.c (rs6000_adjust_cost): Adjust.
828 (is_cracked_insn): Adjust.
829 (insn_must_be_first_in_group): Adjust.
830 * config/rs6000/40x.md: Adjust.
831 * config/rs6000/440.md: Adjust.
832 * config/rs6000/476.md: Adjust.
833 * config/rs6000/601.md: Adjust.
834 * config/rs6000/603.md: Adjust.
835 * config/rs6000/6xx.md: Adjust.
836 * config/rs6000/7450.md: Adjust.
837 * config/rs6000/7xx.md: Adjust.
838 * config/rs6000/8540.md: Adjust.
839 * config/rs6000/cell.md: Adjust.
840 * config/rs6000/e300c2c3.md: Adjust.
841 * config/rs6000/e500mc.md: Adjust.
842 * config/rs6000/e500mc64.md: Adjust.
843 * config/rs6000/e5500.md: Adjust.
844 * config/rs6000/e6500.md: Adjust.
845 * config/rs6000/mpc.md: Adjust.
846 * config/rs6000/power4.md: Adjust.
847 * config/rs6000/power5.md: Adjust.
848 * config/rs6000/power6.md: Adjust.
849 * config/rs6000/power7.md: Adjust.
850 * config/rs6000/power8.md: Adjust.
851 * config/rs6000/power9.md: Adjust.
852 * config/rs6000/rs64.md: Adjust.
853 * config/rs6000/titan.md: Adjust.
855 2018-01-15 H.J. Lu <hongjiu.lu@intel.com>
857 * config/i386/predicates.md (indirect_branch_operand): Rewrite
858 ix86_indirect_branch_register logic.
860 2018-01-15 H.J. Lu <hongjiu.lu@intel.com>
862 * config/i386/constraints.md (Bs): Update
863 ix86_indirect_branch_register check. Don't check
864 ix86_indirect_branch_register with GOT_memory_operand.
866 * config/i386/predicates.md (GOT_memory_operand): Don't check
867 ix86_indirect_branch_register here.
868 (GOT32_symbol_operand): Likewise.
870 2018-01-15 H.J. Lu <hongjiu.lu@intel.com>
872 * config/i386/predicates.md (constant_call_address_operand):
873 Rewrite ix86_indirect_branch_register logic.
874 (sibcall_insn_operand): Likewise.
876 2018-01-15 H.J. Lu <hongjiu.lu@intel.com>
878 * config/i386/constraints.md (Bs): Replace
879 ix86_indirect_branch_thunk_register with
880 ix86_indirect_branch_register.
882 * config/i386/i386.md (indirect_jump): Likewise.
883 (tablejump): Likewise.
884 (*sibcall_memory): Likewise.
885 (*sibcall_value_memory): Likewise.
886 Peepholes of indirect call and jump via memory: Likewise.
887 * config/i386/i386.opt: Likewise.
888 * config/i386/predicates.md (indirect_branch_operand): Likewise.
889 (GOT_memory_operand): Likewise.
890 (call_insn_operand): Likewise.
891 (sibcall_insn_operand): Likewise.
892 (GOT32_symbol_operand): Likewise.
894 2018-01-15 Jakub Jelinek <jakub@redhat.com>
897 * omp-expand.c (expand_omp_atomic_pipeline): Use loaded_val
898 type rather than type addr's type points to.
899 (expand_omp_atomic_mutex): Likewise.
900 (expand_omp_atomic): Likewise.
902 2018-01-15 H.J. Lu <hongjiu.lu@intel.com>
905 * config/i386/i386.c (output_indirect_thunk_function): Use
906 ASM_OUTPUT_LABEL, instead of ASM_OUTPUT_DEF, for TARGET_MACHO
907 for __x86_return_thunk.
909 2018-01-15 Richard Biener <rguenther@suse.de>
912 * expmed.c (extract_bit_field_1): Fix typo.
914 2018-01-15 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
917 * config/arm/iterators.md (VF): New mode iterator.
918 * config/arm/neon.md (neon_vabd<mode>_2): Use the above.
919 Remove integer-related logic from pattern.
920 (neon_vabd<mode>_3): Likewise.
922 2018-01-15 Jakub Jelinek <jakub@redhat.com>
925 * common.opt (fstrict-overflow): No longer an alias.
926 (fwrapv-pointer): New option.
927 * tree.h (TYPE_OVERFLOW_WRAPS, TYPE_OVERFLOW_UNDEFINED): Define
928 also for pointer types based on flag_wrapv_pointer.
929 * opts.c (common_handle_option) <case OPT_fstrict_overflow>: Set
930 opts->x_flag_wrap[pv] to !value, clear opts->x_flag_trapv if
931 opts->x_flag_wrapv got set.
932 * fold-const.c (fold_comparison, fold_binary_loc): Revert 2017-08-01
933 changes, just use TYPE_OVERFLOW_UNDEFINED on pointer type instead of
934 POINTER_TYPE_OVERFLOW_UNDEFINED.
935 * match.pd: Likewise in address comparison pattern.
936 * doc/invoke.texi: Document -fwrapv and -fstrict-overflow.
938 2018-01-15 Richard Biener <rguenther@suse.de>
941 * tree.c (free_lang_data_in_type): Always unlink TYPE_DECLs
942 from TYPE_FIELDS. Free TYPE_BINFO if not used by devirtualization.
943 Reset type names to their identifier if their TYPE_DECL doesn't
944 have linkage (and thus is used for ODR and devirt).
945 (save_debug_info_for_decl): Remove.
946 (save_debug_info_for_type): Likewise.
947 (add_tree_to_fld_list): Adjust.
948 * tree-pretty-print.c (dump_generic_node): Make dumping of
949 type names more robust.
951 2018-01-15 Richard Biener <rguenther@suse.de>
953 * BASE-VER: Bump to 8.0.1.
955 2018-01-14 Martin Sebor <msebor@redhat.com>
958 * builtins.c (check_access): Avoid warning when the no-warning bit
961 2018-01-14 Cory Fields <cory-nospam-@coryfields.com>
963 * tree-ssa-loop-im.c (sort_bbs_in_loop_postorder_cmp): Stabilize sort.
964 * ira-color (allocno_hard_regs_compare): Likewise.
966 2018-01-14 Nathan Rossi <nathan@nathanrossi.com>
969 * config/microblaze/microblaze.c (microblaze_asm_output_ident):
970 Use .pushsection/.popsection.
972 2018-01-14 Martin Sebor <msebor@redhat.com>
975 * doc/invoke.texi (-Wlass-memaccess): Document suppression by casting.
977 2018-01-14 Jakub Jelinek <jakub@redhat.com>
979 * config.gcc (i[34567]86-*-*): Remove one duplicate gfniintrin.h
980 entry from extra_headers.
981 (x86_64-*-*): Remove two duplicate gfniintrin.h entries from
982 extra_headers, make the list bitwise identical to the i?86-*-* one.
984 2018-01-14 H.J. Lu <hongjiu.lu@intel.com>
986 * config/i386/i386.c (ix86_set_indirect_branch_type): Disallow
987 -mcmodel=large with -mindirect-branch=thunk,
988 -mindirect-branch=thunk-extern, -mfunction-return=thunk and
989 -mfunction-return=thunk-extern.
990 * doc/invoke.texi: Document -mcmodel=large is incompatible with
991 -mindirect-branch=thunk, -mindirect-branch=thunk-extern,
992 -mfunction-return=thunk and -mfunction-return=thunk-extern.
994 2018-01-14 H.J. Lu <hongjiu.lu@intel.com>
996 * config/i386/i386.c (print_reg): Print the name of the full
997 integer register without '%'.
998 (ix86_print_operand): Handle 'V'.
999 * doc/extend.texi: Document 'V' modifier.
1001 2018-01-14 H.J. Lu <hongjiu.lu@intel.com>
1003 * config/i386/constraints.md (Bs): Disallow memory operand for
1004 -mindirect-branch-register.
1006 * config/i386/predicates.md (indirect_branch_operand): Likewise.
1007 (GOT_memory_operand): Likewise.
1008 (call_insn_operand): Likewise.
1009 (sibcall_insn_operand): Likewise.
1010 (GOT32_symbol_operand): Likewise.
1011 * config/i386/i386.md (indirect_jump): Call convert_memory_address
1012 for -mindirect-branch-register.
1013 (tablejump): Likewise.
1014 (*sibcall_memory): Likewise.
1015 (*sibcall_value_memory): Likewise.
1016 Disallow peepholes of indirect call and jump via memory for
1017 -mindirect-branch-register.
1018 (*call_pop): Replace m with Bw.
1019 (*call_value_pop): Likewise.
1020 (*sibcall_pop_memory): Replace m with Bs.
1021 * config/i386/i386.opt (mindirect-branch-register): New option.
1022 * doc/invoke.texi: Document -mindirect-branch-register option.
1024 2018-01-14 H.J. Lu <hongjiu.lu@intel.com>
1026 * config/i386/i386-protos.h (ix86_output_function_return): New.
1027 * config/i386/i386.c (ix86_set_indirect_branch_type): Also
1028 set function_return_type.
1029 (indirect_thunk_name): Add ret_p to indicate thunk for function
1031 (output_indirect_thunk_function): Pass false to
1032 indirect_thunk_name.
1033 (ix86_output_indirect_branch_via_reg): Likewise.
1034 (ix86_output_indirect_branch_via_push): Likewise.
1035 (output_indirect_thunk_function): Create alias for function
1036 return thunk if regno < 0.
1037 (ix86_output_function_return): New function.
1038 (ix86_handle_fndecl_attribute): Handle function_return.
1039 (ix86_attribute_table): Add function_return.
1040 * config/i386/i386.h (machine_function): Add
1041 function_return_type.
1042 * config/i386/i386.md (simple_return_internal): Use
1043 ix86_output_function_return.
1044 (simple_return_internal_long): Likewise.
1045 * config/i386/i386.opt (mfunction-return=): New option.
1046 (indirect_branch): Mention -mfunction-return=.
1047 * doc/extend.texi: Document function_return function attribute.
1048 * doc/invoke.texi: Document -mfunction-return= option.
1050 2018-01-14 H.J. Lu <hongjiu.lu@intel.com>
1052 * config/i386/i386-opts.h (indirect_branch): New.
1053 * config/i386/i386-protos.h (ix86_output_indirect_jmp): Likewise.
1054 * config/i386/i386.c (ix86_using_red_zone): Disallow red-zone
1055 with local indirect jump when converting indirect call and jump.
1056 (ix86_set_indirect_branch_type): New.
1057 (ix86_set_current_function): Call ix86_set_indirect_branch_type.
1058 (indirectlabelno): New.
1059 (indirect_thunk_needed): Likewise.
1060 (indirect_thunk_bnd_needed): Likewise.
1061 (indirect_thunks_used): Likewise.
1062 (indirect_thunks_bnd_used): Likewise.
1063 (INDIRECT_LABEL): Likewise.
1064 (indirect_thunk_name): Likewise.
1065 (output_indirect_thunk): Likewise.
1066 (output_indirect_thunk_function): Likewise.
1067 (ix86_output_indirect_branch_via_reg): Likewise.
1068 (ix86_output_indirect_branch_via_push): Likewise.
1069 (ix86_output_indirect_branch): Likewise.
1070 (ix86_output_indirect_jmp): Likewise.
1071 (ix86_code_end): Call output_indirect_thunk_function if needed.
1072 (ix86_output_call_insn): Call ix86_output_indirect_branch if
1074 (ix86_handle_fndecl_attribute): Handle indirect_branch.
1075 (ix86_attribute_table): Add indirect_branch.
1076 * config/i386/i386.h (machine_function): Add indirect_branch_type
1077 and has_local_indirect_jump.
1078 * config/i386/i386.md (indirect_jump): Set has_local_indirect_jump
1080 (tablejump): Likewise.
1081 (*indirect_jump): Use ix86_output_indirect_jmp.
1082 (*tablejump_1): Likewise.
1083 (simple_return_indirect_internal): Likewise.
1084 * config/i386/i386.opt (mindirect-branch=): New option.
1085 (indirect_branch): New.
1088 (thunk-inline): Likewise.
1089 (thunk-extern): Likewise.
1090 * doc/extend.texi: Document indirect_branch function attribute.
1091 * doc/invoke.texi: Document -mindirect-branch= option.
1093 2018-01-14 Jan Hubicka <hubicka@ucw.cz>
1096 * ipa-inline.c (edge_badness): Tolerate roundoff errors.
1098 2018-01-14 Richard Sandiford <richard.sandiford@linaro.org>
1100 * ipa-inline.c (want_inline_small_function_p): Return false if
1101 inlining has already failed with CIF_FINAL_ERROR.
1102 (update_caller_keys): Call want_inline_small_function_p before
1104 (update_callee_keys): Likewise.
1106 2018-01-10 Kelvin Nilsen <kelvin@gcc.gnu.org>
1108 * config/rs6000/rs6000-p8swap.c (rs6000_sum_of_two_registers_p):
1110 (rs6000_quadword_masked_address_p): Likewise.
1111 (quad_aligned_load_p): Likewise.
1112 (quad_aligned_store_p): Likewise.
1113 (const_load_sequence_p): Add comment to describe the outer-most loop.
1114 (mimic_memory_attributes_and_flags): New function.
1115 (rs6000_gen_stvx): Likewise.
1116 (replace_swapped_aligned_store): Likewise.
1117 (rs6000_gen_lvx): Likewise.
1118 (replace_swapped_aligned_load): Likewise.
1119 (replace_swapped_load_constant): Capitalize argument name in
1120 comment describing this function.
1121 (rs6000_analyze_swaps): Add a third pass to search for vector loads
1122 and stores that access quad-word aligned addresses and replace
1123 with stvx or lvx instructions when appropriate.
1124 * config/rs6000/rs6000-protos.h (rs6000_sum_of_two_registers_p):
1125 New function prototype.
1126 (rs6000_quadword_masked_address_p): Likewise.
1127 (rs6000_gen_lvx): Likewise.
1128 (rs6000_gen_stvx): Likewise.
1129 * config/rs6000/vsx.md (*vsx_le_perm_load_<mode>): For modes
1130 VSX_D (V2DF, V2DI), modify this split to select lvx instruction
1131 when memory address is aligned.
1132 (*vsx_le_perm_load_<mode>): For modes VSX_W (V4SF, V4SI), modify
1133 this split to select lvx instruction when memory address is aligned.
1134 (*vsx_le_perm_load_v8hi): Modify this split to select lvx
1135 instruction when memory address is aligned.
1136 (*vsx_le_perm_load_v16qi): Likewise.
1137 (four unnamed splitters): Modify to select the stvx instruction
1138 when memory is aligned.
1140 2018-01-13 Jan Hubicka <hubicka@ucw.cz>
1142 * predict.c (determine_unlikely_bbs): Handle correctly BBs
1143 which appears in the queue multiple times.
1145 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org>
1146 Alan Hayward <alan.hayward@arm.com>
1147 David Sherwood <david.sherwood@arm.com>
1149 * tree-vectorizer.h (vec_lower_bound): New structure.
1150 (_loop_vec_info): Add check_nonzero and lower_bounds.
1151 (LOOP_VINFO_CHECK_NONZERO): New macro.
1152 (LOOP_VINFO_LOWER_BOUNDS): Likewise.
1153 (LOOP_REQUIRES_VERSIONING_FOR_ALIAS): Check lower_bounds too.
1154 * tree-data-ref.h (dr_with_seg_len): Add access_size and align
1155 fields. Make seg_len the distance travelled, not including the
1157 (dr_direction_indicator): Declare.
1158 (dr_zero_step_indicator): Likewise.
1159 (dr_known_forward_stride_p): Likewise.
1160 * tree-data-ref.c: Include stringpool.h, tree-vrp.h and
1162 (runtime_alias_check_p): Allow runtime alias checks with
1164 (operator ==): Compare access_size and align.
1165 (prune_runtime_alias_test_list): Rework for new distinction between
1166 the access_size and seg_len.
1167 (create_intersect_range_checks_index): Likewise. Cope with polynomial
1169 (get_segment_min_max): New function.
1170 (create_intersect_range_checks): Use it.
1171 (dr_step_indicator): New function.
1172 (dr_direction_indicator): Likewise.
1173 (dr_zero_step_indicator): Likewise.
1174 (dr_known_forward_stride_p): Likewise.
1175 * tree-loop-distribution.c (data_ref_segment_size): Return
1176 DR_STEP * (niters - 1).
1177 (compute_alias_check_pairs): Update call to the dr_with_seg_len
1179 * tree-vect-data-refs.c (vect_check_nonzero_value): New function.
1180 (vect_preserves_scalar_order_p): New function, split out from...
1181 (vect_analyze_data_ref_dependence): ...here. Check for zero steps.
1182 (vect_vfa_segment_size): Return DR_STEP * (length_factor - 1).
1183 (vect_vfa_access_size): New function.
1184 (vect_vfa_align): Likewise.
1185 (vect_compile_time_alias): Take access_size_a and access_b arguments.
1186 (dump_lower_bound): New function.
1187 (vect_check_lower_bound): Likewise.
1188 (vect_small_gap_p): Likewise.
1189 (vectorizable_with_step_bound_p): Likewise.
1190 (vect_prune_runtime_alias_test_list): Ignore cross-iteration
1191 depencies if the vectorization factor is 1. Convert the checks
1192 for nonzero steps into checks on the bounds of DR_STEP. Try using
1193 a bunds check for variable steps if the minimum required step is
1194 relatively small. Update calls to the dr_with_seg_len
1195 constructor and to vect_compile_time_alias.
1196 * tree-vect-loop-manip.c (vect_create_cond_for_lower_bounds): New
1198 (vect_loop_versioning): Call it.
1199 * tree-vect-loop.c (vect_analyze_loop_2): Clear LOOP_VINFO_LOWER_BOUNDS
1201 (vect_estimate_min_profitable_iters): Account for any bounds checks.
1203 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org>
1204 Alan Hayward <alan.hayward@arm.com>
1205 David Sherwood <david.sherwood@arm.com>
1207 * doc/sourcebuild.texi (vect_scatter_store): Document.
1208 * optabs.def (scatter_store_optab, mask_scatter_store_optab): New
1210 * doc/md.texi (scatter_store@var{m}, mask_scatter_store@var{m}):
1212 * genopinit.c (main): Add supports_vec_scatter_store and
1213 supports_vec_scatter_store_cached to target_optabs.
1214 * gimple.h (gimple_expr_type): Handle IFN_SCATTER_STORE and
1215 IFN_MASK_SCATTER_STORE.
1216 * internal-fn.def (SCATTER_STORE, MASK_SCATTER_STORE): New internal
1218 * internal-fn.h (internal_store_fn_p): Declare.
1219 (internal_fn_stored_value_index): Likewise.
1220 * internal-fn.c (scatter_store_direct): New macro.
1221 (expand_scatter_store_optab_fn): New function.
1222 (direct_scatter_store_optab_supported_p): New macro.
1223 (internal_store_fn_p): New function.
1224 (internal_gather_scatter_fn_p): Handle IFN_SCATTER_STORE and
1225 IFN_MASK_SCATTER_STORE.
1226 (internal_fn_mask_index): Likewise.
1227 (internal_fn_stored_value_index): New function.
1228 (internal_gather_scatter_fn_supported_p): Adjust operand numbers
1230 * optabs-query.h (supports_vec_scatter_store_p): Declare.
1231 * optabs-query.c (supports_vec_scatter_store_p): New function.
1232 * tree-vectorizer.h (vect_get_store_rhs): Declare.
1233 * tree-vect-data-refs.c (vect_analyze_data_ref_access): Return
1234 true for scatter stores.
1235 (vect_gather_scatter_fn_p): Handle scatter stores too.
1236 (vect_check_gather_scatter): Consider using scatter stores if
1237 supports_vec_scatter_store_p.
1238 * tree-vect-patterns.c (vect_try_gather_scatter_pattern): Handle
1240 * tree-vect-stmts.c (exist_non_indexing_operands_for_use_p): Use
1241 internal_fn_stored_value_index.
1242 (check_load_store_masking): Handle scatter stores too.
1243 (vect_get_store_rhs): Make public.
1244 (vectorizable_call): Use internal_store_fn_p.
1245 (vectorizable_store): Handle scatter store internal functions.
1246 (vect_transform_stmt): Compare GROUP_STORE_COUNT with GROUP_SIZE
1247 when deciding whether the end of the group has been reached.
1248 * config/aarch64/aarch64.md (UNSPEC_ST1_SCATTER): New unspec.
1249 * config/aarch64/aarch64-sve.md (scatter_store<mode>): New expander.
1250 (mask_scatter_store<mode>): New insns.
1252 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org>
1253 Alan Hayward <alan.hayward@arm.com>
1254 David Sherwood <david.sherwood@arm.com>
1256 * tree-vectorizer.h (vect_gather_scatter_fn_p): Declare.
1257 * tree-vect-data-refs.c (vect_gather_scatter_fn_p): Make public.
1258 * tree-vect-stmts.c (vect_truncate_gather_scatter_offset): New
1260 (vect_use_strided_gather_scatters_p): Take a masked_p argument.
1261 Use vect_truncate_gather_scatter_offset if we can't treat the
1262 operation as a normal gather load or scatter store.
1263 (get_group_load_store_type): Take the gather_scatter_info
1264 as argument. Try using a gather load or scatter store for
1265 single-element groups.
1266 (get_load_store_type): Update calls to get_group_load_store_type
1267 and vect_use_strided_gather_scatters_p.
1269 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org>
1270 Alan Hayward <alan.hayward@arm.com>
1271 David Sherwood <david.sherwood@arm.com>
1273 * tree-vectorizer.h (vect_create_data_ref_ptr): Take an extra
1274 optional tree argument.
1275 * tree-vect-data-refs.c (vect_check_gather_scatter): Check for
1277 (vect_create_data_ref_ptr): Take the iv_step as an optional argument,
1278 but continue to use the current value as a fallback.
1279 (bump_vector_ptr): Use operand_equal_p rather than tree_int_cst_compare
1280 to compare the updates.
1281 * tree-vect-stmts.c (vect_use_strided_gather_scatters_p): New function.
1282 (get_load_store_type): Use it when handling a strided access.
1283 (vect_get_strided_load_store_ops): New function.
1284 (vect_get_data_ptr_increment): Likewise.
1285 (vectorizable_load): Handle strided gather loads. Always pass
1286 a step to vect_create_data_ref_ptr and bump_vector_ptr.
1288 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org>
1289 Alan Hayward <alan.hayward@arm.com>
1290 David Sherwood <david.sherwood@arm.com>
1292 * doc/md.texi (gather_load@var{m}): Document.
1293 (mask_gather_load@var{m}): Likewise.
1294 * genopinit.c (main): Add supports_vec_gather_load and
1295 supports_vec_gather_load_cached to target_optabs.
1296 * optabs-tree.c (init_tree_optimization_optabs): Use
1297 ggc_cleared_alloc to allocate target_optabs.
1298 * optabs.def (gather_load_optab, mask_gather_laod_optab): New optabs.
1299 * internal-fn.def (GATHER_LOAD, MASK_GATHER_LOAD): New internal
1301 * internal-fn.h (internal_load_fn_p): Declare.
1302 (internal_gather_scatter_fn_p): Likewise.
1303 (internal_fn_mask_index): Likewise.
1304 (internal_gather_scatter_fn_supported_p): Likewise.
1305 * internal-fn.c (gather_load_direct): New macro.
1306 (expand_gather_load_optab_fn): New function.
1307 (direct_gather_load_optab_supported_p): New macro.
1308 (direct_internal_fn_optab): New function.
1309 (internal_load_fn_p): Likewise.
1310 (internal_gather_scatter_fn_p): Likewise.
1311 (internal_fn_mask_index): Likewise.
1312 (internal_gather_scatter_fn_supported_p): Likewise.
1313 * optabs-query.c (supports_at_least_one_mode_p): New function.
1314 (supports_vec_gather_load_p): Likewise.
1315 * optabs-query.h (supports_vec_gather_load_p): Declare.
1316 * tree-vectorizer.h (gather_scatter_info): Add ifn, element_type
1317 and memory_type field.
1318 (NUM_PATTERNS): Bump to 15.
1319 * tree-vect-data-refs.c: Include internal-fn.h.
1320 (vect_gather_scatter_fn_p): New function.
1321 (vect_describe_gather_scatter_call): Likewise.
1322 (vect_check_gather_scatter): Try using internal functions for
1323 gather loads. Recognize existing calls to a gather load function.
1324 (vect_analyze_data_refs): Consider using gather loads if
1325 supports_vec_gather_load_p.
1326 * tree-vect-patterns.c (vect_get_load_store_mask): New function.
1327 (vect_get_gather_scatter_offset_type): Likewise.
1328 (vect_convert_mask_for_vectype): Likewise.
1329 (vect_add_conversion_to_patterm): Likewise.
1330 (vect_try_gather_scatter_pattern): Likewise.
1331 (vect_recog_gather_scatter_pattern): New pattern recognizer.
1332 (vect_vect_recog_func_ptrs): Add it.
1333 * tree-vect-stmts.c (exist_non_indexing_operands_for_use_p): Use
1334 internal_fn_mask_index and internal_gather_scatter_fn_p.
1335 (check_load_store_masking): Take the gather_scatter_info as an
1336 argument and handle gather loads.
1337 (vect_get_gather_scatter_ops): New function.
1338 (vectorizable_call): Check internal_load_fn_p.
1339 (vectorizable_load): Likewise. Handle gather load internal
1341 (vectorizable_store): Update call to check_load_store_masking.
1342 * config/aarch64/aarch64.md (UNSPEC_LD1_GATHER): New unspec.
1343 * config/aarch64/iterators.md (SVE_S, SVE_D): New mode iterators.
1344 * config/aarch64/predicates.md (aarch64_gather_scale_operand_w)
1345 (aarch64_gather_scale_operand_d): New predicates.
1346 * config/aarch64/aarch64-sve.md (gather_load<mode>): New expander.
1347 (mask_gather_load<mode>): New insns.
1349 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org>
1350 Alan Hayward <alan.hayward@arm.com>
1351 David Sherwood <david.sherwood@arm.com>
1353 * optabs.def (fold_left_plus_optab): New optab.
1354 * doc/md.texi (fold_left_plus_@var{m}): Document.
1355 * internal-fn.def (IFN_FOLD_LEFT_PLUS): New internal function.
1356 * internal-fn.c (fold_left_direct): Define.
1357 (expand_fold_left_optab_fn): Likewise.
1358 (direct_fold_left_optab_supported_p): Likewise.
1359 * fold-const-call.c (fold_const_fold_left): New function.
1360 (fold_const_call): Use it to fold CFN_FOLD_LEFT_PLUS.
1361 * tree-parloops.c (valid_reduction_p): New function.
1362 (gather_scalar_reductions): Use it.
1363 * tree-vectorizer.h (FOLD_LEFT_REDUCTION): New vect_reduction_type.
1364 (vect_finish_replace_stmt): Declare.
1365 * tree-vect-loop.c (fold_left_reduction_fn): New function.
1366 (needs_fold_left_reduction_p): New function, split out from...
1367 (vect_is_simple_reduction): ...here. Accept reductions that
1368 forbid reassociation, but give them type FOLD_LEFT_REDUCTION.
1369 (vect_force_simple_reduction): Also store the reduction type in
1370 the assignment's STMT_VINFO_REDUC_TYPE.
1371 (vect_model_reduction_cost): Handle FOLD_LEFT_REDUCTION.
1372 (merge_with_identity): New function.
1373 (vect_expand_fold_left): Likewise.
1374 (vectorize_fold_left_reduction): Likewise.
1375 (vectorizable_reduction): Handle FOLD_LEFT_REDUCTION. Leave the
1376 scalar phi in place for it. Check for target support and reject
1377 cases that would reassociate the operation. Defer the transform
1378 phase to vectorize_fold_left_reduction.
1379 * config/aarch64/aarch64.md (UNSPEC_FADDA): New unspec.
1380 * config/aarch64/aarch64-sve.md (fold_left_plus_<mode>): New expander.
1381 (*fold_left_plus_<mode>, *pred_fold_left_plus_<mode>): New insns.
1383 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org>
1385 * tree-if-conv.c (predicate_mem_writes): Remove redundant
1386 call to ifc_temp_var.
1388 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org>
1389 Alan Hayward <alan.hayward@arm.com>
1390 David Sherwood <david.sherwood@arm.com>
1392 * target.def (legitimize_address_displacement): Take the original
1393 offset as a poly_int.
1394 * targhooks.h (default_legitimize_address_displacement): Update
1396 * targhooks.c (default_legitimize_address_displacement): Likewise.
1397 * doc/tm.texi: Regenerate.
1398 * lra-constraints.c (base_plus_disp_to_reg): Take the displacement
1399 as an argument, moving assert of ad->disp == ad->disp_term to...
1400 (process_address_1): ...here. Update calls to base_plus_disp_to_reg.
1401 Try calling targetm.legitimize_address_displacement before expanding
1402 the address rather than afterwards, and adjust for the new interface.
1403 * config/aarch64/aarch64.c (aarch64_legitimize_address_displacement):
1404 Match the new hook interface. Handle SVE addresses.
1405 * config/sh/sh.c (sh_legitimize_address_displacement): Make the
1408 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org>
1410 * Makefile.in (OBJS): Add early-remat.o.
1411 * target.def (select_early_remat_modes): New hook.
1412 * doc/tm.texi.in (TARGET_SELECT_EARLY_REMAT_MODES): New hook.
1413 * doc/tm.texi: Regenerate.
1414 * targhooks.h (default_select_early_remat_modes): Declare.
1415 * targhooks.c (default_select_early_remat_modes): New function.
1416 * timevar.def (TV_EARLY_REMAT): New timevar.
1417 * passes.def (pass_early_remat): New pass.
1418 * tree-pass.h (make_pass_early_remat): Declare.
1419 * early-remat.c: New file.
1420 * config/aarch64/aarch64.c (aarch64_select_early_remat_modes): New
1422 (TARGET_SELECT_EARLY_REMAT_MODES): Define.
1424 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org>
1425 Alan Hayward <alan.hayward@arm.com>
1426 David Sherwood <david.sherwood@arm.com>
1428 * tree-vect-loop-manip.c (vect_gen_scalar_loop_niters): Replace
1429 vfm1 with a bound_epilog parameter.
1430 (vect_do_peeling): Update calls accordingly, and move the prologue
1431 call earlier in the function. Treat the base bound_epilog as 0 for
1432 fully-masked loops and retain vf - 1 for other loops. Add 1 to
1433 this base when peeling for gaps.
1434 * tree-vect-loop.c (vect_analyze_loop_2): Allow peeling for gaps
1435 with fully-masked loops.
1436 (vect_estimate_min_profitable_iters): Handle the single peeled
1437 iteration in that case.
1439 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org>
1440 Alan Hayward <alan.hayward@arm.com>
1441 David Sherwood <david.sherwood@arm.com>
1443 * tree-vect-data-refs.c (vect_analyze_group_access_1): Allow
1444 single-element interleaving even if the size is not a power of 2.
1445 * tree-vect-stmts.c (get_load_store_type): Disallow elementwise
1446 accesses for single-element interleaving if the group size is
1449 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org>
1450 Alan Hayward <alan.hayward@arm.com>
1451 David Sherwood <david.sherwood@arm.com>
1453 * doc/md.texi (fold_extract_last_@var{m}): Document.
1454 * doc/sourcebuild.texi (vect_fold_extract_last): Likewise.
1455 * optabs.def (fold_extract_last_optab): New optab.
1456 * internal-fn.def (FOLD_EXTRACT_LAST): New internal function.
1457 * internal-fn.c (fold_extract_direct): New macro.
1458 (expand_fold_extract_optab_fn): Likewise.
1459 (direct_fold_extract_optab_supported_p): Likewise.
1460 * tree-vectorizer.h (EXTRACT_LAST_REDUCTION): New vect_reduction_type.
1461 * tree-vect-loop.c (vect_model_reduction_cost): Handle
1462 EXTRACT_LAST_REDUCTION.
1463 (get_initial_def_for_reduction): Do not create an initial vector
1464 for EXTRACT_LAST_REDUCTION reductions.
1465 (vectorizable_reduction): Leave the scalar phi in place for
1466 EXTRACT_LAST_REDUCTIONs. Try using EXTRACT_LAST_REDUCTION
1467 ahead of INTEGER_INDUC_COND_REDUCTION. Do not check for an
1468 epilogue code for EXTRACT_LAST_REDUCTION and defer the
1469 transform phase to vectorizable_condition.
1470 * tree-vect-stmts.c (vect_finish_stmt_generation_1): New function,
1472 (vect_finish_stmt_generation): ...here.
1473 (vect_finish_replace_stmt): New function.
1474 (vectorizable_condition): Handle EXTRACT_LAST_REDUCTION.
1475 * config/aarch64/aarch64-sve.md (fold_extract_last_<mode>): New
1477 * config/aarch64/aarch64.md (UNSPEC_CLASTB): New unspec.
1479 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org>
1480 Alan Hayward <alan.hayward@arm.com>
1481 David Sherwood <david.sherwood@arm.com>
1483 * doc/md.texi (extract_last_@var{m}): Document.
1484 * optabs.def (extract_last_optab): New optab.
1485 * internal-fn.def (EXTRACT_LAST): New internal function.
1486 * internal-fn.c (cond_unary_direct): New macro.
1487 (expand_cond_unary_optab_fn): Likewise.
1488 (direct_cond_unary_optab_supported_p): Likewise.
1489 * tree-vect-loop.c (vectorizable_live_operation): Allow fully-masked
1490 loops using EXTRACT_LAST.
1491 * config/aarch64/aarch64-sve.md (aarch64_sve_lastb<mode>): Rename to...
1492 (extract_last_<mode>): ...this optab.
1493 (vec_extract<mode><Vel>): Update accordingly.
1495 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org>
1496 Alan Hayward <alan.hayward@arm.com>
1497 David Sherwood <david.sherwood@arm.com>
1499 * target.def (empty_mask_is_expensive): New hook.
1500 * doc/tm.texi.in (TARGET_VECTORIZE_EMPTY_MASK_IS_EXPENSIVE): New hook.
1501 * doc/tm.texi: Regenerate.
1502 * targhooks.h (default_empty_mask_is_expensive): Declare.
1503 * targhooks.c (default_empty_mask_is_expensive): New function.
1504 * tree-vectorizer.c (vectorize_loops): Only call optimize_mask_stores
1505 if the target says that empty masks are expensive.
1506 * config/aarch64/aarch64.c (aarch64_empty_mask_is_expensive):
1508 (TARGET_VECTORIZE_EMPTY_MASK_IS_EXPENSIVE): Redefine.
1510 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org>
1511 Alan Hayward <alan.hayward@arm.com>
1512 David Sherwood <david.sherwood@arm.com>
1514 * tree-vectorizer.h (_loop_vec_info::mask_skip_niters): New field.
1515 (LOOP_VINFO_MASK_SKIP_NITERS): New macro.
1516 (vect_use_loop_mask_for_alignment_p): New function.
1517 (vect_prepare_for_masked_peels, vect_gen_while_not): Declare.
1518 * tree-vect-loop-manip.c (vect_set_loop_masks_directly): Add an
1519 niters_skip argument. Make sure that the first niters_skip elements
1520 of the first iteration are inactive.
1521 (vect_set_loop_condition_masked): Handle LOOP_VINFO_MASK_SKIP_NITERS.
1522 Update call to vect_set_loop_masks_directly.
1523 (get_misalign_in_elems): New function, split out from...
1524 (vect_gen_prolog_loop_niters): ...here.
1525 (vect_update_init_of_dr): Take a code argument that specifies whether
1526 the adjustment should be added or subtracted.
1527 (vect_update_init_of_drs): Likewise.
1528 (vect_prepare_for_masked_peels): New function.
1529 (vect_do_peeling): Skip prologue peeling if we're using a mask
1530 instead. Update call to vect_update_inits_of_drs.
1531 * tree-vect-loop.c (_loop_vec_info::_loop_vec_info): Initialize
1533 (vect_analyze_loop_2): Allow fully-masked loops with peeling for
1534 alignment. Do not include the number of peeled iterations in
1535 the minimum threshold in that case.
1536 (vectorizable_induction): Adjust the start value down by
1537 LOOP_VINFO_MASK_SKIP_NITERS iterations.
1538 (vect_transform_loop): Call vect_prepare_for_masked_peels.
1539 Take the number of skipped iterations into account when calculating
1541 * tree-vect-stmts.c (vect_gen_while_not): New function.
1543 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org>
1544 Alan Hayward <alan.hayward@arm.com>
1545 David Sherwood <david.sherwood@arm.com>
1547 * doc/sourcebuild.texi (vect_fully_masked): Document.
1548 * params.def (PARAM_MIN_VECT_LOOP_BOUND): Change minimum and
1550 * tree-vect-loop.c (vect_analyze_loop_costing): New function,
1552 (vect_analyze_loop_2): ...here. Don't check the vectorization
1553 factor against the number of loop iterations if the loop is
1556 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org>
1557 Alan Hayward <alan.hayward@arm.com>
1558 David Sherwood <david.sherwood@arm.com>
1560 * tree-ssa-loop-ivopts.c (USE_ADDRESS): Split into...
1561 (USE_REF_ADDRESS, USE_PTR_ADDRESS): ...these new use types.
1562 (dump_groups): Update accordingly.
1563 (iv_use::mem_type): New member variable.
1564 (address_p): New function.
1565 (record_use): Add a mem_type argument and initialize the new
1567 (record_group_use): Add a mem_type argument. Use address_p.
1568 Remove obsolete null checks of base_object. Update call to record_use.
1569 (find_interesting_uses_op): Update call to record_group_use.
1570 (find_interesting_uses_cond): Likewise.
1571 (find_interesting_uses_address): Likewise.
1572 (get_mem_type_for_internal_fn): New function.
1573 (find_address_like_use): Likewise.
1574 (find_interesting_uses_stmt): Try find_address_like_use before
1575 calling find_interesting_uses_op.
1576 (addr_offset_valid_p): Use the iv mem_type field as the type
1577 of the addressed memory.
1578 (add_autoinc_candidates): Likewise.
1579 (get_address_cost): Likewise.
1580 (split_small_address_groups_p): Use address_p.
1581 (split_address_groups): Likewise.
1582 (add_iv_candidate_for_use): Likewise.
1583 (autoinc_possible_for_pair): Likewise.
1584 (rewrite_groups): Likewise.
1585 (get_use_type): Check for USE_REF_ADDRESS instead of USE_ADDRESS.
1586 (determine_group_iv_cost): Update after split of USE_ADDRESS.
1587 (get_alias_ptr_type_for_ptr_address): New function.
1588 (rewrite_use_address): Rewrite address uses in calls that were
1589 identified by find_address_like_use.
1591 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org>
1592 Alan Hayward <alan.hayward@arm.com>
1593 David Sherwood <david.sherwood@arm.com>
1595 * expr.c (expand_expr_addr_expr_1): Handle ADDR_EXPRs of
1597 * gimple-expr.h (is_gimple_addressable: Likewise.
1598 * gimple-expr.c (is_gimple_address): Likewise.
1599 * internal-fn.c (expand_call_mem_ref): New function.
1600 (expand_mask_load_optab_fn): Use it.
1601 (expand_mask_store_optab_fn): Likewise.
1603 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org>
1604 Alan Hayward <alan.hayward@arm.com>
1605 David Sherwood <david.sherwood@arm.com>
1607 * doc/md.texi (cond_add@var{mode}, cond_sub@var{mode})
1608 (cond_and@var{mode}, cond_ior@var{mode}, cond_xor@var{mode})
1609 (cond_smin@var{mode}, cond_smax@var{mode}, cond_umin@var{mode})
1610 (cond_umax@var{mode}): Document.
1611 * optabs.def (cond_add_optab, cond_sub_optab, cond_and_optab)
1612 (cond_ior_optab, cond_xor_optab, cond_smin_optab, cond_smax_optab)
1613 (cond_umin_optab, cond_umax_optab): New optabs.
1614 * internal-fn.def (COND_ADD, COND_SUB, COND_MIN, COND_MAX, COND_AND)
1615 (COND_IOR, COND_XOR): New internal functions.
1616 * internal-fn.h (get_conditional_internal_fn): Declare.
1617 * internal-fn.c (cond_binary_direct): New macro.
1618 (expand_cond_binary_optab_fn): Likewise.
1619 (direct_cond_binary_optab_supported_p): Likewise.
1620 (get_conditional_internal_fn): New function.
1621 * tree-vect-loop.c (vectorizable_reduction): Handle fully-masked loops.
1622 Cope with reduction statements that are vectorized as calls rather
1624 * config/aarch64/aarch64-sve.md (cond_<optab><mode>): New insns.
1625 * config/aarch64/iterators.md (UNSPEC_COND_ADD, UNSPEC_COND_SUB)
1626 (UNSPEC_COND_SMAX, UNSPEC_COND_UMAX, UNSPEC_COND_SMIN)
1627 (UNSPEC_COND_UMIN, UNSPEC_COND_AND, UNSPEC_COND_ORR)
1628 (UNSPEC_COND_EOR): New unspecs.
1629 (optab): Add mappings for them.
1630 (SVE_COND_INT_OP, SVE_COND_FP_OP): New int iterators.
1631 (sve_int_op, sve_fp_op): New int attributes.
1633 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org>
1634 Alan Hayward <alan.hayward@arm.com>
1635 David Sherwood <david.sherwood@arm.com>
1637 * optabs.def (while_ult_optab): New optab.
1638 * doc/md.texi (while_ult@var{m}@var{n}): Document.
1639 * internal-fn.def (WHILE_ULT): New internal function.
1640 * internal-fn.h (direct_internal_fn_supported_p): New override
1641 that takes two types as argument.
1642 * internal-fn.c (while_direct): New macro.
1643 (expand_while_optab_fn): New function.
1644 (convert_optab_supported_p): Likewise.
1645 (direct_while_optab_supported_p): New macro.
1646 * wide-int.h (wi::udiv_ceil): New function.
1647 * tree-vectorizer.h (rgroup_masks): New structure.
1648 (vec_loop_masks): New typedef.
1649 (_loop_vec_info): Add masks, mask_compare_type, can_fully_mask_p
1651 (LOOP_VINFO_CAN_FULLY_MASK_P, LOOP_VINFO_FULLY_MASKED_P)
1652 (LOOP_VINFO_MASKS, LOOP_VINFO_MASK_COMPARE_TYPE): New macros.
1653 (vect_max_vf): New function.
1654 (slpeel_make_loop_iterate_ntimes): Delete.
1655 (vect_set_loop_condition, vect_get_loop_mask_type, vect_gen_while)
1656 (vect_halve_mask_nunits, vect_double_mask_nunits): Declare.
1657 (vect_record_loop_mask, vect_get_loop_mask): Likewise.
1658 * tree-vect-loop-manip.c: Include tree-ssa-loop-niter.h,
1659 internal-fn.h, stor-layout.h and optabs-query.h.
1660 (vect_set_loop_mask): New function.
1661 (add_preheader_seq): Likewise.
1662 (add_header_seq): Likewise.
1663 (interleave_supported_p): Likewise.
1664 (vect_maybe_permute_loop_masks): Likewise.
1665 (vect_set_loop_masks_directly): Likewise.
1666 (vect_set_loop_condition_masked): Likewise.
1667 (vect_set_loop_condition_unmasked): New function, split out from
1668 slpeel_make_loop_iterate_ntimes.
1669 (slpeel_make_loop_iterate_ntimes): Rename to..
1670 (vect_set_loop_condition): ...this. Use vect_set_loop_condition_masked
1671 for fully-masked loops and vect_set_loop_condition_unmasked otherwise.
1672 (vect_do_peeling): Update call accordingly.
1673 (vect_gen_vector_loop_niters): Use VF as the step for fully-masked
1675 * tree-vect-loop.c (_loop_vec_info::_loop_vec_info): Initialize
1676 mask_compare_type, can_fully_mask_p and fully_masked_p.
1677 (release_vec_loop_masks): New function.
1678 (_loop_vec_info): Use it to free the loop masks.
1679 (can_produce_all_loop_masks_p): New function.
1680 (vect_get_max_nscalars_per_iter): Likewise.
1681 (vect_verify_full_masking): Likewise.
1682 (vect_analyze_loop_2): Save LOOP_VINFO_CAN_FULLY_MASK_P around
1683 retries, and free the mask rgroups before retrying. Check loop-wide
1684 reasons for disallowing fully-masked loops. Make the final decision
1685 about whether use a fully-masked loop or not.
1686 (vect_estimate_min_profitable_iters): Do not assume that peeling
1687 for the number of iterations will be needed for fully-masked loops.
1688 (vectorizable_reduction): Disable fully-masked loops.
1689 (vectorizable_live_operation): Likewise.
1690 (vect_halve_mask_nunits): New function.
1691 (vect_double_mask_nunits): Likewise.
1692 (vect_record_loop_mask): Likewise.
1693 (vect_get_loop_mask): Likewise.
1694 (vect_transform_loop): Handle the case in which the final loop
1695 iteration might handle a partial vector. Call vect_set_loop_condition
1696 instead of slpeel_make_loop_iterate_ntimes.
1697 * tree-vect-stmts.c: Include tree-ssa-loop-niter.h and gimple-fold.h.
1698 (check_load_store_masking): New function.
1699 (prepare_load_store_mask): Likewise.
1700 (vectorizable_store): Handle fully-masked loops.
1701 (vectorizable_load): Likewise.
1702 (supportable_widening_operation): Use vect_halve_mask_nunits for
1704 (supportable_narrowing_operation): Likewise vect_double_mask_nunits.
1705 (vect_gen_while): New function.
1706 * config/aarch64/aarch64.md (umax<mode>3): New expander.
1707 (aarch64_uqdec<mode>): New insn.
1709 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org>
1710 Alan Hayward <alan.hayward@arm.com>
1711 David Sherwood <david.sherwood@arm.com>
1713 * optabs.def (reduc_and_scal_optab, reduc_ior_scal_optab)
1714 (reduc_xor_scal_optab): New optabs.
1715 * doc/md.texi (reduc_and_scal_@var{m}, reduc_ior_scal_@var{m})
1716 (reduc_xor_scal_@var{m}): Document.
1717 * doc/sourcebuild.texi (vect_logical_reduc): Likewise.
1718 * internal-fn.def (IFN_REDUC_AND, IFN_REDUC_IOR, IFN_REDUC_XOR): New
1720 * fold-const-call.c (fold_const_call): Handle them.
1721 * tree-vect-loop.c (reduction_fn_for_scalar_code): Return the new
1722 internal functions for BIT_AND_EXPR, BIT_IOR_EXPR and BIT_XOR_EXPR.
1723 * config/aarch64/aarch64-sve.md (reduc_<bit_reduc>_scal_<mode>):
1724 (*reduc_<bit_reduc>_scal_<mode>): New patterns.
1725 * config/aarch64/iterators.md (UNSPEC_ANDV, UNSPEC_ORV)
1726 (UNSPEC_XORV): New unspecs.
1727 (optab): Add entries for them.
1728 (BITWISEV): New int iterator.
1729 (bit_reduc_op): New int attributes.
1731 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org>
1732 Alan Hayward <alan.hayward@arm.com>
1733 David Sherwood <david.sherwood@arm.com>
1735 * doc/md.texi (vec_shl_insert_@var{m}): New optab.
1736 * internal-fn.def (VEC_SHL_INSERT): New internal function.
1737 * optabs.def (vec_shl_insert_optab): New optab.
1738 * tree-vectorizer.h (can_duplicate_and_interleave_p): Declare.
1739 (duplicate_and_interleave): Likewise.
1740 * tree-vect-loop.c: Include internal-fn.h.
1741 (neutral_op_for_slp_reduction): New function, split out from
1742 get_initial_defs_for_reduction.
1743 (get_initial_def_for_reduction): Handle option 2 for variable-length
1744 vectors by loading the neutral value into a vector and then shifting
1745 the initial value into element 0.
1746 (get_initial_defs_for_reduction): Replace the code argument with
1747 the neutral value calculated by neutral_op_for_slp_reduction.
1748 Use gimple_build_vector for constant-length vectors.
1749 Use IFN_VEC_SHL_INSERT for variable-length vectors if all
1750 but the first group_size elements have a neutral value.
1751 Use duplicate_and_interleave otherwise.
1752 (vect_create_epilog_for_reduction): Take a neutral_op parameter.
1753 Update call to get_initial_defs_for_reduction. Handle SLP
1754 reductions for variable-length vectors by creating one vector
1755 result for each scalar result, with the elements associated
1756 with other scalar results stubbed out with the neutral value.
1757 (vectorizable_reduction): Call neutral_op_for_slp_reduction.
1758 Require IFN_VEC_SHL_INSERT for double reductions on
1759 variable-length vectors, or SLP reductions that have
1760 a neutral value. Require can_duplicate_and_interleave_p
1761 support for variable-length unchained SLP reductions if there
1762 is no neutral value, such as for MIN/MAX reductions. Also require
1763 the number of vector elements to be a multiple of the number of
1764 SLP statements when doing variable-length unchained SLP reductions.
1765 Update call to vect_create_epilog_for_reduction.
1766 * tree-vect-slp.c (can_duplicate_and_interleave_p): Make public
1767 and remove initial values.
1768 (duplicate_and_interleave): Make public.
1769 * config/aarch64/aarch64.md (UNSPEC_INSR): New unspec.
1770 * config/aarch64/aarch64-sve.md (vec_shl_insert_<mode>): New insn.
1772 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org>
1773 Alan Hayward <alan.hayward@arm.com>
1774 David Sherwood <david.sherwood@arm.com>
1776 * tree-vect-slp.c: Include gimple-fold.h and internal-fn.h
1777 (can_duplicate_and_interleave_p): New function.
1778 (vect_get_and_check_slp_defs): Take the vector of statements
1779 rather than just the current one. Remove excess parentheses.
1780 Restriction rejectinon of vect_constant_def and vect_external_def
1781 for variable-length vectors to boolean types, or types for which
1782 can_duplicate_and_interleave_p is false.
1783 (vect_build_slp_tree_2): Update call to vect_get_and_check_slp_defs.
1784 (duplicate_and_interleave): New function.
1785 (vect_get_constant_vectors): Use gimple_build_vector for
1786 constant-length vectors and suitable variable-length constant
1787 vectors. Use duplicate_and_interleave for other variable-length
1788 vectors. Don't defer the update when inserting new statements.
1790 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org>
1791 Alan Hayward <alan.hayward@arm.com>
1792 David Sherwood <david.sherwood@arm.com>
1794 * tree-vect-loop.c (vect_estimate_min_profitable_iters): Make sure
1795 min_profitable_iters doesn't go negative.
1797 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org>
1798 Alan Hayward <alan.hayward@arm.com>
1799 David Sherwood <david.sherwood@arm.com>
1801 * doc/md.texi (vec_mask_load_lanes@var{m}@var{n}): Document.
1802 (vec_mask_store_lanes@var{m}@var{n}): Likewise.
1803 * optabs.def (vec_mask_load_lanes_optab): New optab.
1804 (vec_mask_store_lanes_optab): Likewise.
1805 * internal-fn.def (MASK_LOAD_LANES): New internal function.
1806 (MASK_STORE_LANES): Likewise.
1807 * internal-fn.c (mask_load_lanes_direct): New macro.
1808 (mask_store_lanes_direct): Likewise.
1809 (expand_mask_load_optab_fn): Handle masked operations.
1810 (expand_mask_load_lanes_optab_fn): New macro.
1811 (expand_mask_store_optab_fn): Handle masked operations.
1812 (expand_mask_store_lanes_optab_fn): New macro.
1813 (direct_mask_load_lanes_optab_supported_p): Likewise.
1814 (direct_mask_store_lanes_optab_supported_p): Likewise.
1815 * tree-vectorizer.h (vect_store_lanes_supported): Take a masked_p
1817 (vect_load_lanes_supported): Likewise.
1818 * tree-vect-data-refs.c (strip_conversion): New function.
1819 (can_group_stmts_p): Likewise.
1820 (vect_analyze_data_ref_accesses): Use it instead of checking
1821 for a pair of assignments.
1822 (vect_store_lanes_supported): Take a masked_p parameter.
1823 (vect_load_lanes_supported): Likewise.
1824 * tree-vect-loop.c (vect_analyze_loop_2): Update calls to
1825 vect_store_lanes_supported and vect_load_lanes_supported.
1826 * tree-vect-slp.c (vect_analyze_slp_instance): Likewise.
1827 * tree-vect-stmts.c (get_group_load_store_type): Take a masked_p
1828 parameter. Don't allow gaps for masked accesses.
1829 Use vect_get_store_rhs. Update calls to vect_store_lanes_supported
1830 and vect_load_lanes_supported.
1831 (get_load_store_type): Take a masked_p parameter and update
1832 call to get_group_load_store_type.
1833 (vectorizable_store): Update call to get_load_store_type.
1834 Handle IFN_MASK_STORE_LANES.
1835 (vectorizable_load): Update call to get_load_store_type.
1836 Handle IFN_MASK_LOAD_LANES.
1838 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org>
1839 Alan Hayward <alan.hayward@arm.com>
1840 David Sherwood <david.sherwood@arm.com>
1842 * config/aarch64/aarch64-modes.def: Define x2, x3 and x4 vector
1844 * config/aarch64/aarch64-protos.h
1845 (aarch64_sve_struct_memory_operand_p): Declare.
1846 * config/aarch64/iterators.md (SVE_STRUCT): New mode iterator.
1847 (vector_count, insn_length, VSINGLE, vsingle): New mode attributes.
1848 (VPRED, vpred): Handle SVE structure modes.
1849 * config/aarch64/constraints.md (Utx): New constraint.
1850 * config/aarch64/predicates.md (aarch64_sve_struct_memory_operand)
1851 (aarch64_sve_struct_nonimmediate_operand): New predicates.
1852 * config/aarch64/aarch64.md (UNSPEC_LDN, UNSPEC_STN): New unspecs.
1853 * config/aarch64/aarch64-sve.md (mov<mode>, *aarch64_sve_mov<mode>_le)
1854 (*aarch64_sve_mov<mode>_be, pred_mov<mode>): New patterns for
1855 structure modes. Split into pieces after RA.
1856 (vec_load_lanes<mode><vsingle>, vec_mask_load_lanes<mode><vsingle>)
1857 (vec_store_lanes<mode><vsingle>, vec_mask_store_lanes<mode><vsingle>):
1859 * config/aarch64/aarch64.c (aarch64_classify_vector_mode): Handle
1860 SVE structure modes.
1861 (aarch64_classify_address): Likewise.
1862 (sizetochar): Move earlier in file.
1863 (aarch64_print_operand): Handle SVE register lists.
1864 (aarch64_array_mode): New function.
1865 (aarch64_sve_struct_memory_operand_p): Likewise.
1866 (TARGET_ARRAY_MODE): Redefine.
1868 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org>
1869 Alan Hayward <alan.hayward@arm.com>
1870 David Sherwood <david.sherwood@arm.com>
1872 * target.def (array_mode): New target hook.
1873 * doc/tm.texi.in (TARGET_ARRAY_MODE): New hook.
1874 * doc/tm.texi: Regenerate.
1875 * hooks.h (hook_optmode_mode_uhwi_none): Declare.
1876 * hooks.c (hook_optmode_mode_uhwi_none): New function.
1877 * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Use
1879 * stor-layout.c (mode_for_array): Likewise. Support polynomial
1882 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org>
1883 Alan Hayward <alan.hayward@arm.com>
1884 David Sherwood <david.sherwood@arm.com>
1886 * fold-const.c (fold_binary_loc): Check the argument types
1887 rather than the result type when testing for a vector operation.
1889 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org>
1891 * doc/tm.texi.in (DWARF_LAZY_REGISTER_VALUE): Document.
1892 * doc/tm.texi: Regenerate.
1894 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org>
1895 Alan Hayward <alan.hayward@arm.com>
1896 David Sherwood <david.sherwood@arm.com>
1898 * doc/invoke.texi (-msve-vector-bits=): Document new option.
1899 (sve): Document new AArch64 extension.
1900 * doc/md.texi (w): Extend the description of the AArch64
1901 constraint to include SVE vectors.
1902 (Upl, Upa): Document new AArch64 predicate constraints.
1903 * config/aarch64/aarch64-opts.h (aarch64_sve_vector_bits_enum): New
1905 * config/aarch64/aarch64.opt (sve_vector_bits): New enum.
1906 (msve-vector-bits=): New option.
1907 * config/aarch64/aarch64-option-extensions.def (fp, simd): Disable
1908 SVE when these are disabled.
1909 (sve): New extension.
1910 * config/aarch64/aarch64-modes.def: Define SVE vector and predicate
1911 modes. Adjust their number of units based on aarch64_sve_vg.
1912 (MAX_BITSIZE_MODE_ANY_MODE): Define.
1913 * config/aarch64/aarch64-protos.h (ADDR_QUERY_ANY): New
1914 aarch64_addr_query_type.
1915 (aarch64_const_vec_all_same_in_range_p, aarch64_sve_pred_mode)
1916 (aarch64_sve_cnt_immediate_p, aarch64_sve_addvl_addpl_immediate_p)
1917 (aarch64_sve_inc_dec_immediate_p, aarch64_add_offset_temporaries)
1918 (aarch64_split_add_offset, aarch64_output_sve_cnt_immediate)
1919 (aarch64_output_sve_addvl_addpl, aarch64_output_sve_inc_dec_immediate)
1920 (aarch64_output_sve_mov_immediate, aarch64_output_ptrue): Declare.
1921 (aarch64_simd_imm_zero_p): Delete.
1922 (aarch64_check_zero_based_sve_index_immediate): Declare.
1923 (aarch64_sve_index_immediate_p, aarch64_sve_arith_immediate_p)
1924 (aarch64_sve_bitmask_immediate_p, aarch64_sve_dup_immediate_p)
1925 (aarch64_sve_cmp_immediate_p, aarch64_sve_float_arith_immediate_p)
1926 (aarch64_sve_float_mul_immediate_p): Likewise.
1927 (aarch64_classify_symbol): Take the offset as a HOST_WIDE_INT
1929 (aarch64_sve_ld1r_operand_p, aarch64_sve_ldr_operand_p): Declare.
1930 (aarch64_expand_mov_immediate): Take a gen_vec_duplicate callback.
1931 (aarch64_emit_sve_pred_move, aarch64_expand_sve_mem_move): Declare.
1932 (aarch64_expand_sve_vec_cmp_int, aarch64_expand_sve_vec_cmp_float)
1933 (aarch64_expand_sve_vcond, aarch64_expand_sve_vec_perm): Declare.
1934 (aarch64_regmode_natural_size): Likewise.
1935 * config/aarch64/aarch64.h (AARCH64_FL_SVE): New macro.
1936 (AARCH64_FL_V8_3, AARCH64_FL_RCPC, AARCH64_FL_DOTPROD): Shift
1938 (AARCH64_ISA_SVE, TARGET_SVE): New macros.
1939 (FIXED_REGISTERS, CALL_USED_REGISTERS, REGISTER_NAMES): Add entries
1940 for VG and the SVE predicate registers.
1941 (V_ALIASES): Add a "z"-prefixed alias.
1942 (FIRST_PSEUDO_REGISTER): Change to P15_REGNUM + 1.
1943 (AARCH64_DWARF_VG, AARCH64_DWARF_P0): New macros.
1944 (PR_REGNUM_P, PR_LO_REGNUM_P): Likewise.
1945 (PR_LO_REGS, PR_HI_REGS, PR_REGS): New reg_classes.
1946 (REG_CLASS_NAMES): Add entries for them.
1947 (REG_CLASS_CONTENTS): Likewise. Update ALL_REGS to include VG
1948 and the predicate registers.
1949 (aarch64_sve_vg): Declare.
1950 (BITS_PER_SVE_VECTOR, BYTES_PER_SVE_VECTOR, BYTES_PER_SVE_PRED)
1951 (SVE_BYTE_MODE, MAX_COMPILE_TIME_VEC_BYTES): New macros.
1952 (REGMODE_NATURAL_SIZE): Define.
1953 * config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins): Handle
1955 * config/aarch64/aarch64.c: Include cfgrtl.h.
1956 (simd_immediate_info): Add a constructor for series vectors,
1957 and an associated step field.
1958 (aarch64_sve_vg): New variable.
1959 (aarch64_dbx_register_number): Handle VG and the predicate registers.
1960 (aarch64_vect_struct_mode_p, aarch64_vector_mode_p): Delete.
1961 (VEC_ADVSIMD, VEC_SVE_DATA, VEC_SVE_PRED, VEC_STRUCT, VEC_ANY_SVE)
1962 (VEC_ANY_DATA, VEC_STRUCT): New constants.
1963 (aarch64_advsimd_struct_mode_p, aarch64_sve_pred_mode_p)
1964 (aarch64_classify_vector_mode, aarch64_vector_data_mode_p)
1965 (aarch64_sve_data_mode_p, aarch64_sve_pred_mode)
1966 (aarch64_get_mask_mode): New functions.
1967 (aarch64_hard_regno_nregs): Handle SVE data modes for FP_REGS
1968 and FP_LO_REGS. Handle PR_REGS, PR_LO_REGS and PR_HI_REGS.
1969 (aarch64_hard_regno_mode_ok): Handle VG. Also handle the SVE
1970 predicate modes and predicate registers. Explicitly restrict
1971 GPRs to modes of 16 bytes or smaller. Only allow FP registers
1972 to store a vector mode if it is recognized by
1973 aarch64_classify_vector_mode.
1974 (aarch64_regmode_natural_size): New function.
1975 (aarch64_hard_regno_caller_save_mode): Return the original mode
1977 (aarch64_sve_cnt_immediate_p, aarch64_output_sve_cnt_immediate)
1978 (aarch64_sve_addvl_addpl_immediate_p, aarch64_output_sve_addvl_addpl)
1979 (aarch64_sve_inc_dec_immediate_p, aarch64_output_sve_inc_dec_immediate)
1980 (aarch64_add_offset_1_temporaries, aarch64_offset_temporaries): New
1982 (aarch64_add_offset): Add a temp2 parameter. Assert that temp1
1983 does not overlap dest if the function is frame-related. Handle
1985 (aarch64_split_add_offset): New function.
1986 (aarch64_add_sp, aarch64_sub_sp): Add temp2 parameters and pass
1987 them aarch64_add_offset.
1988 (aarch64_allocate_and_probe_stack_space): Add a temp2 parameter
1989 and update call to aarch64_sub_sp.
1990 (aarch64_add_cfa_expression): New function.
1991 (aarch64_expand_prologue): Pass extra temporary registers to the
1992 functions above. Handle the case in which we need to emit new
1993 DW_CFA_expressions for registers that were originally saved
1994 relative to the stack pointer, but now have to be expressed
1995 relative to the frame pointer.
1996 (aarch64_output_mi_thunk): Pass extra temporary registers to the
1998 (aarch64_expand_epilogue): Likewise. Prevent inheritance of
1999 IP0 and IP1 values for SVE frames.
2000 (aarch64_expand_vec_series): New function.
2001 (aarch64_expand_sve_widened_duplicate): Likewise.
2002 (aarch64_expand_sve_const_vector): Likewise.
2003 (aarch64_expand_mov_immediate): Add a gen_vec_duplicate parameter.
2004 Handle SVE constants. Use emit_move_insn to move a force_const_mem
2005 into the register, rather than emitting a SET directly.
2006 (aarch64_emit_sve_pred_move, aarch64_expand_sve_mem_move)
2007 (aarch64_get_reg_raw_mode, offset_4bit_signed_scaled_p)
2008 (offset_6bit_unsigned_scaled_p, aarch64_offset_7bit_signed_scaled_p)
2009 (offset_9bit_signed_scaled_p): New functions.
2010 (aarch64_replicate_bitmask_imm): New function.
2011 (aarch64_bitmask_imm): Use it.
2012 (aarch64_cannot_force_const_mem): Reject expressions involving
2013 a CONST_POLY_INT. Update call to aarch64_classify_symbol.
2014 (aarch64_classify_index): Handle SVE indices, by requiring
2015 a plain register index with a scale that matches the element size.
2016 (aarch64_classify_address): Handle SVE addresses. Assert that
2017 the mode of the address is VOIDmode or an integer mode.
2018 Update call to aarch64_classify_symbol.
2019 (aarch64_classify_symbolic_expression): Update call to
2020 aarch64_classify_symbol.
2021 (aarch64_const_vec_all_in_range_p): New function.
2022 (aarch64_print_vector_float_operand): Likewise.
2023 (aarch64_print_operand): Handle 'N' and 'C'. Use "zN" rather than
2024 "vN" for FP registers with SVE modes. Handle (const ...) vectors
2025 and the FP immediates 1.0 and 0.5.
2026 (aarch64_print_address_internal): Handle SVE addresses.
2027 (aarch64_print_operand_address): Use ADDR_QUERY_ANY.
2028 (aarch64_regno_regclass): Handle predicate registers.
2029 (aarch64_secondary_reload): Handle big-endian reloads of SVE
2031 (aarch64_class_max_nregs): Handle SVE modes and predicate registers.
2032 (aarch64_rtx_costs): Check for ADDVL and ADDPL instructions.
2033 (aarch64_convert_sve_vector_bits): New function.
2034 (aarch64_override_options): Use it to handle -msve-vector-bits=.
2035 (aarch64_classify_symbol): Take the offset as a HOST_WIDE_INT
2037 (aarch64_legitimate_constant_p): Use aarch64_classify_vector_mode.
2038 Handle SVE vector and predicate modes. Accept VL-based constants
2039 that need only one temporary register, and VL offsets that require
2040 no temporary registers.
2041 (aarch64_conditional_register_usage): Mark the predicate registers
2042 as fixed if SVE isn't available.
2043 (aarch64_vector_mode_supported_p): Use aarch64_classify_vector_mode.
2044 Return true for SVE vector and predicate modes.
2045 (aarch64_simd_container_mode): Take the number of bits as a poly_int64
2046 rather than an unsigned int. Handle SVE modes.
2047 (aarch64_preferred_simd_mode): Update call accordingly. Handle
2049 (aarch64_autovectorize_vector_sizes): Add BYTES_PER_SVE_VECTOR
2051 (aarch64_sve_index_immediate_p, aarch64_sve_arith_immediate_p)
2052 (aarch64_sve_bitmask_immediate_p, aarch64_sve_dup_immediate_p)
2053 (aarch64_sve_cmp_immediate_p, aarch64_sve_float_arith_immediate_p)
2054 (aarch64_sve_float_mul_immediate_p): New functions.
2055 (aarch64_sve_valid_immediate): New function.
2056 (aarch64_simd_valid_immediate): Use it as the fallback for SVE vectors.
2057 Explicitly reject structure modes. Check for INDEX constants.
2058 Handle PTRUE and PFALSE constants.
2059 (aarch64_check_zero_based_sve_index_immediate): New function.
2060 (aarch64_simd_imm_zero_p): Delete.
2061 (aarch64_mov_operand_p): Use aarch64_simd_valid_immediate for
2062 vector modes. Accept constants in the range of CNT[BHWD].
2063 (aarch64_simd_scalar_immediate_valid_for_move): Explicitly
2064 ask for an Advanced SIMD mode.
2065 (aarch64_sve_ld1r_operand_p, aarch64_sve_ldr_operand_p): New functions.
2066 (aarch64_simd_vector_alignment): Handle SVE predicates.
2067 (aarch64_vectorize_preferred_vector_alignment): New function.
2068 (aarch64_simd_vector_alignment_reachable): Use it instead of
2070 (aarch64_shift_truncation_mask): Use aarch64_vector_data_mode_p.
2071 (aarch64_output_sve_mov_immediate, aarch64_output_ptrue): New
2073 (MAX_VECT_LEN): Delete.
2074 (expand_vec_perm_d): Add a vec_flags field.
2075 (emit_unspec2, aarch64_expand_sve_vec_perm): New functions.
2076 (aarch64_evpc_trn, aarch64_evpc_uzp, aarch64_evpc_zip)
2077 (aarch64_evpc_ext): Don't apply a big-endian lane correction
2079 (aarch64_evpc_rev): Rename to...
2080 (aarch64_evpc_rev_local): ...this. Use a predicated operation for SVE.
2081 (aarch64_evpc_rev_global): New function.
2082 (aarch64_evpc_dup): Enforce a 64-byte range for SVE DUP.
2083 (aarch64_evpc_tbl): Use MAX_COMPILE_TIME_VEC_BYTES instead of
2085 (aarch64_evpc_sve_tbl): New function.
2086 (aarch64_expand_vec_perm_const_1): Update after rename of
2087 aarch64_evpc_rev. Handle SVE permutes too, trying
2088 aarch64_evpc_rev_global and using aarch64_evpc_sve_tbl rather
2089 than aarch64_evpc_tbl.
2090 (aarch64_vectorize_vec_perm_const): Initialize vec_flags.
2091 (aarch64_sve_cmp_operand_p, aarch64_unspec_cond_code)
2092 (aarch64_gen_unspec_cond, aarch64_expand_sve_vec_cmp_int)
2093 (aarch64_emit_unspec_cond, aarch64_emit_unspec_cond_or)
2094 (aarch64_emit_inverted_unspec_cond, aarch64_expand_sve_vec_cmp_float)
2095 (aarch64_expand_sve_vcond): New functions.
2096 (aarch64_modes_tieable_p): Use aarch64_vector_data_mode_p instead
2097 of aarch64_vector_mode_p.
2098 (aarch64_dwarf_poly_indeterminate_value): New function.
2099 (aarch64_compute_pressure_classes): Likewise.
2100 (aarch64_can_change_mode_class): Likewise.
2101 (TARGET_GET_RAW_RESULT_MODE, TARGET_GET_RAW_ARG_MODE): Redefine.
2102 (TARGET_VECTORIZE_PREFERRED_VECTOR_ALIGNMENT): Likewise.
2103 (TARGET_VECTORIZE_GET_MASK_MODE): Likewise.
2104 (TARGET_DWARF_POLY_INDETERMINATE_VALUE): Likewise.
2105 (TARGET_COMPUTE_PRESSURE_CLASSES): Likewise.
2106 (TARGET_CAN_CHANGE_MODE_CLASS): Likewise.
2107 * config/aarch64/constraints.md (Upa, Upl, Uav, Uat, Usv, Usi, Utr)
2108 (Uty, Dm, vsa, vsc, vsd, vsi, vsn, vsl, vsm, vsA, vsM, vsN): New
2110 (Dn, Dl, Dr): Accept const as well as const_vector.
2111 (Dz): Likewise. Compare against CONST0_RTX.
2112 * config/aarch64/iterators.md: Refer to "Advanced SIMD" instead
2113 of "vector" where appropriate.
2114 (SVE_ALL, SVE_BH, SVE_BHS, SVE_BHSI, SVE_HSDI, SVE_HSF, SVE_SD)
2115 (SVE_SDI, SVE_I, SVE_F, PRED_ALL, PRED_BHS): New mode iterators.
2116 (UNSPEC_SEL, UNSPEC_ANDF, UNSPEC_IORF, UNSPEC_XORF, UNSPEC_COND_LT)
2117 (UNSPEC_COND_LE, UNSPEC_COND_EQ, UNSPEC_COND_NE, UNSPEC_COND_GE)
2118 (UNSPEC_COND_GT, UNSPEC_COND_LO, UNSPEC_COND_LS, UNSPEC_COND_HS)
2119 (UNSPEC_COND_HI, UNSPEC_COND_UO): New unspecs.
2120 (Vetype, VEL, Vel, VWIDE, Vwide, vw, vwcore, V_INT_EQUIV)
2121 (v_int_equiv): Extend to SVE modes.
2122 (Vesize, V128, v128, Vewtype, V_FP_EQUIV, v_fp_equiv, VPRED): New
2124 (LOGICAL_OR, SVE_INT_UNARY, SVE_FP_UNARY): New code iterators.
2125 (optab): Handle popcount, smin, smax, umin, umax, abs and sqrt.
2126 (logical_nn, lr, sve_int_op, sve_fp_op): New code attributs.
2127 (LOGICALF, OPTAB_PERMUTE, UNPACK, UNPACK_UNSIGNED, SVE_COND_INT_CMP)
2128 (SVE_COND_FP_CMP): New int iterators.
2129 (perm_hilo): Handle the new unpack unspecs.
2130 (optab, logicalf_op, su, perm_optab, cmp_op, imm_con): New int
2132 * config/aarch64/predicates.md (aarch64_sve_cnt_immediate)
2133 (aarch64_sve_addvl_addpl_immediate, aarch64_split_add_offset_immediate)
2134 (aarch64_pluslong_or_poly_operand, aarch64_nonmemory_operand)
2135 (aarch64_equality_operator, aarch64_constant_vector_operand)
2136 (aarch64_sve_ld1r_operand, aarch64_sve_ldr_operand): New predicates.
2137 (aarch64_sve_nonimmediate_operand): Likewise.
2138 (aarch64_sve_general_operand): Likewise.
2139 (aarch64_sve_dup_operand, aarch64_sve_arith_immediate): Likewise.
2140 (aarch64_sve_sub_arith_immediate, aarch64_sve_inc_dec_immediate)
2141 (aarch64_sve_logical_immediate, aarch64_sve_mul_immediate): Likewise.
2142 (aarch64_sve_dup_immediate, aarch64_sve_cmp_vsc_immediate): Likewise.
2143 (aarch64_sve_cmp_vsd_immediate, aarch64_sve_index_immediate): Likewise.
2144 (aarch64_sve_float_arith_immediate): Likewise.
2145 (aarch64_sve_float_arith_with_sub_immediate): Likewise.
2146 (aarch64_sve_float_mul_immediate, aarch64_sve_arith_operand): Likewise.
2147 (aarch64_sve_add_operand, aarch64_sve_logical_operand): Likewise.
2148 (aarch64_sve_lshift_operand, aarch64_sve_rshift_operand): Likewise.
2149 (aarch64_sve_mul_operand, aarch64_sve_cmp_vsc_operand): Likewise.
2150 (aarch64_sve_cmp_vsd_operand, aarch64_sve_index_operand): Likewise.
2151 (aarch64_sve_float_arith_operand): Likewise.
2152 (aarch64_sve_float_arith_with_sub_operand): Likewise.
2153 (aarch64_sve_float_mul_operand): Likewise.
2154 (aarch64_sve_vec_perm_operand): Likewise.
2155 (aarch64_pluslong_operand): Include aarch64_sve_addvl_addpl_immediate.
2156 (aarch64_mov_operand): Accept const_poly_int and const_vector.
2157 (aarch64_simd_lshift_imm, aarch64_simd_rshift_imm): Accept const
2158 as well as const_vector.
2159 (aarch64_simd_imm_zero, aarch64_simd_imm_minus_one): Move earlier
2160 in file. Use CONST0_RTX and CONSTM1_RTX.
2161 (aarch64_simd_or_scalar_imm_zero): Likewise. Add match_codes.
2162 (aarch64_simd_reg_or_zero): Accept const as well as const_vector.
2163 Use aarch64_simd_imm_zero.
2164 * config/aarch64/aarch64-sve.md: New file.
2165 * config/aarch64/aarch64.md: Include it.
2166 (VG_REGNUM, P0_REGNUM, P7_REGNUM, P15_REGNUM): New register numbers.
2167 (UNSPEC_REV, UNSPEC_LD1_SVE, UNSPEC_ST1_SVE, UNSPEC_MERGE_PTRUE)
2168 (UNSPEC_PTEST_PTRUE, UNSPEC_UNPACKSHI, UNSPEC_UNPACKUHI)
2169 (UNSPEC_UNPACKSLO, UNSPEC_UNPACKULO, UNSPEC_PACK)
2170 (UNSPEC_FLOAT_CONVERT, UNSPEC_WHILE_LO): New unspec constants.
2171 (sve): New attribute.
2172 (enabled): Disable instructions with the sve attribute unless
2174 (movqi, movhi): Pass CONST_POLY_INT operaneds through
2175 aarch64_expand_mov_immediate.
2176 (*mov<mode>_aarch64, *movsi_aarch64, *movdi_aarch64): Handle
2177 CNT[BHSD] immediates.
2178 (movti): Split CONST_POLY_INT moves into two halves.
2179 (add<mode>3): Accept aarch64_pluslong_or_poly_operand.
2180 Split additions that need a temporary here if the destination
2181 is the stack pointer.
2182 (*add<mode>3_aarch64): Handle ADDVL and ADDPL immediates.
2183 (*add<mode>3_poly_1): New instruction.
2184 (set_clobber_cc): New expander.
2186 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org>
2188 * simplify-rtx.c (simplify_immed_subreg): Add an inner_bytes
2189 parameter and use it instead of GET_MODE_SIZE (innermode). Use
2190 inner_bytes * BITS_PER_UNIT instead of GET_MODE_BITSIZE (innermode).
2191 Use CEIL (inner_bytes, GET_MODE_UNIT_SIZE (innermode)) instead of
2192 GET_MODE_NUNITS (innermode). Also add a first_elem parameter.
2193 Change innermode from fixed_mode_size to machine_mode.
2194 (simplify_subreg): Update call accordingly. Handle a constant-sized
2195 subreg of a variable-length CONST_VECTOR.
2197 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org>
2198 Alan Hayward <alan.hayward@arm.com>
2199 David Sherwood <david.sherwood@arm.com>
2201 * tree-ssa-address.c (mem_ref_valid_without_offset_p): New function.
2202 (add_offset_to_base): New function, split out from...
2203 (create_mem_ref): ...here. When handling a scale other than 1,
2204 check first whether the address is valid without the offset.
2205 Add it into the base if so, leaving the index and scale as-is.
2207 2018-01-12 Jakub Jelinek <jakub@redhat.com>
2210 * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Call
2211 fold_for_warn before checking if arg2 is INTEGER_CST.
2213 2018-01-12 Segher Boessenkool <segher@kernel.crashing.org>
2215 * config/rs6000/predicates.md (load_multiple_operation): Delete.
2216 (store_multiple_operation): Delete.
2217 * config/rs6000/rs6000-cpus.def (601): Remove MASK_STRING.
2218 * config/rs6000/rs6000-protos.h (rs6000_output_load_multiple): Delete.
2219 * config/rs6000/rs6000-string.c (expand_block_move): Delete everything
2220 guarded by TARGET_STRING.
2221 (rs6000_output_load_multiple): Delete.
2222 * config/rs6000/rs6000.c (rs6000_option_override_internal): Delete
2223 OPTION_MASK_STRING / TARGET_STRING handling.
2224 (print_operand) <'N', 'O'>: Add comment that these are unused now.
2225 (const rs6000_opt_masks) <"string">: Change mask to 0.
2226 * config/rs6000/rs6000.h (TARGET_DEFAULT): Remove MASK_STRING.
2227 (MASK_STRING): Delete.
2228 * config/rs6000/rs6000.md (*mov<mode>_string): Delete TARGET_STRING
2230 (load_multiple): Delete.
2237 (store_multiple): Delete.
2244 (movmemsi_8reg): Delete.
2245 (corresponding unnamed define_insn): Delete.
2246 (movmemsi_6reg): Delete.
2247 (corresponding unnamed define_insn): Delete.
2248 (movmemsi_4reg): Delete.
2249 (corresponding unnamed define_insn): Delete.
2250 (movmemsi_2reg): Delete.
2251 (corresponding unnamed define_insn): Delete.
2252 (movmemsi_1reg): Delete.
2253 (corresponding unnamed define_insn): Delete.
2254 * config/rs6000/rs6000.opt (mno-string): New.
2255 (mstring): Replace by deprecation warning stub.
2256 * doc/invoke.texi (RS/6000 and PowerPC Options): Delete -mstring.
2258 2018-01-12 Jakub Jelinek <jakub@redhat.com>
2260 * regrename.c (regrename_do_replace): If replacing the same
2261 reg multiple times, try to reuse last created gen_raw_REG.
2264 * bb-reorder.c (pass_partition_blocks::gate): In lto don't partition
2265 main to workaround a bug in GDB.
2267 2018-01-12 Tom de Vries <tom@codesourcery.com>
2270 * config.gcc (nvptx*-*-*): Set use_gcc_stdint=wrap.
2272 2018-01-12 Vladimir Makarov <vmakarov@redhat.com>
2274 PR rtl-optimization/80481
2275 * ira-color.c (get_cap_member): New function.
2276 (allocnos_conflict_by_live_ranges_p): Use it.
2277 (slot_coalesced_allocno_live_ranges_intersect_p): Add assert.
2278 (setup_slot_coalesced_allocno_live_ranges): Ditto.
2280 2018-01-12 Uros Bizjak <ubizjak@gmail.com>
2283 * config/alpha/alpha.md (*saddsi_1): New insn_ans_split pattern.
2284 (*saddl_se_1): Ditto.
2286 (*ssubl_se_1): Ditto.
2288 2018-01-12 Richard Sandiford <richard.sandiford@linaro.org>
2290 * tree-predcom.c (aff_combination_dr_offset): Use wi::to_poly_widest
2291 rather than wi::to_widest for DR_INITs.
2292 * tree-vect-data-refs.c (vect_find_same_alignment_drs): Use
2293 wi::to_poly_offset rather than wi::to_offset for DR_INIT.
2294 (vect_analyze_data_ref_accesses): Require both DR_INITs to be
2296 (vect_analyze_group_access_1): Note that here.
2298 2018-01-12 Richard Sandiford <richard.sandiford@linaro.org>
2300 * tree-vectorizer.c (get_vec_alignment_for_array_type): Handle
2301 polynomial type sizes.
2303 2018-01-12 Richard Sandiford <richard.sandiford@linaro.org>
2305 * gimplify.c (gimple_add_tmp_var_fn): Allow variables to have a
2306 poly_uint64 size, rather than requiring an unsigned HOST_WIDE_INT size.
2307 (gimple_add_tmp_var): Likewise.
2309 2018-01-12 Martin Liska <mliska@suse.cz>
2311 * gimple.c (gimple_alloc_counts): Use uint64_t instead of int.
2312 (gimple_alloc_sizes): Likewise.
2313 (dump_gimple_statistics): Use PRIu64 in printf format.
2314 * gimple.h: Change uint64_t to int.
2316 2018-01-12 Martin Liska <mliska@suse.cz>
2318 * tree-core.h: Use uint64_t instead of int.
2319 * tree.c (tree_node_counts): Likewise.
2320 (tree_node_sizes): Likewise.
2321 (dump_tree_statistics): Use PRIu64 in printf format.
2323 2018-01-12 Martin Liska <mliska@suse.cz>
2325 * Makefile.in: As qsort_chk is implemented in vec.c, add
2326 vec.o to linkage of gencfn-macros.
2327 * tree.c (build_new_poly_int_cst): Add CXX_MEM_STAT_INFO as it's
2328 passing the info to record_node_allocation_statistics.
2329 (test_vector_cst_patterns): Add CXX_MEM_STAT_INFO to declaration
2331 * ggc-common.c (struct ggc_usage): Add operator== and use
2332 it in operator< and compare function.
2333 * mem-stats.h (struct mem_usage): Likewise.
2334 * vec.c (struct vec_usage): Remove operator< and compare
2335 function. Can be simply inherited.
2337 2018-01-12 Martin Jambor <mjambor@suse.cz>
2340 * params.def: New parameter PARAM_AVOID_FMA_MAX_BITS.
2341 * tree-ssa-math-opts.c: Include domwalk.h.
2342 (convert_mult_to_fma_1): New function.
2343 (fma_transformation_info): New type.
2344 (fma_deferring_state): Likewise.
2345 (cancel_fma_deferring): New function.
2346 (result_of_phi): Likewise.
2347 (last_fma_candidate_feeds_initial_phi): Likewise.
2348 (convert_mult_to_fma): Added deferring logic, split actual
2349 transformation to convert_mult_to_fma_1.
2350 (math_opts_dom_walker): New type.
2351 (math_opts_dom_walker::after_dom_children): New method, body moved
2352 here from pass_optimize_widening_mul::execute, added deferring logic
2354 (pass_optimize_widening_mul::execute): Moved most of code to
2355 math_opts_dom_walker::after_dom_children.
2356 * config/i386/x86-tune.def (X86_TUNE_AVOID_128FMA_CHAINS): New.
2357 * config/i386/i386.c (ix86_option_override_internal): Added
2358 maybe_setting of PARAM_AVOID_FMA_MAX_BITS.
2360 2018-01-12 Richard Biener <rguenther@suse.de>
2363 * dwarf2out.c (gen_variable_die): Do not reset old_die for
2364 inline instance vars.
2366 2018-01-12 Oleg Endo <olegendo@gcc.gnu.org>
2369 * config/rx/rx.c (rx_is_restricted_memory_address):
2372 2018-01-12 Richard Biener <rguenther@suse.de>
2374 PR tree-optimization/80846
2375 * target.def (split_reduction): New target hook.
2376 * targhooks.c (default_split_reduction): New function.
2377 * targhooks.h (default_split_reduction): Declare.
2378 * tree-vect-loop.c (vect_create_epilog_for_reduction): If the
2379 target requests first reduce vectors by combining low and high
2381 * tree-vect-stmts.c (vect_gen_perm_mask_any): Adjust.
2382 (get_vectype_for_scalar_type_and_size): Export.
2383 * tree-vectorizer.h (get_vectype_for_scalar_type_and_size): Declare.
2384 * doc/tm.texi.in (TARGET_VECTORIZE_SPLIT_REDUCTION): Document.
2385 * doc/tm.texi: Regenerate.
2386 * config/i386/i386.c (ix86_split_reduction): Implement
2387 TARGET_VECTORIZE_SPLIT_REDUCTION.
2389 2018-01-12 Eric Botcazou <ebotcazou@adacore.com>
2392 * config/sparc/sparc.h (PIC_OFFSET_TABLE_REGNUM): Set to INVALID_REGNUM
2393 in PIC mode except for TARGET_VXWORKS_RTP.
2394 * config/sparc/sparc.c: Include cfgrtl.h.
2395 (TARGET_INIT_PIC_REG): Define.
2396 (TARGET_USE_PSEUDO_PIC_REG): Likewise.
2397 (sparc_pic_register_p): New predicate.
2398 (sparc_legitimate_address_p): Use it.
2399 (sparc_legitimize_pic_address): Likewise.
2400 (sparc_delegitimize_address): Likewise.
2401 (sparc_mode_dependent_address_p): Likewise.
2402 (gen_load_pcrel_sym): Remove 4th parameter.
2403 (load_got_register): Adjust call to above. Remove obsolete stuff.
2404 (sparc_expand_prologue): Do not call load_got_register here.
2405 (sparc_flat_expand_prologue): Likewise.
2406 (sparc_output_mi_thunk): Set the pic_offset_table_rtx object.
2407 (sparc_use_pseudo_pic_reg): New function.
2408 (sparc_init_pic_reg): Likewise.
2409 * config/sparc/sparc.md (vxworks_load_got): Set the GOT register.
2410 (builtin_setjmp_receiver): Enable only for TARGET_VXWORKS_RTP.
2412 2018-01-12 Christophe Lyon <christophe.lyon@linaro.org>
2414 * doc/sourcebuild.texi (Effective-Target Keywords, Other attributes):
2415 Add item for branch_cost.
2417 2018-01-12 Eric Botcazou <ebotcazou@adacore.com>
2419 PR rtl-optimization/83565
2420 * rtlanal.c (nonzero_bits1): On WORD_REGISTER_OPERATIONS machines, do
2421 not extend the result to a larger mode for rotate operations.
2422 (num_sign_bit_copies1): Likewise.
2424 2018-01-12 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2427 * config/sol2.h (STARTFILE_ARCH_SPEC): Don't use with -shared or
2429 Use values-Xc.o for -pedantic.
2430 Link with values-xpg4.o for C90, values-xpg6.o otherwise.
2432 2018-01-12 Martin Liska <mliska@suse.cz>
2435 * ipa-devirt.c (final_warning_record::grow_type_warnings):
2437 (possible_polymorphic_call_targets): Use it.
2438 (ipa_devirt): Likewise.
2440 2018-01-12 Martin Liska <mliska@suse.cz>
2442 * profile-count.h (enum profile_quality): Use 0 as invalid
2443 enum value of profile_quality.
2445 2018-01-12 Chung-Ju Wu <jasonwucj@gmail.com>
2447 * doc/invoke.texi (NDS32 Options): Add -mext-perf, -mext-perf2 and
2448 -mext-string options.
2450 2018-01-12 Richard Biener <rguenther@suse.de>
2452 * lto-streamer-out.c (DFS::DFS_write_tree_body): Process
2453 DECL_DEBUG_EXPR conditional on DECL_HAS_DEBUG_EXPR_P.
2454 * tree-streamer-in.c (lto_input_ts_decl_common_tree_pointers):
2456 * tree-streamer-out.c (write_ts_decl_common_tree_pointers): Likewise.
2458 2018-01-11 Michael Meissner <meissner@linux.vnet.ibm.com>
2460 * configure.ac (--with-long-double-format): Add support for the
2461 configuration option to change the default long double format on
2463 * config.gcc (powerpc*-linux*-*): Likewise.
2464 * configure: Regenerate.
2465 * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): If long
2466 double is IEEE, define __KC__ and __KF__ to allow floatn.h to be
2467 used without modification.
2469 2018-01-11 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
2471 * config/rs6000/rs6000-builtin.def (BU_P7_MISC_X): New #define.
2472 (SPEC_BARRIER): New instantiation of BU_P7_MISC_X.
2473 * config/rs6000/rs6000.c (rs6000_expand_builtin): Handle
2474 MISC_BUILTIN_SPEC_BARRIER.
2475 (rs6000_init_builtins): Likewise.
2476 * config/rs6000/rs6000.md (UNSPECV_SPEC_BARRIER): New UNSPECV
2478 (speculation_barrier): New define_insn.
2479 * doc/extend.texi: Document __builtin_speculation_barrier.
2481 2018-01-11 Jakub Jelinek <jakub@redhat.com>
2484 * config/i386/i386.c (ix86_expand_vector_init_one_nonzero): If one_var
2485 is 0, for V{8,16}S[IF] and V[48]D[IF]mode use gen_vec_set<mode>_0.
2486 * config/i386/sse.md (VI8_AVX_AVX512F, VI4F_256_512): New mode
2488 (ssescalarmodesuffix): Add 512-bit vectors. Use "d" or "q" for
2489 integral modes instead of "ss" and "sd".
2490 (vec_set<mode>_0): New define_insns for 256-bit and 512-bit
2491 vectors with 32-bit and 64-bit elements.
2492 (vecdupssescalarmodesuffix): New mode attribute.
2493 (vec_dup<mode>): Use it.
2495 2018-01-11 H.J. Lu <hongjiu.lu@intel.com>
2498 * config/i386/i386.c (ix86_compute_frame_layout): Align stack
2499 frame if argument is passed on stack.
2501 2018-01-11 Jakub Jelinek <jakub@redhat.com>
2504 * ree.c (combine_reaching_defs): Optimize also
2505 reg2=exp; reg1=reg2; reg2=any_extend(reg1); into
2506 reg2=any_extend(exp); reg1=reg2;, formatting fix.
2508 2018-01-11 Jan Hubicka <hubicka@ucw.cz>
2511 * gimple-ssa-isolate-paths.c (isolate_path): Fix profile update.
2513 2018-01-11 Jan Hubicka <hubicka@ucw.cz>
2516 * tree-inline.c (copy_cfg_body): Adjust num&den for scaling
2517 after they are computed.
2519 2018-01-11 Bin Cheng <bin.cheng@arm.com>
2521 PR tree-optimization/83695
2522 * gimple-loop-linterchange.cc
2523 (tree_loop_interchange::interchange_loops): Call scev_reset_htab to
2524 reset cached scev information after interchange.
2525 (pass_linterchange::execute): Remove call to scev_reset_htab.
2527 2018-01-11 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
2529 * config/arm/arm_neon.h (vfmlal_lane_low_u32, vfmlal_lane_high_u32,
2530 vfmlalq_laneq_low_u32, vfmlalq_lane_low_u32, vfmlal_laneq_low_u32,
2531 vfmlalq_laneq_high_u32, vfmlalq_lane_high_u32, vfmlal_laneq_high_u32,
2532 vfmlsl_lane_low_u32, vfmlsl_lane_high_u32, vfmlslq_laneq_low_u32,
2533 vfmlslq_lane_low_u32, vfmlsl_laneq_low_u32, vfmlslq_laneq_high_u32,
2534 vfmlslq_lane_high_u32, vfmlsl_laneq_high_u32): Define.
2535 * config/arm/arm_neon_builtins.def (vfmal_lane_low,
2536 vfmal_lane_lowv4hf, vfmal_lane_lowv8hf, vfmal_lane_high,
2537 vfmal_lane_highv4hf, vfmal_lane_highv8hf, vfmsl_lane_low,
2538 vfmsl_lane_lowv4hf, vfmsl_lane_lowv8hf, vfmsl_lane_high,
2539 vfmsl_lane_highv4hf, vfmsl_lane_highv8hf): New sets of builtins.
2540 * config/arm/iterators.md (VFMLSEL2, vfmlsel2): New mode attributes.
2541 (V_lane_reg): Likewise.
2542 * config/arm/neon.md (neon_vfm<vfml_op>l_lane_<vfml_half><VCVTF:mode>):
2544 (neon_vfm<vfml_op>l_lane_<vfml_half><vfmlsel2><mode>): Likewise.
2545 (vfmal_lane_low<mode>_intrinsic,
2546 vfmal_lane_low<vfmlsel2><mode>_intrinsic,
2547 vfmal_lane_high<vfmlsel2><mode>_intrinsic,
2548 vfmal_lane_high<mode>_intrinsic, vfmsl_lane_low<mode>_intrinsic,
2549 vfmsl_lane_low<vfmlsel2><mode>_intrinsic,
2550 vfmsl_lane_high<vfmlsel2><mode>_intrinsic,
2551 vfmsl_lane_high<mode>_intrinsic): New define_insns.
2553 2018-01-11 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
2555 * config/arm/arm-cpus.in (fp16fml): New feature.
2556 (ALL_SIMD): Add fp16fml.
2557 (armv8.2-a): Add fp16fml as an option.
2558 (armv8.3-a): Likewise.
2559 (armv8.4-a): Add fp16fml as part of fp16.
2560 * config/arm/arm.h (TARGET_FP16FML): Define.
2561 * config/arm/arm-c.c (arm_cpu_builtins): Define __ARM_FEATURE_FP16_FML
2563 * config/arm/arm-modes.def (V2HF): Define.
2564 * config/arm/arm_neon.h (vfmlal_low_u32, vfmlsl_low_u32,
2565 vfmlal_high_u32, vfmlsl_high_u32, vfmlalq_low_u32,
2566 vfmlslq_low_u32, vfmlalq_high_u32, vfmlslq_high_u32): Define.
2567 * config/arm/arm_neon_builtins.def (vfmal_low, vfmal_high,
2568 vfmsl_low, vfmsl_high): New set of builtins.
2569 * config/arm/iterators.md (PLUSMINUS): New code iterator.
2570 (vfml_op): New code attribute.
2571 (VFMLHALVES): New int iterator.
2572 (VFML, VFMLSEL): New mode attributes.
2573 (V_reg): Define mapping for V2HF.
2574 (V_hi, V_lo): New mode attributes.
2575 (VF_constraint): Likewise.
2576 (vfml_half, vfml_half_selector): New int attributes.
2577 * config/arm/neon.md (neon_vfm<vfml_op>l_<vfml_half><mode>): New
2579 (vfmal_low<mode>_intrinsic, vfmsl_high<mode>_intrinsic,
2580 vfmal_high<mode>_intrinsic, vfmsl_low<mode>_intrinsic):
2582 * config/arm/t-arm-elf (v8_fps): Add fp16fml.
2583 * config/arm/t-multilib (v8_2_a_simd_variants): Add fp16fml.
2584 * config/arm/unspecs.md (UNSPEC_VFML_LO, UNSPEC_VFML_HI): New unspecs.
2585 * doc/invoke.texi (ARM Options): Document fp16fml. Update armv8.4-a
2587 * doc/sourcebuild.texi (arm_fp16fml_neon_ok, arm_fp16fml_neon):
2588 Document new effective target and option set.
2590 2017-01-11 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
2592 * config/arm/arm-cpus.in (armv8_4): New feature.
2593 (ARMv8_4a): New fgroup.
2594 (armv8.4-a): New arch.
2595 * config/arm/arm-tables.opt: Regenerate.
2596 * config/arm/t-aprofile: Add matching rules for -march=armv8.4-a.
2597 * config/arm/t-arm-elf (all_v8_archs): Add armv8.4-a.
2598 * config/arm/t-multilib (v8_4_a_simd_variants): New variable.
2599 Add matching rules for -march=armv8.4-a and extensions.
2600 * doc/invoke.texi (ARM Options): Document -march=armv8.4-a.
2602 2018-01-11 Oleg Endo <olegendo@gcc.gnu.org>
2605 * config/rx/rx.md (BW): New mode attribute.
2606 (sync_lock_test_and_setsi): Add mode suffix to insn output.
2608 2018-01-11 Richard Biener <rguenther@suse.de>
2610 PR tree-optimization/83435
2611 * graphite.c (canonicalize_loop_form): Ignore fake loop exit edges.
2612 * graphite-scop-detection.c (scop_detection::get_sese): Likewise.
2613 * tree-vrp.c (add_assert_info): Drop TREE_OVERFLOW if they appear.
2615 2018-01-11 Richard Sandiford <richard.sandiford@linaro.org>
2616 Alan Hayward <alan.hayward@arm.com>
2617 David Sherwood <david.sherwood@arm.com>
2619 * config/aarch64/aarch64.c (aarch64_address_info): Add a const_offset
2621 (aarch64_classify_address): Initialize it. Track polynomial offsets.
2622 (aarch64_print_address_internal): Use it to check for a zero offset.
2624 2018-01-11 Richard Sandiford <richard.sandiford@linaro.org>
2625 Alan Hayward <alan.hayward@arm.com>
2626 David Sherwood <david.sherwood@arm.com>
2628 * config/aarch64/aarch64-modes.def (NUM_POLY_INT_COEFFS): Set to 2.
2629 * config/aarch64/aarch64-protos.h (aarch64_initial_elimination_offset):
2630 Return a poly_int64 rather than a HOST_WIDE_INT.
2631 (aarch64_offset_7bit_signed_scaled_p): Take the offset as a poly_int64
2632 rather than a HOST_WIDE_INT.
2633 * config/aarch64/aarch64.h (aarch64_frame): Protect with
2634 HAVE_POLY_INT_H rather than HOST_WIDE_INT. Change locals_offset,
2635 hard_fp_offset, frame_size, initial_adjust, callee_offset and
2636 final_offset from HOST_WIDE_INT to poly_int64.
2637 * config/aarch64/aarch64-builtins.c (aarch64_simd_expand_args): Use
2638 to_constant when getting the number of units in an Advanced SIMD
2640 (aarch64_builtin_vectorized_function): Check for a constant number
2642 * config/aarch64/aarch64-simd.md (mov<mode>): Handle polynomial
2644 (aarch64_ld<VSTRUCT:nregs>_lane<VALLDIF:mode>): Use the nunits
2645 attribute instead of GET_MODE_NUNITS.
2646 * config/aarch64/aarch64.c (aarch64_hard_regno_nregs)
2647 (aarch64_class_max_nregs): Use the constant_lowest_bound of the
2648 GET_MODE_SIZE for fixed-size registers.
2649 (aarch64_const_vec_all_same_in_range_p): Use const_vec_duplicate_p.
2650 (aarch64_hard_regno_call_part_clobbered, aarch64_classify_index)
2651 (aarch64_mode_valid_for_sched_fusion_p, aarch64_classify_address)
2652 (aarch64_legitimize_address_displacement, aarch64_secondary_reload)
2653 (aarch64_print_operand, aarch64_print_address_internal)
2654 (aarch64_address_cost, aarch64_rtx_costs, aarch64_register_move_cost)
2655 (aarch64_short_vector_p, aapcs_vfp_sub_candidate)
2656 (aarch64_simd_attr_length_rglist, aarch64_operands_ok_for_ldpstp):
2657 Handle polynomial GET_MODE_SIZE.
2658 (aarch64_hard_regno_caller_save_mode): Likewise. Return modes
2659 wider than SImode without modification.
2660 (tls_symbolic_operand_type): Use strip_offset instead of split_const.
2661 (aarch64_pass_by_reference, aarch64_layout_arg, aarch64_pad_reg_upward)
2662 (aarch64_gimplify_va_arg_expr): Assert that we don't yet handle
2663 passing and returning SVE modes.
2664 (aarch64_function_value, aarch64_layout_arg): Use gen_int_mode
2665 rather than GEN_INT.
2666 (aarch64_emit_probe_stack_range): Take the size as a poly_int64
2667 rather than a HOST_WIDE_INT, but call sorry if it isn't constant.
2668 (aarch64_allocate_and_probe_stack_space): Likewise.
2669 (aarch64_layout_frame): Cope with polynomial offsets.
2670 (aarch64_save_callee_saves, aarch64_restore_callee_saves): Take the
2671 start_offset as a poly_int64 rather than a HOST_WIDE_INT. Track
2673 (offset_9bit_signed_unscaled_p, offset_12bit_unsigned_scaled_p)
2674 (aarch64_offset_7bit_signed_scaled_p): Take the offset as a
2675 poly_int64 rather than a HOST_WIDE_INT.
2676 (aarch64_get_separate_components, aarch64_process_components)
2677 (aarch64_expand_prologue, aarch64_expand_epilogue)
2678 (aarch64_use_return_insn_p): Handle polynomial frame offsets.
2679 (aarch64_anchor_offset): New function, split out from...
2680 (aarch64_legitimize_address): ...here.
2681 (aarch64_builtin_vectorization_cost): Handle polynomial
2682 TYPE_VECTOR_SUBPARTS.
2683 (aarch64_simd_check_vect_par_cnst_half): Handle polynomial
2685 (aarch64_simd_make_constant, aarch64_expand_vector_init): Get the
2686 number of elements from the PARALLEL rather than the mode.
2687 (aarch64_shift_truncation_mask): Use GET_MODE_UNIT_BITSIZE
2688 rather than GET_MODE_BITSIZE.
2689 (aarch64_evpc_trn, aarch64_evpc_uzp, aarch64_evpc_ext)
2690 (aarch64_evpc_rev, aarch64_evpc_dup, aarch64_evpc_zip)
2691 (aarch64_expand_vec_perm_const_1): Handle polynomial
2692 d->perm.length () and d->perm elements.
2693 (aarch64_evpc_tbl): Likewise. Use nelt rather than GET_MODE_NUNITS.
2694 Apply to_constant to d->perm elements.
2695 (aarch64_simd_valid_immediate, aarch64_vec_fpconst_pow_of_2): Handle
2696 polynomial CONST_VECTOR_NUNITS.
2697 (aarch64_move_pointer): Take amount as a poly_int64 rather
2699 (aarch64_progress_pointer): Avoid temporary variable.
2700 * config/aarch64/aarch64.md (aarch64_<crc_variant>): Use
2701 the mode attribute instead of GET_MODE.
2703 2018-01-11 Richard Sandiford <richard.sandiford@linaro.org>
2704 Alan Hayward <alan.hayward@arm.com>
2705 David Sherwood <david.sherwood@arm.com>
2707 * config/aarch64/aarch64.c (aarch64_force_temporary): Assert that
2708 x exists before using it.
2709 (aarch64_add_constant_internal): Rename to...
2710 (aarch64_add_offset_1): ...this. Replace regnum with separate
2711 src and dest rtxes. Handle the case in which they're different,
2712 including when the offset is zero. Replace scratchreg with an rtx.
2713 Use 2 additions if there is no spare register into which we can
2714 move a 16-bit constant.
2715 (aarch64_add_constant): Delete.
2716 (aarch64_add_offset): Replace reg with separate src and dest
2717 rtxes. Take a poly_int64 offset instead of a HOST_WIDE_INT.
2718 Use aarch64_add_offset_1.
2719 (aarch64_add_sp, aarch64_sub_sp): Take the scratch register as
2720 an rtx rather than an int. Take the delta as a poly_int64
2721 rather than a HOST_WIDE_INT. Use aarch64_add_offset.
2722 (aarch64_expand_mov_immediate): Update uses of aarch64_add_offset.
2723 (aarch64_expand_prologue): Update calls to aarch64_sub_sp,
2724 aarch64_allocate_and_probe_stack_space and aarch64_add_offset.
2725 (aarch64_expand_epilogue): Update calls to aarch64_add_offset
2727 (aarch64_output_mi_thunk): Use aarch64_add_offset rather than
2728 aarch64_add_constant.
2730 2018-01-11 Richard Sandiford <richard.sandiford@linaro.org>
2732 * config/aarch64/aarch64.c (aarch64_reinterpret_float_as_int):
2733 Use scalar_float_mode.
2735 2018-01-11 Richard Sandiford <richard.sandiford@linaro.org>
2737 * config/aarch64/aarch64-simd.md
2738 (aarch64_fml<f16mac1>l<f16quad>_low<mode>): Avoid GET_MODE_NUNITS.
2739 (aarch64_fml<f16mac1>l<f16quad>_high<mode>): Likewise.
2740 (aarch64_fml<f16mac1>l_lane_lowv2sf): Likewise.
2741 (aarch64_fml<f16mac1>l_lane_highv2sf): Likewise.
2742 (aarch64_fml<f16mac1>lq_laneq_lowv4sf): Likewise.
2743 (aarch64_fml<f16mac1>lq_laneq_highv4sf): Likewise.
2744 (aarch64_fml<f16mac1>l_laneq_lowv2sf): Likewise.
2745 (aarch64_fml<f16mac1>l_laneq_highv2sf): Likewise.
2746 (aarch64_fml<f16mac1>lq_lane_lowv4sf): Likewise.
2747 (aarch64_fml<f16mac1>lq_lane_highv4sf): Likewise.
2749 2018-01-11 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
2752 * config/arm/arm.c (arm_declare_function_name): Set arch_to_print if
2753 targ_options->x_arm_arch_string is non NULL.
2755 2018-01-11 Tamar Christina <tamar.christina@arm.com>
2757 * config/aarch64/aarch64.h
2758 (AARCH64_FL_FOR_ARCH8_4): Add AARCH64_FL_DOTPROD.
2760 2018-01-11 Sudakshina Das <sudi.das@arm.com>
2763 * expmed.c (emit_store_flag_force): Swap if const op0
2764 and change VOIDmode to mode of op0.
2766 2018-01-11 Richard Sandiford <richard.sandiford@linaro.org>
2768 PR rtl-optimization/83761
2769 * caller-save.c (replace_reg_with_saved_mem): Pass bits rather
2770 than bytes to mode_for_size.
2772 2018-01-10 Jan Hubicka <hubicka@ucw.cz>
2775 * gfortran.fortran-torture/compile/pr83189.f90: New testcase.
2776 * tree-ssa-loop-manip.c (tree_transform_and_unroll_loop): Handle zero
2779 2018-01-10 Jan Hubicka <hubicka@ucw.cz>
2782 * cfgrtl.c (rtl_verify_edges): Only verify fixability of partition
2783 when in layout mode.
2784 (cfg_layout_finalize): Do not verify cfg before we are out of layout.
2785 * cfgcleanup.c (try_optimize_cfg): Only verify flow info when doing
2788 2018-01-10 Michael Collison <michael.collison@arm.com>
2790 * config/aarch64/aarch64-modes.def (V2HF): New VECTOR_MODE.
2791 * config/aarch64/aarch64-option-extension.def: Add
2792 AARCH64_OPT_EXTENSION of 'fp16fml'.
2793 * config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins):
2794 (__ARM_FEATURE_FP16_FML): Define if TARGET_F16FML is true.
2795 * config/aarch64/predicates.md (aarch64_lane_imm3): New predicate.
2796 * config/aarch64/constraints.md (Ui7): New constraint.
2797 * config/aarch64/iterators.md (VFMLA_W): New mode iterator.
2798 (VFMLA_SEL_W): Ditto.
2801 (VFMLA16_LOW): New int iterator.
2802 (VFMLA16_HIGH): Ditto.
2803 (UNSPEC_FMLAL): New unspec.
2804 (UNSPEC_FMLSL): Ditto.
2805 (UNSPEC_FMLAL2): Ditto.
2806 (UNSPEC_FMLSL2): Ditto.
2807 (f16mac): New code attribute.
2808 * config/aarch64/aarch64-simd-builtins.def
2809 (aarch64_fmlal_lowv2sf): Ditto.
2810 (aarch64_fmlsl_lowv2sf): Ditto.
2811 (aarch64_fmlalq_lowv4sf): Ditto.
2812 (aarch64_fmlslq_lowv4sf): Ditto.
2813 (aarch64_fmlal_highv2sf): Ditto.
2814 (aarch64_fmlsl_highv2sf): Ditto.
2815 (aarch64_fmlalq_highv4sf): Ditto.
2816 (aarch64_fmlslq_highv4sf): Ditto.
2817 (aarch64_fmlal_lane_lowv2sf): Ditto.
2818 (aarch64_fmlsl_lane_lowv2sf): Ditto.
2819 (aarch64_fmlal_laneq_lowv2sf): Ditto.
2820 (aarch64_fmlsl_laneq_lowv2sf): Ditto.
2821 (aarch64_fmlalq_lane_lowv4sf): Ditto.
2822 (aarch64_fmlsl_lane_lowv4sf): Ditto.
2823 (aarch64_fmlalq_laneq_lowv4sf): Ditto.
2824 (aarch64_fmlsl_laneq_lowv4sf): Ditto.
2825 (aarch64_fmlal_lane_highv2sf): Ditto.
2826 (aarch64_fmlsl_lane_highv2sf): Ditto.
2827 (aarch64_fmlal_laneq_highv2sf): Ditto.
2828 (aarch64_fmlsl_laneq_highv2sf): Ditto.
2829 (aarch64_fmlalq_lane_highv4sf): Ditto.
2830 (aarch64_fmlsl_lane_highv4sf): Ditto.
2831 (aarch64_fmlalq_laneq_highv4sf): Ditto.
2832 (aarch64_fmlsl_laneq_highv4sf): Ditto.
2833 * config/aarch64/aarch64-simd.md:
2834 (aarch64_fml<f16mac1>l<f16quad>_low<mode>): New pattern.
2835 (aarch64_fml<f16mac1>l<f16quad>_high<mode>): Ditto.
2836 (aarch64_simd_fml<f16mac1>l<f16quad>_low<mode>): Ditto.
2837 (aarch64_simd_fml<f16mac1>l<f16quad>_high<mode>): Ditto.
2838 (aarch64_fml<f16mac1>l_lane_lowv2sf): Ditto.
2839 (aarch64_fml<f16mac1>l_lane_highv2sf): Ditto.
2840 (aarch64_simd_fml<f16mac>l_lane_lowv2sf): Ditto.
2841 (aarch64_simd_fml<f16mac>l_lane_highv2sf): Ditto.
2842 (aarch64_fml<f16mac1>lq_laneq_lowv4sf): Ditto.
2843 (aarch64_fml<f16mac1>lq_laneq_highv4sf): Ditto.
2844 (aarch64_simd_fml<f16mac>lq_laneq_lowv4sf): Ditto.
2845 (aarch64_simd_fml<f16mac>lq_laneq_highv4sf): Ditto.
2846 (aarch64_fml<f16mac1>l_laneq_lowv2sf): Ditto.
2847 (aarch64_fml<f16mac1>l_laneq_highv2sf): Ditto.
2848 (aarch64_simd_fml<f16mac>l_laneq_lowv2sf): Ditto.
2849 (aarch64_simd_fml<f16mac>l_laneq_highv2sf): Ditto.
2850 (aarch64_fml<f16mac1>lq_lane_lowv4sf): Ditto.
2851 (aarch64_fml<f16mac1>lq_lane_highv4sf): Ditto.
2852 (aarch64_simd_fml<f16mac>lq_lane_lowv4sf): Ditto.
2853 (aarch64_simd_fml<f16mac>lq_lane_highv4sf): Ditto.
2854 * config/aarch64/arm_neon.h (vfmlal_low_u32): New intrinsic.
2855 (vfmlsl_low_u32): Ditto.
2856 (vfmlalq_low_u32): Ditto.
2857 (vfmlslq_low_u32): Ditto.
2858 (vfmlal_high_u32): Ditto.
2859 (vfmlsl_high_u32): Ditto.
2860 (vfmlalq_high_u32): Ditto.
2861 (vfmlslq_high_u32): Ditto.
2862 (vfmlal_lane_low_u32): Ditto.
2863 (vfmlsl_lane_low_u32): Ditto.
2864 (vfmlal_laneq_low_u32): Ditto.
2865 (vfmlsl_laneq_low_u32): Ditto.
2866 (vfmlalq_lane_low_u32): Ditto.
2867 (vfmlslq_lane_low_u32): Ditto.
2868 (vfmlalq_laneq_low_u32): Ditto.
2869 (vfmlslq_laneq_low_u32): Ditto.
2870 (vfmlal_lane_high_u32): Ditto.
2871 (vfmlsl_lane_high_u32): Ditto.
2872 (vfmlal_laneq_high_u32): Ditto.
2873 (vfmlsl_laneq_high_u32): Ditto.
2874 (vfmlalq_lane_high_u32): Ditto.
2875 (vfmlslq_lane_high_u32): Ditto.
2876 (vfmlalq_laneq_high_u32): Ditto.
2877 (vfmlslq_laneq_high_u32): Ditto.
2878 * config/aarch64/aarch64.h (AARCH64_FL_F16SML): New flag.
2879 (AARCH64_FL_FOR_ARCH8_4): New.
2880 (AARCH64_ISA_F16FML): New ISA flag.
2881 (TARGET_F16FML): New feature flag for fp16fml.
2882 (doc/invoke.texi): Document new fp16fml option.
2884 2018-01-10 Michael Collison <michael.collison@arm.com>
2886 * config/aarch64/aarch64-builtins.c:
2887 (aarch64_types_ternopu_imm_qualifiers, TYPES_TERNOPUI): New.
2888 * config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins):
2889 (__ARM_FEATURE_SHA3): Define if TARGET_SHA3 is true.
2890 * config/aarch64/aarch64.h (AARCH64_FL_SHA3): New flags.
2891 (AARCH64_ISA_SHA3): New ISA flag.
2892 (TARGET_SHA3): New feature flag for sha3.
2893 * config/aarch64/iterators.md (sha512_op): New int attribute.
2894 (CRYPTO_SHA512): New int iterator.
2895 (UNSPEC_SHA512H): New unspec.
2896 (UNSPEC_SHA512H2): Ditto.
2897 (UNSPEC_SHA512SU0): Ditto.
2898 (UNSPEC_SHA512SU1): Ditto.
2899 * config/aarch64/aarch64-simd-builtins.def
2900 (aarch64_crypto_sha512hqv2di): New builtin.
2901 (aarch64_crypto_sha512h2qv2di): Ditto.
2902 (aarch64_crypto_sha512su0qv2di): Ditto.
2903 (aarch64_crypto_sha512su1qv2di): Ditto.
2904 (aarch64_eor3qv8hi): Ditto.
2905 (aarch64_rax1qv2di): Ditto.
2906 (aarch64_xarqv2di): Ditto.
2907 (aarch64_bcaxqv8hi): Ditto.
2908 * config/aarch64/aarch64-simd.md:
2909 (aarch64_crypto_sha512h<sha512_op>qv2di): New pattern.
2910 (aarch64_crypto_sha512su0qv2di): Ditto.
2911 (aarch64_crypto_sha512su1qv2di): Ditto.
2912 (aarch64_eor3qv8hi): Ditto.
2913 (aarch64_rax1qv2di): Ditto.
2914 (aarch64_xarqv2di): Ditto.
2915 (aarch64_bcaxqv8hi): Ditto.
2916 * config/aarch64/arm_neon.h (vsha512hq_u64): New intrinsic.
2917 (vsha512h2q_u64): Ditto.
2918 (vsha512su0q_u64): Ditto.
2919 (vsha512su1q_u64): Ditto.
2920 (veor3q_u16): Ditto.
2921 (vrax1q_u64): Ditto.
2923 (vbcaxq_u16): Ditto.
2924 * config/arm/types.md (crypto_sha512): New type attribute.
2925 (crypto_sha3): Ditto.
2926 (doc/invoke.texi): Document new sha3 option.
2928 2018-01-10 Michael Collison <michael.collison@arm.com>
2930 * config/aarch64/aarch64-builtins.c:
2931 (aarch64_types_quadopu_imm_qualifiers, TYPES_QUADOPUI): New.
2932 * config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins):
2933 (__ARM_FEATURE_SM3): Define if TARGET_SM4 is true.
2934 (__ARM_FEATURE_SM4): Define if TARGET_SM4 is true.
2935 * config/aarch64/aarch64.h (AARCH64_FL_SM4): New flags.
2936 (AARCH64_ISA_SM4): New ISA flag.
2937 (TARGET_SM4): New feature flag for sm4.
2938 * config/aarch64/aarch64-simd-builtins.def
2939 (aarch64_sm3ss1qv4si): Ditto.
2940 (aarch64_sm3tt1aq4si): Ditto.
2941 (aarch64_sm3tt1bq4si): Ditto.
2942 (aarch64_sm3tt2aq4si): Ditto.
2943 (aarch64_sm3tt2bq4si): Ditto.
2944 (aarch64_sm3partw1qv4si): Ditto.
2945 (aarch64_sm3partw2qv4si): Ditto.
2946 (aarch64_sm4eqv4si): Ditto.
2947 (aarch64_sm4ekeyqv4si): Ditto.
2948 * config/aarch64/aarch64-simd.md:
2949 (aarch64_sm3ss1qv4si): Ditto.
2950 (aarch64_sm3tt<sm3tt_op>qv4si): Ditto.
2951 (aarch64_sm3partw<sm3part_op>qv4si): Ditto.
2952 (aarch64_sm4eqv4si): Ditto.
2953 (aarch64_sm4ekeyqv4si): Ditto.
2954 * config/aarch64/iterators.md (sm3tt_op): New int iterator.
2955 (sm3part_op): Ditto.
2956 (CRYPTO_SM3TT): Ditto.
2957 (CRYPTO_SM3PART): Ditto.
2958 (UNSPEC_SM3SS1): New unspec.
2959 (UNSPEC_SM3TT1A): Ditto.
2960 (UNSPEC_SM3TT1B): Ditto.
2961 (UNSPEC_SM3TT2A): Ditto.
2962 (UNSPEC_SM3TT2B): Ditto.
2963 (UNSPEC_SM3PARTW1): Ditto.
2964 (UNSPEC_SM3PARTW2): Ditto.
2965 (UNSPEC_SM4E): Ditto.
2966 (UNSPEC_SM4EKEY): Ditto.
2967 * config/aarch64/constraints.md (Ui2): New constraint.
2968 * config/aarch64/predicates.md (aarch64_imm2): New predicate.
2969 * config/arm/types.md (crypto_sm3): New type attribute.
2970 (crypto_sm4): Ditto.
2971 * config/aarch64/arm_neon.h (vsm3ss1q_u32): New intrinsic.
2972 (vsm3tt1aq_u32): Ditto.
2973 (vsm3tt1bq_u32): Ditto.
2974 (vsm3tt2aq_u32): Ditto.
2975 (vsm3tt2bq_u32): Ditto.
2976 (vsm3partw1q_u32): Ditto.
2977 (vsm3partw2q_u32): Ditto.
2978 (vsm4eq_u32): Ditto.
2979 (vsm4ekeyq_u32): Ditto.
2980 (doc/invoke.texi): Document new sm4 option.
2982 2018-01-10 Michael Collison <michael.collison@arm.com>
2984 * config/aarch64/aarch64-arches.def (armv8.4-a): New architecture.
2985 * config/aarch64/aarch64.h (AARCH64_ISA_V8_4): New ISA flag.
2986 (AARCH64_FL_FOR_ARCH8_4): New.
2987 (AARCH64_FL_V8_4): New flag.
2988 (doc/invoke.texi): Document new armv8.4-a option.
2990 2018-01-10 Michael Collison <michael.collison@arm.com>
2992 * config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins):
2993 (__ARM_FEATURE_AES): Define if TARGET_AES is true.
2994 (__ARM_FEATURE_SHA2): Define if TARGET_SHA2 is true.
2995 * config/aarch64/aarch64-option-extension.def: Add
2996 AARCH64_OPT_EXTENSION of 'sha2'.
2997 (aes): Add AARCH64_OPT_EXTENSION of 'aes'.
2998 (crypto): Disable sha2 and aes if crypto disabled.
2999 (crypto): Enable aes and sha2 if enabled.
3000 (simd): Disable sha2 and aes if simd disabled.
3001 * config/aarch64/aarch64.h (AARCH64_FL_AES, AARCH64_FL_SHA2):
3003 (AARCH64_ISA_AES, AARCH64_ISA_SHA2): New ISA flags.
3004 (TARGET_SHA2): New feature flag for sha2.
3005 (TARGET_AES): New feature flag for aes.
3006 * config/aarch64/aarch64-simd.md:
3007 (aarch64_crypto_aes<aes_op>v16qi): Make pattern
3008 conditional on TARGET_AES.
3009 (aarch64_crypto_aes<aesmc_op>v16qi): Ditto.
3010 (aarch64_crypto_sha1hsi): Make pattern conditional
3012 (aarch64_crypto_sha1hv4si): Ditto.
3013 (aarch64_be_crypto_sha1hv4si): Ditto.
3014 (aarch64_crypto_sha1su1v4si): Ditto.
3015 (aarch64_crypto_sha1<sha1_op>v4si): Ditto.
3016 (aarch64_crypto_sha1su0v4si): Ditto.
3017 (aarch64_crypto_sha256h<sha256_op>v4si): Ditto.
3018 (aarch64_crypto_sha256su0v4si): Ditto.
3019 (aarch64_crypto_sha256su1v4si): Ditto.
3020 (doc/invoke.texi): Document new aes and sha2 options.
3022 2018-01-10 Martin Sebor <msebor@redhat.com>
3024 PR tree-optimization/83781
3025 * gimple-fold.c (get_range_strlen): Avoid treating arrays of pointers
3028 2018-01-11 Martin Sebor <msebor@gmail.com>
3029 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
3031 PR tree-optimization/83501
3032 PR tree-optimization/81703
3034 * tree-ssa-strlen.c (get_string_cst): Rename...
3035 (get_string_len): ...to this. Handle global constants.
3036 (handle_char_store): Adjust.
3038 2018-01-10 Kito Cheng <kito.cheng@gmail.com>
3039 Jim Wilson <jimw@sifive.com>
3041 * config/riscv/riscv-protos.h (riscv_output_return): New.
3042 * config/riscv/riscv.c (struct machine_function): New naked_p field.
3043 (riscv_attribute_table, riscv_output_return),
3044 (riscv_handle_fndecl_attribute, riscv_naked_function_p),
3045 (riscv_allocate_stack_slots_for_args, riscv_warn_func_return): New.
3046 (riscv_compute_frame_info): Only compute frame->mask if not a naked
3048 (riscv_expand_prologue): Add early return for naked function.
3049 (riscv_expand_epilogue): Likewise.
3050 (riscv_function_ok_for_sibcall): Return false for naked function.
3051 (riscv_set_current_function): New.
3052 (TARGET_SET_CURRENT_FUNCTION, TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS),
3053 (TARGET_ATTRIBUTE_TABLE, TARGET_WARN_FUNC_RETURN): New.
3054 * config/riscv/riscv.md (simple_return): Call riscv_output_return.
3055 * doc/extend.texi (RISC-V Function Attributes): New.
3057 2018-01-10 Michael Meissner <meissner@linux.vnet.ibm.com>
3059 * config/rs6000/rs6000.c (is_complex_IBM_long_double): Explicitly
3060 check for 128-bit long double before checking TCmode.
3061 * config/rs6000/rs6000.h (FLOAT128_IEEE_P): Explicitly check for
3062 128-bit long doubles before checking TFmode or TCmode.
3063 (FLOAT128_IBM_P): Likewise.
3065 2018-01-10 Martin Sebor <msebor@redhat.com>
3067 PR tree-optimization/83671
3068 * builtins.c (c_strlen): Unconditionally return zero for the empty
3070 Use -Warray-bounds for warnings.
3071 * gimple-fold.c (get_range_strlen): Handle non-constant lengths
3072 for non-constant array indices with COMPONENT_REF, arrays of
3073 arrays, and pointers to arrays.
3074 (gimple_fold_builtin_strlen): Determine and set length range for
3075 non-constant character arrays.
3077 2018-01-10 Aldy Hernandez <aldyh@redhat.com>
3080 * tree-ssa-uninit.c (convert_control_dep_chain_into_preds): Skip
3083 2018-01-10 Eric Botcazou <ebotcazou@adacore.com>
3085 * dwarf2out.c (dwarf2out_var_location): Do not pass NULL to fprintf.
3087 2018-01-10 Peter Bergner <bergner@vnet.ibm.com>
3090 * config/rs6000/rs6000.c (print_operand) <'y'>: Use
3091 VECTOR_MEM_ALTIVEC_OR_VSX_P.
3092 * config/rs6000/vsx.md (*vsx_le_perm_load_<mode> for VSX_D): Use
3093 indexed_or_indirect_operand predicate.
3094 (*vsx_le_perm_load_<mode> for VSX_W): Likewise.
3095 (*vsx_le_perm_load_v8hi): Likewise.
3096 (*vsx_le_perm_load_v16qi): Likewise.
3097 (*vsx_le_perm_store_<mode> for VSX_D): Likewise.
3098 (*vsx_le_perm_store_<mode> for VSX_W): Likewise.
3099 (*vsx_le_perm_store_v8hi): Likewise.
3100 (*vsx_le_perm_store_v16qi): Likewise.
3101 (eight unnamed splitters): Likewise.
3103 2018-01-10 Peter Bergner <bergner@vnet.ibm.com>
3105 * config/rs6000/x86intrin.h: Change #warning to #error. Update message.
3106 * config/rs6000/emmintrin.h: Likewise.
3107 * config/rs6000/mmintrin.h: Likewise.
3108 * config/rs6000/xmmintrin.h: Likewise.
3110 2018-01-10 David Malcolm <dmalcolm@redhat.com>
3113 * tree-core.h: Document EXPR_LOCATION_WRAPPER_P's usage of
3115 * tree.c (tree_nop_conversion): Return true for location wrapper
3117 (maybe_wrap_with_location): New function.
3118 (selftest::check_strip_nops): New function.
3119 (selftest::test_location_wrappers): New function.
3120 (selftest::tree_c_tests): Call it.
3121 * tree.h (STRIP_ANY_LOCATION_WRAPPER): New macro.
3122 (maybe_wrap_with_location): New decl.
3123 (EXPR_LOCATION_WRAPPER_P): New macro.
3124 (location_wrapper_p): New inline function.
3125 (tree_strip_any_location_wrapper): New inline function.
3127 2018-01-10 H.J. Lu <hongjiu.lu@intel.com>
3130 * config/i386/i386.c (ix86_compute_frame_layout): Always adjust
3131 stack_realign_offset for the largest alignment of stack slot
3133 (ix86_find_max_used_stack_alignment): New function.
3134 (ix86_finalize_stack_frame_flags): Use it. Set
3135 max_used_stack_alignment if we don't realign stack.
3136 * config/i386/i386.h (machine_function): Add
3137 max_used_stack_alignment.
3139 2018-01-10 Christophe Lyon <christophe.lyon@linaro.org>
3141 * config/arm/arm.opt (-mbranch-cost): New option.
3142 * config/arm/arm.h (BRANCH_COST): Take arm_branch_cost into
3145 2018-01-10 Segher Boessenkool <segher@kernel.crashing.org>
3148 * config/rs6000/rs6000.md (load_toc_v4_PIC_2, load_toc_v4_PIC_3b,
3149 load_toc_v4_PIC_3c): Wrap const term in CONST RTL.
3151 2018-01-10 Richard Biener <rguenther@suse.de>
3154 * dwarf2out.c (gen_subprogram_die): Hoist old_die && declaration
3155 early out so it also covers the case where we have a non-NULL
3158 2018-01-10 Richard Sandiford <richard.sandiford@linaro.org>
3160 PR tree-optimization/83753
3161 * tree-vect-stmts.c (get_group_load_store_type): Use VMAT_CONTIGUOUS
3162 for non-strided grouped accesses if the number of elements is 1.
3164 2018-01-10 Jan Hubicka <hubicka@ucw.cz>
3167 * i386.c (ix86_vectorize_builtin_gather): Check TARGET_USE_GATHER.
3168 * i386.h (TARGET_USE_GATHER): Define.
3169 * x86-tune.def (X86_TUNE_USE_GATHER): New.
3171 2018-01-10 Martin Liska <mliska@suse.cz>
3174 * basic-block.h (CLEANUP_NO_PARTITIONING): New define.
3175 * bb-reorder.c (pass_reorder_blocks::execute): Do not clean up
3177 * cfgcleanup.c (try_optimize_cfg): Fix up partitioning if
3178 CLEANUP_NO_PARTITIONING is not set.
3180 2018-01-10 Richard Sandiford <richard.sandiford@linaro.org>
3182 * doc/rtl.texi: Remove documentation of (const ...) wrappers
3183 for vectors, as a partial revert of r254296.
3184 * rtl.h (const_vec_p): Delete.
3185 (const_vec_duplicate_p): Don't test for vector CONSTs.
3186 (unwrap_const_vec_duplicate, const_vec_series_p): Likewise.
3187 * expmed.c (make_tree): Likewise.
3190 * common.md (E, F): Use CONSTANT_P instead of checking for
3192 * emit-rtl.c (gen_lowpart_common): Use const_vec_p instead of
3193 checking for CONST_VECTOR.
3195 2018-01-09 Jan Hubicka <hubicka@ucw.cz>
3198 * predict.c (force_edge_cold): Handle in more sane way edges
3201 2018-01-09 Carl Love <cel@us.ibm.com>
3203 * config/rs6002/altivec.md (p8_vmrgow): Add support for V2DI, V2DF,
3205 (p8_vmrgew): Add support for V2DI, V2DF, V4SF types.
3206 * config/rs6000/rs6000-builtin.def: Add definitions for FLOAT2_V2DF,
3207 VMRGEW_V2DI, VMRGEW_V2DF, VMRGEW_V4SF, VMRGOW_V4SI, VMRGOW_V4SF,
3208 VMRGOW_V2DI, VMRGOW_V2DF. Remove definition for VMRGOW.
3209 * config/rs6000/rs6000-c.c (VSX_BUILTIN_VEC_FLOAT2,
3210 P8V_BUILTIN_VEC_VMRGEW, P8V_BUILTIN_VEC_VMRGOW): Add definitions.
3211 * config/rs6000/rs6000-protos.h: Add extern defition for
3212 rs6000_generate_float2_double_code.
3213 * config/rs6000/rs6000.c (rs6000_generate_float2_double_code): Add
3215 * config/rs6000/vsx.md (vsx_xvcdpsp): Add define_insn.
3216 (float2_v2df): Add define_expand.
3218 2018-01-09 Uros Bizjak <ubizjak@gmail.com>
3221 * combine.c (force_int_to_mode) <case ASHIFT>: Use mode instead of
3222 op_mode in the force_to_mode call.
3224 2018-01-09 Richard Sandiford <richard.sandiford@linaro.org>
3226 * config/aarch64/aarch64.c (aarch64_evpc_trn): Use d.perm.series_p
3227 instead of checking each element individually.
3228 (aarch64_evpc_uzp): Likewise.
3229 (aarch64_evpc_zip): Likewise.
3230 (aarch64_evpc_ext): Likewise.
3231 (aarch64_evpc_rev): Likewise.
3232 (aarch64_evpc_dup): Test the encoding for a single duplicated element,
3233 instead of checking each element individually. Return true without
3235 (aarch64_vectorize_vec_perm_const): Use all_from_input_p to test
3236 whether all selected elements come from the same input, instead of
3237 checking each element individually. Remove calls to gen_rtx_REG,
3238 start_sequence and end_sequence and instead assert that no rtl is
3241 2018-01-09 Richard Sandiford <richard.sandiford@linaro.org>
3243 * config/aarch64/aarch64.c (aarch64_legitimate_constant_p): Fix
3244 order of HIGH and CONST checks.
3246 2018-01-09 Richard Sandiford <richard.sandiford@linaro.org>
3248 * tree-vect-stmts.c (permute_vec_elements): Create a fresh variable
3249 if the destination isn't an SSA_NAME.
3251 2018-01-09 Richard Biener <rguenther@suse.de>
3253 PR tree-optimization/83668
3254 * graphite.c (canonicalize_loop_closed_ssa): Add edge argument,
3256 (canonicalize_loop_form): ... here, renamed from ...
3257 (canonicalize_loop_closed_ssa_form): ... this and amended to
3258 swap successor edges for loop exit blocks to make us use
3259 the RPO order we need for initial schedule generation.
3261 2018-01-09 Joseph Myers <joseph@codesourcery.com>
3263 PR tree-optimization/64811
3264 * match.pd: When optimizing comparisons with Inf, avoid
3265 introducing or losing exceptions from comparisons with NaN.
3267 2018-01-09 Martin Liska <mliska@suse.cz>
3270 * asan.c (shadow_mem_size): Add gcc_assert.
3272 2018-01-09 Georg-Johann Lay <avr@gjlay.de>
3274 Don't save registers in main().
3277 * doc/invoke.texi (AVR Options) [-mmain-is-OS_task]: Document it.
3278 * config/avr/avr.opt (-mmain-is-OS_task): New target option.
3279 * config/avr/avr.c (avr_set_current_function): Don't error if
3280 naked, OS_task or OS_main are specified at the same time.
3281 (avr_function_ok_for_sibcall): Don't disable sibcalls for OS_task,
3283 (avr_insert_attributes) [-mmain-is-OS_task] <main>: Add OS_task
3285 * common/config/avr/avr-common.c (avr_option_optimization_table):
3286 Switch on -mmain-is-OS_task for optimizing compilations.
3288 2018-01-09 Richard Biener <rguenther@suse.de>
3290 PR tree-optimization/83572
3291 * graphite.c: Include cfganal.h.
3292 (graphite_transform_loops): Connect infinite loops to exit
3293 and remove fake edges at the end.
3295 2018-01-09 Jan Hubicka <hubicka@ucw.cz>
3297 * ipa-inline.c (edge_badness): Revert accidental checkin.
3299 2018-01-09 Jan Hubicka <hubicka@ucw.cz>
3302 * ipa-comdats.c (set_comdat_group): Only set comdat group of real
3303 symbols; not inline clones.
3305 2018-01-09 Jakub Jelinek <jakub@redhat.com>
3308 * modulo-sched.c (schedule_reg_moves): Punt if we'd need to move
3309 hard registers. Formatting fixes.
3311 PR preprocessor/83722
3312 * gcc.c (try_generate_repro): Pass
3313 &temp_stderr_files[RETRY_ICE_ATTEMPTS - 1] rather than
3314 &temp_stdout_files[RETRY_ICE_ATTEMPTS - 1] as last argument to
3317 2018-01-08 Monk Chiang <sh.chiang04@gmail.com>
3318 Kito Cheng <kito.cheng@gmail.com>
3320 * config/riscv/riscv.c (machine_function::is_leaf): Remove field.
3321 (riscv_leaf_function_p): Delete.
3322 (riscv_function_ok_for_sibcall): Return false when TARGET_SAVE_RESTORE.
3324 2018-01-08 Aaron Sawdey <acsawdey@linux.vnet.ibm.com>
3326 * config/rs6000/rs6000-string.c (do_load_for_compare_from_addr): New
3328 (do_ifelse): New function.
3329 (do_isel): New function.
3330 (do_sub3): New function.
3331 (do_add3): New function.
3332 (do_load_mask_compare): New function.
3333 (do_overlap_load_compare): New function.
3334 (expand_compare_loop): New function.
3335 (expand_block_compare): Call expand_compare_loop() when appropriate.
3336 * config/rs6000/rs6000.opt (-mblock-compare-inline-limit): Change
3338 (-mblock-compare-inline-loop-limit): New option.
3340 2018-01-08 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
3343 * config/rs6000/altivec.md (*altivec_vpermr_<mode>_internal):
3344 Reverse order of second and third operands in first alternative.
3345 * config/rs6000/rs6000.c (rs6000_expand_vector_set): Reverse order
3346 of first and second elements in UNSPEC_VPERMR vector.
3347 (altivec_expand_vec_perm_le): Likewise.
3349 2017-01-08 Jeff Law <law@redhat.com>
3351 PR rtl-optimizatin/81308
3352 * tree-switch-conversion.c (cfg_altered): New file scoped static.
3353 (process_switch): If group_case_labels makes a change, then set
3355 (pass_convert_switch::execute): If a switch is converted, then
3356 set cfg_altered. Return TODO_cfg_cleanup if cfg_altered is true.
3358 PR rtl-optimization/81308
3359 * recog.c (split_all_insns): Conditionally cleanup the CFG after
3362 2018-01-08 Vidya Praveen <vidyapraveen@arm.com>
3364 PR target/83663 - Revert r255946
3365 * config/aarch64/aarch64.c (aarch64_expand_vector_init): Modify code
3366 generation for cases where splatting a value is not useful.
3367 * simplify-rtx.c (simplify_ternary_operation): Simplify vec_merge
3368 across a vec_duplicate and a paradoxical subreg forming a vector
3369 mode to a vec_concat.
3371 2018-01-08 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
3373 * config/arm/t-aprofile (MULTILIB_MATCHES): Add mapping rules for
3374 -march=armv8.3-a variants.
3375 * config/arm/t-multilib: Likewise.
3376 * config/arm/t-arm-elf: Likewise. Handle dotprod extension.
3378 2018-01-08 Aaron Sawdey <acsawdey@linux.vnet.ibm.com>
3380 * config/rs6000/rs6000.md (cceq_ior_compare): Remove * so I can use it
3382 (cceq_ior_compare_complement): Give it a name so I can use it, and
3383 change boolean_or_operator predicate to boolean_operator so it can
3384 be used to generate a crand.
3385 (eqne): New code iterator.
3386 (bd/bd_neg): New code_attrs.
3387 (<bd>_<mode>): New name for ctr<mode>_internal[12] now combined into
3388 a single define_insn.
3389 (<bd>tf_<mode>): A new insn pattern for the conditional form branch
3390 decrement (bdnzt/bdnzf/bdzt/bdzf).
3391 * config/rs6000/rs6000.c (rs6000_legitimate_combined_insn): Updated
3392 with the new names of the branch decrement patterns, and added the
3393 names of the branch decrement conditional patterns.
3395 2018-01-08 Richard Biener <rguenther@suse.de>
3397 PR tree-optimization/83563
3398 * graphite.c (canonicalize_loop_closed_ssa_form): Reset the SCEV
3401 2018-01-08 Richard Biener <rguenther@suse.de>
3404 * convert.c (do_narrow): Properly guard TYPE_OVERFLOW_WRAPS checks.
3406 2018-01-08 Richard Biener <rguenther@suse.de>
3408 PR tree-optimization/83685
3409 * tree-ssa-pre.c (create_expression_by_pieces): Do not insert
3410 references to abnormals.
3412 2018-01-08 Richard Biener <rguenther@suse.de>
3415 * dwarf2out.c (output_indirect_strings): Handle empty
3416 skeleton_debug_str_hash.
3417 (dwarf2out_early_finish): Index strings for -gsplit-dwarf.
3419 2018-01-08 Claudiu Zissulescu <claziss@synopsys.com>
3421 * config/arc/arc.c (TARGET_TRAMPOLINE_ADJUST_ADDRESS): Delete.
3422 (emit_store_direct): Likewise.
3423 (arc_trampoline_adjust_address): Likewise.
3424 (arc_asm_trampoline_template): New function.
3425 (arc_initialize_trampoline): Use asm_trampoline_template.
3426 (TARGET_ASM_TRAMPOLINE_TEMPLATE): Define.
3427 * config/arc/arc.h (TRAMPOLINE_SIZE): Adjust to 16.
3428 * config/arc/arc.md (flush_icache): Delete pattern.
3430 2018-01-08 Claudiu Zissulescu <claziss@synopsys.com>
3432 * config/arc/arc-c.def (__ARC_UNALIGNED__): New define.
3433 * config/arc/arc.h (STRICT_ALIGNMENT): Control this macro using
3436 2018-01-08 Sebastian Huber <sebastian.huber@embedded-brains.de>
3439 * config/epiphany/epiphany.h (make_pass_mode_switch_use): Guard
3440 by not USED_FOR_TARGET.
3441 (make_pass_resolve_sw_modes): Likewise.
3443 2018-01-08 Sebastian Huber <sebastian.huber@embedded-brains.de>
3445 * config/nios2/nios2.h (nios2_section_threshold): Guard by not
3448 2018-01-08 Richard Biener <rguenther@suse.de>
3451 * tree-data-ref.c (split_constant_offset): Remove STRIP_NOPS.
3453 2018-01-08 Richard Biener <rguenther@suse.de>
3456 * match.pd ((t * 2) / 2) -> t): Add missing :c.
3458 2018-01-06 Aldy Hernandez <aldyh@redhat.com>
3461 * tree-ssa-uninit.c (compute_control_dep_chain): Do not bail on
3462 basic blocks with a small number of successors.
3463 (convert_control_dep_chain_into_preds): Improve handling of
3465 (dump_predicates): Split apart into...
3466 (dump_pred_chain): ...here...
3467 (dump_pred_info): ...and here.
3468 (can_one_predicate_be_invalidated_p): Add debugging printfs.
3469 (can_chain_union_be_invalidated_p): Improve check for invalidation
3471 (uninit_uses_cannot_happen): Avoid unnecessary if
3472 convert_control_dep_chain_into_preds yielded nothing.
3474 2018-01-06 Martin Sebor <msebor@redhat.com>
3476 PR tree-optimization/83640
3477 * gimple-ssa-warn-restrict.c (builtin_access::builtin_access): Avoid
3478 subtracting negative offset from size.
3479 (builtin_access::overlap): Adjust offset bounds of the access to fall
3480 within the size of the object if possible.
3482 2018-01-06 Richard Sandiford <richard.sandiford@linaro.org>
3484 PR rtl-optimization/83699
3485 * expmed.c (extract_bit_field_1): Restrict the vector usage of
3486 extract_bit_field_as_subreg to cases in which the extracted
3487 value is also a vector.
3489 * lra-constraints.c (process_alt_operands): Test for the equivalence
3490 substitutions when detecting a possible reload cycle.
3492 2018-01-06 Jakub Jelinek <jakub@redhat.com>
3495 * toplev.c (process_options): Don't enable debug_nonbind_markers_p
3496 by default if flag_selective_schedling{,2}. Formatting fixes.
3498 PR rtl-optimization/83682
3499 * rtl.h (const_vec_duplicate_p): Only return true for VEC_DUPLICATE
3500 if it has non-VECTOR_MODE element mode.
3501 (vec_duplicate_p): Likewise.
3504 * cfgexpand.c (expand_debug_expr): Punt if mode1 is VOIDmode
3505 and bitsize might be greater than MAX_BITSIZE_MODE_ANY_INT.
3507 2018-01-05 Jakub Jelinek <jakub@redhat.com>
3510 * config/i386/i386-builtin.def
3511 (__builtin_ia32_vgf2p8affineinvqb_v64qi,
3512 __builtin_ia32_vgf2p8affineqb_v64qi, __builtin_ia32_vgf2p8mulb_v64qi):
3513 Require also OPTION_MASK_ISA_AVX512F in addition to
3514 OPTION_MASK_ISA_GFNI.
3515 (__builtin_ia32_vgf2p8affineinvqb_v16qi_mask,
3516 __builtin_ia32_vgf2p8affineqb_v16qi_mask): Require
3517 OPTION_MASK_ISA_AVX512VL instead of OPTION_MASK_ISA_SSE in addition
3518 to OPTION_MASK_ISA_GFNI.
3519 (__builtin_ia32_vgf2p8mulb_v32qi_mask): Require
3520 OPTION_MASK_ISA_AVX512VL in addition to OPTION_MASK_ISA_GFNI and
3521 OPTION_MASK_ISA_AVX512BW.
3522 (__builtin_ia32_vgf2p8mulb_v16qi_mask): Require
3523 OPTION_MASK_ISA_AVX512VL instead of OPTION_MASK_ISA_AVX512BW in
3524 addition to OPTION_MASK_ISA_GFNI.
3525 (__builtin_ia32_vgf2p8affineinvqb_v16qi,
3526 __builtin_ia32_vgf2p8affineqb_v16qi, __builtin_ia32_vgf2p8mulb_v16qi):
3527 Require OPTION_MASK_ISA_SSE2 instead of OPTION_MASK_ISA_SSE in addition
3528 to OPTION_MASK_ISA_GFNI.
3529 * config/i386/i386.c (def_builtin): Change to builtin isa/isa2 being
3530 a requirement for all ISAs rather than any of them with a few
3532 (ix86_add_new_builtins): Clear OPTION_MASK_ISA_64BIT from isa before
3534 (ix86_expand_builtin): Require all ISAs from builtin's isa and isa2
3535 bitmasks to be enabled with 3 exceptions, instead of requiring any
3536 enabled ISA with lots of exceptions.
3537 * config/i386/sse.md (vgf2p8affineinvqb_<mode><mask_name>,
3538 vgf2p8affineqb_<mode><mask_name>, vgf2p8mulb_<mode><mask_name>):
3539 Change avx512bw in isa attribute to avx512f.
3540 * config/i386/sgxintrin.h: Add license boilerplate.
3541 * config/i386/vaesintrin.h: Likewise. Fix macro spelling __AVX512F
3542 to __AVX512F__ and __AVX512VL to __AVX512VL__.
3543 (_mm256_aesdec_epi128, _mm256_aesdeclast_epi128, _mm256_aesenc_epi128,
3544 _mm256_aesenclast_epi128): Enable temporarily avx if __AVX__ is not
3546 * config/i386/gfniintrin.h (_mm_gf2p8mul_epi8,
3547 _mm_gf2p8affineinv_epi64_epi8, _mm_gf2p8affine_epi64_epi8): Enable
3548 temporarily sse2 rather than sse if not enabled already.
3551 * config/i386/sse.md (VI248_VLBW): Rename to ...
3552 (VI248_AVX512VL): ... this. Don't guard V32HI with TARGET_AVX512BW.
3553 (vpshrd_<mode><mask_name>, vpshld_<mode><mask_name>,
3554 vpshrdv_<mode>, vpshrdv_<mode>_mask, vpshrdv_<mode>_maskz,
3555 vpshrdv_<mode>_maskz_1, vpshldv_<mode>, vpshldv_<mode>_mask,
3556 vpshldv_<mode>_maskz, vpshldv_<mode>_maskz_1): Use VI248_AVX512VL
3557 mode iterator instead of VI248_VLBW.
3559 2018-01-05 Jan Hubicka <hubicka@ucw.cz>
3561 * ipa-fnsummary.c (record_modified_bb_info): Add OP.
3562 (record_modified): Skip clobbers; add debug output.
3563 (param_change_prob): Use sreal frequencies.
3565 2018-01-05 Richard Sandiford <richard.sandiford@linaro.org>
3567 * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Don't
3568 punt for user-aligned variables.
3570 2018-01-05 Richard Sandiford <richard.sandiford@linaro.org>
3572 * tree-chrec.c (chrec_contains_symbols): Return true for
3575 2018-01-05 Sudakshina Das <sudi.das@arm.com>
3578 * simplify-rtx.c (simplify_relational_operation_1): Add simplifications
3579 of (x|y) == x for BICS pattern.
3581 2018-01-05 Jakub Jelinek <jakub@redhat.com>
3583 PR tree-optimization/83605
3584 * gimple-ssa-strength-reduction.c: Include tree-eh.h.
3585 (find_candidates_dom_walker::before_dom_children): Ignore stmts that
3588 2018-01-05 Sebastian Huber <sebastian.huber@embedded-brains.de>
3590 * config.gcc (epiphany-*-elf*): Add (epiphany-*-rtems*) configuration.
3591 * config/epiphany/rtems.h: New file.
3593 2018-01-04 Jakub Jelinek <jakub@redhat.com>
3594 Uros Bizjak <ubizjak@gmail.com>
3597 * config/i386/i386.md (*<rotate_insn>hi3_1 splitter): Use
3598 QIreg_operand instead of register_operand predicate.
3599 * config/i386/i386.c (ix86_rop_should_change_byte_p,
3600 set_rop_modrm_reg_bits, ix86_mitigate_rop): Use -mmitigate-rop in
3601 comments instead of -fmitigate[-_]rop.
3603 2018-01-04 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
3606 * cgraphunit.c (symbol_table::compile): Switch to text_section
3607 before calling assembly_start debug hook.
3608 * run-rtl-passes.c (run_rtl_passes): Likewise.
3611 2018-01-04 Richard Sandiford <richard.sandiford@linaro.org>
3613 * tree-vrp.c (extract_range_from_binary_expr_1): Check
3614 range_int_cst_p rather than !symbolic_range_p before calling
3615 extract_range_from_multiplicative_op_1.
3617 2017-01-04 Jeff Law <law@redhat.com>
3619 * tree-ssa-math-opts.c (execute_cse_reciprocals_1): Remove
3620 redundant test in assertion.
3622 2018-01-04 Richard Sandiford <richard.sandiford@linaro.org>
3624 * doc/rtl.texi: Document machine_mode wrapper classes.
3626 2018-01-04 Richard Sandiford <richard.sandiford@linaro.org>
3628 * fold-const.c (fold_ternary_loc): Check tree_fits_uhwi_p before
3631 2018-01-04 Richard Sandiford <richard.sandiford@linaro.org>
3633 * tree-ssa-forwprop.c (is_combined_permutation_identity): Allow
3634 the VEC_PERM_EXPR fold to fail.
3636 2018-01-04 Jakub Jelinek <jakub@redhat.com>
3639 * bb-reorder.c (insert_section_boundary_note): Set has_bb_partition
3640 to switched_sections.
3642 2018-01-04 Richard Sandiford <richard.sandiford@linaro.org>
3645 * config/arm/arm.c (arm_vectorize_vec_perm_const): Fix inverted
3648 2018-01-04 Peter Bergner <bergner@vnet.ibm.com>
3651 * config/rs6000/rs6000.c (rs6000_discover_homogeneous_aggregate): Do not
3652 allow arguments in FP registers if TARGET_HARD_FLOAT is false.
3654 2018-01-04 Jakub Jelinek <jakub@redhat.com>
3657 * cfgexpand.c (expand_debug_expr) <case BIT_FIELD_REF>: Punt if mode
3658 is BLKmode and bitpos not zero or mode change is needed.
3660 2018-01-04 Richard Sandiford <richard.sandiford@linaro.org>
3663 * config/sparc/sparc.c (sparc_vectorize_vec_perm_const): Require
3666 2018-01-04 Uros Bizjak <ubizjak@gmail.com>
3669 * config/alpha/alpha.md (*sadd<modesuffix>): Use ASHIFT
3670 instead of MULT rtx. Update all corresponding splitters.
3672 (*ssub<modesuffix>): Ditto.
3674 (*cmp_sadd_di): Update split patterns.
3675 (*cmp_sadd_si): Ditto.
3676 (*cmp_sadd_sidi): Ditto.
3677 (*cmp_ssub_di): Ditto.
3678 (*cmp_ssub_si): Ditto.
3679 (*cmp_ssub_sidi): Ditto.
3680 * config/alpha/predicates.md (const23_operand): New predicate.
3681 * config/alpha/alpha.c (alpha_rtx_costs) [PLUS, MINUS]:
3682 Look for ASHIFT, not MULT inner operand.
3683 (alpha_split_conditional_move): Update for *sadd<modesuffix> change.
3685 2018-01-04 Martin Liska <mliska@suse.cz>
3687 PR gcov-profile/83669
3688 * gcov.c (output_intermediate_file): Add version to intermediate
3690 * doc/gcov.texi: Document new field 'version' in intermediate
3691 file format. Fix location of '-k' option of gcov command.
3693 2018-01-04 Martin Liska <mliska@suse.cz>
3696 * ipa-icf.c (sem_function::merge): Do not cross comdat boundary.
3698 2018-01-04 Jakub Jelinek <jakub@redhat.com>
3700 * gimple-ssa-sprintf.c (parse_directive): Cast second dir.len to uhwi.
3702 2018-01-03 Martin Sebor <msebor@redhat.com>
3704 PR tree-optimization/83655
3705 * gimple-ssa-warn-restrict.c (wrestrict_dom_walker::check_call): Avoid
3706 checking calls with invalid arguments.
3708 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
3710 * tree-vect-stmts.c (vect_get_store_rhs): New function.
3711 (vectorizable_mask_load_store): Delete.
3712 (vectorizable_call): Return false for masked loads and stores.
3713 (vectorizable_store): Handle IFN_MASK_STORE. Use vect_get_store_rhs
3714 instead of gimple_assign_rhs1.
3715 (vectorizable_load): Handle IFN_MASK_LOAD.
3716 (vect_transform_stmt): Don't set is_store for call_vec_info_type.
3718 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
3720 * tree-vect-stmts.c (vect_build_gather_load_calls): New function,
3722 (vectorizable_mask_load_store): ...here.
3723 (vectorizable_load): ...and here.
3725 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
3727 * tree-vect-stmts.c (vect_build_all_ones_mask)
3728 (vect_build_zero_merge_argument): New functions, split out from...
3729 (vectorizable_load): ...here.
3731 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
3733 * tree-vect-stmts.c (vect_check_store_rhs): New function,
3735 (vectorizable_mask_load_store): ...here.
3736 (vectorizable_store): ...and here.
3738 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
3740 * tree-vect-stmts.c (vect_check_load_store_mask): New function,
3742 (vectorizable_mask_load_store): ...here.
3744 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
3746 * tree-vectorizer.h (vec_load_store_type): Moved from tree-vec-stmts.c
3747 (vect_model_store_cost): Take a vec_load_store_type instead of a
3749 * tree-vect-stmts.c (vec_load_store_type): Move to tree-vectorizer.h.
3750 (vect_model_store_cost): Take a vec_load_store_type instead of a
3752 (vectorizable_mask_load_store): Update accordingly.
3753 (vectorizable_store): Likewise.
3754 * tree-vect-slp.c (vect_analyze_slp_cost_1): Update accordingly.
3756 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
3758 * tree-vect-loop.c (vect_transform_loop): Stub out scalar
3759 IFN_MASK_LOAD calls here rather than...
3760 * tree-vect-stmts.c (vectorizable_mask_load_store): ...here.
3762 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
3763 Alan Hayward <alan.hayward@arm.com>
3764 David Sherwood <david.sherwood@arm.com>
3766 * expmed.c (extract_bit_field_1): For vector extracts,
3767 fall back to extract_bit_field_as_subreg if vec_extract
3770 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
3771 Alan Hayward <alan.hayward@arm.com>
3772 David Sherwood <david.sherwood@arm.com>
3774 * lra-spills.c (pseudo_reg_slot_compare): Sort slots by whether
3775 they are variable or constant sized.
3776 (assign_stack_slot_num_and_sort_pseudos): Don't reuse variable-sized
3777 slots for constant-sized data.
3779 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
3780 Alan Hayward <alan.hayward@arm.com>
3781 David Sherwood <david.sherwood@arm.com>
3783 * tree-vect-patterns.c (vect_recog_mask_conversion_pattern): When
3784 handling COND_EXPRs with boolean comparisons, try to find a better
3785 basis for the mask type than the boolean itself.
3787 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
3789 * doc/rtl.texi (MAX_BITSIZE_MODE_ANY_MODE): Describe how the default
3790 is calculated and how it can be overridden.
3791 * genmodes.c (max_bitsize_mode_any_mode): New variable.
3792 (create_modes): Initialize it from MAX_BITSIZE_MODE_ANY_MODE,
3794 (emit_max_int): Use it to set the output MAX_BITSIZE_MODE_ANY_MODE,
3797 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
3798 Alan Hayward <alan.hayward@arm.com>
3799 David Sherwood <david.sherwood@arm.com>
3801 * config/aarch64/aarch64-protos.h (aarch64_output_simd_mov_immediate):
3802 Remove the mode argument.
3803 (aarch64_simd_valid_immediate): Remove the mode and inverse
3805 * config/aarch64/iterators.md (bitsize): New iterator.
3806 * config/aarch64/aarch64-simd.md (*aarch64_simd_mov<mode>, and<mode>3)
3807 (ior<mode>3): Update calls to aarch64_output_simd_mov_immediate.
3808 * config/aarch64/constraints.md (Do, Db, Dn): Update calls to
3809 aarch64_simd_valid_immediate.
3810 * config/aarch64/predicates.md (aarch64_reg_or_orr_imm): Likewise.
3811 (aarch64_reg_or_bic_imm): Likewise.
3812 * config/aarch64/aarch64.c (simd_immediate_info): Replace mvn
3813 with an insn_type enum and msl with a modifier_type enum.
3814 Replace element_width with a scalar_mode. Change the shift
3815 to unsigned int. Add constructors for scalar_float_mode and
3816 scalar_int_mode elements.
3817 (aarch64_vect_float_const_representable_p): Delete.
3818 (aarch64_can_const_movi_rtx_p)
3819 (aarch64_simd_scalar_immediate_valid_for_move)
3820 (aarch64_simd_make_constant): Update call to
3821 aarch64_simd_valid_immediate.
3822 (aarch64_advsimd_valid_immediate_hs): New function.
3823 (aarch64_advsimd_valid_immediate): Likewise.
3824 (aarch64_simd_valid_immediate): Remove mode and inverse
3825 arguments. Rewrite to use the above. Use const_vec_duplicate_p
3826 to detect duplicated constants and use aarch64_float_const_zero_rtx_p
3827 and aarch64_float_const_representable_p on the result.
3828 (aarch64_output_simd_mov_immediate): Remove mode argument.
3829 Update call to aarch64_simd_valid_immediate and use of
3830 simd_immediate_info.
3831 (aarch64_output_scalar_simd_mov_immediate): Update call
3834 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
3835 Alan Hayward <alan.hayward@arm.com>
3836 David Sherwood <david.sherwood@arm.com>
3838 * machmode.h (mode_precision): Prefix with CONST_MODE_PRECISION.
3839 (mode_nunits): Likewise CONST_MODE_NUNITS.
3840 * machmode.def (ADJUST_NUNITS): Document.
3841 * genmodes.c (mode_data::need_nunits_adj): New field.
3842 (blank_mode): Update accordingly.
3843 (adj_nunits): New variable.
3844 (print_maybe_const_decl): Replace CATEGORY with a NEEDS_ADJ
3846 (emit_mode_size_inline): Set need_bytesize_adj for all modes
3847 listed in adj_nunits.
3848 (emit_mode_nunits_inline): Set need_nunits_adj for all modes
3849 listed in adj_nunits. Don't emit case statements for such modes.
3850 (emit_insn_modes_h): Emit definitions of CONST_MODE_NUNITS
3851 and CONST_MODE_PRECISION. Make CONST_MODE_SIZE expand to
3852 nothing if adj_nunits is nonnull.
3853 (emit_mode_precision, emit_mode_nunits): Use print_maybe_const_decl.
3854 (emit_mode_unit_size, emit_mode_base_align, emit_mode_ibit)
3855 (emit_mode_fbit): Update use of print_maybe_const_decl.
3856 (emit_move_size): Likewise. Treat the array as non-const
3858 (emit_mode_adjustments): Handle adj_nunits.
3860 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
3862 * machmode.def (VECTOR_MODES_WITH_PREFIX): Document.
3863 * genmodes.c (VECTOR_MODES_WITH_PREFIX): New macro.
3864 (VECTOR_MODES): Use it.
3865 (make_vector_modes): Take the prefix as an argument.
3867 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
3868 Alan Hayward <alan.hayward@arm.com>
3869 David Sherwood <david.sherwood@arm.com>
3871 * mode-classes.def (MODE_VECTOR_BOOL): New mode class.
3872 * machmode.h (INTEGRAL_MODE_P, VECTOR_MODE_P): Return true
3873 for MODE_VECTOR_BOOL.
3874 * machmode.def (VECTOR_BOOL_MODE): Document.
3875 * genmodes.c (VECTOR_BOOL_MODE): New macro.
3876 (make_vector_bool_mode): New function.
3877 (complete_mode, emit_mode_wider, emit_mode_adjustments): Handle
3879 * lto-streamer-in.c (lto_input_mode_table): Likewise.
3880 * rtx-vector-builder.c (rtx_vector_builder::find_cached_value):
3882 * stor-layout.c (int_mode_for_mode): Likewise.
3883 * tree.c (build_vector_type_for_mode): Likewise.
3884 * varasm.c (output_constant_pool_2): Likewise.
3885 * emit-rtl.c (init_emit_once): Make sure that CONST1_RTX (BImode) and
3886 CONSTM1_RTX (BImode) are the same thing. Initialize const_tiny_rtx
3887 for MODE_VECTOR_BOOL.
3888 * expr.c (expand_expr_real_1): Use VECTOR_MODE_P instead of a list
3889 of mode class checks.
3890 * tree-vect-generic.c (expand_vector_operation): Use VECTOR_MODE_P
3891 instead of a list of mode class checks.
3892 (expand_vector_scalar_condition): Likewise.
3893 (type_for_widest_vector_mode): Handle BImode as an inner mode.
3895 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
3896 Alan Hayward <alan.hayward@arm.com>
3897 David Sherwood <david.sherwood@arm.com>
3899 * machmode.h (mode_size): Change from unsigned short to
3901 (mode_to_bytes): Return a poly_uint16 rather than an unsigned short.
3902 (GET_MODE_SIZE): Return a constant if ONLY_FIXED_SIZE_MODES,
3903 or if measurement_type is not polynomial.
3904 (fixed_size_mode::includes_p): Check for constant-sized modes.
3905 * genmodes.c (emit_mode_size_inline): Make mode_size_inline
3906 return a poly_uint16 rather than an unsigned short.
3907 (emit_mode_size): Change the type of mode_size from unsigned short
3908 to poly_uint16_pod. Use ZERO_COEFFS for the initializer.
3909 (emit_mode_adjustments): Cope with polynomial vector sizes.
3910 * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
3912 * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
3914 * auto-inc-dec.c (try_merge): Treat GET_MODE_SIZE as polynomial.
3915 * builtins.c (expand_ifn_atomic_compare_exchange_into_call): Likewise.
3916 * caller-save.c (setup_save_areas): Likewise.
3917 (replace_reg_with_saved_mem): Likewise.
3918 * calls.c (emit_library_call_value_1): Likewise.
3919 * combine-stack-adj.c (combine_stack_adjustments_for_block): Likewise.
3920 * combine.c (simplify_set, make_extraction, simplify_shift_const_1)
3921 (gen_lowpart_for_combine): Likewise.
3922 * convert.c (convert_to_integer_1): Likewise.
3923 * cse.c (equiv_constant, cse_insn): Likewise.
3924 * cselib.c (autoinc_split, cselib_hash_rtx): Likewise.
3925 (cselib_subst_to_values): Likewise.
3926 * dce.c (word_dce_process_block): Likewise.
3927 * df-problems.c (df_word_lr_mark_ref): Likewise.
3928 * dwarf2cfi.c (init_one_dwarf_reg_size): Likewise.
3929 * dwarf2out.c (multiple_reg_loc_descriptor, mem_loc_descriptor)
3930 (concat_loc_descriptor, concatn_loc_descriptor, loc_descriptor)
3931 (rtl_for_decl_location): Likewise.
3932 * emit-rtl.c (gen_highpart, widen_memory_access): Likewise.
3933 * expmed.c (extract_bit_field_1, extract_integral_bit_field): Likewise.
3934 * expr.c (emit_group_load_1, clear_storage_hints): Likewise.
3935 (emit_move_complex, emit_move_multi_word, emit_push_insn): Likewise.
3936 (expand_expr_real_1): Likewise.
3937 * function.c (assign_parm_setup_block_p, assign_parm_setup_block)
3938 (pad_below): Likewise.
3939 * gimple-fold.c (optimize_atomic_compare_exchange_p): Likewise.
3940 * gimple-ssa-store-merging.c (rhs_valid_for_store_merging_p): Likewise.
3941 * ira.c (get_subreg_tracking_sizes): Likewise.
3942 * ira-build.c (ira_create_allocno_objects): Likewise.
3943 * ira-color.c (coalesced_pseudo_reg_slot_compare): Likewise.
3944 (ira_sort_regnos_for_alter_reg): Likewise.
3945 * ira-costs.c (record_operand_costs): Likewise.
3946 * lower-subreg.c (interesting_mode_p, simplify_gen_subreg_concatn)
3947 (resolve_simple_move): Likewise.
3948 * lra-constraints.c (get_reload_reg, operands_match_p): Likewise.
3949 (process_addr_reg, simplify_operand_subreg, curr_insn_transform)
3950 (lra_constraints): Likewise.
3951 (CONST_POOL_OK_P): Reject variable-sized modes.
3952 * lra-spills.c (slot, assign_mem_slot, pseudo_reg_slot_compare)
3953 (add_pseudo_to_slot, lra_spill): Likewise.
3954 * omp-low.c (omp_clause_aligned_alignment): Likewise.
3955 * optabs-query.c (get_best_extraction_insn): Likewise.
3956 * optabs-tree.c (expand_vec_cond_expr_p): Likewise.
3957 * optabs.c (expand_vec_perm_var, expand_vec_cond_expr): Likewise.
3958 (expand_mult_highpart, valid_multiword_target_p): Likewise.
3959 * recog.c (offsettable_address_addr_space_p): Likewise.
3960 * regcprop.c (maybe_mode_change): Likewise.
3961 * reginfo.c (choose_hard_reg_mode, record_subregs_of_mode): Likewise.
3962 * regrename.c (build_def_use): Likewise.
3963 * regstat.c (dump_reg_info): Likewise.
3964 * reload.c (complex_word_subreg_p, push_reload, find_dummy_reload)
3965 (find_reloads, find_reloads_subreg_address): Likewise.
3966 * reload1.c (eliminate_regs_1): Likewise.
3967 * rtlanal.c (for_each_inc_dec_find_inc_dec, rtx_cost): Likewise.
3968 * simplify-rtx.c (avoid_constant_pool_reference): Likewise.
3969 (simplify_binary_operation_1, simplify_subreg): Likewise.
3970 * targhooks.c (default_function_arg_padding): Likewise.
3971 (default_hard_regno_nregs, default_class_max_nregs): Likewise.
3972 * tree-cfg.c (verify_gimple_assign_binary): Likewise.
3973 (verify_gimple_assign_ternary): Likewise.
3974 * tree-inline.c (estimate_move_cost): Likewise.
3975 * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
3976 * tree-ssa-loop-ivopts.c (add_autoinc_candidates): Likewise.
3977 (get_address_cost_ainc): Likewise.
3978 * tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Likewise.
3979 (vect_supportable_dr_alignment): Likewise.
3980 * tree-vect-loop.c (vect_determine_vectorization_factor): Likewise.
3981 (vectorizable_reduction): Likewise.
3982 * tree-vect-stmts.c (vectorizable_assignment, vectorizable_shift)
3983 (vectorizable_operation, vectorizable_load): Likewise.
3984 * tree.c (build_same_sized_truth_vector_type): Likewise.
3985 * valtrack.c (cleanup_auto_inc_dec): Likewise.
3986 * var-tracking.c (emit_note_insn_var_location): Likewise.
3987 * config/arc/arc.h (ASM_OUTPUT_CASE_END): Use as_a <scalar_int_mode>.
3988 (ADDR_VEC_ALIGN): Likewise.
3990 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
3991 Alan Hayward <alan.hayward@arm.com>
3992 David Sherwood <david.sherwood@arm.com>
3994 * machmode.h (mode_to_bits): Return a poly_uint16 rather than an
3996 (GET_MODE_BITSIZE): Return a constant if ONLY_FIXED_SIZE_MODES,
3997 or if measurement_type is polynomial.
3998 * calls.c (shift_return_value): Treat GET_MODE_BITSIZE as polynomial.
3999 * combine.c (make_extraction): Likewise.
4000 * dse.c (find_shift_sequence): Likewise.
4001 * dwarf2out.c (mem_loc_descriptor): Likewise.
4002 * expmed.c (store_integral_bit_field, extract_bit_field_1): Likewise.
4003 (extract_bit_field, extract_low_bits): Likewise.
4004 * expr.c (convert_move, convert_modes, emit_move_insn_1): Likewise.
4005 (optimize_bitfield_assignment_op, expand_assignment): Likewise.
4006 (store_expr_with_bounds, store_field, expand_expr_real_1): Likewise.
4007 * fold-const.c (optimize_bit_field_compare, merge_ranges): Likewise.
4008 * gimple-fold.c (optimize_atomic_compare_exchange_p): Likewise.
4009 * reload.c (find_reloads): Likewise.
4010 * reload1.c (alter_reg): Likewise.
4011 * stor-layout.c (bitwise_mode_for_mode, compute_record_mode): Likewise.
4012 * targhooks.c (default_secondary_memory_needed_mode): Likewise.
4013 * tree-if-conv.c (predicate_mem_writes): Likewise.
4014 * tree-ssa-strlen.c (handle_builtin_memcmp): Likewise.
4015 * tree-vect-patterns.c (adjust_bool_pattern): Likewise.
4016 * tree-vect-stmts.c (vectorizable_simd_clone_call): Likewise.
4017 * valtrack.c (dead_debug_insert_temp): Likewise.
4018 * varasm.c (mergeable_constant_section): Likewise.
4019 * config/sh/sh.h (LOCAL_ALIGNMENT): Use as_a <fixed_size_mode>.
4021 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4022 Alan Hayward <alan.hayward@arm.com>
4023 David Sherwood <david.sherwood@arm.com>
4025 * expr.c (expand_assignment): Cope with polynomial mode sizes
4026 when assigning to a CONCAT.
4028 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4029 Alan Hayward <alan.hayward@arm.com>
4030 David Sherwood <david.sherwood@arm.com>
4032 * machmode.h (mode_precision): Change from unsigned short to
4034 (mode_to_precision): Return a poly_uint16 rather than an unsigned
4036 (GET_MODE_PRECISION): Return a constant if ONLY_FIXED_SIZE_MODES,
4037 or if measurement_type is not polynomial.
4038 (HWI_COMPUTABLE_MODE_P): Turn into a function. Optimize the case
4039 in which the mode is already known to be a scalar_int_mode.
4040 * genmodes.c (emit_mode_precision): Change the type of mode_precision
4041 from unsigned short to poly_uint16_pod. Use ZERO_COEFFS for the
4043 * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
4044 for GET_MODE_PRECISION.
4045 * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
4046 for GET_MODE_PRECISION.
4047 * combine.c (update_rsp_from_reg_equal): Treat GET_MODE_PRECISION
4049 (try_combine, find_split_point, combine_simplify_rtx): Likewise.
4050 (expand_field_assignment, make_extraction): Likewise.
4051 (make_compound_operation_int, record_dead_and_set_regs_1): Likewise.
4052 (get_last_value): Likewise.
4053 * convert.c (convert_to_integer_1): Likewise.
4054 * cse.c (cse_insn): Likewise.
4055 * expr.c (expand_expr_real_1): Likewise.
4056 * lra-constraints.c (simplify_operand_subreg): Likewise.
4057 * optabs-query.c (can_atomic_load_p): Likewise.
4058 * optabs.c (expand_atomic_load): Likewise.
4059 (expand_atomic_store): Likewise.
4060 * ree.c (combine_reaching_defs): Likewise.
4061 * rtl.h (partial_subreg_p, paradoxical_subreg_p): Likewise.
4062 * rtlanal.c (nonzero_bits1, lsb_bitfield_op_p): Likewise.
4063 * tree.h (type_has_mode_precision_p): Likewise.
4064 * ubsan.c (instrument_si_overflow): Likewise.
4066 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4067 Alan Hayward <alan.hayward@arm.com>
4068 David Sherwood <david.sherwood@arm.com>
4070 * tree.h (TYPE_VECTOR_SUBPARTS): Turn into a function and handle
4071 polynomial numbers of units.
4072 (SET_TYPE_VECTOR_SUBPARTS): Likewise.
4073 (valid_vector_subparts_p): New function.
4074 (build_vector_type): Remove temporary shim and take the number
4075 of units as a poly_uint64 rather than an int.
4076 (build_opaque_vector_type): Take the number of units as a
4077 poly_uint64 rather than an int.
4078 * tree.c (build_vector_from_ctor): Handle polynomial
4079 TYPE_VECTOR_SUBPARTS.
4080 (type_hash_canon_hash, type_cache_hasher::equal): Likewise.
4081 (uniform_vector_p, vector_type_mode, build_vector): Likewise.
4082 (build_vector_from_val): If the number of units is variable,
4083 use build_vec_duplicate_cst for constant operands and
4084 VEC_DUPLICATE_EXPR otherwise.
4085 (make_vector_type): Remove temporary is_constant ().
4086 (build_vector_type, build_opaque_vector_type): Take the number of
4087 units as a poly_uint64 rather than an int.
4088 (check_vector_cst): Handle polynomial TYPE_VECTOR_SUBPARTS and
4090 * cfgexpand.c (expand_debug_expr): Likewise.
4091 * expr.c (count_type_elements, categorize_ctor_elements_1): Likewise.
4092 (store_constructor, expand_expr_real_1): Likewise.
4093 (const_scalar_mask_from_tree): Likewise.
4094 * fold-const-call.c (fold_const_reduction): Likewise.
4095 * fold-const.c (const_binop, const_unop, fold_convert_const): Likewise.
4096 (operand_equal_p, fold_vec_perm, fold_ternary_loc): Likewise.
4097 (native_encode_vector, vec_cst_ctor_to_array): Likewise.
4098 (fold_relational_const): Likewise.
4099 (native_interpret_vector): Likewise. Change the size from an
4100 int to an unsigned int.
4101 * gimple-fold.c (gimple_fold_stmt_to_constant_1): Handle polynomial
4102 TYPE_VECTOR_SUBPARTS.
4103 (gimple_fold_indirect_ref, gimple_build_vector): Likewise.
4104 (gimple_build_vector_from_val): Use VEC_DUPLICATE_EXPR when
4105 duplicating a non-constant operand into a variable-length vector.
4106 * hsa-brig.c (hsa_op_immed::emit_to_buffer): Handle polynomial
4107 TYPE_VECTOR_SUBPARTS and VECTOR_CST_NELTS.
4108 * ipa-icf.c (sem_variable::equals): Likewise.
4109 * match.pd: Likewise.
4110 * omp-simd-clone.c (simd_clone_subparts): Likewise.
4111 * print-tree.c (print_node): Likewise.
4112 * stor-layout.c (layout_type): Likewise.
4113 * targhooks.c (default_builtin_vectorization_cost): Likewise.
4114 * tree-cfg.c (verify_gimple_comparison): Likewise.
4115 (verify_gimple_assign_binary): Likewise.
4116 (verify_gimple_assign_ternary): Likewise.
4117 (verify_gimple_assign_single): Likewise.
4118 * tree-pretty-print.c (dump_generic_node): Likewise.
4119 * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
4120 (simplify_bitfield_ref, is_combined_permutation_identity): Likewise.
4121 * tree-vect-data-refs.c (vect_permute_store_chain): Likewise.
4122 (vect_grouped_load_supported, vect_permute_load_chain): Likewise.
4123 (vect_shift_permute_load_chain): Likewise.
4124 * tree-vect-generic.c (nunits_for_known_piecewise_op): Likewise.
4125 (expand_vector_condition, optimize_vector_constructor): Likewise.
4126 (lower_vec_perm, get_compute_type): Likewise.
4127 * tree-vect-loop.c (vect_determine_vectorization_factor): Likewise.
4128 (get_initial_defs_for_reduction, vect_transform_loop): Likewise.
4129 * tree-vect-patterns.c (vect_recog_bool_pattern): Likewise.
4130 (vect_recog_mask_conversion_pattern): Likewise.
4131 * tree-vect-slp.c (vect_supported_load_permutation_p): Likewise.
4132 (vect_get_constant_vectors, vect_transform_slp_perm_load): Likewise.
4133 * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
4134 (get_group_load_store_type, vectorizable_mask_load_store): Likewise.
4135 (vectorizable_bswap, simd_clone_subparts, vectorizable_assignment)
4136 (vectorizable_shift, vectorizable_operation, vectorizable_store)
4137 (vectorizable_load, vect_is_simple_cond, vectorizable_comparison)
4138 (supportable_widening_operation): Likewise.
4139 (supportable_narrowing_operation): Likewise.
4140 * tree-vector-builder.c (tree_vector_builder::binary_encoded_nelts):
4142 * varasm.c (output_constant): Likewise.
4144 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4145 Alan Hayward <alan.hayward@arm.com>
4146 David Sherwood <david.sherwood@arm.com>
4148 * tree-vect-data-refs.c (vect_permute_store_chain): Reorganize
4149 so that both the length == 3 and length != 3 cases set up their
4150 own permute vectors. Add comments explaining why we know the
4151 number of elements is constant.
4152 (vect_permute_load_chain): Likewise.
4154 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4155 Alan Hayward <alan.hayward@arm.com>
4156 David Sherwood <david.sherwood@arm.com>
4158 * machmode.h (mode_nunits): Change from unsigned char to
4160 (ONLY_FIXED_SIZE_MODES): New macro.
4161 (pod_mode::measurement_type, scalar_int_mode::measurement_type)
4162 (scalar_float_mode::measurement_type, scalar_mode::measurement_type)
4163 (complex_mode::measurement_type, fixed_size_mode::measurement_type):
4165 (mode_to_nunits): Return a poly_uint16 rather than an unsigned short.
4166 (GET_MODE_NUNITS): Return a constant if ONLY_FIXED_SIZE_MODES,
4167 or if measurement_type is not polynomial.
4168 * genmodes.c (ZERO_COEFFS): New macro.
4169 (emit_mode_nunits_inline): Make mode_nunits_inline return a
4171 (emit_mode_nunits): Change the type of mode_nunits to poly_uint16_pod.
4172 Use ZERO_COEFFS when emitting initializers.
4173 * data-streamer.h (bp_pack_poly_value): New function.
4174 (bp_unpack_poly_value): Likewise.
4175 * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
4176 for GET_MODE_NUNITS.
4177 * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
4178 for GET_MODE_NUNITS.
4179 * tree.c (make_vector_type): Remove temporary shim and make
4180 the real function take the number of units as a poly_uint64
4182 (build_vector_type_for_mode): Handle polynomial nunits.
4183 * dwarf2out.c (loc_descriptor, add_const_value_attribute): Likewise.
4184 * emit-rtl.c (const_vec_series_p_1): Likewise.
4185 (gen_rtx_CONST_VECTOR): Likewise.
4186 * fold-const.c (test_vec_duplicate_folding): Likewise.
4187 * genrecog.c (validate_pattern): Likewise.
4188 * optabs-query.c (can_vec_perm_var_p, can_mult_highpart_p): Likewise.
4189 * optabs-tree.c (expand_vec_cond_expr_p): Likewise.
4190 * optabs.c (expand_vector_broadcast, expand_binop_directly): Likewise.
4191 (shift_amt_for_vec_perm_mask, expand_vec_perm_var): Likewise.
4192 (expand_vec_cond_expr, expand_mult_highpart): Likewise.
4193 * rtlanal.c (subreg_get_info): Likewise.
4194 * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
4195 (vect_grouped_load_supported): Likewise.
4196 * tree-vect-generic.c (type_for_widest_vector_mode): Likewise.
4197 * tree-vect-loop.c (have_whole_vector_shift): Likewise.
4198 * simplify-rtx.c (simplify_unary_operation_1): Likewise.
4199 (simplify_const_unary_operation, simplify_binary_operation_1)
4200 (simplify_const_binary_operation, simplify_ternary_operation)
4201 (test_vector_ops_duplicate, test_vector_ops): Likewise.
4202 (simplify_immed_subreg): Use GET_MODE_NUNITS on a fixed_size_mode
4203 instead of CONST_VECTOR_NUNITS.
4204 * varasm.c (output_constant_pool_2): Likewise.
4205 * rtx-vector-builder.c (rtx_vector_builder::build): Only include the
4206 explicit-encoded elements in the XVEC for variable-length vectors.
4208 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4210 * lra-constraints.c (curr_insn_transform): Use partial_subreg_p.
4212 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4213 Alan Hayward <alan.hayward@arm.com>
4214 David Sherwood <david.sherwood@arm.com>
4216 * coretypes.h (fixed_size_mode): Declare.
4217 (fixed_size_mode_pod): New typedef.
4218 * builtins.h (target_builtins::x_apply_args_mode)
4219 (target_builtins::x_apply_result_mode): Change type to
4220 fixed_size_mode_pod.
4221 * builtins.c (apply_args_size, apply_result_size, result_vector)
4222 (expand_builtin_apply_args_1, expand_builtin_apply)
4223 (expand_builtin_return): Update accordingly.
4225 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4227 * cse.c (hash_rtx_cb): Hash only the encoded elements.
4228 * cselib.c (cselib_hash_rtx): Likewise.
4229 * expmed.c (make_tree): Build VECTOR_CSTs directly from the
4230 CONST_VECTOR encoding.
4232 2017-01-03 Jakub Jelinek <jakub@redhat.com>
4233 Jeff Law <law@redhat.com>
4236 * config/i386/i386.c (ix86_adjust_stack_and_probe_stack_clash): For
4237 noreturn probe, use gen_pop instead of ix86_emit_restore_reg_using_pop,
4238 only set RTX_FRAME_RELATED_P on both the push and pop if cfa_reg is sp
4239 and add REG_CFA_ADJUST_CFA notes in that case to both insns.
4242 * config/i386/i386.c (ix86_adjust_stack_and_probe_stack_clash): Do not
4243 explicitly probe *sp in a noreturn function if there were any callee
4244 register saves or frame pointer is needed.
4246 2018-01-03 Jakub Jelinek <jakub@redhat.com>
4249 * cfgexpand.c (expand_debug_expr): Return NULL if mode is
4250 BLKmode for ternary, binary or unary expressions.
4253 * var-tracking.c (delete_vta_debug_insn): New inline function.
4254 (delete_vta_debug_insns): Add USE_CFG argument, if true, walk just
4255 insns from get_insns () to NULL instead of each bb separately.
4256 Use delete_vta_debug_insn. No longer static.
4257 (vt_debug_insns_local, variable_tracking_main_1): Adjust
4258 delete_vta_debug_insns callers.
4259 * rtl.h (delete_vta_debug_insns): Declare.
4260 * final.c (rest_of_handle_final): Call delete_vta_debug_insns
4261 instead of variable_tracking_main.
4263 2018-01-03 Martin Sebor <msebor@redhat.com>
4265 PR tree-optimization/83603
4266 * calls.c (maybe_warn_nonstring_arg): Avoid accessing function
4267 arguments past the endof the argument list in functions declared
4268 without a prototype.
4269 * gimple-ssa-warn-restrict.c (wrestrict_dom_walker::check_call):
4270 Avoid checking when arguments are null.
4272 2018-01-03 Martin Sebor <msebor@redhat.com>
4275 * doc/extend.texi (attribute const): Fix a typo.
4276 * ipa-pure-const.c ((warn_function_const, warn_function_pure): Avoid
4277 issuing -Wsuggest-attribute for void functions.
4279 2018-01-03 Martin Sebor <msebor@redhat.com>
4281 * gimple-ssa-warn-restrict.c (builtin_memref::builtin_memref): Use
4282 offset_int::from instead of wide_int::to_shwi.
4283 (maybe_diag_overlap): Remove assertion.
4284 Use HOST_WIDE_INT_PRINT_DEC instead of %lli.
4285 * gimple-ssa-sprintf.c (format_directive): Same.
4286 (parse_directive): Same.
4287 (sprintf_dom_walker::compute_format_length): Same.
4288 (try_substitute_return_value): Same.
4290 2017-01-03 Jeff Law <law@redhat.com>
4293 * explow.c (anti_adjust_stack_and_probe_stack_clash): Test a
4294 non-constant residual for zero at runtime and avoid probing in
4295 that case. Reorganize code for trailing problem to mirror handling
4298 2018-01-03 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
4300 PR tree-optimization/83501
4301 * tree-ssa-strlen.c (get_string_cst): New.
4302 (handle_char_store): Call get_string_cst.
4304 2018-01-03 Martin Liska <mliska@suse.cz>
4306 PR tree-optimization/83593
4307 * tree-ssa-strlen.c: Include tree-cfg.h.
4308 (strlen_check_and_optimize_stmt): Add new argument cleanup_eh.
4309 (strlen_dom_walker): Add new member variable m_cleanup_cfg.
4310 (strlen_dom_walker::strlen_dom_walker): Initialize m_cleanup_cfg
4312 (strlen_dom_walker::before_dom_children): Call
4313 gimple_purge_dead_eh_edges. Dump tranformation with details
4315 (strlen_dom_walker::before_dom_children): Update call by adding
4316 new argument cleanup_eh.
4317 (pass_strlen::execute): Return TODO_cleanup_cfg if needed.
4319 2018-01-03 Martin Liska <mliska@suse.cz>
4322 * cif-code.def (VARIADIC_THUNK): New enum value.
4323 * ipa-fnsummary.c (compute_fn_summary): Do not inline variadic
4326 2018-01-03 Jan Beulich <jbeulich@suse.com>
4328 * sse.md (mov<mode>_internal): Tighten condition for when to use
4329 vmovdqu<ssescalarsize> for TI and OI modes.
4331 2018-01-03 Jakub Jelinek <jakub@redhat.com>
4333 Update copyright years.
4335 2018-01-03 Martin Liska <mliska@suse.cz>
4338 * ipa-visibility.c (function_and_variable_visibility): Skip
4339 functions with noipa attribure.
4341 2018-01-03 Jakub Jelinek <jakub@redhat.com>
4343 * gcc.c (process_command): Update copyright notice dates.
4344 * gcov-dump.c (print_version): Ditto.
4345 * gcov.c (print_version): Ditto.
4346 * gcov-tool.c (print_version): Ditto.
4347 * gengtype.c (create_file): Ditto.
4348 * doc/cpp.texi: Bump @copying's copyright year.
4349 * doc/cppinternals.texi: Ditto.
4350 * doc/gcc.texi: Ditto.
4351 * doc/gccint.texi: Ditto.
4352 * doc/gcov.texi: Ditto.
4353 * doc/install.texi: Ditto.
4354 * doc/invoke.texi: Ditto.
4356 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4358 * vector-builder.h (vector_builder::m_full_nelts): Change from
4359 unsigned int to poly_uint64.
4360 (vector_builder::full_nelts): Update prototype accordingly.
4361 (vector_builder::new_vector): Likewise.
4362 (vector_builder::encoded_full_vector_p): Handle polynomial full_nelts.
4363 (vector_builder::operator ==): Likewise.
4364 (vector_builder::finalize): Likewise.
4365 * int-vector-builder.h (int_vector_builder::int_vector_builder):
4366 Take the number of elements as a poly_uint64 rather than an
4368 * vec-perm-indices.h (vec_perm_indices::m_nelts_per_input): Change
4369 from unsigned int to poly_uint64.
4370 (vec_perm_indices::vec_perm_indices): Update prototype accordingly.
4371 (vec_perm_indices::new_vector): Likewise.
4372 (vec_perm_indices::length): Likewise.
4373 (vec_perm_indices::nelts_per_input): Likewise.
4374 (vec_perm_indices::input_nelts): Likewise.
4375 * vec-perm-indices.c (vec_perm_indices::new_vector): Take the
4376 number of elements per input as a poly_uint64 rather than an
4377 unsigned int. Use the original encoding for variable-length
4378 vectors, rather than clamping each individual element.
4379 For the second and subsequent elements in each pattern,
4380 clamp the step and base before clamping their sum.
4381 (vec_perm_indices::series_p): Handle polynomial element counts.
4382 (vec_perm_indices::all_in_range_p): Likewise.
4383 (vec_perm_indices_to_tree): Likewise.
4384 (vec_perm_indices_to_rtx): Likewise.
4385 * tree-vect-stmts.c (vect_gen_perm_mask_any): Likewise.
4386 * tree-vector-builder.c (tree_vector_builder::new_unary_operation)
4387 (tree_vector_builder::new_binary_operation): Handle polynomial
4388 element counts. Return false if we need to know the number
4389 of elements at compile time.
4390 * fold-const.c (fold_vec_perm): Punt if the number of elements
4391 isn't known at compile time.
4393 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4395 * vec-perm-indices.h (vec_perm_builder): Change element type
4396 from HOST_WIDE_INT to poly_int64.
4397 (vec_perm_indices::element_type): Update accordingly.
4398 (vec_perm_indices::clamp): Handle polynomial element_types.
4399 * vec-perm-indices.c (vec_perm_indices::series_p): Likewise.
4400 (vec_perm_indices::all_in_range_p): Likewise.
4401 (tree_to_vec_perm_builder): Check for poly_int64 trees rather
4403 * vector-builder.h (vector_builder::stepped_sequence_p): Handle
4404 polynomial vec_perm_indices element types.
4405 * int-vector-builder.h (int_vector_builder::equal_p): Likewise.
4406 * fold-const.c (fold_vec_perm): Likewise.
4407 * optabs.c (shift_amt_for_vec_perm_mask): Likewise.
4408 * tree-vect-generic.c (lower_vec_perm): Likewise.
4409 * tree-vect-slp.c (vect_transform_slp_perm_load): Likewise.
4410 * config/aarch64/aarch64.c (aarch64_evpc_tbl): Cast d->perm
4411 element type to HOST_WIDE_INT.
4413 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4414 Alan Hayward <alan.hayward@arm.com>
4415 David Sherwood <david.sherwood@arm.com>
4417 * alias.c (addr_side_effect_eval): Take the size as a poly_int64
4418 rather than an int. Use plus_constant.
4419 (memrefs_conflict_p): Take the sizes as poly_int64s rather than ints.
4420 Take the offset "c" as a poly_int64 rather than a HOST_WIDE_INT.
4422 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4423 Alan Hayward <alan.hayward@arm.com>
4424 David Sherwood <david.sherwood@arm.com>
4426 * calls.c (emit_call_1, expand_call): Change struct_value_size from
4427 a HOST_WIDE_INT to a poly_int64.
4429 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4430 Alan Hayward <alan.hayward@arm.com>
4431 David Sherwood <david.sherwood@arm.com>
4433 * calls.c (load_register_parameters): Cope with polynomial
4434 mode sizes. Require a constant size for BLKmode parameters
4435 that aren't described by a PARALLEL. If BLOCK_REG_PADDING
4436 forces a parameter to be padded at the lsb end in order to
4437 fill a complete number of words, require the parameter size
4438 to be ordered wrt UNITS_PER_WORD.
4440 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4441 Alan Hayward <alan.hayward@arm.com>
4442 David Sherwood <david.sherwood@arm.com>
4444 * reload1.c (spill_stack_slot_width): Change element type
4445 from unsigned int to poly_uint64_pod.
4446 (alter_reg): Treat mode sizes as polynomial.
4448 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4449 Alan Hayward <alan.hayward@arm.com>
4450 David Sherwood <david.sherwood@arm.com>
4452 * reload.c (complex_word_subreg_p): New function.
4453 (reload_inner_reg_of_subreg, push_reload): Use it.
4455 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4456 Alan Hayward <alan.hayward@arm.com>
4457 David Sherwood <david.sherwood@arm.com>
4459 * lra-constraints.c (process_alt_operands): Reject matched
4460 operands whose sizes aren't ordered.
4461 (match_reload): Refer to this check here.
4463 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4464 Alan Hayward <alan.hayward@arm.com>
4465 David Sherwood <david.sherwood@arm.com>
4467 * builtins.c (expand_ifn_atomic_compare_exchange_into_call): Assert
4468 that the mode size is in the set {1, 2, 4, 8, 16}.
4470 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4471 Alan Hayward <alan.hayward@arm.com>
4472 David Sherwood <david.sherwood@arm.com>
4474 * var-tracking.c (adjust_mems): Treat mode sizes as polynomial.
4475 Use plus_constant instead of gen_rtx_PLUS.
4477 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4478 Alan Hayward <alan.hayward@arm.com>
4479 David Sherwood <david.sherwood@arm.com>
4481 * config/cr16/cr16-protos.h (cr16_push_rounding): Declare.
4482 * config/cr16/cr16.h (PUSH_ROUNDING): Move implementation to...
4483 * config/cr16/cr16.c (cr16_push_rounding): ...this new function.
4484 * config/h8300/h8300-protos.h (h8300_push_rounding): Declare.
4485 * config/h8300/h8300.h (PUSH_ROUNDING): Move implementation to...
4486 * config/h8300/h8300.c (h8300_push_rounding): ...this new function.
4487 * config/i386/i386-protos.h (ix86_push_rounding): Declare.
4488 * config/i386/i386.h (PUSH_ROUNDING): Move implementation to...
4489 * config/i386/i386.c (ix86_push_rounding): ...this new function.
4490 * config/m32c/m32c-protos.h (m32c_push_rounding): Take and return
4492 * config/m32c/m32c.c (m32c_push_rounding): Likewise.
4493 * config/m68k/m68k-protos.h (m68k_push_rounding): Declare.
4494 * config/m68k/m68k.h (PUSH_ROUNDING): Move implementation to...
4495 * config/m68k/m68k.c (m68k_push_rounding): ...this new function.
4496 * config/pdp11/pdp11-protos.h (pdp11_push_rounding): Declare.
4497 * config/pdp11/pdp11.h (PUSH_ROUNDING): Move implementation to...
4498 * config/pdp11/pdp11.c (pdp11_push_rounding): ...this new function.
4499 * config/stormy16/stormy16-protos.h (xstormy16_push_rounding): Declare.
4500 * config/stormy16/stormy16.h (PUSH_ROUNDING): Move implementation to...
4501 * config/stormy16/stormy16.c (xstormy16_push_rounding): ...this new
4503 * expr.c (emit_move_resolve_push): Treat the input and result
4504 of PUSH_ROUNDING as a poly_int64.
4505 (emit_move_complex_push, emit_single_push_insn_1): Likewise.
4506 (emit_push_insn): Likewise.
4507 * lra-eliminations.c (mark_not_eliminable): Likewise.
4508 * recog.c (push_operand): Likewise.
4509 * reload1.c (elimination_effects): Likewise.
4510 * rtlanal.c (nonzero_bits1): Likewise.
4511 * calls.c (store_one_arg): Likewise. Require the padding to be
4512 known at compile time.
4514 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4515 Alan Hayward <alan.hayward@arm.com>
4516 David Sherwood <david.sherwood@arm.com>
4518 * expr.c (emit_single_push_insn_1): Treat mode sizes as polynomial.
4519 Use plus_constant instead of gen_rtx_PLUS.
4521 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4522 Alan Hayward <alan.hayward@arm.com>
4523 David Sherwood <david.sherwood@arm.com>
4525 * auto-inc-dec.c (set_inc_state): Take the mode size as a poly_int64
4528 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4529 Alan Hayward <alan.hayward@arm.com>
4530 David Sherwood <david.sherwood@arm.com>
4532 * expr.c (expand_expr_real_1): Use tree_to_poly_uint64
4533 instead of int_size_in_bytes when handling VIEW_CONVERT_EXPRs
4534 via stack temporaries. Treat the mode size as polynomial too.
4536 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4537 Alan Hayward <alan.hayward@arm.com>
4538 David Sherwood <david.sherwood@arm.com>
4540 * expr.c (expand_expr_real_2): When handling conversions involving
4541 unions, apply tree_to_poly_uint64 to the TYPE_SIZE rather than
4542 multiplying int_size_in_bytes by BITS_PER_UNIT. Treat GET_MODE_BISIZE
4543 as a poly_uint64 too.
4545 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4546 Alan Hayward <alan.hayward@arm.com>
4547 David Sherwood <david.sherwood@arm.com>
4549 * rtlanal.c (subreg_get_info): Handle polynomial mode sizes.
4551 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4552 Alan Hayward <alan.hayward@arm.com>
4553 David Sherwood <david.sherwood@arm.com>
4555 * combine.c (can_change_dest_mode): Handle polynomial
4556 REGMODE_NATURAL_SIZE.
4557 * expmed.c (store_bit_field_1): Likewise.
4558 * expr.c (store_constructor): Likewise.
4559 * emit-rtl.c (validate_subreg): Operate on polynomial mode sizes
4560 and polynomial REGMODE_NATURAL_SIZE.
4561 (gen_lowpart_common): Likewise.
4562 * reginfo.c (record_subregs_of_mode): Likewise.
4563 * rtlanal.c (read_modify_subreg_p): Likewise.
4565 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4566 Alan Hayward <alan.hayward@arm.com>
4567 David Sherwood <david.sherwood@arm.com>
4569 * internal-fn.c (expand_vector_ubsan_overflow): Handle polynomial
4570 numbers of elements.
4572 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4573 Alan Hayward <alan.hayward@arm.com>
4574 David Sherwood <david.sherwood@arm.com>
4576 * match.pd: Cope with polynomial numbers of vector elements.
4578 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4579 Alan Hayward <alan.hayward@arm.com>
4580 David Sherwood <david.sherwood@arm.com>
4582 * fold-const.c (fold_indirect_ref_1): Handle polynomial offsets
4583 in a POINTER_PLUS_EXPR.
4585 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4586 Alan Hayward <alan.hayward@arm.com>
4587 David Sherwood <david.sherwood@arm.com>
4589 * omp-simd-clone.c (simd_clone_subparts): New function.
4590 (simd_clone_init_simd_arrays): Use it instead of TYPE_VECTOR_SUBPARTS.
4591 (ipa_simd_modify_function_body): Likewise.
4593 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4594 Alan Hayward <alan.hayward@arm.com>
4595 David Sherwood <david.sherwood@arm.com>
4597 * tree-vect-generic.c (nunits_for_known_piecewise_op): New function.
4598 (expand_vector_piecewise): Use it instead of TYPE_VECTOR_SUBPARTS.
4599 (expand_vector_addition, add_rshift, expand_vector_divmod): Likewise.
4600 (expand_vector_condition, vector_element): Likewise.
4601 (subparts_gt): New function.
4602 (get_compute_type): Use subparts_gt.
4603 (count_type_subparts): Delete.
4604 (expand_vector_operations_1): Use subparts_gt instead of
4605 count_type_subparts.
4607 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4608 Alan Hayward <alan.hayward@arm.com>
4609 David Sherwood <david.sherwood@arm.com>
4611 * tree-vect-data-refs.c (vect_no_alias_p): Replace with...
4612 (vect_compile_time_alias): ...this new function. Do the calculation
4613 on poly_ints rather than trees.
4614 (vect_prune_runtime_alias_test_list): Update call accordingly.
4616 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4617 Alan Hayward <alan.hayward@arm.com>
4618 David Sherwood <david.sherwood@arm.com>
4620 * tree-vect-slp.c (vect_build_slp_tree_1): Handle polynomial
4622 (vect_schedule_slp_instance): Likewise.
4624 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4625 Alan Hayward <alan.hayward@arm.com>
4626 David Sherwood <david.sherwood@arm.com>
4628 * tree-vect-slp.c (vect_get_and_check_slp_defs): Reject
4629 constant and extern definitions for variable-length vectors.
4630 (vect_get_constant_vectors): Note that the number of units
4631 is known to be constant.
4633 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4634 Alan Hayward <alan.hayward@arm.com>
4635 David Sherwood <david.sherwood@arm.com>
4637 * tree-vect-stmts.c (vectorizable_conversion): Treat the number
4638 of units as polynomial. Choose between WIDE and NARROW based
4641 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4642 Alan Hayward <alan.hayward@arm.com>
4643 David Sherwood <david.sherwood@arm.com>
4645 * tree-vect-stmts.c (simd_clone_subparts): New function.
4646 (vectorizable_simd_clone_call): Use it instead of TYPE_VECTOR_SUBPARTS.
4648 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4649 Alan Hayward <alan.hayward@arm.com>
4650 David Sherwood <david.sherwood@arm.com>
4652 * tree-vect-stmts.c (vectorizable_call): Treat the number of
4653 vectors as polynomial. Use build_index_vector for
4656 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4657 Alan Hayward <alan.hayward@arm.com>
4658 David Sherwood <david.sherwood@arm.com>
4660 * tree-vect-stmts.c (get_load_store_type): Treat the number of
4661 units as polynomial. Reject VMAT_ELEMENTWISE and VMAT_STRIDED_SLP
4662 for variable-length vectors.
4663 (vectorizable_mask_load_store): Treat the number of units as
4664 polynomial, asserting that it is constant if the condition has
4665 already been enforced.
4666 (vectorizable_store, vectorizable_load): Likewise.
4668 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4669 Alan Hayward <alan.hayward@arm.com>
4670 David Sherwood <david.sherwood@arm.com>
4672 * tree-vect-loop.c (vectorizable_live_operation): Treat the number
4673 of units as polynomial. Punt if we can't tell at compile time
4674 which vector contains the final result.
4676 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4677 Alan Hayward <alan.hayward@arm.com>
4678 David Sherwood <david.sherwood@arm.com>
4680 * tree-vect-loop.c (vectorizable_induction): Treat the number
4681 of units as polynomial. Punt on SLP inductions. Use an integer
4682 VEC_SERIES_EXPR for variable-length integer reductions. Use a
4683 cast of such a series for variable-length floating-point
4686 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4687 Alan Hayward <alan.hayward@arm.com>
4688 David Sherwood <david.sherwood@arm.com>
4690 * tree.h (build_index_vector): Declare.
4691 * tree.c (build_index_vector): New function.
4692 * tree-vect-loop.c (get_initial_defs_for_reduction): Treat the number
4693 of units as polynomial, forcibly converting it to a constant if
4694 vectorizable_reduction has already enforced the condition.
4695 (vect_create_epilog_for_reduction): Likewise. Use build_index_vector
4696 to create a {1,2,3,...} vector.
4697 (vectorizable_reduction): Treat the number of units as polynomial.
4698 Choose vectype_in based on the largest scalar element size rather
4699 than the smallest number of units. Enforce the restrictions
4702 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4703 Alan Hayward <alan.hayward@arm.com>
4704 David Sherwood <david.sherwood@arm.com>
4706 * tree-vect-data-refs.c (vector_alignment_reachable_p): Treat the
4707 number of units as polynomial.
4709 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4710 Alan Hayward <alan.hayward@arm.com>
4711 David Sherwood <david.sherwood@arm.com>
4713 * target.h (vector_sizes, auto_vector_sizes): New typedefs.
4714 * target.def (autovectorize_vector_sizes): Return the vector sizes
4715 by pointer, using vector_sizes rather than a bitmask.
4716 * targhooks.h (default_autovectorize_vector_sizes): Update accordingly.
4717 * targhooks.c (default_autovectorize_vector_sizes): Likewise.
4718 * config/aarch64/aarch64.c (aarch64_autovectorize_vector_sizes):
4720 * config/arc/arc.c (arc_autovectorize_vector_sizes): Likewise.
4721 * config/arm/arm.c (arm_autovectorize_vector_sizes): Likewise.
4722 * config/i386/i386.c (ix86_autovectorize_vector_sizes): Likewise.
4723 * config/mips/mips.c (mips_autovectorize_vector_sizes): Likewise.
4724 * omp-general.c (omp_max_vf): Likewise.
4725 * omp-low.c (omp_clause_aligned_alignment): Likewise.
4726 * optabs-query.c (can_vec_mask_load_store_p): Likewise.
4727 * tree-vect-loop.c (vect_analyze_loop): Likewise.
4728 * tree-vect-slp.c (vect_slp_bb): Likewise.
4729 * doc/tm.texi: Regenerate.
4730 * tree-vectorizer.h (current_vector_size): Change from an unsigned int
4732 * tree-vect-stmts.c (get_vectype_for_scalar_type_and_size): Take
4733 the vector size as a poly_uint64 rather than an unsigned int.
4734 (current_vector_size): Change from an unsigned int to a poly_uint64.
4735 (get_vectype_for_scalar_type): Update accordingly.
4736 * tree.h (build_truth_vector_type): Take the size and number of
4737 units as a poly_uint64 rather than an unsigned int.
4738 (build_vector_type): Add a temporary overload that takes
4739 the number of units as a poly_uint64 rather than an unsigned int.
4740 * tree.c (make_vector_type): Likewise.
4741 (build_truth_vector_type): Take the number of units as a poly_uint64
4742 rather than an unsigned int.
4744 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4745 Alan Hayward <alan.hayward@arm.com>
4746 David Sherwood <david.sherwood@arm.com>
4748 * target.def (get_mask_mode): Take the number of units and length
4749 as poly_uint64s rather than unsigned ints.
4750 * targhooks.h (default_get_mask_mode): Update accordingly.
4751 * targhooks.c (default_get_mask_mode): Likewise.
4752 * config/i386/i386.c (ix86_get_mask_mode): Likewise.
4753 * doc/tm.texi: Regenerate.
4755 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4756 Alan Hayward <alan.hayward@arm.com>
4757 David Sherwood <david.sherwood@arm.com>
4759 * omp-general.h (omp_max_vf): Return a poly_uint64 instead of an int.
4760 * omp-general.c (omp_max_vf): Likewise.
4761 * omp-expand.c (omp_adjust_chunk_size): Update call to omp_max_vf.
4762 (expand_omp_simd): Handle polynomial safelen.
4763 * omp-low.c (omplow_simd_context): Add a default constructor.
4764 (omplow_simd_context::max_vf): Change from int to poly_uint64.
4765 (lower_rec_simd_input_clauses): Update accordingly.
4766 (lower_rec_input_clauses): Likewise.
4768 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4769 Alan Hayward <alan.hayward@arm.com>
4770 David Sherwood <david.sherwood@arm.com>
4772 * tree-vectorizer.h (vect_nunits_for_cost): New function.
4773 * tree-vect-loop.c (vect_model_reduction_cost): Use it.
4774 * tree-vect-slp.c (vect_analyze_slp_cost_1): Likewise.
4775 (vect_analyze_slp_cost): Likewise.
4776 * tree-vect-stmts.c (vect_model_store_cost): Likewise.
4777 (vect_model_load_cost): Likewise.
4779 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4780 Alan Hayward <alan.hayward@arm.com>
4781 David Sherwood <david.sherwood@arm.com>
4783 * tree-vect-slp.c (vect_record_max_nunits, vect_build_slp_tree_1)
4784 (vect_build_slp_tree_2, vect_build_slp_tree): Change max_nunits
4785 from an unsigned int * to a poly_uint64_pod *.
4786 (calculate_unrolling_factor): New function.
4787 (vect_analyze_slp_instance): Use it. Track polynomial max_nunits.
4789 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4790 Alan Hayward <alan.hayward@arm.com>
4791 David Sherwood <david.sherwood@arm.com>
4793 * tree-vectorizer.h (_slp_instance::unrolling_factor): Change
4794 from an unsigned int to a poly_uint64.
4795 (_loop_vec_info::slp_unrolling_factor): Likewise.
4796 (_loop_vec_info::vectorization_factor): Change from an int
4798 (MAX_VECTORIZATION_FACTOR): Bump from 64 to INT_MAX.
4799 (vect_get_num_vectors): New function.
4800 (vect_update_max_nunits, vect_vf_for_cost): Likewise.
4801 (vect_get_num_copies): Use vect_get_num_vectors.
4802 (vect_analyze_data_ref_dependences): Change max_vf from an int *
4803 to an unsigned int *.
4804 (vect_analyze_data_refs): Change min_vf from an int * to a
4806 (vect_transform_slp_perm_load): Take the vf as a poly_uint64 rather
4807 than an unsigned HOST_WIDE_INT.
4808 * tree-vect-data-refs.c (vect_analyze_possibly_independent_ddr)
4809 (vect_analyze_data_ref_dependence): Change max_vf from an int *
4810 to an unsigned int *.
4811 (vect_analyze_data_ref_dependences): Likewise.
4812 (vect_compute_data_ref_alignment): Handle polynomial vf.
4813 (vect_enhance_data_refs_alignment): Likewise.
4814 (vect_prune_runtime_alias_test_list): Likewise.
4815 (vect_shift_permute_load_chain): Likewise.
4816 (vect_supportable_dr_alignment): Likewise.
4817 (dependence_distance_ge_vf): Take the vectorization factor as a
4818 poly_uint64 rather than an unsigned HOST_WIDE_INT.
4819 (vect_analyze_data_refs): Change min_vf from an int * to a
4821 * tree-vect-loop-manip.c (vect_gen_scalar_loop_niters): Take
4822 vfm1 as a poly_uint64 rather than an int. Make the same change
4823 for the returned bound_scalar.
4824 (vect_gen_vector_loop_niters): Handle polynomial vf.
4825 (vect_do_peeling): Likewise. Update call to
4826 vect_gen_scalar_loop_niters and handle polynomial bound_scalars.
4827 (vect_gen_vector_loop_niters_mult_vf): Assert that the vf must
4829 * tree-vect-loop.c (vect_determine_vectorization_factor)
4830 (vect_update_vf_for_slp, vect_analyze_loop_2): Handle polynomial vf.
4831 (vect_get_known_peeling_cost): Likewise.
4832 (vect_estimate_min_profitable_iters, vectorizable_reduction): Likewise.
4833 (vect_worthwhile_without_simd_p, vectorizable_induction): Likewise.
4834 (vect_transform_loop): Likewise. Use the lowest possible VF when
4835 updating the upper bounds of the loop.
4836 (vect_min_worthwhile_factor): Make static. Return an unsigned int
4838 * tree-vect-slp.c (vect_attempt_slp_rearrange_stmts): Cope with
4839 polynomial unroll factors.
4840 (vect_analyze_slp_cost_1, vect_analyze_slp_instance): Likewise.
4841 (vect_make_slp_decision): Likewise.
4842 (vect_supported_load_permutation_p): Likewise, and polynomial
4844 (vect_analyze_slp_cost): Handle polynomial vf.
4845 (vect_slp_analyze_node_operations): Likewise.
4846 (vect_slp_analyze_bb_1): Likewise.
4847 (vect_transform_slp_perm_load): Take the vf as a poly_uint64 rather
4848 than an unsigned HOST_WIDE_INT.
4849 * tree-vect-stmts.c (vectorizable_simd_clone_call, vectorizable_store)
4850 (vectorizable_load): Handle polynomial vf.
4851 * tree-vectorizer.c (simduid_to_vf::vf): Change from an int to
4853 (adjust_simduid_builtins, shrink_simd_arrays): Update accordingly.
4855 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4856 Alan Hayward <alan.hayward@arm.com>
4857 David Sherwood <david.sherwood@arm.com>
4859 * match.pd: Handle bit operations involving three constants
4860 and try to fold one pair.
4862 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
4864 * tree-vect-loop-manip.c: Include gimple-fold.h.
4865 (slpeel_make_loop_iterate_ntimes): Add step, final_iv and
4866 niters_maybe_zero parameters. Handle other cases besides a step of 1.
4867 (vect_gen_vector_loop_niters): Add a step_vector_ptr parameter.
4868 Add a path that uses a step of VF instead of 1, but disable it
4870 (vect_do_peeling): Add step_vector, niters_vector_mult_vf_var
4871 and niters_no_overflow parameters. Update calls to
4872 slpeel_make_loop_iterate_ntimes and vect_gen_vector_loop_niters.
4873 Create a new SSA name if the latter choses to use a ste other
4874 than zero, and return it via niters_vector_mult_vf_var.
4875 * tree-vect-loop.c (vect_transform_loop): Update calls to
4876 vect_do_peeling, vect_gen_vector_loop_niters and
4877 slpeel_make_loop_iterate_ntimes.
4878 * tree-vectorizer.h (slpeel_make_loop_iterate_ntimes, vect_do_peeling)
4879 (vect_gen_vector_loop_niters): Update declarations after above changes.
4881 2018-01-02 Michael Meissner <meissner@linux.vnet.ibm.com>
4883 * config/rs6000/rs6000.md (floor<mode>2): Add support for IEEE
4884 128-bit round to integer instructions.
4885 (ceil<mode>2): Likewise.
4886 (btrunc<mode>2): Likewise.
4887 (round<mode>2): Likewise.
4889 2018-01-02 Aaron Sawdey <acsawdey@linux.vnet.ibm.com>
4891 * config/rs6000/rs6000-string.c (expand_block_move): Allow the use of
4892 unaligned VSX load/store on P8/P9.
4893 (expand_block_clear): Allow the use of unaligned VSX
4894 load/store on P8/P9.
4896 2018-01-02 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
4898 * config/rs6000/rs6000-p8swap.c (swap_feeds_both_load_and_store):
4900 (rs6000_analyze_swaps): Mark a web unoptimizable if it contains a
4901 swap associated with both a load and a store.
4903 2018-01-02 Andrew Waterman <andrew@sifive.com>
4905 * config/riscv/linux.h (ICACHE_FLUSH_FUNC): New.
4906 * config/riscv/riscv.md (clear_cache): Use it.
4908 2018-01-02 Artyom Skrobov <tyomitch@gmail.com>
4910 * web.c: Remove out-of-date comment.
4912 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
4914 * expr.c (fixup_args_size_notes): Check that any existing
4915 REG_ARGS_SIZE notes are correct, and don't try to re-add them.
4916 (emit_single_push_insn_1): Move stack_pointer_delta adjustment to...
4917 (emit_single_push_insn): ...here.
4919 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
4921 * rtl.h (CONST_VECTOR_ELT): Redefine to const_vector_elt.
4922 (const_vector_encoded_nelts): New function.
4923 (CONST_VECTOR_NUNITS): Redefine to use GET_MODE_NUNITS.
4924 (const_vector_int_elt, const_vector_elt): Declare.
4925 * emit-rtl.c (const_vector_int_elt_1): New function.
4926 (const_vector_elt): Likewise.
4927 * simplify-rtx.c (simplify_immed_subreg): Avoid taking the address
4928 of CONST_VECTOR_ELT.
4930 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
4932 * expr.c: Include rtx-vector-builder.h.
4933 (const_vector_mask_from_tree): Use rtx_vector_builder and operate
4934 directly on the tree encoding.
4935 (const_vector_from_tree): Likewise.
4936 * optabs.c: Include rtx-vector-builder.h.
4937 (expand_vec_perm_var): Use rtx_vector_builder and create a repeating
4938 sequence of "u" values.
4939 * vec-perm-indices.c: Include rtx-vector-builder.h.
4940 (vec_perm_indices_to_rtx): Use rtx_vector_builder and operate
4941 directly on the vec_perm_indices encoding.
4943 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
4945 * doc/rtl.texi (const_vector): Describe new encoding scheme.
4946 * Makefile.in (OBJS): Add rtx-vector-builder.o.
4947 * rtx-vector-builder.h: New file.
4948 * rtx-vector-builder.c: Likewise.
4949 * rtl.h (rtx_def::u2): Add a const_vector field.
4950 (CONST_VECTOR_NPATTERNS): New macro.
4951 (CONST_VECTOR_NELTS_PER_PATTERN): Likewise.
4952 (CONST_VECTOR_DUPLICATE_P): Likewise.
4953 (CONST_VECTOR_STEPPED_P): Likewise.
4954 (CONST_VECTOR_ENCODED_ELT): Likewise.
4955 (const_vec_duplicate_p): Check for a duplicated vector encoding.
4956 (unwrap_const_vec_duplicate): Likewise.
4957 (const_vec_series_p): Check for a non-duplicated vector encoding.
4958 Say that the function only returns true for integer vectors.
4959 * emit-rtl.c: Include rtx-vector-builder.h.
4960 (gen_const_vec_duplicate_1): Delete.
4961 (gen_const_vector): Call gen_const_vec_duplicate instead of
4962 gen_const_vec_duplicate_1.
4963 (const_vec_series_p_1): Operate directly on the CONST_VECTOR encoding.
4964 (gen_const_vec_duplicate): Use rtx_vector_builder.
4965 (gen_const_vec_series): Likewise.
4966 (gen_rtx_CONST_VECTOR): Likewise.
4967 * config/powerpcspe/powerpcspe.c: Include rtx-vector-builder.h.
4968 (swap_const_vector_halves): Take an rtx pointer rather than rtx.
4969 Build a new vector rather than modifying a CONST_VECTOR in-place.
4970 (handle_special_swappables): Update call accordingly.
4971 * config/rs6000/rs6000-p8swap.c: Include rtx-vector-builder.h.
4972 (swap_const_vector_halves): Take an rtx pointer rather than rtx.
4973 Build a new vector rather than modifying a CONST_VECTOR in-place.
4974 (handle_special_swappables): Update call accordingly.
4976 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
4978 * simplify-rtx.c (simplify_const_binary_operation): Use
4979 CONST_VECTOR_ELT instead of XVECEXP.
4981 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
4983 * tree-cfg.c (verify_gimple_assign_ternary): Allow the size of
4984 the selector elements to be different from the data elements
4985 if the selector is a VECTOR_CST.
4986 * tree-vect-stmts.c (vect_gen_perm_mask_any): Use a vector of
4987 ssizetype for the selector.
4989 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
4991 * optabs.c (shift_amt_for_vec_perm_mask): Try using series_p
4992 before testing each element individually.
4993 * tree-vect-generic.c (lower_vec_perm): Likewise.
4995 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
4997 * selftest.h (selftest::vec_perm_indices_c_tests): Declare.
4998 * selftest-run-tests.c (selftest::run_tests): Call it.
4999 * vector-builder.h (vector_builder::operator ==): New function.
5000 (vector_builder::operator !=): Likewise.
5001 * vec-perm-indices.h (vec_perm_indices::series_p): Declare.
5002 (vec_perm_indices::all_from_input_p): New function.
5003 * vec-perm-indices.c (vec_perm_indices::series_p): Likewise.
5004 (test_vec_perm_12, selftest::vec_perm_indices_c_tests): Likewise.
5005 * fold-const.c (fold_ternary_loc): Use tree_to_vec_perm_builder
5006 instead of reading the VECTOR_CST directly. Detect whether both
5007 vector inputs are the same before constructing the vec_perm_indices,
5008 and update the number of inputs argument accordingly. Use the
5009 utility functions added above. Only construct sel2 if we need to.
5011 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
5013 * optabs.c (expand_vec_perm_var): Use an explicit encoding for
5014 the broadcast of the low byte.
5015 (expand_mult_highpart): Use an explicit encoding for the permutes.
5016 * optabs-query.c (can_mult_highpart_p): Likewise.
5017 * tree-vect-loop.c (calc_vec_perm_mask_for_shift): Likewise.
5018 * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
5019 (vectorizable_bswap): Likewise.
5020 * tree-vect-data-refs.c (vect_grouped_store_supported): Use an
5021 explicit encoding for the power-of-2 permutes.
5022 (vect_permute_store_chain): Likewise.
5023 (vect_grouped_load_supported): Likewise.
5024 (vect_permute_load_chain): Likewise.
5026 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
5028 * vec-perm-indices.h (vec_perm_indices_to_tree): Declare.
5029 * vec-perm-indices.c (vec_perm_indices_to_tree): New function.
5030 * tree-ssa-forwprop.c (simplify_vector_constructor): Use it.
5031 * tree-vect-slp.c (vect_transform_slp_perm_load): Likewise.
5032 * tree-vect-stmts.c (vectorizable_bswap): Likewise.
5033 (vect_gen_perm_mask_any): Likewise.
5035 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
5037 * int-vector-builder.h: New file.
5038 * vec-perm-indices.h: Include int-vector-builder.h.
5039 (vec_perm_indices): Redefine as an int_vector_builder.
5040 (auto_vec_perm_indices): Delete.
5041 (vec_perm_builder): Redefine as a stand-alone class.
5042 (vec_perm_indices::vec_perm_indices): New function.
5043 (vec_perm_indices::clamp): Likewise.
5044 * vec-perm-indices.c: Include fold-const.h and tree-vector-builder.h.
5045 (vec_perm_indices::new_vector): New function.
5046 (vec_perm_indices::new_expanded_vector): Update for new
5047 vec_perm_indices class.
5048 (vec_perm_indices::rotate_inputs): New function.
5049 (vec_perm_indices::all_in_range_p): Operate directly on the
5050 encoded form, without computing elided elements.
5051 (tree_to_vec_perm_builder): Operate directly on the VECTOR_CST
5052 encoding. Update for new vec_perm_indices class.
5053 * optabs.c (expand_vec_perm_const): Create a vec_perm_indices for
5054 the given vec_perm_builder.
5055 (expand_vec_perm_var): Update vec_perm_builder constructor.
5056 (expand_mult_highpart): Use vec_perm_builder instead of
5057 auto_vec_perm_indices.
5058 * optabs-query.c (can_mult_highpart_p): Use vec_perm_builder and
5059 vec_perm_indices instead of auto_vec_perm_indices. Use a single
5060 or double series encoding as appropriate.
5061 * fold-const.c (fold_ternary_loc): Use vec_perm_builder and
5062 vec_perm_indices instead of auto_vec_perm_indices.
5063 * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
5064 * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
5065 (vect_permute_store_chain): Likewise.
5066 (vect_grouped_load_supported): Likewise.
5067 (vect_permute_load_chain): Likewise.
5068 (vect_shift_permute_load_chain): Likewise.
5069 * tree-vect-slp.c (vect_build_slp_tree_1): Likewise.
5070 (vect_transform_slp_perm_load): Likewise.
5071 (vect_schedule_slp_instance): Likewise.
5072 * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
5073 (vectorizable_mask_load_store): Likewise.
5074 (vectorizable_bswap): Likewise.
5075 (vectorizable_store): Likewise.
5076 (vectorizable_load): Likewise.
5077 * tree-vect-generic.c (lower_vec_perm): Use vec_perm_builder and
5078 vec_perm_indices instead of auto_vec_perm_indices. Use
5079 tree_to_vec_perm_builder to read the vector from a tree.
5080 * tree-vect-loop.c (calc_vec_perm_mask_for_shift): Take a
5081 vec_perm_builder instead of a vec_perm_indices.
5082 (have_whole_vector_shift): Use vec_perm_builder and
5083 vec_perm_indices instead of auto_vec_perm_indices. Leave the
5084 truncation to calc_vec_perm_mask_for_shift.
5085 (vect_create_epilog_for_reduction): Likewise.
5086 * config/aarch64/aarch64.c (expand_vec_perm_d::perm): Change
5087 from auto_vec_perm_indices to vec_perm_indices.
5088 (aarch64_expand_vec_perm_const_1): Use rotate_inputs on d.perm
5089 instead of changing individual elements.
5090 (aarch64_vectorize_vec_perm_const): Use new_vector to install
5091 the vector in d.perm.
5092 * config/arm/arm.c (expand_vec_perm_d::perm): Change
5093 from auto_vec_perm_indices to vec_perm_indices.
5094 (arm_expand_vec_perm_const_1): Use rotate_inputs on d.perm
5095 instead of changing individual elements.
5096 (arm_vectorize_vec_perm_const): Use new_vector to install
5097 the vector in d.perm.
5098 * config/powerpcspe/powerpcspe.c (rs6000_expand_extract_even):
5099 Update vec_perm_builder constructor.
5100 (rs6000_expand_interleave): Likewise.
5101 * config/rs6000/rs6000.c (rs6000_expand_extract_even): Likewise.
5102 (rs6000_expand_interleave): Likewise.
5104 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
5106 * optabs-query.c (can_vec_perm_var_p): Check whether lowering
5107 to qimode could truncate the indices.
5108 * optabs.c (expand_vec_perm_var): Likewise.
5110 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
5112 * Makefile.in (OBJS): Add vec-perm-indices.o.
5113 * vec-perm-indices.h: New file.
5114 * vec-perm-indices.c: Likewise.
5115 * target.h (vec_perm_indices): Replace with a forward class
5117 (auto_vec_perm_indices): Move to vec-perm-indices.h.
5118 * optabs.h: Include vec-perm-indices.h.
5119 (expand_vec_perm): Delete.
5120 (selector_fits_mode_p, expand_vec_perm_var): Declare.
5121 (expand_vec_perm_const): Declare.
5122 * target.def (vec_perm_const_ok): Replace with...
5123 (vec_perm_const): ...this new hook.
5124 * doc/tm.texi.in (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Replace with...
5125 (TARGET_VECTORIZE_VEC_PERM_CONST): ...this new hook.
5126 * doc/tm.texi: Regenerate.
5127 * optabs.def (vec_perm_const): Delete.
5128 * doc/md.texi (vec_perm_const): Likewise.
5129 (vec_perm): Refer to TARGET_VECTORIZE_VEC_PERM_CONST.
5130 * expr.c (expand_expr_real_2): Use expand_vec_perm_const rather than
5131 expand_vec_perm for constant permutation vectors. Assert that
5132 the mode of variable permutation vectors is the integer equivalent
5133 of the mode that is being permuted.
5134 * optabs-query.h (selector_fits_mode_p): Declare.
5135 * optabs-query.c: Include vec-perm-indices.h.
5136 (selector_fits_mode_p): New function.
5137 (can_vec_perm_const_p): Check whether targetm.vectorize.vec_perm_const
5138 is defined, instead of checking whether the vec_perm_const_optab
5139 exists. Use targetm.vectorize.vec_perm_const instead of
5140 targetm.vectorize.vec_perm_const_ok. Check whether the indices
5141 fit in the vector mode before using a variable permute.
5142 * optabs.c (shift_amt_for_vec_perm_mask): Take a mode and a
5143 vec_perm_indices instead of an rtx.
5144 (expand_vec_perm): Replace with...
5145 (expand_vec_perm_const): ...this new function. Take the selector
5146 as a vec_perm_indices rather than an rtx. Also take the mode of
5147 the selector. Update call to shift_amt_for_vec_perm_mask.
5148 Use targetm.vectorize.vec_perm_const instead of vec_perm_const_optab.
5149 Use vec_perm_indices::new_expanded_vector to expand the original
5150 selector into bytes. Check whether the indices fit in the vector
5151 mode before using a variable permute.
5152 (expand_vec_perm_var): Make global.
5153 (expand_mult_highpart): Use expand_vec_perm_const.
5154 * fold-const.c: Includes vec-perm-indices.h.
5155 * tree-ssa-forwprop.c: Likewise.
5156 * tree-vect-data-refs.c: Likewise.
5157 * tree-vect-generic.c: Likewise.
5158 * tree-vect-loop.c: Likewise.
5159 * tree-vect-slp.c: Likewise.
5160 * tree-vect-stmts.c: Likewise.
5161 * config/aarch64/aarch64-protos.h (aarch64_expand_vec_perm_const):
5163 * config/aarch64/aarch64-simd.md (vec_perm_const<mode>): Delete.
5164 * config/aarch64/aarch64.c (aarch64_expand_vec_perm_const)
5165 (aarch64_vectorize_vec_perm_const_ok): Fuse into...
5166 (aarch64_vectorize_vec_perm_const): ...this new function.
5167 (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
5168 (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
5169 * config/arm/arm-protos.h (arm_expand_vec_perm_const): Delete.
5170 * config/arm/vec-common.md (vec_perm_const<mode>): Delete.
5171 * config/arm/arm.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
5172 (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
5173 (arm_expand_vec_perm_const, arm_vectorize_vec_perm_const_ok): Merge
5175 (arm_vectorize_vec_perm_const): ...this new function. Explicitly
5176 check for NEON modes.
5177 * config/i386/i386-protos.h (ix86_expand_vec_perm_const): Delete.
5178 * config/i386/sse.md (VEC_PERM_CONST, vec_perm_const<mode>): Delete.
5179 * config/i386/i386.c (ix86_expand_vec_perm_const_1): Update comment.
5180 (ix86_expand_vec_perm_const, ix86_vectorize_vec_perm_const_ok): Merge
5182 (ix86_vectorize_vec_perm_const): ...this new function. Incorporate
5183 the old VEC_PERM_CONST conditions.
5184 * config/ia64/ia64-protos.h (ia64_expand_vec_perm_const): Delete.
5185 * config/ia64/vect.md (vec_perm_const<mode>): Delete.
5186 * config/ia64/ia64.c (ia64_expand_vec_perm_const)
5187 (ia64_vectorize_vec_perm_const_ok): Merge into...
5188 (ia64_vectorize_vec_perm_const): ...this new function.
5189 * config/mips/loongson.md (vec_perm_const<mode>): Delete.
5190 * config/mips/mips-msa.md (vec_perm_const<mode>): Delete.
5191 * config/mips/mips-ps-3d.md (vec_perm_constv2sf): Delete.
5192 * config/mips/mips-protos.h (mips_expand_vec_perm_const): Delete.
5193 * config/mips/mips.c (mips_expand_vec_perm_const)
5194 (mips_vectorize_vec_perm_const_ok): Merge into...
5195 (mips_vectorize_vec_perm_const): ...this new function.
5196 * config/powerpcspe/altivec.md (vec_perm_constv16qi): Delete.
5197 * config/powerpcspe/paired.md (vec_perm_constv2sf): Delete.
5198 * config/powerpcspe/spe.md (vec_perm_constv2si): Delete.
5199 * config/powerpcspe/vsx.md (vec_perm_const<mode>): Delete.
5200 * config/powerpcspe/powerpcspe-protos.h (altivec_expand_vec_perm_const)
5201 (rs6000_expand_vec_perm_const): Delete.
5202 * config/powerpcspe/powerpcspe.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK):
5204 (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
5205 (altivec_expand_vec_perm_const_le): Take each operand individually.
5206 Operate on constant selectors rather than rtxes.
5207 (altivec_expand_vec_perm_const): Likewise. Update call to
5208 altivec_expand_vec_perm_const_le.
5209 (rs6000_expand_vec_perm_const): Delete.
5210 (rs6000_vectorize_vec_perm_const_ok): Delete.
5211 (rs6000_vectorize_vec_perm_const): New function.
5212 (rs6000_do_expand_vec_perm): Take a vec_perm_builder instead of
5213 an element count and rtx array.
5214 (rs6000_expand_extract_even): Update call accordingly.
5215 (rs6000_expand_interleave): Likewise.
5216 * config/rs6000/altivec.md (vec_perm_constv16qi): Delete.
5217 * config/rs6000/paired.md (vec_perm_constv2sf): Delete.
5218 * config/rs6000/vsx.md (vec_perm_const<mode>): Delete.
5219 * config/rs6000/rs6000-protos.h (altivec_expand_vec_perm_const)
5220 (rs6000_expand_vec_perm_const): Delete.
5221 * config/rs6000/rs6000.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
5222 (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
5223 (altivec_expand_vec_perm_const_le): Take each operand individually.
5224 Operate on constant selectors rather than rtxes.
5225 (altivec_expand_vec_perm_const): Likewise. Update call to
5226 altivec_expand_vec_perm_const_le.
5227 (rs6000_expand_vec_perm_const): Delete.
5228 (rs6000_vectorize_vec_perm_const_ok): Delete.
5229 (rs6000_vectorize_vec_perm_const): New function. Remove stray
5230 reference to the SPE evmerge intructions.
5231 (rs6000_do_expand_vec_perm): Take a vec_perm_builder instead of
5232 an element count and rtx array.
5233 (rs6000_expand_extract_even): Update call accordingly.
5234 (rs6000_expand_interleave): Likewise.
5235 * config/sparc/sparc.md (vec_perm_constv8qi): Delete in favor of...
5236 * config/sparc/sparc.c (sparc_vectorize_vec_perm_const): ...this
5238 (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
5240 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
5242 * optabs.c (expand_vec_perm_1): Assert that SEL has an integer
5243 vector mode and that that mode matches the mode of the data
5245 (expand_vec_perm): Split handling of non-CONST_VECTOR selectors
5246 out into expand_vec_perm_var. Do all CONST_VECTOR handling here,
5247 directly using expand_vec_perm_1 when forcing selectors into
5249 (expand_vec_perm_var): New function, split out from expand_vec_perm.
5251 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
5253 * optabs-query.h (can_vec_perm_p): Delete.
5254 (can_vec_perm_var_p, can_vec_perm_const_p): Declare.
5255 * optabs-query.c (can_vec_perm_p): Split into...
5256 (can_vec_perm_var_p, can_vec_perm_const_p): ...these two functions.
5257 (can_mult_highpart_p): Use can_vec_perm_const_p to test whether a
5258 particular selector is valid.
5259 * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
5260 * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
5261 (vect_grouped_load_supported): Likewise.
5262 (vect_shift_permute_load_chain): Likewise.
5263 * tree-vect-slp.c (vect_build_slp_tree_1): Likewise.
5264 (vect_transform_slp_perm_load): Likewise.
5265 * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
5266 (vectorizable_bswap): Likewise.
5267 (vect_gen_perm_mask_checked): Likewise.
5268 * fold-const.c (fold_ternary_loc): Likewise. Don't take
5269 implementations of variable permutation vectors into account
5270 when deciding which selector to use.
5271 * tree-vect-loop.c (have_whole_vector_shift): Don't check whether
5272 vec_perm_const_optab is supported; instead use can_vec_perm_const_p
5273 with a false third argument.
5274 * tree-vect-generic.c (lower_vec_perm): Use can_vec_perm_const_p
5275 to test whether the constant selector is valid and can_vec_perm_var_p
5276 to test whether a variable selector is valid.
5278 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
5280 * optabs-query.h (can_vec_perm_p): Take a const vec_perm_indices *.
5281 * optabs-query.c (can_vec_perm_p): Likewise.
5282 * fold-const.c (fold_vec_perm): Take a const vec_perm_indices &
5283 instead of vec_perm_indices.
5284 * tree-vectorizer.h (vect_gen_perm_mask_any): Likewise,
5285 (vect_gen_perm_mask_checked): Likewise,
5286 * tree-vect-stmts.c (vect_gen_perm_mask_any): Likewise,
5287 (vect_gen_perm_mask_checked): Likewise,
5289 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
5291 * optabs-query.h (qimode_for_vec_perm): Declare.
5292 * optabs-query.c (can_vec_perm_p): Split out qimode search to...
5293 (qimode_for_vec_perm): ...this new function.
5294 * optabs.c (expand_vec_perm): Use qimode_for_vec_perm.
5296 2018-01-02 Aaron Sawdey <acsawdey@linux.vnet.ibm.com>
5298 * rtlanal.c (canonicalize_condition): Return 0 if final rtx
5299 does not have a conditional at the top.
5301 2018-01-02 Richard Biener <rguenther@suse.de>
5303 * ipa-inline.c (big_speedup_p): Fix expression.
5305 2018-01-02 Jan Hubicka <hubicka@ucw.cz>
5308 * config/i386/x86-tune-costs.h: Increase cost of integer load costs
5311 2018-01-02 Jan Hubicka <hubicka@ucw.cz>
5315 * x86-tune-costs.h (generic_cost): Reduce cost of FDIV 20->17,
5316 cost of sqrt 20->14, DIVSS 18->13, DIVSD 32->17, SQRtSS 30->14
5317 and SQRTsD 58->18, cond_not_taken_branch_cost. 2->1. Increase
5318 cond_taken_branch_cost 3->4.
5320 2018-01-01 Jakub Jelinek <jakub@redhat.com>
5322 PR tree-optimization/83581
5323 * tree-loop-distribution.c (pass_loop_distribution::execute): Return
5324 TODO_cleanup_cfg if any changes have been made.
5327 * expr.c (store_expr_with_bounds): Use simplify_gen_subreg instead of
5328 convert_modes if target mode has the right side, but different mode
5332 * expr.c (expand_assignment): Fix up a typo in simplify_gen_subreg
5333 last argument when extracting from CONCAT. If either from_real or
5334 from_imag is NULL, use expansion through memory. If result is not
5335 a CONCAT and simplify_gen_subreg fails, try to simplify_gen_subreg
5336 the parts directly to inner mode, if even that fails, use expansion
5340 * expmed.c (expand_shift_1): For 2-byte rotates by BITS_PER_UNIT,
5341 check for bswap in mode rather than HImode and use that in expand_unop
5344 Copyright (C) 2018 Free Software Foundation, Inc.
5346 Copying and distribution of this file, with or without modification,
5347 are permitted in any medium without royalty provided the copyright
5348 notice and this notice are preserved.