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