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