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