Use gather loads for strided accesses
[official-gcc.git] / gcc / ChangeLog
blobfb7a205be00936a699c37da18bb353c76517a3c8
1 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
2             Alan Hayward  <alan.hayward@arm.com>
3             David Sherwood  <david.sherwood@arm.com>
5         * tree-vectorizer.h (vect_create_data_ref_ptr): Take an extra
6         optional tree argument.
7         * tree-vect-data-refs.c (vect_check_gather_scatter): Check for
8         null target hooks.
9         (vect_create_data_ref_ptr): Take the iv_step as an optional argument,
10         but continue to use the current value as a fallback.
11         (bump_vector_ptr): Use operand_equal_p rather than tree_int_cst_compare
12         to compare the updates.
13         * tree-vect-stmts.c (vect_use_strided_gather_scatters_p): New function.
14         (get_load_store_type): Use it when handling a strided access.
15         (vect_get_strided_load_store_ops): New function.
16         (vect_get_data_ptr_increment): Likewise.
17         (vectorizable_load): Handle strided gather loads.  Always pass
18         a step to vect_create_data_ref_ptr and bump_vector_ptr.
20 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
21             Alan Hayward  <alan.hayward@arm.com>
22             David Sherwood  <david.sherwood@arm.com>
24         * doc/md.texi (gather_load@var{m}): Document.
25         (mask_gather_load@var{m}): Likewise.
26         * genopinit.c (main): Add supports_vec_gather_load and
27         supports_vec_gather_load_cached to target_optabs.
28         * optabs-tree.c (init_tree_optimization_optabs): Use
29         ggc_cleared_alloc to allocate target_optabs.
30         * optabs.def (gather_load_optab, mask_gather_laod_optab): New optabs.
31         * internal-fn.def (GATHER_LOAD, MASK_GATHER_LOAD): New internal
32         functions.
33         * internal-fn.h (internal_load_fn_p): Declare.
34         (internal_gather_scatter_fn_p): Likewise.
35         (internal_fn_mask_index): Likewise.
36         (internal_gather_scatter_fn_supported_p): Likewise.
37         * internal-fn.c (gather_load_direct): New macro.
38         (expand_gather_load_optab_fn): New function.
39         (direct_gather_load_optab_supported_p): New macro.
40         (direct_internal_fn_optab): New function.
41         (internal_load_fn_p): Likewise.
42         (internal_gather_scatter_fn_p): Likewise.
43         (internal_fn_mask_index): Likewise.
44         (internal_gather_scatter_fn_supported_p): Likewise.
45         * optabs-query.c (supports_at_least_one_mode_p): New function.
46         (supports_vec_gather_load_p): Likewise.
47         * optabs-query.h (supports_vec_gather_load_p): Declare.
48         * tree-vectorizer.h (gather_scatter_info): Add ifn, element_type
49         and memory_type field.
50         (NUM_PATTERNS): Bump to 15.
51         * tree-vect-data-refs.c: Include internal-fn.h.
52         (vect_gather_scatter_fn_p): New function.
53         (vect_describe_gather_scatter_call): Likewise.
54         (vect_check_gather_scatter): Try using internal functions for
55         gather loads.  Recognize existing calls to a gather load function.
56         (vect_analyze_data_refs): Consider using gather loads if
57         supports_vec_gather_load_p.
58         * tree-vect-patterns.c (vect_get_load_store_mask): New function.
59         (vect_get_gather_scatter_offset_type): Likewise.
60         (vect_convert_mask_for_vectype): Likewise.
61         (vect_add_conversion_to_patterm): Likewise.
62         (vect_try_gather_scatter_pattern): Likewise.
63         (vect_recog_gather_scatter_pattern): New pattern recognizer.
64         (vect_vect_recog_func_ptrs): Add it.
65         * tree-vect-stmts.c (exist_non_indexing_operands_for_use_p): Use
66         internal_fn_mask_index and internal_gather_scatter_fn_p.
67         (check_load_store_masking): Take the gather_scatter_info as an
68         argument and handle gather loads.
69         (vect_get_gather_scatter_ops): New function.
70         (vectorizable_call): Check internal_load_fn_p.
71         (vectorizable_load): Likewise.  Handle gather load internal
72         functions.
73         (vectorizable_store): Update call to check_load_store_masking.
74         * config/aarch64/aarch64.md (UNSPEC_LD1_GATHER): New unspec.
75         * config/aarch64/iterators.md (SVE_S, SVE_D): New mode iterators.
76         * config/aarch64/predicates.md (aarch64_gather_scale_operand_w)
77         (aarch64_gather_scale_operand_d): New predicates.
78         * config/aarch64/aarch64-sve.md (gather_load<mode>): New expander.
79         (mask_gather_load<mode>): New insns.
81 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
82             Alan Hayward  <alan.hayward@arm.com>
83             David Sherwood  <david.sherwood@arm.com>
85         * optabs.def (fold_left_plus_optab): New optab.
86         * doc/md.texi (fold_left_plus_@var{m}): Document.
87         * internal-fn.def (IFN_FOLD_LEFT_PLUS): New internal function.
88         * internal-fn.c (fold_left_direct): Define.
89         (expand_fold_left_optab_fn): Likewise.
90         (direct_fold_left_optab_supported_p): Likewise.
91         * fold-const-call.c (fold_const_fold_left): New function.
92         (fold_const_call): Use it to fold CFN_FOLD_LEFT_PLUS.
93         * tree-parloops.c (valid_reduction_p): New function.
94         (gather_scalar_reductions): Use it.
95         * tree-vectorizer.h (FOLD_LEFT_REDUCTION): New vect_reduction_type.
96         (vect_finish_replace_stmt): Declare.
97         * tree-vect-loop.c (fold_left_reduction_fn): New function.
98         (needs_fold_left_reduction_p): New function, split out from...
99         (vect_is_simple_reduction): ...here.  Accept reductions that
100         forbid reassociation, but give them type FOLD_LEFT_REDUCTION.
101         (vect_force_simple_reduction): Also store the reduction type in
102         the assignment's STMT_VINFO_REDUC_TYPE.
103         (vect_model_reduction_cost): Handle FOLD_LEFT_REDUCTION.
104         (merge_with_identity): New function.
105         (vect_expand_fold_left): Likewise.
106         (vectorize_fold_left_reduction): Likewise.
107         (vectorizable_reduction): Handle FOLD_LEFT_REDUCTION.  Leave the
108         scalar phi in place for it.  Check for target support and reject
109         cases that would reassociate the operation.  Defer the transform
110         phase to vectorize_fold_left_reduction.
111         * config/aarch64/aarch64.md (UNSPEC_FADDA): New unspec.
112         * config/aarch64/aarch64-sve.md (fold_left_plus_<mode>): New expander.
113         (*fold_left_plus_<mode>, *pred_fold_left_plus_<mode>): New insns.
115 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
117         * tree-if-conv.c (predicate_mem_writes): Remove redundant
118         call to ifc_temp_var.
120 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
121             Alan Hayward  <alan.hayward@arm.com>
122             David Sherwood  <david.sherwood@arm.com>
124         * target.def (legitimize_address_displacement): Take the original
125         offset as a poly_int.
126         * targhooks.h (default_legitimize_address_displacement): Update
127         accordingly.
128         * targhooks.c (default_legitimize_address_displacement): Likewise.
129         * doc/tm.texi: Regenerate.
130         * lra-constraints.c (base_plus_disp_to_reg): Take the displacement
131         as an argument, moving assert of ad->disp == ad->disp_term to...
132         (process_address_1): ...here.  Update calls to base_plus_disp_to_reg.
133         Try calling targetm.legitimize_address_displacement before expanding
134         the address rather than afterwards, and adjust for the new interface.
135         * config/aarch64/aarch64.c (aarch64_legitimize_address_displacement):
136         Match the new hook interface.  Handle SVE addresses.
137         * config/sh/sh.c (sh_legitimize_address_displacement): Make the
138         new hook interface.
140 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
142         * Makefile.in (OBJS): Add early-remat.o.
143         * target.def (select_early_remat_modes): New hook.
144         * doc/tm.texi.in (TARGET_SELECT_EARLY_REMAT_MODES): New hook.
145         * doc/tm.texi: Regenerate.
146         * targhooks.h (default_select_early_remat_modes): Declare.
147         * targhooks.c (default_select_early_remat_modes): New function.
148         * timevar.def (TV_EARLY_REMAT): New timevar.
149         * passes.def (pass_early_remat): New pass.
150         * tree-pass.h (make_pass_early_remat): Declare.
151         * early-remat.c: New file.
152         * config/aarch64/aarch64.c (aarch64_select_early_remat_modes): New
153         function.
154         (TARGET_SELECT_EARLY_REMAT_MODES): Define.
156 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
157             Alan Hayward  <alan.hayward@arm.com>
158             David Sherwood  <david.sherwood@arm.com>
160         * tree-vect-loop-manip.c (vect_gen_scalar_loop_niters): Replace
161         vfm1 with a bound_epilog parameter.
162         (vect_do_peeling): Update calls accordingly, and move the prologue
163         call earlier in the function.  Treat the base bound_epilog as 0 for
164         fully-masked loops and retain vf - 1 for other loops.  Add 1 to
165         this base when peeling for gaps.
166         * tree-vect-loop.c (vect_analyze_loop_2): Allow peeling for gaps
167         with fully-masked loops.
168         (vect_estimate_min_profitable_iters): Handle the single peeled
169         iteration in that case.
171 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
172             Alan Hayward  <alan.hayward@arm.com>
173             David Sherwood  <david.sherwood@arm.com>
175         * tree-vect-data-refs.c (vect_analyze_group_access_1): Allow
176         single-element interleaving even if the size is not a power of 2.
177         * tree-vect-stmts.c (get_load_store_type): Disallow elementwise
178         accesses for single-element interleaving if the group size is
179         not a power of 2.
181 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
182             Alan Hayward  <alan.hayward@arm.com>
183             David Sherwood  <david.sherwood@arm.com>
185         * doc/md.texi (fold_extract_last_@var{m}): Document.
186         * doc/sourcebuild.texi (vect_fold_extract_last): Likewise.
187         * optabs.def (fold_extract_last_optab): New optab.
188         * internal-fn.def (FOLD_EXTRACT_LAST): New internal function.
189         * internal-fn.c (fold_extract_direct): New macro.
190         (expand_fold_extract_optab_fn): Likewise.
191         (direct_fold_extract_optab_supported_p): Likewise.
192         * tree-vectorizer.h (EXTRACT_LAST_REDUCTION): New vect_reduction_type.
193         * tree-vect-loop.c (vect_model_reduction_cost): Handle
194         EXTRACT_LAST_REDUCTION.
195         (get_initial_def_for_reduction): Do not create an initial vector
196         for EXTRACT_LAST_REDUCTION reductions.
197         (vectorizable_reduction): Leave the scalar phi in place for
198         EXTRACT_LAST_REDUCTIONs.  Try using EXTRACT_LAST_REDUCTION
199         ahead of INTEGER_INDUC_COND_REDUCTION.  Do not check for an
200         epilogue code for EXTRACT_LAST_REDUCTION and defer the
201         transform phase to vectorizable_condition.
202         * tree-vect-stmts.c (vect_finish_stmt_generation_1): New function,
203         split out from...
204         (vect_finish_stmt_generation): ...here.
205         (vect_finish_replace_stmt): New function.
206         (vectorizable_condition): Handle EXTRACT_LAST_REDUCTION.
207         * config/aarch64/aarch64-sve.md (fold_extract_last_<mode>): New
208         pattern.
209         * config/aarch64/aarch64.md (UNSPEC_CLASTB): New unspec.
211 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
212             Alan Hayward  <alan.hayward@arm.com>
213             David Sherwood  <david.sherwood@arm.com>
215         * doc/md.texi (extract_last_@var{m}): Document.
216         * optabs.def (extract_last_optab): New optab.
217         * internal-fn.def (EXTRACT_LAST): New internal function.
218         * internal-fn.c (cond_unary_direct): New macro.
219         (expand_cond_unary_optab_fn): Likewise.
220         (direct_cond_unary_optab_supported_p): Likewise.
221         * tree-vect-loop.c (vectorizable_live_operation): Allow fully-masked
222         loops using EXTRACT_LAST.
223         * config/aarch64/aarch64-sve.md (aarch64_sve_lastb<mode>): Rename to...
224         (extract_last_<mode>): ...this optab.
225         (vec_extract<mode><Vel>): Update accordingly.
227 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
228             Alan Hayward  <alan.hayward@arm.com>
229             David Sherwood  <david.sherwood@arm.com>
231         * target.def (empty_mask_is_expensive): New hook.
232         * doc/tm.texi.in (TARGET_VECTORIZE_EMPTY_MASK_IS_EXPENSIVE): New hook.
233         * doc/tm.texi: Regenerate.
234         * targhooks.h (default_empty_mask_is_expensive): Declare.
235         * targhooks.c (default_empty_mask_is_expensive): New function.
236         * tree-vectorizer.c (vectorize_loops): Only call optimize_mask_stores
237         if the target says that empty masks are expensive.
238         * config/aarch64/aarch64.c (aarch64_empty_mask_is_expensive):
239         New function.
240         (TARGET_VECTORIZE_EMPTY_MASK_IS_EXPENSIVE): Redefine.
242 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
243             Alan Hayward  <alan.hayward@arm.com>
244             David Sherwood  <david.sherwood@arm.com>
246         * tree-vectorizer.h (_loop_vec_info::mask_skip_niters): New field.
247         (LOOP_VINFO_MASK_SKIP_NITERS): New macro.
248         (vect_use_loop_mask_for_alignment_p): New function.
249         (vect_prepare_for_masked_peels, vect_gen_while_not): Declare.
250         * tree-vect-loop-manip.c (vect_set_loop_masks_directly): Add an
251         niters_skip argument.  Make sure that the first niters_skip elements
252         of the first iteration are inactive.
253         (vect_set_loop_condition_masked): Handle LOOP_VINFO_MASK_SKIP_NITERS.
254         Update call to vect_set_loop_masks_directly.
255         (get_misalign_in_elems): New function, split out from...
256         (vect_gen_prolog_loop_niters): ...here.
257         (vect_update_init_of_dr): Take a code argument that specifies whether
258         the adjustment should be added or subtracted.
259         (vect_update_init_of_drs): Likewise.
260         (vect_prepare_for_masked_peels): New function.
261         (vect_do_peeling): Skip prologue peeling if we're using a mask
262         instead.  Update call to vect_update_inits_of_drs.
263         * tree-vect-loop.c (_loop_vec_info::_loop_vec_info): Initialize
264         mask_skip_niters.
265         (vect_analyze_loop_2): Allow fully-masked loops with peeling for
266         alignment.  Do not include the number of peeled iterations in
267         the minimum threshold in that case.
268         (vectorizable_induction): Adjust the start value down by
269         LOOP_VINFO_MASK_SKIP_NITERS iterations.
270         (vect_transform_loop): Call vect_prepare_for_masked_peels.
271         Take the number of skipped iterations into account when calculating
272         the loop bounds.
273         * tree-vect-stmts.c (vect_gen_while_not): New function.
275 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
276             Alan Hayward  <alan.hayward@arm.com>
277             David Sherwood  <david.sherwood@arm.com>
279         * doc/sourcebuild.texi (vect_fully_masked): Document.
280         * params.def (PARAM_MIN_VECT_LOOP_BOUND): Change minimum and
281         default value to 0.
282         * tree-vect-loop.c (vect_analyze_loop_costing): New function,
283         split out from...
284         (vect_analyze_loop_2): ...here. Don't check the vectorization
285         factor against the number of loop iterations if the loop is
286         fully-masked.
288 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
289             Alan Hayward  <alan.hayward@arm.com>
290             David Sherwood  <david.sherwood@arm.com>
292         * tree-ssa-loop-ivopts.c (USE_ADDRESS): Split into...
293         (USE_REF_ADDRESS, USE_PTR_ADDRESS): ...these new use types.
294         (dump_groups): Update accordingly.
295         (iv_use::mem_type): New member variable.
296         (address_p): New function.
297         (record_use): Add a mem_type argument and initialize the new
298         mem_type field.
299         (record_group_use): Add a mem_type argument.  Use address_p.
300         Remove obsolete null checks of base_object.  Update call to record_use.
301         (find_interesting_uses_op): Update call to record_group_use.
302         (find_interesting_uses_cond): Likewise.
303         (find_interesting_uses_address): Likewise.
304         (get_mem_type_for_internal_fn): New function.
305         (find_address_like_use): Likewise.
306         (find_interesting_uses_stmt): Try find_address_like_use before
307         calling find_interesting_uses_op.
308         (addr_offset_valid_p): Use the iv mem_type field as the type
309         of the addressed memory.
310         (add_autoinc_candidates): Likewise.
311         (get_address_cost): Likewise.
312         (split_small_address_groups_p): Use address_p.
313         (split_address_groups): Likewise.
314         (add_iv_candidate_for_use): Likewise.
315         (autoinc_possible_for_pair): Likewise.
316         (rewrite_groups): Likewise.
317         (get_use_type): Check for USE_REF_ADDRESS instead of USE_ADDRESS.
318         (determine_group_iv_cost): Update after split of USE_ADDRESS.
319         (get_alias_ptr_type_for_ptr_address): New function.
320         (rewrite_use_address): Rewrite address uses in calls that were
321         identified by find_address_like_use.
323 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
324             Alan Hayward  <alan.hayward@arm.com>
325             David Sherwood  <david.sherwood@arm.com>
327         * expr.c (expand_expr_addr_expr_1): Handle ADDR_EXPRs of
328         TARGET_MEM_REFs.
329         * gimple-expr.h (is_gimple_addressable: Likewise.
330         * gimple-expr.c (is_gimple_address): Likewise.
331         * internal-fn.c (expand_call_mem_ref): New function.
332         (expand_mask_load_optab_fn): Use it.
333         (expand_mask_store_optab_fn): Likewise.
335 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
336             Alan Hayward  <alan.hayward@arm.com>
337             David Sherwood  <david.sherwood@arm.com>
339         * doc/md.texi (cond_add@var{mode}, cond_sub@var{mode})
340         (cond_and@var{mode}, cond_ior@var{mode}, cond_xor@var{mode})
341         (cond_smin@var{mode}, cond_smax@var{mode}, cond_umin@var{mode})
342         (cond_umax@var{mode}): Document.
343         * optabs.def (cond_add_optab, cond_sub_optab, cond_and_optab)
344         (cond_ior_optab, cond_xor_optab, cond_smin_optab, cond_smax_optab)
345         (cond_umin_optab, cond_umax_optab): New optabs.
346         * internal-fn.def (COND_ADD, COND_SUB, COND_MIN, COND_MAX, COND_AND)
347         (COND_IOR, COND_XOR): New internal functions.
348         * internal-fn.h (get_conditional_internal_fn): Declare.
349         * internal-fn.c (cond_binary_direct): New macro.
350         (expand_cond_binary_optab_fn): Likewise.
351         (direct_cond_binary_optab_supported_p): Likewise.
352         (get_conditional_internal_fn): New function.
353         * tree-vect-loop.c (vectorizable_reduction): Handle fully-masked loops.
354         Cope with reduction statements that are vectorized as calls rather
355         than assignments.
356         * config/aarch64/aarch64-sve.md (cond_<optab><mode>): New insns.
357         * config/aarch64/iterators.md (UNSPEC_COND_ADD, UNSPEC_COND_SUB)
358         (UNSPEC_COND_SMAX, UNSPEC_COND_UMAX, UNSPEC_COND_SMIN)
359         (UNSPEC_COND_UMIN, UNSPEC_COND_AND, UNSPEC_COND_ORR)
360         (UNSPEC_COND_EOR): New unspecs.
361         (optab): Add mappings for them.
362         (SVE_COND_INT_OP, SVE_COND_FP_OP): New int iterators.
363         (sve_int_op, sve_fp_op): New int attributes.
365 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
366             Alan Hayward  <alan.hayward@arm.com>
367             David Sherwood  <david.sherwood@arm.com>
369         * optabs.def (while_ult_optab): New optab.
370         * doc/md.texi (while_ult@var{m}@var{n}): Document.
371         * internal-fn.def (WHILE_ULT): New internal function.
372         * internal-fn.h (direct_internal_fn_supported_p): New override
373         that takes two types as argument.
374         * internal-fn.c (while_direct): New macro.
375         (expand_while_optab_fn): New function.
376         (convert_optab_supported_p): Likewise.
377         (direct_while_optab_supported_p): New macro.
378         * wide-int.h (wi::udiv_ceil): New function.
379         * tree-vectorizer.h (rgroup_masks): New structure.
380         (vec_loop_masks): New typedef.
381         (_loop_vec_info): Add masks, mask_compare_type, can_fully_mask_p
382         and fully_masked_p.
383         (LOOP_VINFO_CAN_FULLY_MASK_P, LOOP_VINFO_FULLY_MASKED_P)
384         (LOOP_VINFO_MASKS, LOOP_VINFO_MASK_COMPARE_TYPE): New macros.
385         (vect_max_vf): New function.
386         (slpeel_make_loop_iterate_ntimes): Delete.
387         (vect_set_loop_condition, vect_get_loop_mask_type, vect_gen_while)
388         (vect_halve_mask_nunits, vect_double_mask_nunits): Declare.
389         (vect_record_loop_mask, vect_get_loop_mask): Likewise.
390         * tree-vect-loop-manip.c: Include tree-ssa-loop-niter.h,
391         internal-fn.h, stor-layout.h and optabs-query.h.
392         (vect_set_loop_mask): New function.
393         (add_preheader_seq): Likewise.
394         (add_header_seq): Likewise.
395         (interleave_supported_p): Likewise.
396         (vect_maybe_permute_loop_masks): Likewise.
397         (vect_set_loop_masks_directly): Likewise.
398         (vect_set_loop_condition_masked): Likewise.
399         (vect_set_loop_condition_unmasked): New function, split out from
400         slpeel_make_loop_iterate_ntimes.
401         (slpeel_make_loop_iterate_ntimes): Rename to..
402         (vect_set_loop_condition): ...this.  Use vect_set_loop_condition_masked
403         for fully-masked loops and vect_set_loop_condition_unmasked otherwise.
404         (vect_do_peeling): Update call accordingly.
405         (vect_gen_vector_loop_niters): Use VF as the step for fully-masked
406         loops.
407         * tree-vect-loop.c (_loop_vec_info::_loop_vec_info): Initialize
408         mask_compare_type, can_fully_mask_p and fully_masked_p.
409         (release_vec_loop_masks): New function.
410         (_loop_vec_info): Use it to free the loop masks.
411         (can_produce_all_loop_masks_p): New function.
412         (vect_get_max_nscalars_per_iter): Likewise.
413         (vect_verify_full_masking): Likewise.
414         (vect_analyze_loop_2): Save LOOP_VINFO_CAN_FULLY_MASK_P around
415         retries, and free the mask rgroups before retrying.  Check loop-wide
416         reasons for disallowing fully-masked loops.  Make the final decision
417         about whether use a fully-masked loop or not.
418         (vect_estimate_min_profitable_iters): Do not assume that peeling
419         for the number of iterations will be needed for fully-masked loops.
420         (vectorizable_reduction): Disable fully-masked loops.
421         (vectorizable_live_operation): Likewise.
422         (vect_halve_mask_nunits): New function.
423         (vect_double_mask_nunits): Likewise.
424         (vect_record_loop_mask): Likewise.
425         (vect_get_loop_mask): Likewise.
426         (vect_transform_loop): Handle the case in which the final loop
427         iteration might handle a partial vector.  Call vect_set_loop_condition
428         instead of slpeel_make_loop_iterate_ntimes.
429         * tree-vect-stmts.c: Include tree-ssa-loop-niter.h and gimple-fold.h.
430         (check_load_store_masking): New function.
431         (prepare_load_store_mask): Likewise.
432         (vectorizable_store): Handle fully-masked loops.
433         (vectorizable_load): Likewise.
434         (supportable_widening_operation): Use vect_halve_mask_nunits for
435         booleans.
436         (supportable_narrowing_operation): Likewise vect_double_mask_nunits.
437         (vect_gen_while): New function.
438         * config/aarch64/aarch64.md (umax<mode>3): New expander.
439         (aarch64_uqdec<mode>): New insn.
441 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
442             Alan Hayward  <alan.hayward@arm.com>
443             David Sherwood  <david.sherwood@arm.com>
445         * optabs.def (reduc_and_scal_optab, reduc_ior_scal_optab)
446         (reduc_xor_scal_optab): New optabs.
447         * doc/md.texi (reduc_and_scal_@var{m}, reduc_ior_scal_@var{m})
448         (reduc_xor_scal_@var{m}): Document.
449         * doc/sourcebuild.texi (vect_logical_reduc): Likewise.
450         * internal-fn.def (IFN_REDUC_AND, IFN_REDUC_IOR, IFN_REDUC_XOR): New
451         internal functions.
452         * fold-const-call.c (fold_const_call): Handle them.
453         * tree-vect-loop.c (reduction_fn_for_scalar_code): Return the new
454         internal functions for BIT_AND_EXPR, BIT_IOR_EXPR and BIT_XOR_EXPR.
455         * config/aarch64/aarch64-sve.md (reduc_<bit_reduc>_scal_<mode>):
456         (*reduc_<bit_reduc>_scal_<mode>): New patterns.
457         * config/aarch64/iterators.md (UNSPEC_ANDV, UNSPEC_ORV)
458         (UNSPEC_XORV): New unspecs.
459         (optab): Add entries for them.
460         (BITWISEV): New int iterator.
461         (bit_reduc_op): New int attributes.
463 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
464             Alan Hayward  <alan.hayward@arm.com>
465             David Sherwood  <david.sherwood@arm.com>
467         * doc/md.texi (vec_shl_insert_@var{m}): New optab.
468         * internal-fn.def (VEC_SHL_INSERT): New internal function.
469         * optabs.def (vec_shl_insert_optab): New optab.
470         * tree-vectorizer.h (can_duplicate_and_interleave_p): Declare.
471         (duplicate_and_interleave): Likewise.
472         * tree-vect-loop.c: Include internal-fn.h.
473         (neutral_op_for_slp_reduction): New function, split out from
474         get_initial_defs_for_reduction.
475         (get_initial_def_for_reduction): Handle option 2 for variable-length
476         vectors by loading the neutral value into a vector and then shifting
477         the initial value into element 0.
478         (get_initial_defs_for_reduction): Replace the code argument with
479         the neutral value calculated by neutral_op_for_slp_reduction.
480         Use gimple_build_vector for constant-length vectors.
481         Use IFN_VEC_SHL_INSERT for variable-length vectors if all
482         but the first group_size elements have a neutral value.
483         Use duplicate_and_interleave otherwise.
484         (vect_create_epilog_for_reduction): Take a neutral_op parameter.
485         Update call to get_initial_defs_for_reduction.  Handle SLP
486         reductions for variable-length vectors by creating one vector
487         result for each scalar result, with the elements associated
488         with other scalar results stubbed out with the neutral value.
489         (vectorizable_reduction): Call neutral_op_for_slp_reduction.
490         Require IFN_VEC_SHL_INSERT for double reductions on
491         variable-length vectors, or SLP reductions that have
492         a neutral value.  Require can_duplicate_and_interleave_p
493         support for variable-length unchained SLP reductions if there
494         is no neutral value, such as for MIN/MAX reductions.  Also require
495         the number of vector elements to be a multiple of the number of
496         SLP statements when doing variable-length unchained SLP reductions.
497         Update call to vect_create_epilog_for_reduction.
498         * tree-vect-slp.c (can_duplicate_and_interleave_p): Make public
499         and remove initial values.
500         (duplicate_and_interleave): Make public.
501         * config/aarch64/aarch64.md (UNSPEC_INSR): New unspec.
502         * config/aarch64/aarch64-sve.md (vec_shl_insert_<mode>): New insn.
504 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
505             Alan Hayward  <alan.hayward@arm.com>
506             David Sherwood  <david.sherwood@arm.com>
508         * tree-vect-slp.c: Include gimple-fold.h and internal-fn.h
509         (can_duplicate_and_interleave_p): New function.
510         (vect_get_and_check_slp_defs): Take the vector of statements
511         rather than just the current one.  Remove excess parentheses.
512         Restriction rejectinon of vect_constant_def and vect_external_def
513         for variable-length vectors to boolean types, or types for which
514         can_duplicate_and_interleave_p is false.
515         (vect_build_slp_tree_2): Update call to vect_get_and_check_slp_defs.
516         (duplicate_and_interleave): New function.
517         (vect_get_constant_vectors): Use gimple_build_vector for
518         constant-length vectors and suitable variable-length constant
519         vectors.  Use duplicate_and_interleave for other variable-length
520         vectors.  Don't defer the update when inserting new statements.
522 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
523             Alan Hayward  <alan.hayward@arm.com>
524             David Sherwood  <david.sherwood@arm.com>
526         * tree-vect-loop.c (vect_estimate_min_profitable_iters): Make sure
527         min_profitable_iters doesn't go negative.
529 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
530             Alan Hayward  <alan.hayward@arm.com>
531             David Sherwood  <david.sherwood@arm.com>
533         * doc/md.texi (vec_mask_load_lanes@var{m}@var{n}): Document.
534         (vec_mask_store_lanes@var{m}@var{n}): Likewise.
535         * optabs.def (vec_mask_load_lanes_optab): New optab.
536         (vec_mask_store_lanes_optab): Likewise.
537         * internal-fn.def (MASK_LOAD_LANES): New internal function.
538         (MASK_STORE_LANES): Likewise.
539         * internal-fn.c (mask_load_lanes_direct): New macro.
540         (mask_store_lanes_direct): Likewise.
541         (expand_mask_load_optab_fn): Handle masked operations.
542         (expand_mask_load_lanes_optab_fn): New macro.
543         (expand_mask_store_optab_fn): Handle masked operations.
544         (expand_mask_store_lanes_optab_fn): New macro.
545         (direct_mask_load_lanes_optab_supported_p): Likewise.
546         (direct_mask_store_lanes_optab_supported_p): Likewise.
547         * tree-vectorizer.h (vect_store_lanes_supported): Take a masked_p
548         parameter.
549         (vect_load_lanes_supported): Likewise.
550         * tree-vect-data-refs.c (strip_conversion): New function.
551         (can_group_stmts_p): Likewise.
552         (vect_analyze_data_ref_accesses): Use it instead of checking
553         for a pair of assignments.
554         (vect_store_lanes_supported): Take a masked_p parameter.
555         (vect_load_lanes_supported): Likewise.
556         * tree-vect-loop.c (vect_analyze_loop_2): Update calls to
557         vect_store_lanes_supported and vect_load_lanes_supported.
558         * tree-vect-slp.c (vect_analyze_slp_instance): Likewise.
559         * tree-vect-stmts.c (get_group_load_store_type): Take a masked_p
560         parameter.  Don't allow gaps for masked accesses.
561         Use vect_get_store_rhs.  Update calls to vect_store_lanes_supported
562         and vect_load_lanes_supported.
563         (get_load_store_type): Take a masked_p parameter and update
564         call to get_group_load_store_type.
565         (vectorizable_store): Update call to get_load_store_type.
566         Handle IFN_MASK_STORE_LANES.
567         (vectorizable_load): Update call to get_load_store_type.
568         Handle IFN_MASK_LOAD_LANES.
570 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
571             Alan Hayward  <alan.hayward@arm.com>
572             David Sherwood  <david.sherwood@arm.com>
574         * config/aarch64/aarch64-modes.def: Define x2, x3 and x4 vector
575         modes for SVE.
576         * config/aarch64/aarch64-protos.h
577         (aarch64_sve_struct_memory_operand_p): Declare.
578         * config/aarch64/iterators.md (SVE_STRUCT): New mode iterator.
579         (vector_count, insn_length, VSINGLE, vsingle): New mode attributes.
580         (VPRED, vpred): Handle SVE structure modes.
581         * config/aarch64/constraints.md (Utx): New constraint.
582         * config/aarch64/predicates.md (aarch64_sve_struct_memory_operand)
583         (aarch64_sve_struct_nonimmediate_operand): New predicates.
584         * config/aarch64/aarch64.md (UNSPEC_LDN, UNSPEC_STN): New unspecs.
585         * config/aarch64/aarch64-sve.md (mov<mode>, *aarch64_sve_mov<mode>_le)
586         (*aarch64_sve_mov<mode>_be, pred_mov<mode>): New patterns for
587         structure modes.  Split into pieces after RA.
588         (vec_load_lanes<mode><vsingle>, vec_mask_load_lanes<mode><vsingle>)
589         (vec_store_lanes<mode><vsingle>, vec_mask_store_lanes<mode><vsingle>):
590         New patterns.
591         * config/aarch64/aarch64.c (aarch64_classify_vector_mode): Handle
592         SVE structure modes.
593         (aarch64_classify_address): Likewise.
594         (sizetochar): Move earlier in file.
595         (aarch64_print_operand): Handle SVE register lists.
596         (aarch64_array_mode): New function.
597         (aarch64_sve_struct_memory_operand_p): Likewise.
598         (TARGET_ARRAY_MODE): Redefine.
600 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
601             Alan Hayward  <alan.hayward@arm.com>
602             David Sherwood  <david.sherwood@arm.com>
604         * target.def (array_mode): New target hook.
605         * doc/tm.texi.in (TARGET_ARRAY_MODE): New hook.
606         * doc/tm.texi: Regenerate.
607         * hooks.h (hook_optmode_mode_uhwi_none): Declare.
608         * hooks.c (hook_optmode_mode_uhwi_none): New function.
609         * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Use
610         targetm.array_mode.
611         * stor-layout.c (mode_for_array): Likewise.  Support polynomial
612         type sizes.
614 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
615             Alan Hayward  <alan.hayward@arm.com>
616             David Sherwood  <david.sherwood@arm.com>
618         * fold-const.c (fold_binary_loc): Check the argument types
619         rather than the result type when testing for a vector operation.
621 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
623         * doc/tm.texi.in (DWARF_LAZY_REGISTER_VALUE): Document.
624         * doc/tm.texi: Regenerate.
626 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
627             Alan Hayward  <alan.hayward@arm.com>
628             David Sherwood  <david.sherwood@arm.com>
630         * doc/invoke.texi (-msve-vector-bits=): Document new option.
631         (sve): Document new AArch64 extension.
632         * doc/md.texi (w): Extend the description of the AArch64
633         constraint to include SVE vectors.
634         (Upl, Upa): Document new AArch64 predicate constraints.
635         * config/aarch64/aarch64-opts.h (aarch64_sve_vector_bits_enum): New
636         enum.
637         * config/aarch64/aarch64.opt (sve_vector_bits): New enum.
638         (msve-vector-bits=): New option.
639         * config/aarch64/aarch64-option-extensions.def (fp, simd): Disable
640         SVE when these are disabled.
641         (sve): New extension.
642         * config/aarch64/aarch64-modes.def: Define SVE vector and predicate
643         modes.  Adjust their number of units based on aarch64_sve_vg.
644         (MAX_BITSIZE_MODE_ANY_MODE): Define.
645         * config/aarch64/aarch64-protos.h (ADDR_QUERY_ANY): New
646         aarch64_addr_query_type.
647         (aarch64_const_vec_all_same_in_range_p, aarch64_sve_pred_mode)
648         (aarch64_sve_cnt_immediate_p, aarch64_sve_addvl_addpl_immediate_p)
649         (aarch64_sve_inc_dec_immediate_p, aarch64_add_offset_temporaries)
650         (aarch64_split_add_offset, aarch64_output_sve_cnt_immediate)
651         (aarch64_output_sve_addvl_addpl, aarch64_output_sve_inc_dec_immediate)
652         (aarch64_output_sve_mov_immediate, aarch64_output_ptrue): Declare.
653         (aarch64_simd_imm_zero_p): Delete.
654         (aarch64_check_zero_based_sve_index_immediate): Declare.
655         (aarch64_sve_index_immediate_p, aarch64_sve_arith_immediate_p)
656         (aarch64_sve_bitmask_immediate_p, aarch64_sve_dup_immediate_p)
657         (aarch64_sve_cmp_immediate_p, aarch64_sve_float_arith_immediate_p)
658         (aarch64_sve_float_mul_immediate_p): Likewise.
659         (aarch64_classify_symbol): Take the offset as a HOST_WIDE_INT
660         rather than an rtx.
661         (aarch64_sve_ld1r_operand_p, aarch64_sve_ldr_operand_p): Declare.
662         (aarch64_expand_mov_immediate): Take a gen_vec_duplicate callback.
663         (aarch64_emit_sve_pred_move, aarch64_expand_sve_mem_move): Declare.
664         (aarch64_expand_sve_vec_cmp_int, aarch64_expand_sve_vec_cmp_float)
665         (aarch64_expand_sve_vcond, aarch64_expand_sve_vec_perm): Declare.
666         (aarch64_regmode_natural_size): Likewise.
667         * config/aarch64/aarch64.h (AARCH64_FL_SVE): New macro.
668         (AARCH64_FL_V8_3, AARCH64_FL_RCPC, AARCH64_FL_DOTPROD): Shift
669         left one place.
670         (AARCH64_ISA_SVE, TARGET_SVE): New macros.
671         (FIXED_REGISTERS, CALL_USED_REGISTERS, REGISTER_NAMES): Add entries
672         for VG and the SVE predicate registers.
673         (V_ALIASES): Add a "z"-prefixed alias.
674         (FIRST_PSEUDO_REGISTER): Change to P15_REGNUM + 1.
675         (AARCH64_DWARF_VG, AARCH64_DWARF_P0): New macros.
676         (PR_REGNUM_P, PR_LO_REGNUM_P): Likewise.
677         (PR_LO_REGS, PR_HI_REGS, PR_REGS): New reg_classes.
678         (REG_CLASS_NAMES): Add entries for them.
679         (REG_CLASS_CONTENTS): Likewise.  Update ALL_REGS to include VG
680         and the predicate registers.
681         (aarch64_sve_vg): Declare.
682         (BITS_PER_SVE_VECTOR, BYTES_PER_SVE_VECTOR, BYTES_PER_SVE_PRED)
683         (SVE_BYTE_MODE, MAX_COMPILE_TIME_VEC_BYTES): New macros.
684         (REGMODE_NATURAL_SIZE): Define.
685         * config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins): Handle
686         SVE macros.
687         * config/aarch64/aarch64.c: Include cfgrtl.h.
688         (simd_immediate_info): Add a constructor for series vectors,
689         and an associated step field.
690         (aarch64_sve_vg): New variable.
691         (aarch64_dbx_register_number): Handle VG and the predicate registers.
692         (aarch64_vect_struct_mode_p, aarch64_vector_mode_p): Delete.
693         (VEC_ADVSIMD, VEC_SVE_DATA, VEC_SVE_PRED, VEC_STRUCT, VEC_ANY_SVE)
694         (VEC_ANY_DATA, VEC_STRUCT): New constants.
695         (aarch64_advsimd_struct_mode_p, aarch64_sve_pred_mode_p)
696         (aarch64_classify_vector_mode, aarch64_vector_data_mode_p)
697         (aarch64_sve_data_mode_p, aarch64_sve_pred_mode)
698         (aarch64_get_mask_mode): New functions.
699         (aarch64_hard_regno_nregs): Handle SVE data modes for FP_REGS
700         and FP_LO_REGS.  Handle PR_REGS, PR_LO_REGS and PR_HI_REGS.
701         (aarch64_hard_regno_mode_ok): Handle VG.  Also handle the SVE
702         predicate modes and predicate registers.  Explicitly restrict
703         GPRs to modes of 16 bytes or smaller.  Only allow FP registers
704         to store a vector mode if it is recognized by
705         aarch64_classify_vector_mode.
706         (aarch64_regmode_natural_size): New function.
707         (aarch64_hard_regno_caller_save_mode): Return the original mode
708         for predicates.
709         (aarch64_sve_cnt_immediate_p, aarch64_output_sve_cnt_immediate)
710         (aarch64_sve_addvl_addpl_immediate_p, aarch64_output_sve_addvl_addpl)
711         (aarch64_sve_inc_dec_immediate_p, aarch64_output_sve_inc_dec_immediate)
712         (aarch64_add_offset_1_temporaries, aarch64_offset_temporaries): New
713         functions.
714         (aarch64_add_offset): Add a temp2 parameter.  Assert that temp1
715         does not overlap dest if the function is frame-related.  Handle
716         SVE constants.
717         (aarch64_split_add_offset): New function.
718         (aarch64_add_sp, aarch64_sub_sp): Add temp2 parameters and pass
719         them aarch64_add_offset.
720         (aarch64_allocate_and_probe_stack_space): Add a temp2 parameter
721         and update call to aarch64_sub_sp.
722         (aarch64_add_cfa_expression): New function.
723         (aarch64_expand_prologue): Pass extra temporary registers to the
724         functions above.  Handle the case in which we need to emit new
725         DW_CFA_expressions for registers that were originally saved
726         relative to the stack pointer, but now have to be expressed
727         relative to the frame pointer.
728         (aarch64_output_mi_thunk): Pass extra temporary registers to the
729         functions above.
730         (aarch64_expand_epilogue): Likewise.  Prevent inheritance of
731         IP0 and IP1 values for SVE frames.
732         (aarch64_expand_vec_series): New function.
733         (aarch64_expand_sve_widened_duplicate): Likewise.
734         (aarch64_expand_sve_const_vector): Likewise.
735         (aarch64_expand_mov_immediate): Add a gen_vec_duplicate parameter.
736         Handle SVE constants.  Use emit_move_insn to move a force_const_mem
737         into the register, rather than emitting a SET directly.
738         (aarch64_emit_sve_pred_move, aarch64_expand_sve_mem_move)
739         (aarch64_get_reg_raw_mode, offset_4bit_signed_scaled_p)
740         (offset_6bit_unsigned_scaled_p, aarch64_offset_7bit_signed_scaled_p)
741         (offset_9bit_signed_scaled_p): New functions.
742         (aarch64_replicate_bitmask_imm): New function.
743         (aarch64_bitmask_imm): Use it.
744         (aarch64_cannot_force_const_mem): Reject expressions involving
745         a CONST_POLY_INT.  Update call to aarch64_classify_symbol.
746         (aarch64_classify_index): Handle SVE indices, by requiring
747         a plain register index with a scale that matches the element size.
748         (aarch64_classify_address): Handle SVE addresses.  Assert that
749         the mode of the address is VOIDmode or an integer mode.
750         Update call to aarch64_classify_symbol.
751         (aarch64_classify_symbolic_expression): Update call to
752         aarch64_classify_symbol.
753         (aarch64_const_vec_all_in_range_p): New function.
754         (aarch64_print_vector_float_operand): Likewise.
755         (aarch64_print_operand): Handle 'N' and 'C'.  Use "zN" rather than
756         "vN" for FP registers with SVE modes.  Handle (const ...) vectors
757         and the FP immediates 1.0 and 0.5.
758         (aarch64_print_address_internal): Handle SVE addresses.
759         (aarch64_print_operand_address): Use ADDR_QUERY_ANY.
760         (aarch64_regno_regclass): Handle predicate registers.
761         (aarch64_secondary_reload): Handle big-endian reloads of SVE
762         data modes.
763         (aarch64_class_max_nregs): Handle SVE modes and predicate registers.
764         (aarch64_rtx_costs): Check for ADDVL and ADDPL instructions.
765         (aarch64_convert_sve_vector_bits): New function.
766         (aarch64_override_options): Use it to handle -msve-vector-bits=.
767         (aarch64_classify_symbol): Take the offset as a HOST_WIDE_INT
768         rather than an rtx.
769         (aarch64_legitimate_constant_p): Use aarch64_classify_vector_mode.
770         Handle SVE vector and predicate modes.  Accept VL-based constants
771         that need only one temporary register, and VL offsets that require
772         no temporary registers.
773         (aarch64_conditional_register_usage): Mark the predicate registers
774         as fixed if SVE isn't available.
775         (aarch64_vector_mode_supported_p): Use aarch64_classify_vector_mode.
776         Return true for SVE vector and predicate modes.
777         (aarch64_simd_container_mode): Take the number of bits as a poly_int64
778         rather than an unsigned int.  Handle SVE modes.
779         (aarch64_preferred_simd_mode): Update call accordingly.  Handle
780         SVE modes.
781         (aarch64_autovectorize_vector_sizes): Add BYTES_PER_SVE_VECTOR
782         if SVE is enabled.
783         (aarch64_sve_index_immediate_p, aarch64_sve_arith_immediate_p)
784         (aarch64_sve_bitmask_immediate_p, aarch64_sve_dup_immediate_p)
785         (aarch64_sve_cmp_immediate_p, aarch64_sve_float_arith_immediate_p)
786         (aarch64_sve_float_mul_immediate_p): New functions.
787         (aarch64_sve_valid_immediate): New function.
788         (aarch64_simd_valid_immediate): Use it as the fallback for SVE vectors.
789         Explicitly reject structure modes.  Check for INDEX constants.
790         Handle PTRUE and PFALSE constants.
791         (aarch64_check_zero_based_sve_index_immediate): New function.
792         (aarch64_simd_imm_zero_p): Delete.
793         (aarch64_mov_operand_p): Use aarch64_simd_valid_immediate for
794         vector modes.  Accept constants in the range of CNT[BHWD].
795         (aarch64_simd_scalar_immediate_valid_for_move): Explicitly
796         ask for an Advanced SIMD mode.
797         (aarch64_sve_ld1r_operand_p, aarch64_sve_ldr_operand_p): New functions.
798         (aarch64_simd_vector_alignment): Handle SVE predicates.
799         (aarch64_vectorize_preferred_vector_alignment): New function.
800         (aarch64_simd_vector_alignment_reachable): Use it instead of
801         the vector size.
802         (aarch64_shift_truncation_mask): Use aarch64_vector_data_mode_p.
803         (aarch64_output_sve_mov_immediate, aarch64_output_ptrue): New
804         functions.
805         (MAX_VECT_LEN): Delete.
806         (expand_vec_perm_d): Add a vec_flags field.
807         (emit_unspec2, aarch64_expand_sve_vec_perm): New functions.
808         (aarch64_evpc_trn, aarch64_evpc_uzp, aarch64_evpc_zip)
809         (aarch64_evpc_ext): Don't apply a big-endian lane correction
810         for SVE modes.
811         (aarch64_evpc_rev): Rename to...
812         (aarch64_evpc_rev_local): ...this.  Use a predicated operation for SVE.
813         (aarch64_evpc_rev_global): New function.
814         (aarch64_evpc_dup): Enforce a 64-byte range for SVE DUP.
815         (aarch64_evpc_tbl): Use MAX_COMPILE_TIME_VEC_BYTES instead of
816         MAX_VECT_LEN.
817         (aarch64_evpc_sve_tbl): New function.
818         (aarch64_expand_vec_perm_const_1): Update after rename of
819         aarch64_evpc_rev.  Handle SVE permutes too, trying
820         aarch64_evpc_rev_global and using aarch64_evpc_sve_tbl rather
821         than aarch64_evpc_tbl.
822         (aarch64_vectorize_vec_perm_const): Initialize vec_flags.
823         (aarch64_sve_cmp_operand_p, aarch64_unspec_cond_code)
824         (aarch64_gen_unspec_cond, aarch64_expand_sve_vec_cmp_int)
825         (aarch64_emit_unspec_cond, aarch64_emit_unspec_cond_or)
826         (aarch64_emit_inverted_unspec_cond, aarch64_expand_sve_vec_cmp_float)
827         (aarch64_expand_sve_vcond): New functions.
828         (aarch64_modes_tieable_p): Use aarch64_vector_data_mode_p instead
829         of aarch64_vector_mode_p.
830         (aarch64_dwarf_poly_indeterminate_value): New function.
831         (aarch64_compute_pressure_classes): Likewise.
832         (aarch64_can_change_mode_class): Likewise.
833         (TARGET_GET_RAW_RESULT_MODE, TARGET_GET_RAW_ARG_MODE): Redefine.
834         (TARGET_VECTORIZE_PREFERRED_VECTOR_ALIGNMENT): Likewise.
835         (TARGET_VECTORIZE_GET_MASK_MODE): Likewise.
836         (TARGET_DWARF_POLY_INDETERMINATE_VALUE): Likewise.
837         (TARGET_COMPUTE_PRESSURE_CLASSES): Likewise.
838         (TARGET_CAN_CHANGE_MODE_CLASS): Likewise.
839         * config/aarch64/constraints.md (Upa, Upl, Uav, Uat, Usv, Usi, Utr)
840         (Uty, Dm, vsa, vsc, vsd, vsi, vsn, vsl, vsm, vsA, vsM, vsN): New
841         constraints.
842         (Dn, Dl, Dr): Accept const as well as const_vector.
843         (Dz): Likewise.  Compare against CONST0_RTX.
844         * config/aarch64/iterators.md: Refer to "Advanced SIMD" instead
845         of "vector" where appropriate.
846         (SVE_ALL, SVE_BH, SVE_BHS, SVE_BHSI, SVE_HSDI, SVE_HSF, SVE_SD)
847         (SVE_SDI, SVE_I, SVE_F, PRED_ALL, PRED_BHS): New mode iterators.
848         (UNSPEC_SEL, UNSPEC_ANDF, UNSPEC_IORF, UNSPEC_XORF, UNSPEC_COND_LT)
849         (UNSPEC_COND_LE, UNSPEC_COND_EQ, UNSPEC_COND_NE, UNSPEC_COND_GE)
850         (UNSPEC_COND_GT, UNSPEC_COND_LO, UNSPEC_COND_LS, UNSPEC_COND_HS)
851         (UNSPEC_COND_HI, UNSPEC_COND_UO): New unspecs.
852         (Vetype, VEL, Vel, VWIDE, Vwide, vw, vwcore, V_INT_EQUIV)
853         (v_int_equiv): Extend to SVE modes.
854         (Vesize, V128, v128, Vewtype, V_FP_EQUIV, v_fp_equiv, VPRED): New
855         mode attributes.
856         (LOGICAL_OR, SVE_INT_UNARY, SVE_FP_UNARY): New code iterators.
857         (optab): Handle popcount, smin, smax, umin, umax, abs and sqrt.
858         (logical_nn, lr, sve_int_op, sve_fp_op): New code attributs.
859         (LOGICALF, OPTAB_PERMUTE, UNPACK, UNPACK_UNSIGNED, SVE_COND_INT_CMP)
860         (SVE_COND_FP_CMP): New int iterators.
861         (perm_hilo): Handle the new unpack unspecs.
862         (optab, logicalf_op, su, perm_optab, cmp_op, imm_con): New int
863         attributes.
864         * config/aarch64/predicates.md (aarch64_sve_cnt_immediate)
865         (aarch64_sve_addvl_addpl_immediate, aarch64_split_add_offset_immediate)
866         (aarch64_pluslong_or_poly_operand, aarch64_nonmemory_operand)
867         (aarch64_equality_operator, aarch64_constant_vector_operand)
868         (aarch64_sve_ld1r_operand, aarch64_sve_ldr_operand): New predicates.
869         (aarch64_sve_nonimmediate_operand): Likewise.
870         (aarch64_sve_general_operand): Likewise.
871         (aarch64_sve_dup_operand, aarch64_sve_arith_immediate): Likewise.
872         (aarch64_sve_sub_arith_immediate, aarch64_sve_inc_dec_immediate)
873         (aarch64_sve_logical_immediate, aarch64_sve_mul_immediate): Likewise.
874         (aarch64_sve_dup_immediate, aarch64_sve_cmp_vsc_immediate): Likewise.
875         (aarch64_sve_cmp_vsd_immediate, aarch64_sve_index_immediate): Likewise.
876         (aarch64_sve_float_arith_immediate): Likewise.
877         (aarch64_sve_float_arith_with_sub_immediate): Likewise.
878         (aarch64_sve_float_mul_immediate, aarch64_sve_arith_operand): Likewise.
879         (aarch64_sve_add_operand, aarch64_sve_logical_operand): Likewise.
880         (aarch64_sve_lshift_operand, aarch64_sve_rshift_operand): Likewise.
881         (aarch64_sve_mul_operand, aarch64_sve_cmp_vsc_operand): Likewise.
882         (aarch64_sve_cmp_vsd_operand, aarch64_sve_index_operand): Likewise.
883         (aarch64_sve_float_arith_operand): Likewise.
884         (aarch64_sve_float_arith_with_sub_operand): Likewise.
885         (aarch64_sve_float_mul_operand): Likewise.
886         (aarch64_sve_vec_perm_operand): Likewise.
887         (aarch64_pluslong_operand): Include aarch64_sve_addvl_addpl_immediate.
888         (aarch64_mov_operand): Accept const_poly_int and const_vector.
889         (aarch64_simd_lshift_imm, aarch64_simd_rshift_imm): Accept const
890         as well as const_vector.
891         (aarch64_simd_imm_zero, aarch64_simd_imm_minus_one): Move earlier
892         in file.  Use CONST0_RTX and CONSTM1_RTX.
893         (aarch64_simd_or_scalar_imm_zero): Likewise.  Add match_codes.
894         (aarch64_simd_reg_or_zero): Accept const as well as const_vector.
895         Use aarch64_simd_imm_zero.
896         * config/aarch64/aarch64-sve.md: New file.
897         * config/aarch64/aarch64.md: Include it.
898         (VG_REGNUM, P0_REGNUM, P7_REGNUM, P15_REGNUM): New register numbers.
899         (UNSPEC_REV, UNSPEC_LD1_SVE, UNSPEC_ST1_SVE, UNSPEC_MERGE_PTRUE)
900         (UNSPEC_PTEST_PTRUE, UNSPEC_UNPACKSHI, UNSPEC_UNPACKUHI)
901         (UNSPEC_UNPACKSLO, UNSPEC_UNPACKULO, UNSPEC_PACK)
902         (UNSPEC_FLOAT_CONVERT, UNSPEC_WHILE_LO): New unspec constants.
903         (sve): New attribute.
904         (enabled): Disable instructions with the sve attribute unless
905         TARGET_SVE.
906         (movqi, movhi): Pass CONST_POLY_INT operaneds through
907         aarch64_expand_mov_immediate.
908         (*mov<mode>_aarch64, *movsi_aarch64, *movdi_aarch64): Handle
909         CNT[BHSD] immediates.
910         (movti): Split CONST_POLY_INT moves into two halves.
911         (add<mode>3): Accept aarch64_pluslong_or_poly_operand.
912         Split additions that need a temporary here if the destination
913         is the stack pointer.
914         (*add<mode>3_aarch64): Handle ADDVL and ADDPL immediates.
915         (*add<mode>3_poly_1): New instruction.
916         (set_clobber_cc): New expander.
918 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
920         * simplify-rtx.c (simplify_immed_subreg): Add an inner_bytes
921         parameter and use it instead of GET_MODE_SIZE (innermode).  Use
922         inner_bytes * BITS_PER_UNIT instead of GET_MODE_BITSIZE (innermode).
923         Use CEIL (inner_bytes, GET_MODE_UNIT_SIZE (innermode)) instead of
924         GET_MODE_NUNITS (innermode).  Also add a first_elem parameter.
925         Change innermode from fixed_mode_size to machine_mode.
926         (simplify_subreg): Update call accordingly.  Handle a constant-sized
927         subreg of a variable-length CONST_VECTOR.
929 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
930             Alan Hayward  <alan.hayward@arm.com>
931             David Sherwood  <david.sherwood@arm.com>
933         * tree-ssa-address.c (mem_ref_valid_without_offset_p): New function.
934         (add_offset_to_base): New function, split out from...
935         (create_mem_ref): ...here.  When handling a scale other than 1,
936         check first whether the address is valid without the offset.
937         Add it into the base if so, leaving the index and scale as-is.
939 2018-01-12  Jakub Jelinek  <jakub@redhat.com>
941         PR c++/83778
942         * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Call
943         fold_for_warn before checking if arg2 is INTEGER_CST.
945 2018-01-12  Segher Boessenkool  <segher@kernel.crashing.org>
947         * config/rs6000/predicates.md (load_multiple_operation): Delete.
948         (store_multiple_operation): Delete.
949         * config/rs6000/rs6000-cpus.def (601): Remove MASK_STRING.
950         * config/rs6000/rs6000-protos.h (rs6000_output_load_multiple): Delete.
951         * config/rs6000/rs6000-string.c (expand_block_move): Delete everything
952         guarded by TARGET_STRING.
953         (rs6000_output_load_multiple): Delete.
954         * config/rs6000/rs6000.c (rs6000_option_override_internal): Delete
955         OPTION_MASK_STRING / TARGET_STRING handling.
956         (print_operand) <'N', 'O'>: Add comment that these are unused now.
957         (const rs6000_opt_masks) <"string">: Change mask to 0.
958         * config/rs6000/rs6000.h (TARGET_DEFAULT): Remove MASK_STRING.
959         (MASK_STRING): Delete.
960         * config/rs6000/rs6000.md (*mov<mode>_string): Delete TARGET_STRING
961         parts.  Simplify.
962         (load_multiple): Delete.
963         (*ldmsi8): Delete.
964         (*ldmsi7): Delete.
965         (*ldmsi6): Delete.
966         (*ldmsi5): Delete.
967         (*ldmsi4): Delete.
968         (*ldmsi3): Delete.
969         (store_multiple): Delete.
970         (*stmsi8): Delete.
971         (*stmsi7): Delete.
972         (*stmsi6): Delete.
973         (*stmsi5): Delete.
974         (*stmsi4): Delete.
975         (*stmsi3): Delete.
976         (movmemsi_8reg): Delete.
977         (corresponding unnamed define_insn): Delete.
978         (movmemsi_6reg): Delete.
979         (corresponding unnamed define_insn): Delete.
980         (movmemsi_4reg): Delete.
981         (corresponding unnamed define_insn): Delete.
982         (movmemsi_2reg): Delete.
983         (corresponding unnamed define_insn): Delete.
984         (movmemsi_1reg): Delete.
985         (corresponding unnamed define_insn): Delete.
986         * config/rs6000/rs6000.opt (mno-string): New.
987         (mstring): Replace by deprecation warning stub.
988         * doc/invoke.texi (RS/6000 and PowerPC Options): Delete -mstring.
990 2018-01-12  Jakub Jelinek  <jakub@redhat.com>
992         * regrename.c (regrename_do_replace): If replacing the same
993         reg multiple times, try to reuse last created gen_raw_REG.
995         PR debug/81155
996         * bb-reorder.c (pass_partition_blocks::gate): In lto don't partition
997         main to workaround a bug in GDB.
999 2018-01-12  Tom de Vries  <tom@codesourcery.com>
1001         PR target/83737
1002         * config.gcc (nvptx*-*-*): Set use_gcc_stdint=wrap.
1004 2018-01-12  Vladimir Makarov  <vmakarov@redhat.com>
1006         PR rtl-optimization/80481
1007         * ira-color.c (get_cap_member): New function.
1008         (allocnos_conflict_by_live_ranges_p): Use it.
1009         (slot_coalesced_allocno_live_ranges_intersect_p): Add assert.
1010         (setup_slot_coalesced_allocno_live_ranges): Ditto.
1012 2018-01-12  Uros Bizjak  <ubizjak@gmail.com>
1014         PR target/83628
1015         * config/alpha/alpha.md (*saddsi_1): New insn_ans_split pattern.
1016         (*saddl_se_1): Ditto.
1017         (*ssubsi_1): Ditto.
1018         (*saddl_se_1): Ditto.
1020 2018-01-12  Richard Sandiford  <richard.sandiford@linaro.org>
1022         * tree-predcom.c (aff_combination_dr_offset): Use wi::to_poly_widest
1023         rather than wi::to_widest for DR_INITs.
1024         * tree-vect-data-refs.c (vect_find_same_alignment_drs): Use
1025         wi::to_poly_offset rather than wi::to_offset for DR_INIT.
1026         (vect_analyze_data_ref_accesses): Require both DR_INITs to be
1027         INTEGER_CSTs.
1028         (vect_analyze_group_access_1): Note that here.
1030 2018-01-12  Richard Sandiford  <richard.sandiford@linaro.org>
1032         * tree-vectorizer.c (get_vec_alignment_for_array_type): Handle
1033         polynomial type sizes.
1035 2018-01-12  Richard Sandiford  <richard.sandiford@linaro.org>
1037         * gimplify.c (gimple_add_tmp_var_fn): Allow variables to have a
1038         poly_uint64 size, rather than requiring an unsigned HOST_WIDE_INT size.
1039         (gimple_add_tmp_var): Likewise.
1041 2018-01-12  Martin Liska  <mliska@suse.cz>
1043         * gimple.c (gimple_alloc_counts): Use uint64_t instead of int.
1044         (gimple_alloc_sizes): Likewise.
1045         (dump_gimple_statistics): Use PRIu64 in printf format.
1046         * gimple.h: Change uint64_t to int.
1048 2018-01-12  Martin Liska  <mliska@suse.cz>
1050         * tree-core.h: Use uint64_t instead of int.
1051         * tree.c (tree_node_counts): Likewise.
1052         (tree_node_sizes): Likewise.
1053         (dump_tree_statistics): Use PRIu64 in printf format.
1055 2018-01-12  Martin Liska  <mliska@suse.cz>
1057         * Makefile.in: As qsort_chk is implemented in vec.c, add
1058         vec.o to linkage of gencfn-macros.
1059         * tree.c (build_new_poly_int_cst): Add CXX_MEM_STAT_INFO as it's
1060         passing the info to record_node_allocation_statistics.
1061         (test_vector_cst_patterns): Add CXX_MEM_STAT_INFO to declaration
1062         and pass the info.
1063         * ggc-common.c (struct ggc_usage): Add operator== and use
1064         it in operator< and compare function.
1065         * mem-stats.h (struct mem_usage): Likewise.
1066         * vec.c (struct vec_usage): Remove operator< and compare
1067         function. Can be simply inherited.
1069 2018-01-12  Martin Jambor  <mjambor@suse.cz>
1071         PR target/81616
1072         * params.def: New parameter PARAM_AVOID_FMA_MAX_BITS.
1073         * tree-ssa-math-opts.c: Include domwalk.h.
1074         (convert_mult_to_fma_1): New function.
1075         (fma_transformation_info): New type.
1076         (fma_deferring_state): Likewise.
1077         (cancel_fma_deferring): New function.
1078         (result_of_phi): Likewise.
1079         (last_fma_candidate_feeds_initial_phi): Likewise.
1080         (convert_mult_to_fma): Added deferring logic, split actual
1081         transformation to convert_mult_to_fma_1.
1082         (math_opts_dom_walker): New type.
1083         (math_opts_dom_walker::after_dom_children): New method, body moved
1084         here from pass_optimize_widening_mul::execute, added deferring logic
1085         bits.
1086         (pass_optimize_widening_mul::execute): Moved most of code to
1087         math_opts_dom_walker::after_dom_children.
1088         * config/i386/x86-tune.def (X86_TUNE_AVOID_128FMA_CHAINS): New.
1089         * config/i386/i386.c (ix86_option_override_internal): Added
1090         maybe_setting of PARAM_AVOID_FMA_MAX_BITS.
1092 2018-01-12  Richard Biener  <rguenther@suse.de>
1094         PR debug/83157
1095         * dwarf2out.c (gen_variable_die): Do not reset old_die for
1096         inline instance vars.
1098 2018-01-12  Oleg Endo  <olegendo@gcc.gnu.org>
1100         PR target/81819
1101         * config/rx/rx.c (rx_is_restricted_memory_address):
1102         Handle SUBREG case.
1104 2018-01-12  Richard Biener  <rguenther@suse.de>
1106         PR tree-optimization/80846
1107         * target.def (split_reduction): New target hook.
1108         * targhooks.c (default_split_reduction): New function.
1109         * targhooks.h (default_split_reduction): Declare.
1110         * tree-vect-loop.c (vect_create_epilog_for_reduction): If the
1111         target requests first reduce vectors by combining low and high
1112         parts.
1113         * tree-vect-stmts.c (vect_gen_perm_mask_any): Adjust.
1114         (get_vectype_for_scalar_type_and_size): Export.
1115         * tree-vectorizer.h (get_vectype_for_scalar_type_and_size): Declare.
1116         * doc/tm.texi.in (TARGET_VECTORIZE_SPLIT_REDUCTION): Document.
1117         * doc/tm.texi: Regenerate.
1118         * config/i386/i386.c (ix86_split_reduction): Implement
1119         TARGET_VECTORIZE_SPLIT_REDUCTION.
1121 2018-01-12  Eric Botcazou  <ebotcazou@adacore.com>
1123         PR target/83368
1124         * config/sparc/sparc.h (PIC_OFFSET_TABLE_REGNUM): Set to INVALID_REGNUM
1125         in PIC mode except for TARGET_VXWORKS_RTP.
1126         * config/sparc/sparc.c: Include cfgrtl.h.
1127         (TARGET_INIT_PIC_REG): Define.
1128         (TARGET_USE_PSEUDO_PIC_REG): Likewise.
1129         (sparc_pic_register_p): New predicate.
1130         (sparc_legitimate_address_p): Use it.
1131         (sparc_legitimize_pic_address): Likewise.
1132         (sparc_delegitimize_address): Likewise.
1133         (sparc_mode_dependent_address_p): Likewise.
1134         (gen_load_pcrel_sym): Remove 4th parameter.
1135         (load_got_register): Adjust call to above.  Remove obsolete stuff.
1136         (sparc_expand_prologue): Do not call load_got_register here.
1137         (sparc_flat_expand_prologue): Likewise.
1138         (sparc_output_mi_thunk): Set the pic_offset_table_rtx object.
1139         (sparc_use_pseudo_pic_reg): New function.
1140         (sparc_init_pic_reg): Likewise.
1141         * config/sparc/sparc.md (vxworks_load_got): Set the GOT register.
1142         (builtin_setjmp_receiver): Enable only for TARGET_VXWORKS_RTP.
1144 2018-01-12  Christophe Lyon  <christophe.lyon@linaro.org>
1146         * doc/sourcebuild.texi (Effective-Target Keywords, Other attributes):
1147         Add item for branch_cost.
1149 2018-01-12  Eric Botcazou  <ebotcazou@adacore.com>
1151         PR rtl-optimization/83565
1152         * rtlanal.c (nonzero_bits1): On WORD_REGISTER_OPERATIONS machines, do
1153         not extend the result to a larger mode for rotate operations.
1154         (num_sign_bit_copies1): Likewise.
1156 2018-01-12  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1158         PR target/40411
1159         * config/sol2.h (STARTFILE_ARCH_SPEC): Don't use with -shared or
1160         -symbolic.
1161         Use values-Xc.o for -pedantic.
1162         Link with values-xpg4.o for C90, values-xpg6.o otherwise.
1164 2018-01-12  Martin Liska  <mliska@suse.cz>
1166         PR ipa/83054
1167         * ipa-devirt.c (final_warning_record::grow_type_warnings):
1168         New function.
1169         (possible_polymorphic_call_targets): Use it.
1170         (ipa_devirt): Likewise.
1172 2018-01-12  Martin Liska  <mliska@suse.cz>
1174         * profile-count.h (enum profile_quality): Use 0 as invalid
1175         enum value of profile_quality.
1177 2018-01-12  Chung-Ju Wu  <jasonwucj@gmail.com>
1179         * doc/invoke.texi (NDS32 Options): Add -mext-perf, -mext-perf2 and
1180         -mext-string options.
1182 2018-01-12  Richard Biener  <rguenther@suse.de>
1184         * lto-streamer-out.c (DFS::DFS_write_tree_body): Process
1185         DECL_DEBUG_EXPR conditional on DECL_HAS_DEBUG_EXPR_P.
1186         * tree-streamer-in.c (lto_input_ts_decl_common_tree_pointers):
1187         Likewise.
1188         * tree-streamer-out.c (write_ts_decl_common_tree_pointers): Likewise.
1190 2018-01-11  Michael Meissner  <meissner@linux.vnet.ibm.com>
1192         * configure.ac (--with-long-double-format): Add support for the
1193         configuration option to change the default long double format on
1194         PowerPC systems.
1195         * config.gcc (powerpc*-linux*-*): Likewise.
1196         * configure: Regenerate.
1197         * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): If long
1198         double is IEEE, define __KC__ and __KF__ to allow floatn.h to be
1199         used without modification.
1201 2018-01-11  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
1203         * config/rs6000/rs6000-builtin.def (BU_P7_MISC_X): New #define.
1204         (SPEC_BARRIER): New instantiation of BU_P7_MISC_X.
1205         * config/rs6000/rs6000.c (rs6000_expand_builtin): Handle
1206         MISC_BUILTIN_SPEC_BARRIER.
1207         (rs6000_init_builtins): Likewise.
1208         * config/rs6000/rs6000.md (UNSPECV_SPEC_BARRIER): New UNSPECV
1209         enum value.
1210         (speculation_barrier): New define_insn.
1211         * doc/extend.texi: Document __builtin_speculation_barrier.
1213 2018-01-11  Jakub Jelinek  <jakub@redhat.com>
1215         PR target/83203
1216         * config/i386/i386.c (ix86_expand_vector_init_one_nonzero): If one_var
1217         is 0, for V{8,16}S[IF] and V[48]D[IF]mode use gen_vec_set<mode>_0.
1218         * config/i386/sse.md (VI8_AVX_AVX512F, VI4F_256_512): New mode
1219         iterators.
1220         (ssescalarmodesuffix): Add 512-bit vectors.  Use "d" or "q" for
1221         integral modes instead of "ss" and "sd".
1222         (vec_set<mode>_0): New define_insns for 256-bit and 512-bit
1223         vectors with 32-bit and 64-bit elements.
1224         (vecdupssescalarmodesuffix): New mode attribute.
1225         (vec_dup<mode>): Use it.
1227 2018-01-11  H.J. Lu  <hongjiu.lu@intel.com>
1229         PR target/83330
1230         * config/i386/i386.c (ix86_compute_frame_layout): Align stack
1231         frame if argument is passed on stack.
1233 2018-01-11  Jakub Jelinek  <jakub@redhat.com>
1235         PR target/82682
1236         * ree.c (combine_reaching_defs): Optimize also
1237         reg2=exp; reg1=reg2; reg2=any_extend(reg1); into
1238         reg2=any_extend(exp); reg1=reg2;, formatting fix.
1240 2018-01-11  Jan Hubicka  <hubicka@ucw.cz>
1242         PR middle-end/83189
1243         * gimple-ssa-isolate-paths.c (isolate_path): Fix profile update.
1245 2018-01-11  Jan Hubicka  <hubicka@ucw.cz>
1247         PR middle-end/83718
1248         * tree-inline.c (copy_cfg_body): Adjust num&den for scaling
1249         after they are computed.
1251 2018-01-11  Bin Cheng  <bin.cheng@arm.com>
1253         PR tree-optimization/83695
1254         * gimple-loop-linterchange.cc
1255         (tree_loop_interchange::interchange_loops): Call scev_reset_htab to
1256         reset cached scev information after interchange.
1257         (pass_linterchange::execute): Remove call to scev_reset_htab.
1259 2018-01-11  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
1261         * config/arm/arm_neon.h (vfmlal_lane_low_u32, vfmlal_lane_high_u32,
1262         vfmlalq_laneq_low_u32, vfmlalq_lane_low_u32, vfmlal_laneq_low_u32,
1263         vfmlalq_laneq_high_u32, vfmlalq_lane_high_u32, vfmlal_laneq_high_u32,
1264         vfmlsl_lane_low_u32, vfmlsl_lane_high_u32, vfmlslq_laneq_low_u32,
1265         vfmlslq_lane_low_u32, vfmlsl_laneq_low_u32, vfmlslq_laneq_high_u32,
1266         vfmlslq_lane_high_u32, vfmlsl_laneq_high_u32): Define.
1267         * config/arm/arm_neon_builtins.def (vfmal_lane_low,
1268         vfmal_lane_lowv4hf, vfmal_lane_lowv8hf, vfmal_lane_high,
1269         vfmal_lane_highv4hf, vfmal_lane_highv8hf, vfmsl_lane_low,
1270         vfmsl_lane_lowv4hf, vfmsl_lane_lowv8hf, vfmsl_lane_high,
1271         vfmsl_lane_highv4hf, vfmsl_lane_highv8hf): New sets of builtins.
1272         * config/arm/iterators.md (VFMLSEL2, vfmlsel2): New mode attributes.
1273         (V_lane_reg): Likewise.
1274         * config/arm/neon.md (neon_vfm<vfml_op>l_lane_<vfml_half><VCVTF:mode>):
1275         New define_expand.
1276         (neon_vfm<vfml_op>l_lane_<vfml_half><vfmlsel2><mode>): Likewise.
1277         (vfmal_lane_low<mode>_intrinsic,
1278         vfmal_lane_low<vfmlsel2><mode>_intrinsic,
1279         vfmal_lane_high<vfmlsel2><mode>_intrinsic,
1280         vfmal_lane_high<mode>_intrinsic, vfmsl_lane_low<mode>_intrinsic,
1281         vfmsl_lane_low<vfmlsel2><mode>_intrinsic,
1282         vfmsl_lane_high<vfmlsel2><mode>_intrinsic,
1283         vfmsl_lane_high<mode>_intrinsic): New define_insns.
1285 2018-01-11  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
1287         * config/arm/arm-cpus.in (fp16fml): New feature.
1288         (ALL_SIMD): Add fp16fml.
1289         (armv8.2-a): Add fp16fml as an option.
1290         (armv8.3-a): Likewise.
1291         (armv8.4-a): Add fp16fml as part of fp16.
1292         * config/arm/arm.h (TARGET_FP16FML): Define.
1293         * config/arm/arm-c.c (arm_cpu_builtins): Define __ARM_FEATURE_FP16_FML
1294         when appropriate.
1295         * config/arm/arm-modes.def (V2HF): Define.
1296         * config/arm/arm_neon.h (vfmlal_low_u32, vfmlsl_low_u32,
1297         vfmlal_high_u32, vfmlsl_high_u32, vfmlalq_low_u32,
1298         vfmlslq_low_u32, vfmlalq_high_u32, vfmlslq_high_u32): Define.
1299         * config/arm/arm_neon_builtins.def (vfmal_low, vfmal_high,
1300         vfmsl_low, vfmsl_high): New set of builtins.
1301         * config/arm/iterators.md (PLUSMINUS): New code iterator.
1302         (vfml_op): New code attribute.
1303         (VFMLHALVES): New int iterator.
1304         (VFML, VFMLSEL): New mode attributes.
1305         (V_reg): Define mapping for V2HF.
1306         (V_hi, V_lo): New mode attributes.
1307         (VF_constraint): Likewise.
1308         (vfml_half, vfml_half_selector): New int attributes.
1309         * config/arm/neon.md (neon_vfm<vfml_op>l_<vfml_half><mode>): New
1310         define_expand.
1311         (vfmal_low<mode>_intrinsic, vfmsl_high<mode>_intrinsic,
1312         vfmal_high<mode>_intrinsic, vfmsl_low<mode>_intrinsic):
1313         New define_insn.
1314         * config/arm/t-arm-elf (v8_fps): Add fp16fml.
1315         * config/arm/t-multilib (v8_2_a_simd_variants): Add fp16fml.
1316         * config/arm/unspecs.md (UNSPEC_VFML_LO, UNSPEC_VFML_HI): New unspecs.
1317         * doc/invoke.texi (ARM Options): Document fp16fml.  Update armv8.4-a
1318         documentation.
1319         * doc/sourcebuild.texi (arm_fp16fml_neon_ok, arm_fp16fml_neon):
1320         Document new effective target and option set.
1322 2017-01-11  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
1324         * config/arm/arm-cpus.in (armv8_4): New feature.
1325         (ARMv8_4a): New fgroup.
1326         (armv8.4-a): New arch.
1327         * config/arm/arm-tables.opt: Regenerate.
1328         * config/arm/t-aprofile: Add matching rules for -march=armv8.4-a.
1329         * config/arm/t-arm-elf (all_v8_archs): Add armv8.4-a.
1330         * config/arm/t-multilib (v8_4_a_simd_variants): New variable.
1331         Add matching rules for -march=armv8.4-a and extensions.
1332         * doc/invoke.texi (ARM Options): Document -march=armv8.4-a.
1334 2018-01-11  Oleg Endo  <olegendo@gcc.gnu.org>
1336         PR target/81821
1337         * config/rx/rx.md (BW): New mode attribute.
1338         (sync_lock_test_and_setsi): Add mode suffix to insn output.
1340 2018-01-11  Richard Biener  <rguenther@suse.de>
1342         PR tree-optimization/83435
1343         * graphite.c (canonicalize_loop_form): Ignore fake loop exit edges.
1344         * graphite-scop-detection.c (scop_detection::get_sese): Likewise.
1345         * tree-vrp.c (add_assert_info): Drop TREE_OVERFLOW if they appear.
1347 2018-01-11  Richard Sandiford  <richard.sandiford@linaro.org>
1348             Alan Hayward  <alan.hayward@arm.com>
1349             David Sherwood  <david.sherwood@arm.com>
1351         * config/aarch64/aarch64.c (aarch64_address_info): Add a const_offset
1352         field.
1353         (aarch64_classify_address): Initialize it.  Track polynomial offsets.
1354         (aarch64_print_address_internal): Use it to check for a zero offset.
1356 2018-01-11  Richard Sandiford  <richard.sandiford@linaro.org>
1357             Alan Hayward  <alan.hayward@arm.com>
1358             David Sherwood  <david.sherwood@arm.com>
1360         * config/aarch64/aarch64-modes.def (NUM_POLY_INT_COEFFS): Set to 2.
1361         * config/aarch64/aarch64-protos.h (aarch64_initial_elimination_offset):
1362         Return a poly_int64 rather than a HOST_WIDE_INT.
1363         (aarch64_offset_7bit_signed_scaled_p): Take the offset as a poly_int64
1364         rather than a HOST_WIDE_INT.
1365         * config/aarch64/aarch64.h (aarch64_frame): Protect with
1366         HAVE_POLY_INT_H rather than HOST_WIDE_INT.  Change locals_offset,
1367         hard_fp_offset, frame_size, initial_adjust, callee_offset and
1368         final_offset from HOST_WIDE_INT to poly_int64.
1369         * config/aarch64/aarch64-builtins.c (aarch64_simd_expand_args): Use
1370         to_constant when getting the number of units in an Advanced SIMD
1371         mode.
1372         (aarch64_builtin_vectorized_function): Check for a constant number
1373         of units.
1374         * config/aarch64/aarch64-simd.md (mov<mode>): Handle polynomial
1375         GET_MODE_SIZE.
1376         (aarch64_ld<VSTRUCT:nregs>_lane<VALLDIF:mode>): Use the nunits
1377         attribute instead of GET_MODE_NUNITS.
1378         * config/aarch64/aarch64.c (aarch64_hard_regno_nregs)
1379         (aarch64_class_max_nregs): Use the constant_lowest_bound of the
1380         GET_MODE_SIZE for fixed-size registers.
1381         (aarch64_const_vec_all_same_in_range_p): Use const_vec_duplicate_p.
1382         (aarch64_hard_regno_call_part_clobbered, aarch64_classify_index)
1383         (aarch64_mode_valid_for_sched_fusion_p, aarch64_classify_address)
1384         (aarch64_legitimize_address_displacement, aarch64_secondary_reload)
1385         (aarch64_print_operand, aarch64_print_address_internal)
1386         (aarch64_address_cost, aarch64_rtx_costs, aarch64_register_move_cost)
1387         (aarch64_short_vector_p, aapcs_vfp_sub_candidate)
1388         (aarch64_simd_attr_length_rglist, aarch64_operands_ok_for_ldpstp):
1389         Handle polynomial GET_MODE_SIZE.
1390         (aarch64_hard_regno_caller_save_mode): Likewise.  Return modes
1391         wider than SImode without modification.
1392         (tls_symbolic_operand_type): Use strip_offset instead of split_const.
1393         (aarch64_pass_by_reference, aarch64_layout_arg, aarch64_pad_reg_upward)
1394         (aarch64_gimplify_va_arg_expr): Assert that we don't yet handle
1395         passing and returning SVE modes.
1396         (aarch64_function_value, aarch64_layout_arg): Use gen_int_mode
1397         rather than GEN_INT.
1398         (aarch64_emit_probe_stack_range): Take the size as a poly_int64
1399         rather than a HOST_WIDE_INT, but call sorry if it isn't constant.
1400         (aarch64_allocate_and_probe_stack_space): Likewise.
1401         (aarch64_layout_frame): Cope with polynomial offsets.
1402         (aarch64_save_callee_saves, aarch64_restore_callee_saves): Take the
1403         start_offset as a poly_int64 rather than a HOST_WIDE_INT.  Track
1404         polynomial offsets.
1405         (offset_9bit_signed_unscaled_p, offset_12bit_unsigned_scaled_p)
1406         (aarch64_offset_7bit_signed_scaled_p): Take the offset as a
1407         poly_int64 rather than a HOST_WIDE_INT.
1408         (aarch64_get_separate_components, aarch64_process_components)
1409         (aarch64_expand_prologue, aarch64_expand_epilogue)
1410         (aarch64_use_return_insn_p): Handle polynomial frame offsets.
1411         (aarch64_anchor_offset): New function, split out from...
1412         (aarch64_legitimize_address): ...here.
1413         (aarch64_builtin_vectorization_cost): Handle polynomial
1414         TYPE_VECTOR_SUBPARTS.
1415         (aarch64_simd_check_vect_par_cnst_half): Handle polynomial
1416         GET_MODE_NUNITS.
1417         (aarch64_simd_make_constant, aarch64_expand_vector_init): Get the
1418         number of elements from the PARALLEL rather than the mode.
1419         (aarch64_shift_truncation_mask): Use GET_MODE_UNIT_BITSIZE
1420         rather than GET_MODE_BITSIZE.
1421         (aarch64_evpc_trn, aarch64_evpc_uzp, aarch64_evpc_ext)
1422         (aarch64_evpc_rev, aarch64_evpc_dup, aarch64_evpc_zip)
1423         (aarch64_expand_vec_perm_const_1): Handle polynomial
1424         d->perm.length () and d->perm elements.
1425         (aarch64_evpc_tbl): Likewise.  Use nelt rather than GET_MODE_NUNITS.
1426         Apply to_constant to d->perm elements.
1427         (aarch64_simd_valid_immediate, aarch64_vec_fpconst_pow_of_2): Handle
1428         polynomial CONST_VECTOR_NUNITS.
1429         (aarch64_move_pointer): Take amount as a poly_int64 rather
1430         than an int.
1431         (aarch64_progress_pointer): Avoid temporary variable.
1432         * config/aarch64/aarch64.md (aarch64_<crc_variant>): Use
1433         the mode attribute instead of GET_MODE.
1435 2018-01-11  Richard Sandiford  <richard.sandiford@linaro.org>
1436             Alan Hayward  <alan.hayward@arm.com>
1437             David Sherwood  <david.sherwood@arm.com>
1439         * config/aarch64/aarch64.c (aarch64_force_temporary): Assert that
1440         x exists before using it.
1441         (aarch64_add_constant_internal): Rename to...
1442         (aarch64_add_offset_1): ...this.  Replace regnum with separate
1443         src and dest rtxes.  Handle the case in which they're different,
1444         including when the offset is zero.  Replace scratchreg with an rtx.
1445         Use 2 additions if there is no spare register into which we can
1446         move a 16-bit constant.
1447         (aarch64_add_constant): Delete.
1448         (aarch64_add_offset): Replace reg with separate src and dest
1449         rtxes.  Take a poly_int64 offset instead of a HOST_WIDE_INT.
1450         Use aarch64_add_offset_1.
1451         (aarch64_add_sp, aarch64_sub_sp): Take the scratch register as
1452         an rtx rather than an int.  Take the delta as a poly_int64
1453         rather than a HOST_WIDE_INT.  Use aarch64_add_offset.
1454         (aarch64_expand_mov_immediate): Update uses of aarch64_add_offset.
1455         (aarch64_expand_prologue): Update calls to aarch64_sub_sp,
1456         aarch64_allocate_and_probe_stack_space and aarch64_add_offset.
1457         (aarch64_expand_epilogue): Update calls to aarch64_add_offset
1458         and aarch64_add_sp.
1459         (aarch64_output_mi_thunk): Use aarch64_add_offset rather than
1460         aarch64_add_constant.
1462 2018-01-11  Richard Sandiford  <richard.sandiford@linaro.org>
1464         * config/aarch64/aarch64.c (aarch64_reinterpret_float_as_int):
1465         Use scalar_float_mode.
1467 2018-01-11  Richard Sandiford  <richard.sandiford@linaro.org>
1469         * config/aarch64/aarch64-simd.md
1470         (aarch64_fml<f16mac1>l<f16quad>_low<mode>): Avoid GET_MODE_NUNITS.
1471         (aarch64_fml<f16mac1>l<f16quad>_high<mode>): Likewise.
1472         (aarch64_fml<f16mac1>l_lane_lowv2sf): Likewise.
1473         (aarch64_fml<f16mac1>l_lane_highv2sf): Likewise.
1474         (aarch64_fml<f16mac1>lq_laneq_lowv4sf): Likewise.
1475         (aarch64_fml<f16mac1>lq_laneq_highv4sf): Likewise.
1476         (aarch64_fml<f16mac1>l_laneq_lowv2sf): Likewise.
1477         (aarch64_fml<f16mac1>l_laneq_highv2sf): Likewise.
1478         (aarch64_fml<f16mac1>lq_lane_lowv4sf): Likewise.
1479         (aarch64_fml<f16mac1>lq_lane_highv4sf): Likewise.
1481 2018-01-11  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
1483         PR target/83514
1484         * config/arm/arm.c (arm_declare_function_name): Set arch_to_print if
1485         targ_options->x_arm_arch_string is non NULL.
1487 2018-01-11  Tamar Christina  <tamar.christina@arm.com>
1489         * config/aarch64/aarch64.h
1490         (AARCH64_FL_FOR_ARCH8_4): Add  AARCH64_FL_DOTPROD.
1492 2018-01-11  Sudakshina Das  <sudi.das@arm.com>
1494         PR target/82096
1495         * expmed.c (emit_store_flag_force): Swap if const op0
1496         and change VOIDmode to mode of op0.
1498 2018-01-11  Richard Sandiford  <richard.sandiford@linaro.org>
1500         PR rtl-optimization/83761
1501         * caller-save.c (replace_reg_with_saved_mem): Pass bits rather
1502         than bytes to mode_for_size.
1504 2018-01-10  Jan Hubicka  <hubicka@ucw.cz>
1506         PR middle-end/83189
1507         * gfortran.fortran-torture/compile/pr83189.f90: New testcase.
1508         * tree-ssa-loop-manip.c (tree_transform_and_unroll_loop): Handle zero
1509         profile.
1511 2018-01-10  Jan Hubicka  <hubicka@ucw.cz>
1513         PR middle-end/83575
1514         * cfgrtl.c (rtl_verify_edges): Only verify fixability of partition
1515         when in layout mode.
1516         (cfg_layout_finalize): Do not verify cfg before we are out of layout.
1517         * cfgcleanup.c (try_optimize_cfg): Only verify flow info when doing
1518         partition fixup.
1520 2018-01-10  Michael Collison  <michael.collison@arm.com>
1522         * config/aarch64/aarch64-modes.def (V2HF): New VECTOR_MODE.
1523         * config/aarch64/aarch64-option-extension.def: Add
1524         AARCH64_OPT_EXTENSION of 'fp16fml'.
1525         * config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins):
1526         (__ARM_FEATURE_FP16_FML): Define if TARGET_F16FML is true.
1527         * config/aarch64/predicates.md (aarch64_lane_imm3): New predicate.
1528         * config/aarch64/constraints.md (Ui7): New constraint.
1529         * config/aarch64/iterators.md (VFMLA_W): New mode iterator.
1530         (VFMLA_SEL_W): Ditto.
1531         (f16quad): Ditto.
1532         (f16mac1): Ditto.
1533         (VFMLA16_LOW): New int iterator.
1534         (VFMLA16_HIGH): Ditto.
1535         (UNSPEC_FMLAL): New unspec.
1536         (UNSPEC_FMLSL): Ditto.
1537         (UNSPEC_FMLAL2): Ditto.
1538         (UNSPEC_FMLSL2): Ditto.
1539         (f16mac): New code attribute.
1540         * config/aarch64/aarch64-simd-builtins.def
1541         (aarch64_fmlal_lowv2sf): Ditto.
1542         (aarch64_fmlsl_lowv2sf): Ditto.
1543         (aarch64_fmlalq_lowv4sf): Ditto.
1544         (aarch64_fmlslq_lowv4sf): Ditto.
1545         (aarch64_fmlal_highv2sf): Ditto.
1546         (aarch64_fmlsl_highv2sf): Ditto.
1547         (aarch64_fmlalq_highv4sf): Ditto.
1548         (aarch64_fmlslq_highv4sf): Ditto.
1549         (aarch64_fmlal_lane_lowv2sf): Ditto.
1550         (aarch64_fmlsl_lane_lowv2sf): Ditto.
1551         (aarch64_fmlal_laneq_lowv2sf): Ditto.
1552         (aarch64_fmlsl_laneq_lowv2sf): Ditto.
1553         (aarch64_fmlalq_lane_lowv4sf): Ditto.
1554         (aarch64_fmlsl_lane_lowv4sf): Ditto.
1555         (aarch64_fmlalq_laneq_lowv4sf): Ditto.
1556         (aarch64_fmlsl_laneq_lowv4sf): Ditto.
1557         (aarch64_fmlal_lane_highv2sf): Ditto.
1558         (aarch64_fmlsl_lane_highv2sf): Ditto.
1559         (aarch64_fmlal_laneq_highv2sf): Ditto.
1560         (aarch64_fmlsl_laneq_highv2sf): Ditto.
1561         (aarch64_fmlalq_lane_highv4sf): Ditto.
1562         (aarch64_fmlsl_lane_highv4sf): Ditto.
1563         (aarch64_fmlalq_laneq_highv4sf): Ditto.
1564         (aarch64_fmlsl_laneq_highv4sf): Ditto.
1565         * config/aarch64/aarch64-simd.md:
1566         (aarch64_fml<f16mac1>l<f16quad>_low<mode>): New pattern.
1567         (aarch64_fml<f16mac1>l<f16quad>_high<mode>): Ditto.
1568         (aarch64_simd_fml<f16mac1>l<f16quad>_low<mode>): Ditto.
1569         (aarch64_simd_fml<f16mac1>l<f16quad>_high<mode>): Ditto.
1570         (aarch64_fml<f16mac1>l_lane_lowv2sf): Ditto.
1571         (aarch64_fml<f16mac1>l_lane_highv2sf): Ditto.
1572         (aarch64_simd_fml<f16mac>l_lane_lowv2sf): Ditto.
1573         (aarch64_simd_fml<f16mac>l_lane_highv2sf): Ditto.
1574         (aarch64_fml<f16mac1>lq_laneq_lowv4sf): Ditto.
1575         (aarch64_fml<f16mac1>lq_laneq_highv4sf): Ditto.
1576         (aarch64_simd_fml<f16mac>lq_laneq_lowv4sf): Ditto.
1577         (aarch64_simd_fml<f16mac>lq_laneq_highv4sf): Ditto.
1578         (aarch64_fml<f16mac1>l_laneq_lowv2sf): Ditto.
1579         (aarch64_fml<f16mac1>l_laneq_highv2sf): Ditto.
1580         (aarch64_simd_fml<f16mac>l_laneq_lowv2sf): Ditto.
1581         (aarch64_simd_fml<f16mac>l_laneq_highv2sf): Ditto.
1582         (aarch64_fml<f16mac1>lq_lane_lowv4sf): Ditto.
1583         (aarch64_fml<f16mac1>lq_lane_highv4sf): Ditto.
1584         (aarch64_simd_fml<f16mac>lq_lane_lowv4sf): Ditto.
1585         (aarch64_simd_fml<f16mac>lq_lane_highv4sf): Ditto.
1586         * config/aarch64/arm_neon.h (vfmlal_low_u32): New intrinsic.
1587         (vfmlsl_low_u32): Ditto.
1588         (vfmlalq_low_u32): Ditto.
1589         (vfmlslq_low_u32): Ditto.
1590         (vfmlal_high_u32): Ditto.
1591         (vfmlsl_high_u32): Ditto.
1592         (vfmlalq_high_u32): Ditto.
1593         (vfmlslq_high_u32): Ditto.
1594         (vfmlal_lane_low_u32): Ditto.
1595         (vfmlsl_lane_low_u32): Ditto.
1596         (vfmlal_laneq_low_u32): Ditto.
1597         (vfmlsl_laneq_low_u32): Ditto.
1598         (vfmlalq_lane_low_u32): Ditto.
1599         (vfmlslq_lane_low_u32): Ditto.
1600         (vfmlalq_laneq_low_u32): Ditto.
1601         (vfmlslq_laneq_low_u32): Ditto.
1602         (vfmlal_lane_high_u32): Ditto.
1603         (vfmlsl_lane_high_u32): Ditto.
1604         (vfmlal_laneq_high_u32): Ditto.
1605         (vfmlsl_laneq_high_u32): Ditto.
1606         (vfmlalq_lane_high_u32): Ditto.
1607         (vfmlslq_lane_high_u32): Ditto.
1608         (vfmlalq_laneq_high_u32): Ditto.
1609         (vfmlslq_laneq_high_u32): Ditto.
1610         * config/aarch64/aarch64.h (AARCH64_FL_F16SML): New flag.
1611         (AARCH64_FL_FOR_ARCH8_4): New.
1612         (AARCH64_ISA_F16FML): New ISA flag.
1613         (TARGET_F16FML): New feature flag for fp16fml.
1614         (doc/invoke.texi): Document new fp16fml option.
1616 2018-01-10  Michael Collison  <michael.collison@arm.com>
1618         * config/aarch64/aarch64-builtins.c:
1619         (aarch64_types_ternopu_imm_qualifiers, TYPES_TERNOPUI): New.
1620         * config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins):
1621         (__ARM_FEATURE_SHA3): Define if TARGET_SHA3 is true.
1622         * config/aarch64/aarch64.h (AARCH64_FL_SHA3): New flags.
1623         (AARCH64_ISA_SHA3): New ISA flag.
1624         (TARGET_SHA3): New feature flag for sha3.
1625         * config/aarch64/iterators.md (sha512_op): New int attribute.
1626         (CRYPTO_SHA512): New int iterator.
1627         (UNSPEC_SHA512H): New unspec.
1628         (UNSPEC_SHA512H2): Ditto.
1629         (UNSPEC_SHA512SU0): Ditto.
1630         (UNSPEC_SHA512SU1): Ditto.
1631         * config/aarch64/aarch64-simd-builtins.def
1632         (aarch64_crypto_sha512hqv2di): New builtin.
1633         (aarch64_crypto_sha512h2qv2di): Ditto.
1634         (aarch64_crypto_sha512su0qv2di): Ditto.
1635         (aarch64_crypto_sha512su1qv2di): Ditto.
1636         (aarch64_eor3qv8hi): Ditto.
1637         (aarch64_rax1qv2di): Ditto.
1638         (aarch64_xarqv2di): Ditto.
1639         (aarch64_bcaxqv8hi): Ditto.
1640         * config/aarch64/aarch64-simd.md:
1641         (aarch64_crypto_sha512h<sha512_op>qv2di): New pattern.
1642         (aarch64_crypto_sha512su0qv2di): Ditto.
1643         (aarch64_crypto_sha512su1qv2di): Ditto.
1644         (aarch64_eor3qv8hi): Ditto.
1645         (aarch64_rax1qv2di): Ditto.
1646         (aarch64_xarqv2di): Ditto.
1647         (aarch64_bcaxqv8hi): Ditto.
1648         * config/aarch64/arm_neon.h (vsha512hq_u64): New intrinsic.
1649         (vsha512h2q_u64): Ditto.
1650         (vsha512su0q_u64): Ditto.
1651         (vsha512su1q_u64): Ditto.
1652         (veor3q_u16): Ditto.
1653         (vrax1q_u64): Ditto.
1654         (vxarq_u64): Ditto.
1655         (vbcaxq_u16): Ditto.
1656         * config/arm/types.md (crypto_sha512): New type attribute.
1657         (crypto_sha3): Ditto.
1658         (doc/invoke.texi): Document new sha3 option.
1660 2018-01-10  Michael Collison  <michael.collison@arm.com>
1662         * config/aarch64/aarch64-builtins.c:
1663         (aarch64_types_quadopu_imm_qualifiers, TYPES_QUADOPUI): New.
1664         * config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins):
1665         (__ARM_FEATURE_SM3): Define if TARGET_SM4 is true.
1666         (__ARM_FEATURE_SM4): Define if TARGET_SM4 is true.
1667         * config/aarch64/aarch64.h (AARCH64_FL_SM4): New flags.
1668         (AARCH64_ISA_SM4): New ISA flag.
1669         (TARGET_SM4): New feature flag for sm4.
1670         * config/aarch64/aarch64-simd-builtins.def
1671         (aarch64_sm3ss1qv4si): Ditto.
1672         (aarch64_sm3tt1aq4si): Ditto.
1673         (aarch64_sm3tt1bq4si): Ditto.
1674         (aarch64_sm3tt2aq4si): Ditto.
1675         (aarch64_sm3tt2bq4si): Ditto.
1676         (aarch64_sm3partw1qv4si): Ditto.
1677         (aarch64_sm3partw2qv4si): Ditto.
1678         (aarch64_sm4eqv4si): Ditto.
1679         (aarch64_sm4ekeyqv4si): Ditto.
1680         * config/aarch64/aarch64-simd.md:
1681         (aarch64_sm3ss1qv4si): Ditto.
1682         (aarch64_sm3tt<sm3tt_op>qv4si): Ditto.
1683         (aarch64_sm3partw<sm3part_op>qv4si): Ditto.
1684         (aarch64_sm4eqv4si): Ditto.
1685         (aarch64_sm4ekeyqv4si): Ditto.
1686         * config/aarch64/iterators.md (sm3tt_op): New int iterator.
1687         (sm3part_op): Ditto.
1688         (CRYPTO_SM3TT): Ditto.
1689         (CRYPTO_SM3PART): Ditto.
1690         (UNSPEC_SM3SS1): New unspec.
1691         (UNSPEC_SM3TT1A): Ditto.
1692         (UNSPEC_SM3TT1B): Ditto.
1693         (UNSPEC_SM3TT2A): Ditto.
1694         (UNSPEC_SM3TT2B): Ditto.
1695         (UNSPEC_SM3PARTW1): Ditto.
1696         (UNSPEC_SM3PARTW2): Ditto.
1697         (UNSPEC_SM4E): Ditto.
1698         (UNSPEC_SM4EKEY): Ditto.
1699         * config/aarch64/constraints.md (Ui2): New constraint.
1700         * config/aarch64/predicates.md (aarch64_imm2): New predicate.
1701         * config/arm/types.md (crypto_sm3): New type attribute.
1702         (crypto_sm4): Ditto.
1703         * config/aarch64/arm_neon.h (vsm3ss1q_u32): New intrinsic.
1704         (vsm3tt1aq_u32): Ditto.
1705         (vsm3tt1bq_u32): Ditto.
1706         (vsm3tt2aq_u32): Ditto.
1707         (vsm3tt2bq_u32): Ditto.
1708         (vsm3partw1q_u32): Ditto.
1709         (vsm3partw2q_u32): Ditto.
1710         (vsm4eq_u32): Ditto.
1711         (vsm4ekeyq_u32): Ditto.
1712         (doc/invoke.texi): Document new sm4 option.
1714 2018-01-10  Michael Collison  <michael.collison@arm.com>
1716         * config/aarch64/aarch64-arches.def (armv8.4-a): New architecture.
1717         * config/aarch64/aarch64.h (AARCH64_ISA_V8_4): New ISA flag.
1718         (AARCH64_FL_FOR_ARCH8_4): New.
1719         (AARCH64_FL_V8_4): New flag.
1720         (doc/invoke.texi): Document new armv8.4-a option.
1722 2018-01-10  Michael Collison  <michael.collison@arm.com>
1724         * config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins):
1725         (__ARM_FEATURE_AES): Define if TARGET_AES is true.
1726         (__ARM_FEATURE_SHA2): Define if TARGET_SHA2 is true.
1727         * config/aarch64/aarch64-option-extension.def: Add
1728         AARCH64_OPT_EXTENSION of 'sha2'.
1729         (aes): Add AARCH64_OPT_EXTENSION of 'aes'.
1730         (crypto): Disable sha2 and aes if crypto disabled.
1731         (crypto): Enable aes and sha2 if enabled.
1732         (simd): Disable sha2 and aes if simd disabled.
1733         * config/aarch64/aarch64.h (AARCH64_FL_AES, AARCH64_FL_SHA2):
1734         New flags.
1735         (AARCH64_ISA_AES, AARCH64_ISA_SHA2): New ISA flags.
1736         (TARGET_SHA2): New feature flag for sha2.
1737         (TARGET_AES): New feature flag for aes.
1738         * config/aarch64/aarch64-simd.md:
1739         (aarch64_crypto_aes<aes_op>v16qi): Make pattern
1740         conditional on TARGET_AES.
1741         (aarch64_crypto_aes<aesmc_op>v16qi): Ditto.
1742         (aarch64_crypto_sha1hsi): Make pattern conditional
1743         on TARGET_SHA2.
1744         (aarch64_crypto_sha1hv4si): Ditto.
1745         (aarch64_be_crypto_sha1hv4si): Ditto.
1746         (aarch64_crypto_sha1su1v4si): Ditto.
1747         (aarch64_crypto_sha1<sha1_op>v4si): Ditto.
1748         (aarch64_crypto_sha1su0v4si): Ditto.
1749         (aarch64_crypto_sha256h<sha256_op>v4si): Ditto.
1750         (aarch64_crypto_sha256su0v4si): Ditto.
1751         (aarch64_crypto_sha256su1v4si): Ditto.
1752         (doc/invoke.texi): Document new aes and sha2 options.
1754 2018-01-10  Martin Sebor  <msebor@redhat.com>
1756         PR tree-optimization/83781
1757         * gimple-fold.c (get_range_strlen): Avoid treating arrays of pointers
1758         as string arrays.
1760 2018-01-11  Martin Sebor  <msebor@gmail.com>
1761             Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
1763         PR tree-optimization/83501
1764         PR tree-optimization/81703
1766         * tree-ssa-strlen.c (get_string_cst): Rename...
1767         (get_string_len): ...to this.  Handle global constants.
1768         (handle_char_store): Adjust.
1770 2018-01-10  Kito Cheng  <kito.cheng@gmail.com>
1771             Jim Wilson  <jimw@sifive.com>
1773         * config/riscv/riscv-protos.h (riscv_output_return): New.
1774         * config/riscv/riscv.c (struct machine_function): New naked_p field.
1775         (riscv_attribute_table, riscv_output_return),
1776         (riscv_handle_fndecl_attribute, riscv_naked_function_p),
1777         (riscv_allocate_stack_slots_for_args, riscv_warn_func_return): New.
1778         (riscv_compute_frame_info): Only compute frame->mask if not a naked
1779         function.
1780         (riscv_expand_prologue): Add early return for naked function.
1781         (riscv_expand_epilogue): Likewise.
1782         (riscv_function_ok_for_sibcall): Return false for naked function.
1783         (riscv_set_current_function): New.
1784         (TARGET_SET_CURRENT_FUNCTION, TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS),
1785         (TARGET_ATTRIBUTE_TABLE, TARGET_WARN_FUNC_RETURN): New.
1786         * config/riscv/riscv.md (simple_return): Call riscv_output_return.
1787         * doc/extend.texi (RISC-V Function Attributes): New.
1789 2018-01-10  Michael Meissner  <meissner@linux.vnet.ibm.com>
1791         * config/rs6000/rs6000.c (is_complex_IBM_long_double): Explicitly
1792         check for 128-bit long double before checking TCmode.
1793         * config/rs6000/rs6000.h (FLOAT128_IEEE_P): Explicitly check for
1794         128-bit long doubles before checking TFmode or TCmode.
1795         (FLOAT128_IBM_P): Likewise.
1797 2018-01-10  Martin Sebor  <msebor@redhat.com>
1799         PR tree-optimization/83671
1800         * builtins.c (c_strlen): Unconditionally return zero for the empty
1801         string.
1802         Use -Warray-bounds for warnings.
1803         * gimple-fold.c (get_range_strlen): Handle non-constant lengths
1804         for non-constant array indices with COMPONENT_REF, arrays of
1805         arrays, and pointers to arrays.
1806         (gimple_fold_builtin_strlen): Determine and set length range for
1807         non-constant character arrays.
1809 2018-01-10  Aldy Hernandez  <aldyh@redhat.com>
1811         PR middle-end/81897
1812         * tree-ssa-uninit.c (convert_control_dep_chain_into_preds): Skip
1813         empty blocks.
1815 2018-01-10  Eric Botcazou  <ebotcazou@adacore.com>
1817         * dwarf2out.c (dwarf2out_var_location): Do not pass NULL to fprintf.
1819 2018-01-10  Peter Bergner  <bergner@vnet.ibm.com>
1821         PR target/83399
1822         * config/rs6000/rs6000.c (print_operand) <'y'>: Use
1823         VECTOR_MEM_ALTIVEC_OR_VSX_P.
1824         * config/rs6000/vsx.md (*vsx_le_perm_load_<mode> for VSX_D): Use
1825         indexed_or_indirect_operand predicate.
1826         (*vsx_le_perm_load_<mode> for VSX_W): Likewise.
1827         (*vsx_le_perm_load_v8hi): Likewise.
1828         (*vsx_le_perm_load_v16qi): Likewise.
1829         (*vsx_le_perm_store_<mode> for VSX_D): Likewise.
1830         (*vsx_le_perm_store_<mode> for VSX_W): Likewise.
1831         (*vsx_le_perm_store_v8hi): Likewise.
1832         (*vsx_le_perm_store_v16qi): Likewise.
1833         (eight unnamed splitters): Likewise.
1835 2018-01-10  Peter Bergner  <bergner@vnet.ibm.com>
1837         * config/rs6000/x86intrin.h: Change #warning to #error. Update message.
1838         * config/rs6000/emmintrin.h: Likewise.
1839         * config/rs6000/mmintrin.h: Likewise.
1840         * config/rs6000/xmmintrin.h: Likewise.
1842 2018-01-10  David Malcolm  <dmalcolm@redhat.com>
1844         PR c++/43486
1845         * tree-core.h: Document EXPR_LOCATION_WRAPPER_P's usage of
1846         "public_flag".
1847         * tree.c (tree_nop_conversion): Return true for location wrapper
1848         nodes.
1849         (maybe_wrap_with_location): New function.
1850         (selftest::check_strip_nops): New function.
1851         (selftest::test_location_wrappers): New function.
1852         (selftest::tree_c_tests): Call it.
1853         * tree.h (STRIP_ANY_LOCATION_WRAPPER): New macro.
1854         (maybe_wrap_with_location): New decl.
1855         (EXPR_LOCATION_WRAPPER_P): New macro.
1856         (location_wrapper_p): New inline function.
1857         (tree_strip_any_location_wrapper): New inline function.
1859 2018-01-10  H.J. Lu  <hongjiu.lu@intel.com>
1861         PR target/83735
1862         * config/i386/i386.c (ix86_compute_frame_layout): Always adjust
1863         stack_realign_offset for the largest alignment of stack slot
1864         actually used.
1865         (ix86_find_max_used_stack_alignment): New function.
1866         (ix86_finalize_stack_frame_flags): Use it.  Set
1867         max_used_stack_alignment if we don't realign stack.
1868         * config/i386/i386.h (machine_function): Add
1869         max_used_stack_alignment.
1871 2018-01-10  Christophe Lyon  <christophe.lyon@linaro.org>
1873         * config/arm/arm.opt (-mbranch-cost): New option.
1874         * config/arm/arm.h (BRANCH_COST): Take arm_branch_cost into
1875         account.
1877 2018-01-10  Segher Boessenkool  <segher@kernel.crashing.org>
1879         PR target/83629
1880         * config/rs6000/rs6000.md (load_toc_v4_PIC_2, load_toc_v4_PIC_3b,
1881         load_toc_v4_PIC_3c): Wrap const term in CONST RTL.
1883 2018-01-10  Richard Biener  <rguenther@suse.de>
1885         PR debug/83765
1886         * dwarf2out.c (gen_subprogram_die): Hoist old_die && declaration
1887         early out so it also covers the case where we have a non-NULL
1888         origin.
1890 2018-01-10  Richard Sandiford  <richard.sandiford@linaro.org>
1892         PR tree-optimization/83753
1893         * tree-vect-stmts.c (get_group_load_store_type): Use VMAT_CONTIGUOUS
1894         for non-strided grouped accesses if the number of elements is 1.
1896 2018-01-10  Jan Hubicka  <hubicka@ucw.cz>
1898         PR target/81616
1899         * i386.c (ix86_vectorize_builtin_gather): Check TARGET_USE_GATHER.
1900         * i386.h (TARGET_USE_GATHER): Define.
1901         * x86-tune.def (X86_TUNE_USE_GATHER): New.
1903 2018-01-10  Martin Liska  <mliska@suse.cz>
1905         PR bootstrap/82831
1906         * basic-block.h (CLEANUP_NO_PARTITIONING): New define.
1907         * bb-reorder.c (pass_reorder_blocks::execute): Do not clean up
1908         partitioning.
1909         * cfgcleanup.c (try_optimize_cfg): Fix up partitioning if
1910         CLEANUP_NO_PARTITIONING is not set.
1912 2018-01-10  Richard Sandiford  <richard.sandiford@linaro.org>
1914         * doc/rtl.texi: Remove documentation of (const ...) wrappers
1915         for vectors, as a partial revert of r254296.
1916         * rtl.h (const_vec_p): Delete.
1917         (const_vec_duplicate_p): Don't test for vector CONSTs.
1918         (unwrap_const_vec_duplicate, const_vec_series_p): Likewise.
1919         * expmed.c (make_tree): Likewise.
1921         Revert:
1922         * common.md (E, F): Use CONSTANT_P instead of checking for
1923         CONST_VECTOR.
1924         * emit-rtl.c (gen_lowpart_common): Use const_vec_p instead of
1925         checking for CONST_VECTOR.
1927 2018-01-09  Jan Hubicka  <hubicka@ucw.cz>
1929         PR middle-end/83575
1930         * predict.c (force_edge_cold): Handle in more sane way edges
1931         with no prediction.
1933 2018-01-09  Carl Love  <cel@us.ibm.com>
1935         * config/rs6002/altivec.md (p8_vmrgow): Add support for V2DI, V2DF,
1936         V4SI, V4SF types.
1937         (p8_vmrgew): Add support for V2DI, V2DF, V4SF types.
1938         * config/rs6000/rs6000-builtin.def: Add definitions for FLOAT2_V2DF,
1939         VMRGEW_V2DI, VMRGEW_V2DF, VMRGEW_V4SF, VMRGOW_V4SI, VMRGOW_V4SF,
1940         VMRGOW_V2DI, VMRGOW_V2DF.  Remove definition for VMRGOW.
1941         * config/rs6000/rs6000-c.c (VSX_BUILTIN_VEC_FLOAT2,
1942         P8V_BUILTIN_VEC_VMRGEW, P8V_BUILTIN_VEC_VMRGOW):  Add definitions.
1943         * config/rs6000/rs6000-protos.h: Add extern defition for
1944         rs6000_generate_float2_double_code.
1945         * config/rs6000/rs6000.c (rs6000_generate_float2_double_code): Add
1946         function.
1947         * config/rs6000/vsx.md (vsx_xvcdpsp): Add define_insn.
1948         (float2_v2df): Add define_expand.
1950 2018-01-09  Uros Bizjak  <ubizjak@gmail.com>
1952         PR target/83628
1953         * combine.c (force_int_to_mode) <case ASHIFT>: Use mode instead of
1954         op_mode in the force_to_mode call.
1956 2018-01-09  Richard Sandiford  <richard.sandiford@linaro.org>
1958         * config/aarch64/aarch64.c (aarch64_evpc_trn): Use d.perm.series_p
1959         instead of checking each element individually.
1960         (aarch64_evpc_uzp): Likewise.
1961         (aarch64_evpc_zip): Likewise.
1962         (aarch64_evpc_ext): Likewise.
1963         (aarch64_evpc_rev): Likewise.
1964         (aarch64_evpc_dup): Test the encoding for a single duplicated element,
1965         instead of checking each element individually.  Return true without
1966         generating rtl if
1967         (aarch64_vectorize_vec_perm_const): Use all_from_input_p to test
1968         whether all selected elements come from the same input, instead of
1969         checking each element individually.  Remove calls to gen_rtx_REG,
1970         start_sequence and end_sequence and instead assert that no rtl is
1971         generated.
1973 2018-01-09  Richard Sandiford  <richard.sandiford@linaro.org>
1975         * config/aarch64/aarch64.c (aarch64_legitimate_constant_p): Fix
1976         order of HIGH and CONST checks.
1978 2018-01-09  Richard Sandiford  <richard.sandiford@linaro.org>
1980         * tree-vect-stmts.c (permute_vec_elements): Create a fresh variable
1981         if the destination isn't an SSA_NAME.
1983 2018-01-09  Richard Biener  <rguenther@suse.de>
1985         PR tree-optimization/83668
1986         * graphite.c (canonicalize_loop_closed_ssa): Add edge argument,
1987         move prologue...
1988         (canonicalize_loop_form): ... here, renamed from ...
1989         (canonicalize_loop_closed_ssa_form): ... this and amended to
1990         swap successor edges for loop exit blocks to make us use
1991         the RPO order we need for initial schedule generation.
1993 2018-01-09  Joseph Myers  <joseph@codesourcery.com>
1995         PR tree-optimization/64811
1996         * match.pd: When optimizing comparisons with Inf, avoid
1997         introducing or losing exceptions from comparisons with NaN.
1999 2018-01-09  Martin Liska  <mliska@suse.cz>
2001         PR sanitizer/82517
2002         * asan.c (shadow_mem_size): Add gcc_assert.
2004 2018-01-09  Georg-Johann Lay  <avr@gjlay.de>
2006         Don't save registers in main().
2008         PR target/83738
2009         * doc/invoke.texi (AVR Options) [-mmain-is-OS_task]: Document it.
2010         * config/avr/avr.opt (-mmain-is-OS_task): New target option.
2011         * config/avr/avr.c (avr_set_current_function): Don't error if
2012         naked, OS_task or OS_main are specified at the same time.
2013         (avr_function_ok_for_sibcall): Don't disable sibcalls for OS_task,
2014         OS_main.
2015         (avr_insert_attributes) [-mmain-is-OS_task] <main>: Add OS_task
2016         attribute.
2017         * common/config/avr/avr-common.c (avr_option_optimization_table):
2018         Switch on -mmain-is-OS_task for optimizing compilations.
2020 2018-01-09  Richard Biener  <rguenther@suse.de>
2022         PR tree-optimization/83572
2023         * graphite.c: Include cfganal.h.
2024         (graphite_transform_loops): Connect infinite loops to exit
2025         and remove fake edges at the end.
2027 2018-01-09  Jan Hubicka  <hubicka@ucw.cz>
2029         * ipa-inline.c (edge_badness): Revert accidental checkin.
2031 2018-01-09  Jan Hubicka  <hubicka@ucw.cz>
2033         PR ipa/80763
2034         * ipa-comdats.c (set_comdat_group): Only set comdat group of real
2035         symbols; not inline clones.
2037 2018-01-09  Jakub Jelinek  <jakub@redhat.com>
2039         PR target/83507
2040         * modulo-sched.c (schedule_reg_moves): Punt if we'd need to move
2041         hard registers.  Formatting fixes.
2043         PR preprocessor/83722
2044         * gcc.c (try_generate_repro): Pass
2045         &temp_stderr_files[RETRY_ICE_ATTEMPTS - 1] rather than
2046         &temp_stdout_files[RETRY_ICE_ATTEMPTS - 1] as last argument to
2047         do_report_bug.
2049 2018-01-08  Monk Chiang  <sh.chiang04@gmail.com>
2050             Kito Cheng  <kito.cheng@gmail.com>
2052         * config/riscv/riscv.c (machine_function::is_leaf): Remove field.
2053         (riscv_leaf_function_p): Delete.
2054         (riscv_function_ok_for_sibcall): Return false when TARGET_SAVE_RESTORE.
2056 2018-01-08  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>
2058         * config/rs6000/rs6000-string.c (do_load_for_compare_from_addr): New
2059         function.
2060         (do_ifelse): New function.
2061         (do_isel): New function.
2062         (do_sub3): New function.
2063         (do_add3): New function.
2064         (do_load_mask_compare): New function.
2065         (do_overlap_load_compare): New function.
2066         (expand_compare_loop): New function.
2067         (expand_block_compare): Call expand_compare_loop() when appropriate.
2068         * config/rs6000/rs6000.opt (-mblock-compare-inline-limit): Change
2069         option description.
2070         (-mblock-compare-inline-loop-limit): New option.
2072 2018-01-08  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
2074         PR target/83677
2075         * config/rs6000/altivec.md (*altivec_vpermr_<mode>_internal):
2076         Reverse order of second and third operands in first alternative.
2077         * config/rs6000/rs6000.c (rs6000_expand_vector_set): Reverse order
2078         of first and second elements in UNSPEC_VPERMR vector.
2079         (altivec_expand_vec_perm_le): Likewise.
2081 2017-01-08  Jeff Law  <law@redhat.com>
2083         PR rtl-optimizatin/81308
2084         * tree-switch-conversion.c (cfg_altered): New file scoped static.
2085         (process_switch): If group_case_labels makes a change, then set
2086         cfg_altered.
2087         (pass_convert_switch::execute): If a switch is converted, then
2088         set cfg_altered.  Return TODO_cfg_cleanup if cfg_altered is true.
2090         PR rtl-optimization/81308
2091         * recog.c (split_all_insns): Conditionally cleanup the CFG after
2092         splitting insns.
2094 2018-01-08  Vidya Praveen  <vidyapraveen@arm.com>
2096         PR target/83663 - Revert r255946
2097         * config/aarch64/aarch64.c (aarch64_expand_vector_init): Modify code
2098         generation for cases where splatting a value is not useful.
2099         * simplify-rtx.c (simplify_ternary_operation): Simplify vec_merge
2100         across a vec_duplicate and a paradoxical subreg forming a vector
2101         mode to a vec_concat.
2103 2018-01-08  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
2105         * config/arm/t-aprofile (MULTILIB_MATCHES): Add mapping rules for
2106         -march=armv8.3-a variants.
2107         * config/arm/t-multilib: Likewise.
2108         * config/arm/t-arm-elf: Likewise.  Handle dotprod extension.
2110 2018-01-08  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>
2112         * config/rs6000/rs6000.md (cceq_ior_compare): Remove * so I can use it
2113         to generate rtl.
2114         (cceq_ior_compare_complement): Give it a name so I can use it, and
2115         change boolean_or_operator predicate to boolean_operator so it can
2116         be used to generate a crand.
2117         (eqne): New code iterator.
2118         (bd/bd_neg): New code_attrs.
2119         (<bd>_<mode>): New name for ctr<mode>_internal[12] now combined into
2120         a single define_insn.
2121         (<bd>tf_<mode>): A new insn pattern for the conditional form branch
2122         decrement (bdnzt/bdnzf/bdzt/bdzf).
2123         * config/rs6000/rs6000.c (rs6000_legitimate_combined_insn): Updated
2124         with the new names of the branch decrement patterns, and added the
2125         names of the branch decrement conditional patterns.
2127 2018-01-08  Richard Biener  <rguenther@suse.de>
2129         PR tree-optimization/83563
2130         * graphite.c (canonicalize_loop_closed_ssa_form): Reset the SCEV
2131         cache.
2133 2018-01-08  Richard Biener  <rguenther@suse.de>
2135         PR middle-end/83713
2136         * convert.c (do_narrow): Properly guard TYPE_OVERFLOW_WRAPS checks.
2138 2018-01-08  Richard Biener  <rguenther@suse.de>
2140         PR tree-optimization/83685
2141         * tree-ssa-pre.c (create_expression_by_pieces): Do not insert
2142         references to abnormals.
2144 2018-01-08  Richard Biener  <rguenther@suse.de>
2146         PR lto/83719
2147         * dwarf2out.c (output_indirect_strings): Handle empty
2148         skeleton_debug_str_hash.
2149         (dwarf2out_early_finish): Index strings for -gsplit-dwarf.
2151 2018-01-08  Claudiu Zissulescu  <claziss@synopsys.com>
2153         * config/arc/arc.c (TARGET_TRAMPOLINE_ADJUST_ADDRESS): Delete.
2154         (emit_store_direct): Likewise.
2155         (arc_trampoline_adjust_address): Likewise.
2156         (arc_asm_trampoline_template): New function.
2157         (arc_initialize_trampoline): Use asm_trampoline_template.
2158         (TARGET_ASM_TRAMPOLINE_TEMPLATE): Define.
2159         * config/arc/arc.h (TRAMPOLINE_SIZE): Adjust to 16.
2160         * config/arc/arc.md (flush_icache): Delete pattern.
2162 2018-01-08  Claudiu Zissulescu  <claziss@synopsys.com>
2164         * config/arc/arc-c.def (__ARC_UNALIGNED__): New define.
2165         * config/arc/arc.h (STRICT_ALIGNMENT): Control this macro using
2166         munaligned-access.
2168 2018-01-08  Sebastian Huber  <sebastian.huber@embedded-brains.de>
2170         PR target/83681
2171         * config/epiphany/epiphany.h (make_pass_mode_switch_use): Guard
2172         by not USED_FOR_TARGET.
2173         (make_pass_resolve_sw_modes): Likewise.
2175 2018-01-08  Sebastian Huber  <sebastian.huber@embedded-brains.de>
2177         * config/nios2/nios2.h (nios2_section_threshold): Guard by not
2178         USED_FOR_TARGET.
2180 2018-01-08  Richard Biener  <rguenther@suse.de>
2182         PR middle-end/83580
2183         * tree-data-ref.c (split_constant_offset): Remove STRIP_NOPS.
2185 2018-01-08  Richard Biener  <rguenther@suse.de>
2187         PR middle-end/83517
2188         * match.pd ((t * 2) / 2) -> t): Add missing :c.
2190 2018-01-06  Aldy Hernandez  <aldyh@redhat.com>
2192         PR middle-end/81897
2193         * tree-ssa-uninit.c (compute_control_dep_chain): Do not bail on
2194         basic blocks with a small number of successors.
2195         (convert_control_dep_chain_into_preds): Improve handling of
2196         forwarder blocks.
2197         (dump_predicates): Split apart into...
2198         (dump_pred_chain): ...here...
2199         (dump_pred_info): ...and here.
2200         (can_one_predicate_be_invalidated_p): Add debugging printfs.
2201         (can_chain_union_be_invalidated_p): Improve check for invalidation
2202         of paths.
2203         (uninit_uses_cannot_happen): Avoid unnecessary if
2204         convert_control_dep_chain_into_preds yielded nothing.
2206 2018-01-06  Martin Sebor  <msebor@redhat.com>
2208         PR tree-optimization/83640
2209         * gimple-ssa-warn-restrict.c (builtin_access::builtin_access): Avoid
2210         subtracting negative offset from size.
2211         (builtin_access::overlap): Adjust offset bounds of the access to fall
2212         within the size of the object if possible.
2214 2018-01-06  Richard Sandiford  <richard.sandiford@linaro.org>
2216         PR rtl-optimization/83699
2217         * expmed.c (extract_bit_field_1): Restrict the vector usage of
2218         extract_bit_field_as_subreg to cases in which the extracted
2219         value is also a vector.
2221         * lra-constraints.c (process_alt_operands): Test for the equivalence
2222         substitutions when detecting a possible reload cycle.
2224 2018-01-06  Jakub Jelinek  <jakub@redhat.com>
2226         PR debug/83480
2227         * toplev.c (process_options): Don't enable debug_nonbind_markers_p
2228         by default if flag_selective_schedling{,2}.  Formatting fixes.
2230         PR rtl-optimization/83682
2231         * rtl.h (const_vec_duplicate_p): Only return true for VEC_DUPLICATE
2232         if it has non-VECTOR_MODE element mode.
2233         (vec_duplicate_p): Likewise.
2235         PR middle-end/83694
2236         * cfgexpand.c (expand_debug_expr): Punt if mode1 is VOIDmode
2237         and bitsize might be greater than MAX_BITSIZE_MODE_ANY_INT.
2239 2018-01-05  Jakub Jelinek  <jakub@redhat.com>
2241         PR target/83604
2242         * config/i386/i386-builtin.def
2243         (__builtin_ia32_vgf2p8affineinvqb_v64qi,
2244         __builtin_ia32_vgf2p8affineqb_v64qi, __builtin_ia32_vgf2p8mulb_v64qi):
2245         Require also OPTION_MASK_ISA_AVX512F in addition to
2246         OPTION_MASK_ISA_GFNI.
2247         (__builtin_ia32_vgf2p8affineinvqb_v16qi_mask,
2248         __builtin_ia32_vgf2p8affineqb_v16qi_mask): Require
2249         OPTION_MASK_ISA_AVX512VL instead of OPTION_MASK_ISA_SSE in addition
2250         to OPTION_MASK_ISA_GFNI.
2251         (__builtin_ia32_vgf2p8mulb_v32qi_mask): Require
2252         OPTION_MASK_ISA_AVX512VL in addition to OPTION_MASK_ISA_GFNI and
2253         OPTION_MASK_ISA_AVX512BW.
2254         (__builtin_ia32_vgf2p8mulb_v16qi_mask): Require
2255         OPTION_MASK_ISA_AVX512VL instead of OPTION_MASK_ISA_AVX512BW in
2256         addition to OPTION_MASK_ISA_GFNI.
2257         (__builtin_ia32_vgf2p8affineinvqb_v16qi,
2258         __builtin_ia32_vgf2p8affineqb_v16qi, __builtin_ia32_vgf2p8mulb_v16qi):
2259         Require OPTION_MASK_ISA_SSE2 instead of OPTION_MASK_ISA_SSE in addition
2260         to OPTION_MASK_ISA_GFNI.
2261         * config/i386/i386.c (def_builtin): Change to builtin isa/isa2 being
2262         a requirement for all ISAs rather than any of them with a few
2263         exceptions.
2264         (ix86_add_new_builtins): Clear OPTION_MASK_ISA_64BIT from isa before
2265         processing.
2266         (ix86_expand_builtin): Require all ISAs from builtin's isa and isa2
2267         bitmasks to be enabled with 3 exceptions, instead of requiring any
2268         enabled ISA with lots of exceptions.
2269         * config/i386/sse.md (vgf2p8affineinvqb_<mode><mask_name>,
2270         vgf2p8affineqb_<mode><mask_name>, vgf2p8mulb_<mode><mask_name>):
2271         Change avx512bw in isa attribute to avx512f.
2272         * config/i386/sgxintrin.h: Add license boilerplate.
2273         * config/i386/vaesintrin.h: Likewise.  Fix macro spelling __AVX512F
2274         to __AVX512F__ and __AVX512VL to __AVX512VL__.
2275         (_mm256_aesdec_epi128, _mm256_aesdeclast_epi128, _mm256_aesenc_epi128,
2276         _mm256_aesenclast_epi128): Enable temporarily avx if __AVX__ is not
2277         defined.
2278         * config/i386/gfniintrin.h (_mm_gf2p8mul_epi8,
2279         _mm_gf2p8affineinv_epi64_epi8, _mm_gf2p8affine_epi64_epi8): Enable
2280         temporarily sse2 rather than sse if not enabled already.
2282         PR target/83604
2283         * config/i386/sse.md (VI248_VLBW): Rename to ...
2284         (VI248_AVX512VL): ... this.  Don't guard V32HI with TARGET_AVX512BW.
2285         (vpshrd_<mode><mask_name>, vpshld_<mode><mask_name>,
2286         vpshrdv_<mode>, vpshrdv_<mode>_mask, vpshrdv_<mode>_maskz,
2287         vpshrdv_<mode>_maskz_1, vpshldv_<mode>, vpshldv_<mode>_mask,
2288         vpshldv_<mode>_maskz, vpshldv_<mode>_maskz_1): Use VI248_AVX512VL
2289         mode iterator instead of VI248_VLBW.
2291 2018-01-05  Jan Hubicka  <hubicka@ucw.cz>
2293         * ipa-fnsummary.c (record_modified_bb_info): Add OP.
2294         (record_modified): Skip clobbers; add debug output.
2295         (param_change_prob): Use sreal frequencies.
2297 2018-01-05  Richard Sandiford  <richard.sandiford@linaro.org>
2299         * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Don't
2300         punt for user-aligned variables.
2302 2018-01-05  Richard Sandiford  <richard.sandiford@linaro.org>
2304         * tree-chrec.c (chrec_contains_symbols): Return true for
2305         POLY_INT_CST.
2307 2018-01-05  Sudakshina Das  <sudi.das@arm.com>
2309         PR target/82439
2310         * simplify-rtx.c (simplify_relational_operation_1): Add simplifications
2311         of (x|y) == x for BICS pattern.
2313 2018-01-05  Jakub Jelinek  <jakub@redhat.com>
2315         PR tree-optimization/83605
2316         * gimple-ssa-strength-reduction.c: Include tree-eh.h.
2317         (find_candidates_dom_walker::before_dom_children): Ignore stmts that
2318         can throw.
2320 2018-01-05  Sebastian Huber  <sebastian.huber@embedded-brains.de>
2322         * config.gcc (epiphany-*-elf*): Add (epiphany-*-rtems*) configuration.
2323         * config/epiphany/rtems.h: New file.
2325 2018-01-04  Jakub Jelinek  <jakub@redhat.com>
2326             Uros Bizjak  <ubizjak@gmail.com>
2328         PR target/83554
2329         * config/i386/i386.md (*<rotate_insn>hi3_1 splitter): Use
2330         QIreg_operand instead of register_operand predicate.
2331         * config/i386/i386.c (ix86_rop_should_change_byte_p,
2332         set_rop_modrm_reg_bits, ix86_mitigate_rop): Use -mmitigate-rop in
2333         comments instead of -fmitigate[-_]rop.
2335 2018-01-04  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
2337         PR bootstrap/81926
2338         * cgraphunit.c (symbol_table::compile): Switch to text_section
2339         before calling assembly_start debug hook.
2340         * run-rtl-passes.c (run_rtl_passes): Likewise.
2341         Include output.h.
2343 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
2345         * tree-vrp.c (extract_range_from_binary_expr_1): Check
2346         range_int_cst_p rather than !symbolic_range_p before calling
2347         extract_range_from_multiplicative_op_1.
2349 2017-01-04  Jeff Law  <law@redhat.com>
2351         * tree-ssa-math-opts.c (execute_cse_reciprocals_1): Remove
2352         redundant test in assertion.
2354 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
2356         * doc/rtl.texi: Document machine_mode wrapper classes.
2358 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
2360         * fold-const.c (fold_ternary_loc): Check tree_fits_uhwi_p before
2361         using tree_to_uhwi.
2363 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
2365         * tree-ssa-forwprop.c (is_combined_permutation_identity): Allow
2366         the VEC_PERM_EXPR fold to fail.
2368 2018-01-04  Jakub Jelinek  <jakub@redhat.com>
2370         PR debug/83585
2371         * bb-reorder.c (insert_section_boundary_note): Set has_bb_partition
2372         to switched_sections.
2374 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
2376         PR target/83680
2377         * config/arm/arm.c (arm_vectorize_vec_perm_const): Fix inverted
2378         test for d.testing.
2380 2018-01-04  Peter Bergner  <bergner@vnet.ibm.com>
2382         PR target/83387
2383         * config/rs6000/rs6000.c (rs6000_discover_homogeneous_aggregate): Do not
2384         allow arguments in FP registers if TARGET_HARD_FLOAT is false.
2386 2018-01-04  Jakub Jelinek  <jakub@redhat.com>
2388         PR debug/83666
2389         * cfgexpand.c (expand_debug_expr) <case BIT_FIELD_REF>: Punt if mode
2390         is BLKmode and bitpos not zero or mode change is needed.
2392 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
2394         PR target/83675
2395         * config/sparc/sparc.c (sparc_vectorize_vec_perm_const): Require
2396         TARGET_VIS2.
2398 2018-01-04  Uros Bizjak  <ubizjak@gmail.com>
2400         PR target/83628
2401         * config/alpha/alpha.md (*sadd<modesuffix>): Use ASHIFT
2402         instead of MULT rtx.  Update all corresponding splitters.
2403         (*saddl_se): Ditto.
2404         (*ssub<modesuffix>): Ditto.
2405         (*ssubl_se): Ditto.
2406         (*cmp_sadd_di): Update split patterns.
2407         (*cmp_sadd_si): Ditto.
2408         (*cmp_sadd_sidi): Ditto.
2409         (*cmp_ssub_di): Ditto.
2410         (*cmp_ssub_si): Ditto.
2411         (*cmp_ssub_sidi): Ditto.
2412         * config/alpha/predicates.md (const23_operand): New predicate.
2413         * config/alpha/alpha.c (alpha_rtx_costs) [PLUS, MINUS]:
2414         Look for ASHIFT, not MULT inner operand.
2415         (alpha_split_conditional_move): Update for *sadd<modesuffix> change.
2417 2018-01-04  Martin Liska  <mliska@suse.cz>
2419         PR gcov-profile/83669
2420         * gcov.c (output_intermediate_file): Add version to intermediate
2421         gcov file.
2422         * doc/gcov.texi: Document new field 'version' in intermediate
2423         file format. Fix location of '-k' option of gcov command.
2425 2018-01-04  Martin Liska  <mliska@suse.cz>
2427         PR ipa/82352
2428         * ipa-icf.c (sem_function::merge): Do not cross comdat boundary.
2430 2018-01-04  Jakub Jelinek  <jakub@redhat.com>
2432         * gimple-ssa-sprintf.c (parse_directive): Cast second dir.len to uhwi.
2434 2018-01-03  Martin Sebor  <msebor@redhat.com>
2436         PR tree-optimization/83655
2437         * gimple-ssa-warn-restrict.c (wrestrict_dom_walker::check_call): Avoid
2438         checking calls with invalid arguments.
2440 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2442         * tree-vect-stmts.c (vect_get_store_rhs): New function.
2443         (vectorizable_mask_load_store): Delete.
2444         (vectorizable_call): Return false for masked loads and stores.
2445         (vectorizable_store): Handle IFN_MASK_STORE.  Use vect_get_store_rhs
2446         instead of gimple_assign_rhs1.
2447         (vectorizable_load): Handle IFN_MASK_LOAD.
2448         (vect_transform_stmt): Don't set is_store for call_vec_info_type.
2450 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2452         * tree-vect-stmts.c (vect_build_gather_load_calls): New function,
2453         split out from..,
2454         (vectorizable_mask_load_store): ...here.
2455         (vectorizable_load): ...and here.
2457 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2459         * tree-vect-stmts.c (vect_build_all_ones_mask)
2460         (vect_build_zero_merge_argument): New functions, split out from...
2461         (vectorizable_load): ...here.
2463 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2465         * tree-vect-stmts.c (vect_check_store_rhs): New function,
2466         split out from...
2467         (vectorizable_mask_load_store): ...here.
2468         (vectorizable_store): ...and here.
2470 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2472         * tree-vect-stmts.c (vect_check_load_store_mask): New function,
2473         split out from...
2474         (vectorizable_mask_load_store): ...here.
2476 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2478         * tree-vectorizer.h (vec_load_store_type): Moved from tree-vec-stmts.c
2479         (vect_model_store_cost): Take a vec_load_store_type instead of a
2480         vect_def_type.
2481         * tree-vect-stmts.c (vec_load_store_type): Move to tree-vectorizer.h.
2482         (vect_model_store_cost): Take a vec_load_store_type instead of a
2483         vect_def_type.
2484         (vectorizable_mask_load_store): Update accordingly.
2485         (vectorizable_store): Likewise.
2486         * tree-vect-slp.c (vect_analyze_slp_cost_1): Update accordingly.
2488 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2490         * tree-vect-loop.c (vect_transform_loop): Stub out scalar
2491         IFN_MASK_LOAD calls here rather than...
2492         * tree-vect-stmts.c (vectorizable_mask_load_store): ...here.
2494 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2495             Alan Hayward  <alan.hayward@arm.com>
2496             David Sherwood  <david.sherwood@arm.com>
2498         * expmed.c (extract_bit_field_1): For vector extracts,
2499         fall back to extract_bit_field_as_subreg if vec_extract
2500         isn't available.
2502 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2503             Alan Hayward  <alan.hayward@arm.com>
2504             David Sherwood  <david.sherwood@arm.com>
2506         * lra-spills.c (pseudo_reg_slot_compare): Sort slots by whether
2507         they are variable or constant sized.
2508         (assign_stack_slot_num_and_sort_pseudos): Don't reuse variable-sized
2509         slots for constant-sized data.
2511 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2512             Alan Hayward  <alan.hayward@arm.com>
2513             David Sherwood  <david.sherwood@arm.com>
2515         * tree-vect-patterns.c (vect_recog_mask_conversion_pattern): When
2516         handling COND_EXPRs with boolean comparisons, try to find a better
2517         basis for the mask type than the boolean itself.
2519 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2521         * doc/rtl.texi (MAX_BITSIZE_MODE_ANY_MODE): Describe how the default
2522         is calculated and how it can be overridden.
2523         * genmodes.c (max_bitsize_mode_any_mode): New variable.
2524         (create_modes): Initialize it from MAX_BITSIZE_MODE_ANY_MODE,
2525         if defined.
2526         (emit_max_int): Use it to set the output MAX_BITSIZE_MODE_ANY_MODE,
2527         if nonzero.
2529 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2530             Alan Hayward  <alan.hayward@arm.com>
2531             David Sherwood  <david.sherwood@arm.com>
2533         * config/aarch64/aarch64-protos.h (aarch64_output_simd_mov_immediate):
2534         Remove the mode argument.
2535         (aarch64_simd_valid_immediate): Remove the mode and inverse
2536         arguments.
2537         * config/aarch64/iterators.md (bitsize): New iterator.
2538         * config/aarch64/aarch64-simd.md (*aarch64_simd_mov<mode>, and<mode>3)
2539         (ior<mode>3): Update calls to aarch64_output_simd_mov_immediate.
2540         * config/aarch64/constraints.md (Do, Db, Dn): Update calls to
2541         aarch64_simd_valid_immediate.
2542         * config/aarch64/predicates.md (aarch64_reg_or_orr_imm): Likewise.
2543         (aarch64_reg_or_bic_imm): Likewise.
2544         * config/aarch64/aarch64.c (simd_immediate_info): Replace mvn
2545         with an insn_type enum and msl with a modifier_type enum.
2546         Replace element_width with a scalar_mode.  Change the shift
2547         to unsigned int.  Add constructors for scalar_float_mode and
2548         scalar_int_mode elements.
2549         (aarch64_vect_float_const_representable_p): Delete.
2550         (aarch64_can_const_movi_rtx_p)
2551         (aarch64_simd_scalar_immediate_valid_for_move)
2552         (aarch64_simd_make_constant): Update call to
2553         aarch64_simd_valid_immediate.
2554         (aarch64_advsimd_valid_immediate_hs): New function.
2555         (aarch64_advsimd_valid_immediate): Likewise.
2556         (aarch64_simd_valid_immediate): Remove mode and inverse
2557         arguments.  Rewrite to use the above.  Use const_vec_duplicate_p
2558         to detect duplicated constants and use aarch64_float_const_zero_rtx_p
2559         and aarch64_float_const_representable_p on the result.
2560         (aarch64_output_simd_mov_immediate): Remove mode argument.
2561         Update call to aarch64_simd_valid_immediate and use of
2562         simd_immediate_info.
2563         (aarch64_output_scalar_simd_mov_immediate): Update call
2564         accordingly.
2566 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2567             Alan Hayward  <alan.hayward@arm.com>
2568             David Sherwood  <david.sherwood@arm.com>
2570         * machmode.h (mode_precision): Prefix with CONST_MODE_PRECISION.
2571         (mode_nunits): Likewise CONST_MODE_NUNITS.
2572         * machmode.def (ADJUST_NUNITS): Document.
2573         * genmodes.c (mode_data::need_nunits_adj): New field.
2574         (blank_mode): Update accordingly.
2575         (adj_nunits): New variable.
2576         (print_maybe_const_decl): Replace CATEGORY with a NEEDS_ADJ
2577         parameter.
2578         (emit_mode_size_inline): Set need_bytesize_adj for all modes
2579         listed in adj_nunits.
2580         (emit_mode_nunits_inline): Set need_nunits_adj for all modes
2581         listed in adj_nunits.  Don't emit case statements for such modes.
2582         (emit_insn_modes_h): Emit definitions of CONST_MODE_NUNITS
2583         and CONST_MODE_PRECISION.  Make CONST_MODE_SIZE expand to
2584         nothing if adj_nunits is nonnull.
2585         (emit_mode_precision, emit_mode_nunits): Use print_maybe_const_decl.
2586         (emit_mode_unit_size, emit_mode_base_align, emit_mode_ibit)
2587         (emit_mode_fbit): Update use of print_maybe_const_decl.
2588         (emit_move_size): Likewise.  Treat the array as non-const
2589         if adj_nunits.
2590         (emit_mode_adjustments): Handle adj_nunits.
2592 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2594         * machmode.def (VECTOR_MODES_WITH_PREFIX): Document.
2595         * genmodes.c (VECTOR_MODES_WITH_PREFIX): New macro.
2596         (VECTOR_MODES): Use it.
2597         (make_vector_modes): Take the prefix as an argument.
2599 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2600             Alan Hayward  <alan.hayward@arm.com>
2601             David Sherwood  <david.sherwood@arm.com>
2603         * mode-classes.def (MODE_VECTOR_BOOL): New mode class.
2604         * machmode.h (INTEGRAL_MODE_P, VECTOR_MODE_P): Return true
2605         for MODE_VECTOR_BOOL.
2606         * machmode.def (VECTOR_BOOL_MODE): Document.
2607         * genmodes.c (VECTOR_BOOL_MODE): New macro.
2608         (make_vector_bool_mode): New function.
2609         (complete_mode, emit_mode_wider, emit_mode_adjustments): Handle
2610         MODE_VECTOR_BOOL.
2611         * lto-streamer-in.c (lto_input_mode_table): Likewise.
2612         * rtx-vector-builder.c (rtx_vector_builder::find_cached_value):
2613         Likewise.
2614         * stor-layout.c (int_mode_for_mode): Likewise.
2615         * tree.c (build_vector_type_for_mode): Likewise.
2616         * varasm.c (output_constant_pool_2): Likewise.
2617         * emit-rtl.c (init_emit_once): Make sure that CONST1_RTX (BImode) and
2618         CONSTM1_RTX (BImode) are the same thing.  Initialize const_tiny_rtx
2619         for MODE_VECTOR_BOOL.
2620         * expr.c (expand_expr_real_1): Use VECTOR_MODE_P instead of a list
2621         of mode class checks.
2622         * tree-vect-generic.c (expand_vector_operation): Use VECTOR_MODE_P
2623         instead of a list of mode class checks.
2624         (expand_vector_scalar_condition): Likewise.
2625         (type_for_widest_vector_mode): Handle BImode as an inner mode.
2627 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2628             Alan Hayward  <alan.hayward@arm.com>
2629             David Sherwood  <david.sherwood@arm.com>
2631         * machmode.h (mode_size): Change from unsigned short to
2632         poly_uint16_pod.
2633         (mode_to_bytes): Return a poly_uint16 rather than an unsigned short.
2634         (GET_MODE_SIZE): Return a constant if ONLY_FIXED_SIZE_MODES,
2635         or if measurement_type is not polynomial.
2636         (fixed_size_mode::includes_p): Check for constant-sized modes.
2637         * genmodes.c (emit_mode_size_inline): Make mode_size_inline
2638         return a poly_uint16 rather than an unsigned short.
2639         (emit_mode_size): Change the type of mode_size from unsigned short
2640         to poly_uint16_pod.  Use ZERO_COEFFS for the initializer.
2641         (emit_mode_adjustments): Cope with polynomial vector sizes.
2642         * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
2643         for GET_MODE_SIZE.
2644         * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
2645         for GET_MODE_SIZE.
2646         * auto-inc-dec.c (try_merge): Treat GET_MODE_SIZE as polynomial.
2647         * builtins.c (expand_ifn_atomic_compare_exchange_into_call): Likewise.
2648         * caller-save.c (setup_save_areas): Likewise.
2649         (replace_reg_with_saved_mem): Likewise.
2650         * calls.c (emit_library_call_value_1): Likewise.
2651         * combine-stack-adj.c (combine_stack_adjustments_for_block): Likewise.
2652         * combine.c (simplify_set, make_extraction, simplify_shift_const_1)
2653         (gen_lowpart_for_combine): Likewise.
2654         * convert.c (convert_to_integer_1): Likewise.
2655         * cse.c (equiv_constant, cse_insn): Likewise.
2656         * cselib.c (autoinc_split, cselib_hash_rtx): Likewise.
2657         (cselib_subst_to_values): Likewise.
2658         * dce.c (word_dce_process_block): Likewise.
2659         * df-problems.c (df_word_lr_mark_ref): Likewise.
2660         * dwarf2cfi.c (init_one_dwarf_reg_size): Likewise.
2661         * dwarf2out.c (multiple_reg_loc_descriptor, mem_loc_descriptor)
2662         (concat_loc_descriptor, concatn_loc_descriptor, loc_descriptor)
2663         (rtl_for_decl_location): Likewise.
2664         * emit-rtl.c (gen_highpart, widen_memory_access): Likewise.
2665         * expmed.c (extract_bit_field_1, extract_integral_bit_field): Likewise.
2666         * expr.c (emit_group_load_1, clear_storage_hints): Likewise.
2667         (emit_move_complex, emit_move_multi_word, emit_push_insn): Likewise.
2668         (expand_expr_real_1): Likewise.
2669         * function.c (assign_parm_setup_block_p, assign_parm_setup_block)
2670         (pad_below): Likewise.
2671         * gimple-fold.c (optimize_atomic_compare_exchange_p): Likewise.
2672         * gimple-ssa-store-merging.c (rhs_valid_for_store_merging_p): Likewise.
2673         * ira.c (get_subreg_tracking_sizes): Likewise.
2674         * ira-build.c (ira_create_allocno_objects): Likewise.
2675         * ira-color.c (coalesced_pseudo_reg_slot_compare): Likewise.
2676         (ira_sort_regnos_for_alter_reg): Likewise.
2677         * ira-costs.c (record_operand_costs): Likewise.
2678         * lower-subreg.c (interesting_mode_p, simplify_gen_subreg_concatn)
2679         (resolve_simple_move): Likewise.
2680         * lra-constraints.c (get_reload_reg, operands_match_p): Likewise.
2681         (process_addr_reg, simplify_operand_subreg, curr_insn_transform)
2682         (lra_constraints): Likewise.
2683         (CONST_POOL_OK_P): Reject variable-sized modes.
2684         * lra-spills.c (slot, assign_mem_slot, pseudo_reg_slot_compare)
2685         (add_pseudo_to_slot, lra_spill): Likewise.
2686         * omp-low.c (omp_clause_aligned_alignment): Likewise.
2687         * optabs-query.c (get_best_extraction_insn): Likewise.
2688         * optabs-tree.c (expand_vec_cond_expr_p): Likewise.
2689         * optabs.c (expand_vec_perm_var, expand_vec_cond_expr): Likewise.
2690         (expand_mult_highpart, valid_multiword_target_p): Likewise.
2691         * recog.c (offsettable_address_addr_space_p): Likewise.
2692         * regcprop.c (maybe_mode_change): Likewise.
2693         * reginfo.c (choose_hard_reg_mode, record_subregs_of_mode): Likewise.
2694         * regrename.c (build_def_use): Likewise.
2695         * regstat.c (dump_reg_info): Likewise.
2696         * reload.c (complex_word_subreg_p, push_reload, find_dummy_reload)
2697         (find_reloads, find_reloads_subreg_address): Likewise.
2698         * reload1.c (eliminate_regs_1): Likewise.
2699         * rtlanal.c (for_each_inc_dec_find_inc_dec, rtx_cost): Likewise.
2700         * simplify-rtx.c (avoid_constant_pool_reference): Likewise.
2701         (simplify_binary_operation_1, simplify_subreg): Likewise.
2702         * targhooks.c (default_function_arg_padding): Likewise.
2703         (default_hard_regno_nregs, default_class_max_nregs): Likewise.
2704         * tree-cfg.c (verify_gimple_assign_binary): Likewise.
2705         (verify_gimple_assign_ternary): Likewise.
2706         * tree-inline.c (estimate_move_cost): Likewise.
2707         * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
2708         * tree-ssa-loop-ivopts.c (add_autoinc_candidates): Likewise.
2709         (get_address_cost_ainc): Likewise.
2710         * tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Likewise.
2711         (vect_supportable_dr_alignment): Likewise.
2712         * tree-vect-loop.c (vect_determine_vectorization_factor): Likewise.
2713         (vectorizable_reduction): Likewise.
2714         * tree-vect-stmts.c (vectorizable_assignment, vectorizable_shift)
2715         (vectorizable_operation, vectorizable_load): Likewise.
2716         * tree.c (build_same_sized_truth_vector_type): Likewise.
2717         * valtrack.c (cleanup_auto_inc_dec): Likewise.
2718         * var-tracking.c (emit_note_insn_var_location): Likewise.
2719         * config/arc/arc.h (ASM_OUTPUT_CASE_END): Use as_a <scalar_int_mode>.
2720         (ADDR_VEC_ALIGN): Likewise.
2722 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2723             Alan Hayward  <alan.hayward@arm.com>
2724             David Sherwood  <david.sherwood@arm.com>
2726         * machmode.h (mode_to_bits): Return a poly_uint16 rather than an
2727         unsigned short.
2728         (GET_MODE_BITSIZE): Return a constant if ONLY_FIXED_SIZE_MODES,
2729         or if measurement_type is polynomial.
2730         * calls.c (shift_return_value): Treat GET_MODE_BITSIZE as polynomial.
2731         * combine.c (make_extraction): Likewise.
2732         * dse.c (find_shift_sequence): Likewise.
2733         * dwarf2out.c (mem_loc_descriptor): Likewise.
2734         * expmed.c (store_integral_bit_field, extract_bit_field_1): Likewise.
2735         (extract_bit_field, extract_low_bits): Likewise.
2736         * expr.c (convert_move, convert_modes, emit_move_insn_1): Likewise.
2737         (optimize_bitfield_assignment_op, expand_assignment): Likewise.
2738         (store_expr_with_bounds, store_field, expand_expr_real_1): Likewise.
2739         * fold-const.c (optimize_bit_field_compare, merge_ranges): Likewise.
2740         * gimple-fold.c (optimize_atomic_compare_exchange_p): Likewise.
2741         * reload.c (find_reloads): Likewise.
2742         * reload1.c (alter_reg): Likewise.
2743         * stor-layout.c (bitwise_mode_for_mode, compute_record_mode): Likewise.
2744         * targhooks.c (default_secondary_memory_needed_mode): Likewise.
2745         * tree-if-conv.c (predicate_mem_writes): Likewise.
2746         * tree-ssa-strlen.c (handle_builtin_memcmp): Likewise.
2747         * tree-vect-patterns.c (adjust_bool_pattern): Likewise.
2748         * tree-vect-stmts.c (vectorizable_simd_clone_call): Likewise.
2749         * valtrack.c (dead_debug_insert_temp): Likewise.
2750         * varasm.c (mergeable_constant_section): Likewise.
2751         * config/sh/sh.h (LOCAL_ALIGNMENT): Use as_a <fixed_size_mode>.
2753 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2754             Alan Hayward  <alan.hayward@arm.com>
2755             David Sherwood  <david.sherwood@arm.com>
2757         * expr.c (expand_assignment): Cope with polynomial mode sizes
2758         when assigning to a CONCAT.
2760 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2761             Alan Hayward  <alan.hayward@arm.com>
2762             David Sherwood  <david.sherwood@arm.com>
2764         * machmode.h (mode_precision): Change from unsigned short to
2765         poly_uint16_pod.
2766         (mode_to_precision): Return a poly_uint16 rather than an unsigned
2767         short.
2768         (GET_MODE_PRECISION): Return a constant if ONLY_FIXED_SIZE_MODES,
2769         or if measurement_type is not polynomial.
2770         (HWI_COMPUTABLE_MODE_P): Turn into a function.  Optimize the case
2771         in which the mode is already known to be a scalar_int_mode.
2772         * genmodes.c (emit_mode_precision): Change the type of mode_precision
2773         from unsigned short to poly_uint16_pod.  Use ZERO_COEFFS for the
2774         initializer.
2775         * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
2776         for GET_MODE_PRECISION.
2777         * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
2778         for GET_MODE_PRECISION.
2779         * combine.c (update_rsp_from_reg_equal): Treat GET_MODE_PRECISION
2780         as polynomial.
2781         (try_combine, find_split_point, combine_simplify_rtx): Likewise.
2782         (expand_field_assignment, make_extraction): Likewise.
2783         (make_compound_operation_int, record_dead_and_set_regs_1): Likewise.
2784         (get_last_value): Likewise.
2785         * convert.c (convert_to_integer_1): Likewise.
2786         * cse.c (cse_insn): Likewise.
2787         * expr.c (expand_expr_real_1): Likewise.
2788         * lra-constraints.c (simplify_operand_subreg): Likewise.
2789         * optabs-query.c (can_atomic_load_p): Likewise.
2790         * optabs.c (expand_atomic_load): Likewise.
2791         (expand_atomic_store): Likewise.
2792         * ree.c (combine_reaching_defs): Likewise.
2793         * rtl.h (partial_subreg_p, paradoxical_subreg_p): Likewise.
2794         * rtlanal.c (nonzero_bits1, lsb_bitfield_op_p): Likewise.
2795         * tree.h (type_has_mode_precision_p): Likewise.
2796         * ubsan.c (instrument_si_overflow): Likewise.
2798 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2799             Alan Hayward  <alan.hayward@arm.com>
2800             David Sherwood  <david.sherwood@arm.com>
2802         * tree.h (TYPE_VECTOR_SUBPARTS): Turn into a function and handle
2803         polynomial numbers of units.
2804         (SET_TYPE_VECTOR_SUBPARTS): Likewise.
2805         (valid_vector_subparts_p): New function.
2806         (build_vector_type): Remove temporary shim and take the number
2807         of units as a poly_uint64 rather than an int.
2808         (build_opaque_vector_type): Take the number of units as a
2809         poly_uint64 rather than an int.
2810         * tree.c (build_vector_from_ctor): Handle polynomial
2811         TYPE_VECTOR_SUBPARTS.
2812         (type_hash_canon_hash, type_cache_hasher::equal): Likewise.
2813         (uniform_vector_p, vector_type_mode, build_vector): Likewise.
2814         (build_vector_from_val): If the number of units is variable,
2815         use build_vec_duplicate_cst for constant operands and
2816         VEC_DUPLICATE_EXPR otherwise.
2817         (make_vector_type): Remove temporary is_constant ().
2818         (build_vector_type, build_opaque_vector_type): Take the number of
2819         units as a poly_uint64 rather than an int.
2820         (check_vector_cst): Handle polynomial TYPE_VECTOR_SUBPARTS and
2821         VECTOR_CST_NELTS.
2822         * cfgexpand.c (expand_debug_expr): Likewise.
2823         * expr.c (count_type_elements, categorize_ctor_elements_1): Likewise.
2824         (store_constructor, expand_expr_real_1): Likewise.
2825         (const_scalar_mask_from_tree): Likewise.
2826         * fold-const-call.c (fold_const_reduction): Likewise.
2827         * fold-const.c (const_binop, const_unop, fold_convert_const): Likewise.
2828         (operand_equal_p, fold_vec_perm, fold_ternary_loc): Likewise.
2829         (native_encode_vector, vec_cst_ctor_to_array): Likewise.
2830         (fold_relational_const): Likewise.
2831         (native_interpret_vector): Likewise.  Change the size from an
2832         int to an unsigned int.
2833         * gimple-fold.c (gimple_fold_stmt_to_constant_1): Handle polynomial
2834         TYPE_VECTOR_SUBPARTS.
2835         (gimple_fold_indirect_ref, gimple_build_vector): Likewise.
2836         (gimple_build_vector_from_val): Use VEC_DUPLICATE_EXPR when
2837         duplicating a non-constant operand into a variable-length vector.
2838         * hsa-brig.c (hsa_op_immed::emit_to_buffer): Handle polynomial
2839         TYPE_VECTOR_SUBPARTS and VECTOR_CST_NELTS.
2840         * ipa-icf.c (sem_variable::equals): Likewise.
2841         * match.pd: Likewise.
2842         * omp-simd-clone.c (simd_clone_subparts): Likewise.
2843         * print-tree.c (print_node): Likewise.
2844         * stor-layout.c (layout_type): Likewise.
2845         * targhooks.c (default_builtin_vectorization_cost): Likewise.
2846         * tree-cfg.c (verify_gimple_comparison): Likewise.
2847         (verify_gimple_assign_binary): Likewise.
2848         (verify_gimple_assign_ternary): Likewise.
2849         (verify_gimple_assign_single): Likewise.
2850         * tree-pretty-print.c (dump_generic_node): Likewise.
2851         * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
2852         (simplify_bitfield_ref, is_combined_permutation_identity): Likewise.
2853         * tree-vect-data-refs.c (vect_permute_store_chain): Likewise.
2854         (vect_grouped_load_supported, vect_permute_load_chain): Likewise.
2855         (vect_shift_permute_load_chain): Likewise.
2856         * tree-vect-generic.c (nunits_for_known_piecewise_op): Likewise.
2857         (expand_vector_condition, optimize_vector_constructor): Likewise.
2858         (lower_vec_perm, get_compute_type): Likewise.
2859         * tree-vect-loop.c (vect_determine_vectorization_factor): Likewise.
2860         (get_initial_defs_for_reduction, vect_transform_loop): Likewise.
2861         * tree-vect-patterns.c (vect_recog_bool_pattern): Likewise.
2862         (vect_recog_mask_conversion_pattern): Likewise.
2863         * tree-vect-slp.c (vect_supported_load_permutation_p): Likewise.
2864         (vect_get_constant_vectors, vect_transform_slp_perm_load): Likewise.
2865         * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
2866         (get_group_load_store_type, vectorizable_mask_load_store): Likewise.
2867         (vectorizable_bswap, simd_clone_subparts, vectorizable_assignment)
2868         (vectorizable_shift, vectorizable_operation, vectorizable_store)
2869         (vectorizable_load, vect_is_simple_cond, vectorizable_comparison)
2870         (supportable_widening_operation): Likewise.
2871         (supportable_narrowing_operation): Likewise.
2872         * tree-vector-builder.c (tree_vector_builder::binary_encoded_nelts):
2873         Likewise.
2874         * varasm.c (output_constant): Likewise.
2876 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2877             Alan Hayward  <alan.hayward@arm.com>
2878             David Sherwood  <david.sherwood@arm.com>
2880         * tree-vect-data-refs.c (vect_permute_store_chain): Reorganize
2881         so that both the length == 3 and length != 3 cases set up their
2882         own permute vectors.  Add comments explaining why we know the
2883         number of elements is constant.
2884         (vect_permute_load_chain): Likewise.
2886 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2887             Alan Hayward  <alan.hayward@arm.com>
2888             David Sherwood  <david.sherwood@arm.com>
2890         * machmode.h (mode_nunits): Change from unsigned char to
2891         poly_uint16_pod.
2892         (ONLY_FIXED_SIZE_MODES): New macro.
2893         (pod_mode::measurement_type, scalar_int_mode::measurement_type)
2894         (scalar_float_mode::measurement_type, scalar_mode::measurement_type)
2895         (complex_mode::measurement_type, fixed_size_mode::measurement_type):
2896         New typedefs.
2897         (mode_to_nunits): Return a poly_uint16 rather than an unsigned short.
2898         (GET_MODE_NUNITS): Return a constant if ONLY_FIXED_SIZE_MODES,
2899         or if measurement_type is not polynomial.
2900         * genmodes.c (ZERO_COEFFS): New macro.
2901         (emit_mode_nunits_inline): Make mode_nunits_inline return a
2902         poly_uint16.
2903         (emit_mode_nunits): Change the type of mode_nunits to poly_uint16_pod.
2904         Use ZERO_COEFFS when emitting initializers.
2905         * data-streamer.h (bp_pack_poly_value): New function.
2906         (bp_unpack_poly_value): Likewise.
2907         * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
2908         for GET_MODE_NUNITS.
2909         * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
2910         for GET_MODE_NUNITS.
2911         * tree.c (make_vector_type): Remove temporary shim and make
2912         the real function take the number of units as a poly_uint64
2913         rather than an int.
2914         (build_vector_type_for_mode): Handle polynomial nunits.
2915         * dwarf2out.c (loc_descriptor, add_const_value_attribute): Likewise.
2916         * emit-rtl.c (const_vec_series_p_1): Likewise.
2917         (gen_rtx_CONST_VECTOR): Likewise.
2918         * fold-const.c (test_vec_duplicate_folding): Likewise.
2919         * genrecog.c (validate_pattern): Likewise.
2920         * optabs-query.c (can_vec_perm_var_p, can_mult_highpart_p): Likewise.
2921         * optabs-tree.c (expand_vec_cond_expr_p): Likewise.
2922         * optabs.c (expand_vector_broadcast, expand_binop_directly): Likewise.
2923         (shift_amt_for_vec_perm_mask, expand_vec_perm_var): Likewise.
2924         (expand_vec_cond_expr, expand_mult_highpart): Likewise.
2925         * rtlanal.c (subreg_get_info): Likewise.
2926         * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
2927         (vect_grouped_load_supported): Likewise.
2928         * tree-vect-generic.c (type_for_widest_vector_mode): Likewise.
2929         * tree-vect-loop.c (have_whole_vector_shift): Likewise.
2930         * simplify-rtx.c (simplify_unary_operation_1): Likewise.
2931         (simplify_const_unary_operation, simplify_binary_operation_1)
2932         (simplify_const_binary_operation, simplify_ternary_operation)
2933         (test_vector_ops_duplicate, test_vector_ops): Likewise.
2934         (simplify_immed_subreg): Use GET_MODE_NUNITS on a fixed_size_mode
2935         instead of CONST_VECTOR_NUNITS.
2936         * varasm.c (output_constant_pool_2): Likewise.
2937         * rtx-vector-builder.c (rtx_vector_builder::build): Only include the
2938         explicit-encoded elements in the XVEC for variable-length vectors.
2940 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2942         * lra-constraints.c (curr_insn_transform): Use partial_subreg_p.
2944 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2945             Alan Hayward  <alan.hayward@arm.com>
2946             David Sherwood  <david.sherwood@arm.com>
2948         * coretypes.h (fixed_size_mode): Declare.
2949         (fixed_size_mode_pod): New typedef.
2950         * builtins.h (target_builtins::x_apply_args_mode)
2951         (target_builtins::x_apply_result_mode): Change type to
2952         fixed_size_mode_pod.
2953         * builtins.c (apply_args_size, apply_result_size, result_vector)
2954         (expand_builtin_apply_args_1, expand_builtin_apply)
2955         (expand_builtin_return): Update accordingly.
2957 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2959         * cse.c (hash_rtx_cb): Hash only the encoded elements.
2960         * cselib.c (cselib_hash_rtx): Likewise.
2961         * expmed.c (make_tree): Build VECTOR_CSTs directly from the
2962         CONST_VECTOR encoding.
2964 2017-01-03  Jakub Jelinek  <jakub@redhat.com>
2965             Jeff Law  <law@redhat.com>
2967         PR target/83641
2968         * config/i386/i386.c (ix86_adjust_stack_and_probe_stack_clash): For
2969         noreturn probe, use gen_pop instead of ix86_emit_restore_reg_using_pop,
2970         only set RTX_FRAME_RELATED_P on both the push and pop if cfa_reg is sp
2971         and add REG_CFA_ADJUST_CFA notes in that case to both insns.
2973         PR target/83641
2974         * config/i386/i386.c (ix86_adjust_stack_and_probe_stack_clash): Do not
2975         explicitly probe *sp in a noreturn function if there were any callee
2976         register saves or frame pointer is needed.
2978 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
2980         PR debug/83621
2981         * cfgexpand.c (expand_debug_expr): Return NULL if mode is
2982         BLKmode for ternary, binary or unary expressions.
2984         PR debug/83645
2985         * var-tracking.c (delete_vta_debug_insn): New inline function.
2986         (delete_vta_debug_insns): Add USE_CFG argument, if true, walk just
2987         insns from get_insns () to NULL instead of each bb separately.
2988         Use delete_vta_debug_insn.  No longer static.
2989         (vt_debug_insns_local, variable_tracking_main_1): Adjust
2990         delete_vta_debug_insns callers.
2991         * rtl.h (delete_vta_debug_insns): Declare.
2992         * final.c (rest_of_handle_final): Call delete_vta_debug_insns
2993         instead of variable_tracking_main.
2995 2018-01-03  Martin Sebor  <msebor@redhat.com>
2997         PR tree-optimization/83603
2998         * calls.c (maybe_warn_nonstring_arg): Avoid accessing function
2999         arguments past the endof the argument list in functions declared
3000         without a prototype.
3001         * gimple-ssa-warn-restrict.c (wrestrict_dom_walker::check_call):
3002         Avoid checking when arguments are null.
3004 2018-01-03  Martin Sebor  <msebor@redhat.com>
3006         PR c/83559
3007         * doc/extend.texi (attribute const): Fix a typo.
3008         * ipa-pure-const.c ((warn_function_const, warn_function_pure): Avoid
3009         issuing -Wsuggest-attribute for void functions.
3011 2018-01-03  Martin Sebor  <msebor@redhat.com>
3013         * gimple-ssa-warn-restrict.c (builtin_memref::builtin_memref): Use
3014         offset_int::from instead of wide_int::to_shwi.
3015         (maybe_diag_overlap): Remove assertion.
3016         Use HOST_WIDE_INT_PRINT_DEC instead of %lli.
3017         * gimple-ssa-sprintf.c (format_directive): Same.
3018         (parse_directive): Same.
3019         (sprintf_dom_walker::compute_format_length): Same.
3020         (try_substitute_return_value): Same.
3022 2017-01-03  Jeff Law  <law@redhat.com>
3024         PR middle-end/83654
3025         * explow.c (anti_adjust_stack_and_probe_stack_clash): Test a
3026         non-constant residual for zero at runtime and avoid probing in
3027         that case.  Reorganize code for trailing problem to mirror handling
3028         of the residual.
3030 2018-01-03  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
3032         PR tree-optimization/83501
3033         * tree-ssa-strlen.c (get_string_cst): New.
3034         (handle_char_store): Call get_string_cst.
3036 2018-01-03  Martin Liska  <mliska@suse.cz>
3038         PR tree-optimization/83593
3039         * tree-ssa-strlen.c: Include tree-cfg.h.
3040         (strlen_check_and_optimize_stmt): Add new argument cleanup_eh.
3041         (strlen_dom_walker): Add new member variable m_cleanup_cfg.
3042         (strlen_dom_walker::strlen_dom_walker): Initialize m_cleanup_cfg
3043         to false.
3044         (strlen_dom_walker::before_dom_children): Call
3045         gimple_purge_dead_eh_edges. Dump tranformation with details
3046         dump flags.
3047         (strlen_dom_walker::before_dom_children): Update call by adding
3048         new argument cleanup_eh.
3049         (pass_strlen::execute): Return TODO_cleanup_cfg if needed.
3051 2018-01-03  Martin Liska  <mliska@suse.cz>
3053         PR ipa/83549
3054         * cif-code.def (VARIADIC_THUNK): New enum value.
3055         * ipa-fnsummary.c (compute_fn_summary): Do not inline variadic
3056         thunks.
3058 2018-01-03  Jan Beulich  <jbeulich@suse.com>
3060         * sse.md (mov<mode>_internal): Tighten condition for when to use
3061         vmovdqu<ssescalarsize> for TI and OI modes.
3063 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
3065         Update copyright years.
3067 2018-01-03  Martin Liska  <mliska@suse.cz>
3069         PR ipa/83594
3070         * ipa-visibility.c (function_and_variable_visibility): Skip
3071         functions with noipa attribure.
3073 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
3075         * gcc.c (process_command): Update copyright notice dates.
3076         * gcov-dump.c (print_version): Ditto.
3077         * gcov.c (print_version): Ditto.
3078         * gcov-tool.c (print_version): Ditto.
3079         * gengtype.c (create_file): Ditto.
3080         * doc/cpp.texi: Bump @copying's copyright year.
3081         * doc/cppinternals.texi: Ditto.
3082         * doc/gcc.texi: Ditto.
3083         * doc/gccint.texi: Ditto.
3084         * doc/gcov.texi: Ditto.
3085         * doc/install.texi: Ditto.
3086         * doc/invoke.texi: Ditto.
3088 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3090         * vector-builder.h (vector_builder::m_full_nelts): Change from
3091         unsigned int to poly_uint64.
3092         (vector_builder::full_nelts): Update prototype accordingly.
3093         (vector_builder::new_vector): Likewise.
3094         (vector_builder::encoded_full_vector_p): Handle polynomial full_nelts.
3095         (vector_builder::operator ==): Likewise.
3096         (vector_builder::finalize): Likewise.
3097         * int-vector-builder.h (int_vector_builder::int_vector_builder):
3098         Take the number of elements as a poly_uint64 rather than an
3099         unsigned int.
3100         * vec-perm-indices.h (vec_perm_indices::m_nelts_per_input): Change
3101         from unsigned int to poly_uint64.
3102         (vec_perm_indices::vec_perm_indices): Update prototype accordingly.
3103         (vec_perm_indices::new_vector): Likewise.
3104         (vec_perm_indices::length): Likewise.
3105         (vec_perm_indices::nelts_per_input): Likewise.
3106         (vec_perm_indices::input_nelts): Likewise.
3107         * vec-perm-indices.c (vec_perm_indices::new_vector): Take the
3108         number of elements per input as a poly_uint64 rather than an
3109         unsigned int.  Use the original encoding for variable-length
3110         vectors, rather than clamping each individual element.
3111         For the second and subsequent elements in each pattern,
3112         clamp the step and base before clamping their sum.
3113         (vec_perm_indices::series_p): Handle polynomial element counts.
3114         (vec_perm_indices::all_in_range_p): Likewise.
3115         (vec_perm_indices_to_tree): Likewise.
3116         (vec_perm_indices_to_rtx): Likewise.
3117         * tree-vect-stmts.c (vect_gen_perm_mask_any): Likewise.
3118         * tree-vector-builder.c (tree_vector_builder::new_unary_operation)
3119         (tree_vector_builder::new_binary_operation): Handle polynomial
3120         element counts.  Return false if we need to know the number
3121         of elements at compile time.
3122         * fold-const.c (fold_vec_perm): Punt if the number of elements
3123         isn't known at compile time.
3125 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3127         * vec-perm-indices.h (vec_perm_builder): Change element type
3128         from HOST_WIDE_INT to poly_int64.
3129         (vec_perm_indices::element_type): Update accordingly.
3130         (vec_perm_indices::clamp): Handle polynomial element_types.
3131         * vec-perm-indices.c (vec_perm_indices::series_p): Likewise.
3132         (vec_perm_indices::all_in_range_p): Likewise.
3133         (tree_to_vec_perm_builder): Check for poly_int64 trees rather
3134         than shwi trees.
3135         * vector-builder.h (vector_builder::stepped_sequence_p): Handle
3136         polynomial vec_perm_indices element types.
3137         * int-vector-builder.h (int_vector_builder::equal_p): Likewise.
3138         * fold-const.c (fold_vec_perm): Likewise.
3139         * optabs.c (shift_amt_for_vec_perm_mask): Likewise.
3140         * tree-vect-generic.c (lower_vec_perm): Likewise.
3141         * tree-vect-slp.c (vect_transform_slp_perm_load): Likewise.
3142         * config/aarch64/aarch64.c (aarch64_evpc_tbl): Cast d->perm
3143         element type to HOST_WIDE_INT.
3145 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3146             Alan Hayward  <alan.hayward@arm.com>
3147             David Sherwood  <david.sherwood@arm.com>
3149         * alias.c (addr_side_effect_eval): Take the size as a poly_int64
3150         rather than an int.  Use plus_constant.
3151         (memrefs_conflict_p): Take the sizes as poly_int64s rather than ints.
3152         Take the offset "c" as a poly_int64 rather than a HOST_WIDE_INT.
3154 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3155             Alan Hayward  <alan.hayward@arm.com>
3156             David Sherwood  <david.sherwood@arm.com>
3158         * calls.c (emit_call_1, expand_call): Change struct_value_size from
3159         a HOST_WIDE_INT to a poly_int64.
3161 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3162             Alan Hayward  <alan.hayward@arm.com>
3163             David Sherwood  <david.sherwood@arm.com>
3165         * calls.c (load_register_parameters): Cope with polynomial
3166         mode sizes.  Require a constant size for BLKmode parameters
3167         that aren't described by a PARALLEL.  If BLOCK_REG_PADDING
3168         forces a parameter to be padded at the lsb end in order to
3169         fill a complete number of words, require the parameter size
3170         to be ordered wrt UNITS_PER_WORD.
3172 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3173             Alan Hayward  <alan.hayward@arm.com>
3174             David Sherwood  <david.sherwood@arm.com>
3176         * reload1.c (spill_stack_slot_width): Change element type
3177         from unsigned int to poly_uint64_pod.
3178         (alter_reg): Treat mode sizes as polynomial.
3180 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3181             Alan Hayward  <alan.hayward@arm.com>
3182             David Sherwood  <david.sherwood@arm.com>
3184         * reload.c (complex_word_subreg_p): New function.
3185         (reload_inner_reg_of_subreg, push_reload): Use it.
3187 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3188             Alan Hayward  <alan.hayward@arm.com>
3189             David Sherwood  <david.sherwood@arm.com>
3191         * lra-constraints.c (process_alt_operands): Reject matched
3192         operands whose sizes aren't ordered.
3193         (match_reload): Refer to this check here.
3195 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3196             Alan Hayward  <alan.hayward@arm.com>
3197             David Sherwood  <david.sherwood@arm.com>
3199         * builtins.c (expand_ifn_atomic_compare_exchange_into_call): Assert
3200         that the mode size is in the set {1, 2, 4, 8, 16}.
3202 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3203             Alan Hayward  <alan.hayward@arm.com>
3204             David Sherwood  <david.sherwood@arm.com>
3206         * var-tracking.c (adjust_mems): Treat mode sizes as polynomial.
3207         Use plus_constant instead of gen_rtx_PLUS.
3209 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3210             Alan Hayward  <alan.hayward@arm.com>
3211             David Sherwood  <david.sherwood@arm.com>
3213         * config/cr16/cr16-protos.h (cr16_push_rounding): Declare.
3214         * config/cr16/cr16.h (PUSH_ROUNDING): Move implementation to...
3215         * config/cr16/cr16.c (cr16_push_rounding): ...this new function.
3216         * config/h8300/h8300-protos.h (h8300_push_rounding): Declare.
3217         * config/h8300/h8300.h (PUSH_ROUNDING): Move implementation to...
3218         * config/h8300/h8300.c (h8300_push_rounding): ...this new function.
3219         * config/i386/i386-protos.h (ix86_push_rounding): Declare.
3220         * config/i386/i386.h (PUSH_ROUNDING): Move implementation to...
3221         * config/i386/i386.c (ix86_push_rounding): ...this new function.
3222         * config/m32c/m32c-protos.h (m32c_push_rounding): Take and return
3223         a poly_int64.
3224         * config/m32c/m32c.c (m32c_push_rounding): Likewise.
3225         * config/m68k/m68k-protos.h (m68k_push_rounding): Declare.
3226         * config/m68k/m68k.h (PUSH_ROUNDING): Move implementation to...
3227         * config/m68k/m68k.c (m68k_push_rounding): ...this new function.
3228         * config/pdp11/pdp11-protos.h (pdp11_push_rounding): Declare.
3229         * config/pdp11/pdp11.h (PUSH_ROUNDING): Move implementation to...
3230         * config/pdp11/pdp11.c (pdp11_push_rounding): ...this new function.
3231         * config/stormy16/stormy16-protos.h (xstormy16_push_rounding): Declare.
3232         * config/stormy16/stormy16.h (PUSH_ROUNDING): Move implementation to...
3233         * config/stormy16/stormy16.c (xstormy16_push_rounding): ...this new
3234         function.
3235         * expr.c (emit_move_resolve_push): Treat the input and result
3236         of PUSH_ROUNDING as a poly_int64.
3237         (emit_move_complex_push, emit_single_push_insn_1): Likewise.
3238         (emit_push_insn): Likewise.
3239         * lra-eliminations.c (mark_not_eliminable): Likewise.
3240         * recog.c (push_operand): Likewise.
3241         * reload1.c (elimination_effects): Likewise.
3242         * rtlanal.c (nonzero_bits1): Likewise.
3243         * calls.c (store_one_arg): Likewise.  Require the padding to be
3244         known at compile time.
3246 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3247             Alan Hayward  <alan.hayward@arm.com>
3248             David Sherwood  <david.sherwood@arm.com>
3250         * expr.c (emit_single_push_insn_1): Treat mode sizes as polynomial.
3251         Use plus_constant instead of gen_rtx_PLUS.
3253 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3254             Alan Hayward  <alan.hayward@arm.com>
3255             David Sherwood  <david.sherwood@arm.com>
3257         * auto-inc-dec.c (set_inc_state): Take the mode size as a poly_int64
3258         rather than an int.
3260 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3261             Alan Hayward  <alan.hayward@arm.com>
3262             David Sherwood  <david.sherwood@arm.com>
3264         * expr.c (expand_expr_real_1): Use tree_to_poly_uint64
3265         instead of int_size_in_bytes when handling VIEW_CONVERT_EXPRs
3266         via stack temporaries.  Treat the mode size as polynomial too.
3268 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3269             Alan Hayward  <alan.hayward@arm.com>
3270             David Sherwood  <david.sherwood@arm.com>
3272         * expr.c (expand_expr_real_2): When handling conversions involving
3273         unions, apply tree_to_poly_uint64 to the TYPE_SIZE rather than
3274         multiplying int_size_in_bytes by BITS_PER_UNIT.  Treat GET_MODE_BISIZE
3275         as a poly_uint64 too.
3277 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3278             Alan Hayward  <alan.hayward@arm.com>
3279             David Sherwood  <david.sherwood@arm.com>
3281         * rtlanal.c (subreg_get_info): Handle polynomial mode sizes.
3283 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3284             Alan Hayward  <alan.hayward@arm.com>
3285             David Sherwood  <david.sherwood@arm.com>
3287         * combine.c (can_change_dest_mode): Handle polynomial
3288         REGMODE_NATURAL_SIZE.
3289         * expmed.c (store_bit_field_1): Likewise.
3290         * expr.c (store_constructor): Likewise.
3291         * emit-rtl.c (validate_subreg): Operate on polynomial mode sizes
3292         and polynomial REGMODE_NATURAL_SIZE.
3293         (gen_lowpart_common): Likewise.
3294         * reginfo.c (record_subregs_of_mode): Likewise.
3295         * rtlanal.c (read_modify_subreg_p): Likewise.
3297 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3298             Alan Hayward  <alan.hayward@arm.com>
3299             David Sherwood  <david.sherwood@arm.com>
3301         * internal-fn.c (expand_vector_ubsan_overflow): Handle polynomial
3302         numbers of elements.
3304 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3305             Alan Hayward  <alan.hayward@arm.com>
3306             David Sherwood  <david.sherwood@arm.com>
3308         * match.pd: Cope with polynomial numbers of vector elements.
3310 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3311             Alan Hayward  <alan.hayward@arm.com>
3312             David Sherwood  <david.sherwood@arm.com>
3314         * fold-const.c (fold_indirect_ref_1): Handle polynomial offsets
3315         in a POINTER_PLUS_EXPR.
3317 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3318             Alan Hayward  <alan.hayward@arm.com>
3319             David Sherwood  <david.sherwood@arm.com>
3321         * omp-simd-clone.c (simd_clone_subparts): New function.
3322         (simd_clone_init_simd_arrays): Use it instead of TYPE_VECTOR_SUBPARTS.
3323         (ipa_simd_modify_function_body): Likewise.
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         * tree-vect-generic.c (nunits_for_known_piecewise_op): New function.
3330         (expand_vector_piecewise): Use it instead of TYPE_VECTOR_SUBPARTS.
3331         (expand_vector_addition, add_rshift, expand_vector_divmod): Likewise.
3332         (expand_vector_condition, vector_element): Likewise.
3333         (subparts_gt): New function.
3334         (get_compute_type): Use subparts_gt.
3335         (count_type_subparts): Delete.
3336         (expand_vector_operations_1): Use subparts_gt instead of
3337         count_type_subparts.
3339 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3340             Alan Hayward  <alan.hayward@arm.com>
3341             David Sherwood  <david.sherwood@arm.com>
3343         * tree-vect-data-refs.c (vect_no_alias_p): Replace with...
3344         (vect_compile_time_alias): ...this new function.  Do the calculation
3345         on poly_ints rather than trees.
3346         (vect_prune_runtime_alias_test_list): Update call accordingly.
3348 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3349             Alan Hayward  <alan.hayward@arm.com>
3350             David Sherwood  <david.sherwood@arm.com>
3352         * tree-vect-slp.c (vect_build_slp_tree_1): Handle polynomial
3353         numbers of units.
3354         (vect_schedule_slp_instance): Likewise.
3356 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3357             Alan Hayward  <alan.hayward@arm.com>
3358             David Sherwood  <david.sherwood@arm.com>
3360         * tree-vect-slp.c (vect_get_and_check_slp_defs): Reject
3361         constant and extern definitions for variable-length vectors.
3362         (vect_get_constant_vectors): Note that the number of units
3363         is known to be constant.
3365 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3366             Alan Hayward  <alan.hayward@arm.com>
3367             David Sherwood  <david.sherwood@arm.com>
3369         * tree-vect-stmts.c (vectorizable_conversion): Treat the number
3370         of units as polynomial.  Choose between WIDE and NARROW based
3371         on multiple_p.
3373 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3374             Alan Hayward  <alan.hayward@arm.com>
3375             David Sherwood  <david.sherwood@arm.com>
3377         * tree-vect-stmts.c (simd_clone_subparts): New function.
3378         (vectorizable_simd_clone_call): Use it instead of TYPE_VECTOR_SUBPARTS.
3380 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3381             Alan Hayward  <alan.hayward@arm.com>
3382             David Sherwood  <david.sherwood@arm.com>
3384         * tree-vect-stmts.c (vectorizable_call): Treat the number of
3385         vectors as polynomial.  Use build_index_vector for
3386         IFN_GOMP_SIMD_LANE.
3388 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3389             Alan Hayward  <alan.hayward@arm.com>
3390             David Sherwood  <david.sherwood@arm.com>
3392         * tree-vect-stmts.c (get_load_store_type): Treat the number of
3393         units as polynomial.  Reject VMAT_ELEMENTWISE and VMAT_STRIDED_SLP
3394         for variable-length vectors.
3395         (vectorizable_mask_load_store): Treat the number of units as
3396         polynomial, asserting that it is constant if the condition has
3397         already been enforced.
3398         (vectorizable_store, vectorizable_load): Likewise.
3400 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3401             Alan Hayward  <alan.hayward@arm.com>
3402             David Sherwood  <david.sherwood@arm.com>
3404         * tree-vect-loop.c (vectorizable_live_operation): Treat the number
3405         of units as polynomial.  Punt if we can't tell at compile time
3406         which vector contains the final result.
3408 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3409             Alan Hayward  <alan.hayward@arm.com>
3410             David Sherwood  <david.sherwood@arm.com>
3412         * tree-vect-loop.c (vectorizable_induction): Treat the number
3413         of units as polynomial.  Punt on SLP inductions.  Use an integer
3414         VEC_SERIES_EXPR for variable-length integer reductions.  Use a
3415         cast of such a series for variable-length floating-point
3416         reductions.
3418 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3419             Alan Hayward  <alan.hayward@arm.com>
3420             David Sherwood  <david.sherwood@arm.com>
3422         * tree.h (build_index_vector): Declare.
3423         * tree.c (build_index_vector): New function.
3424         * tree-vect-loop.c (get_initial_defs_for_reduction): Treat the number
3425         of units as polynomial, forcibly converting it to a constant if
3426         vectorizable_reduction has already enforced the condition.
3427         (vect_create_epilog_for_reduction): Likewise.  Use build_index_vector
3428         to create a {1,2,3,...} vector.
3429         (vectorizable_reduction): Treat the number of units as polynomial.
3430         Choose vectype_in based on the largest scalar element size rather
3431         than the smallest number of units.  Enforce the restrictions
3432         relied on above.
3434 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3435             Alan Hayward  <alan.hayward@arm.com>
3436             David Sherwood  <david.sherwood@arm.com>
3438         * tree-vect-data-refs.c (vector_alignment_reachable_p): Treat the
3439         number of units as polynomial.
3441 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3442             Alan Hayward  <alan.hayward@arm.com>
3443             David Sherwood  <david.sherwood@arm.com>
3445         * target.h (vector_sizes, auto_vector_sizes): New typedefs.
3446         * target.def (autovectorize_vector_sizes): Return the vector sizes
3447         by pointer, using vector_sizes rather than a bitmask.
3448         * targhooks.h (default_autovectorize_vector_sizes): Update accordingly.
3449         * targhooks.c (default_autovectorize_vector_sizes): Likewise.
3450         * config/aarch64/aarch64.c (aarch64_autovectorize_vector_sizes):
3451         Likewise.
3452         * config/arc/arc.c (arc_autovectorize_vector_sizes): Likewise.
3453         * config/arm/arm.c (arm_autovectorize_vector_sizes): Likewise.
3454         * config/i386/i386.c (ix86_autovectorize_vector_sizes): Likewise.
3455         * config/mips/mips.c (mips_autovectorize_vector_sizes): Likewise.
3456         * omp-general.c (omp_max_vf): Likewise.
3457         * omp-low.c (omp_clause_aligned_alignment): Likewise.
3458         * optabs-query.c (can_vec_mask_load_store_p): Likewise.
3459         * tree-vect-loop.c (vect_analyze_loop): Likewise.
3460         * tree-vect-slp.c (vect_slp_bb): Likewise.
3461         * doc/tm.texi: Regenerate.
3462         * tree-vectorizer.h (current_vector_size): Change from an unsigned int
3463         to a poly_uint64.
3464         * tree-vect-stmts.c (get_vectype_for_scalar_type_and_size): Take
3465         the vector size as a poly_uint64 rather than an unsigned int.
3466         (current_vector_size): Change from an unsigned int to a poly_uint64.
3467         (get_vectype_for_scalar_type): Update accordingly.
3468         * tree.h (build_truth_vector_type): Take the size and number of
3469         units as a poly_uint64 rather than an unsigned int.
3470         (build_vector_type): Add a temporary overload that takes
3471         the number of units as a poly_uint64 rather than an unsigned int.
3472         * tree.c (make_vector_type): Likewise.
3473         (build_truth_vector_type): Take the number of units as a poly_uint64
3474         rather than an unsigned int.
3476 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3477             Alan Hayward  <alan.hayward@arm.com>
3478             David Sherwood  <david.sherwood@arm.com>
3480         * target.def (get_mask_mode): Take the number of units and length
3481         as poly_uint64s rather than unsigned ints.
3482         * targhooks.h (default_get_mask_mode): Update accordingly.
3483         * targhooks.c (default_get_mask_mode): Likewise.
3484         * config/i386/i386.c (ix86_get_mask_mode): Likewise.
3485         * doc/tm.texi: Regenerate.
3487 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3488             Alan Hayward  <alan.hayward@arm.com>
3489             David Sherwood  <david.sherwood@arm.com>
3491         * omp-general.h (omp_max_vf): Return a poly_uint64 instead of an int.
3492         * omp-general.c (omp_max_vf): Likewise.
3493         * omp-expand.c (omp_adjust_chunk_size): Update call to omp_max_vf.
3494         (expand_omp_simd): Handle polynomial safelen.
3495         * omp-low.c (omplow_simd_context): Add a default constructor.
3496         (omplow_simd_context::max_vf): Change from int to poly_uint64.
3497         (lower_rec_simd_input_clauses): Update accordingly.
3498         (lower_rec_input_clauses): Likewise.
3500 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3501             Alan Hayward  <alan.hayward@arm.com>
3502             David Sherwood  <david.sherwood@arm.com>
3504         * tree-vectorizer.h (vect_nunits_for_cost): New function.
3505         * tree-vect-loop.c (vect_model_reduction_cost): Use it.
3506         * tree-vect-slp.c (vect_analyze_slp_cost_1): Likewise.
3507         (vect_analyze_slp_cost): Likewise.
3508         * tree-vect-stmts.c (vect_model_store_cost): Likewise.
3509         (vect_model_load_cost): Likewise.
3511 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3512             Alan Hayward  <alan.hayward@arm.com>
3513             David Sherwood  <david.sherwood@arm.com>
3515         * tree-vect-slp.c (vect_record_max_nunits, vect_build_slp_tree_1)
3516         (vect_build_slp_tree_2, vect_build_slp_tree): Change max_nunits
3517         from an unsigned int * to a poly_uint64_pod *.
3518         (calculate_unrolling_factor): New function.
3519         (vect_analyze_slp_instance): Use it.  Track polynomial max_nunits.
3521 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3522             Alan Hayward  <alan.hayward@arm.com>
3523             David Sherwood  <david.sherwood@arm.com>
3525         * tree-vectorizer.h (_slp_instance::unrolling_factor): Change
3526         from an unsigned int to a poly_uint64.
3527         (_loop_vec_info::slp_unrolling_factor): Likewise.
3528         (_loop_vec_info::vectorization_factor): Change from an int
3529         to a poly_uint64.
3530         (MAX_VECTORIZATION_FACTOR): Bump from 64 to INT_MAX.
3531         (vect_get_num_vectors): New function.
3532         (vect_update_max_nunits, vect_vf_for_cost): Likewise.
3533         (vect_get_num_copies): Use vect_get_num_vectors.
3534         (vect_analyze_data_ref_dependences): Change max_vf from an int *
3535         to an unsigned int *.
3536         (vect_analyze_data_refs): Change min_vf from an int * to a
3537         poly_uint64 *.
3538         (vect_transform_slp_perm_load): Take the vf as a poly_uint64 rather
3539         than an unsigned HOST_WIDE_INT.
3540         * tree-vect-data-refs.c (vect_analyze_possibly_independent_ddr)
3541         (vect_analyze_data_ref_dependence): Change max_vf from an int *
3542         to an unsigned int *.
3543         (vect_analyze_data_ref_dependences): Likewise.
3544         (vect_compute_data_ref_alignment): Handle polynomial vf.
3545         (vect_enhance_data_refs_alignment): Likewise.
3546         (vect_prune_runtime_alias_test_list): Likewise.
3547         (vect_shift_permute_load_chain): Likewise.
3548         (vect_supportable_dr_alignment): Likewise.
3549         (dependence_distance_ge_vf): Take the vectorization factor as a
3550         poly_uint64 rather than an unsigned HOST_WIDE_INT.
3551         (vect_analyze_data_refs): Change min_vf from an int * to a
3552         poly_uint64 *.
3553         * tree-vect-loop-manip.c (vect_gen_scalar_loop_niters): Take
3554         vfm1 as a poly_uint64 rather than an int.  Make the same change
3555         for the returned bound_scalar.
3556         (vect_gen_vector_loop_niters): Handle polynomial vf.
3557         (vect_do_peeling): Likewise.  Update call to
3558         vect_gen_scalar_loop_niters and handle polynomial bound_scalars.
3559         (vect_gen_vector_loop_niters_mult_vf): Assert that the vf must
3560         be constant.
3561         * tree-vect-loop.c (vect_determine_vectorization_factor)
3562         (vect_update_vf_for_slp, vect_analyze_loop_2): Handle polynomial vf.
3563         (vect_get_known_peeling_cost): Likewise.
3564         (vect_estimate_min_profitable_iters, vectorizable_reduction): Likewise.
3565         (vect_worthwhile_without_simd_p, vectorizable_induction): Likewise.
3566         (vect_transform_loop): Likewise.  Use the lowest possible VF when
3567         updating the upper bounds of the loop.
3568         (vect_min_worthwhile_factor): Make static.  Return an unsigned int
3569         rather than an int.
3570         * tree-vect-slp.c (vect_attempt_slp_rearrange_stmts): Cope with
3571         polynomial unroll factors.
3572         (vect_analyze_slp_cost_1, vect_analyze_slp_instance): Likewise.
3573         (vect_make_slp_decision): Likewise.
3574         (vect_supported_load_permutation_p): Likewise, and polynomial
3575         vf too.
3576         (vect_analyze_slp_cost): Handle polynomial vf.
3577         (vect_slp_analyze_node_operations): Likewise.
3578         (vect_slp_analyze_bb_1): Likewise.
3579         (vect_transform_slp_perm_load): Take the vf as a poly_uint64 rather
3580         than an unsigned HOST_WIDE_INT.
3581         * tree-vect-stmts.c (vectorizable_simd_clone_call, vectorizable_store)
3582         (vectorizable_load): Handle polynomial vf.
3583         * tree-vectorizer.c (simduid_to_vf::vf): Change from an int to
3584         a poly_uint64.
3585         (adjust_simduid_builtins, shrink_simd_arrays): Update accordingly.
3587 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3588             Alan Hayward  <alan.hayward@arm.com>
3589             David Sherwood  <david.sherwood@arm.com>
3591         * match.pd: Handle bit operations involving three constants
3592         and try to fold one pair.
3594 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3596         * tree-vect-loop-manip.c: Include gimple-fold.h.
3597         (slpeel_make_loop_iterate_ntimes): Add step, final_iv and
3598         niters_maybe_zero parameters.  Handle other cases besides a step of 1.
3599         (vect_gen_vector_loop_niters): Add a step_vector_ptr parameter.
3600         Add a path that uses a step of VF instead of 1, but disable it
3601         for now.
3602         (vect_do_peeling): Add step_vector, niters_vector_mult_vf_var
3603         and niters_no_overflow parameters.  Update calls to
3604         slpeel_make_loop_iterate_ntimes and vect_gen_vector_loop_niters.
3605         Create a new SSA name if the latter choses to use a ste other
3606         than zero, and return it via niters_vector_mult_vf_var.
3607         * tree-vect-loop.c (vect_transform_loop): Update calls to
3608         vect_do_peeling, vect_gen_vector_loop_niters and
3609         slpeel_make_loop_iterate_ntimes.
3610         * tree-vectorizer.h (slpeel_make_loop_iterate_ntimes, vect_do_peeling)
3611         (vect_gen_vector_loop_niters): Update declarations after above changes.
3613 2018-01-02  Michael Meissner  <meissner@linux.vnet.ibm.com>
3615         * config/rs6000/rs6000.md (floor<mode>2): Add support for IEEE
3616         128-bit round to integer instructions.
3617         (ceil<mode>2): Likewise.
3618         (btrunc<mode>2): Likewise.
3619         (round<mode>2): Likewise.
3621 2018-01-02  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>
3623         * config/rs6000/rs6000-string.c (expand_block_move): Allow the use of
3624         unaligned VSX load/store on P8/P9.
3625         (expand_block_clear): Allow the use of unaligned VSX
3626         load/store on P8/P9.
3628 2018-01-02  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
3630         * config/rs6000/rs6000-p8swap.c (swap_feeds_both_load_and_store):
3631         New function.
3632         (rs6000_analyze_swaps): Mark a web unoptimizable if it contains a
3633         swap associated with both a load and a store.
3635 2018-01-02  Andrew Waterman  <andrew@sifive.com>
3637         * config/riscv/linux.h (ICACHE_FLUSH_FUNC): New.
3638         * config/riscv/riscv.md (clear_cache): Use it.
3640 2018-01-02  Artyom Skrobov  <tyomitch@gmail.com>
3642         * web.c: Remove out-of-date comment.
3644 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
3646         * expr.c (fixup_args_size_notes): Check that any existing
3647         REG_ARGS_SIZE notes are correct, and don't try to re-add them.
3648         (emit_single_push_insn_1): Move stack_pointer_delta adjustment to...
3649         (emit_single_push_insn): ...here.
3651 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
3653         * rtl.h (CONST_VECTOR_ELT): Redefine to const_vector_elt.
3654         (const_vector_encoded_nelts): New function.
3655         (CONST_VECTOR_NUNITS): Redefine to use GET_MODE_NUNITS.
3656         (const_vector_int_elt, const_vector_elt): Declare.
3657         * emit-rtl.c (const_vector_int_elt_1): New function.
3658         (const_vector_elt): Likewise.
3659         * simplify-rtx.c (simplify_immed_subreg): Avoid taking the address
3660         of CONST_VECTOR_ELT.
3662 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
3664         * expr.c: Include rtx-vector-builder.h.
3665         (const_vector_mask_from_tree): Use rtx_vector_builder and operate
3666         directly on the tree encoding.
3667         (const_vector_from_tree): Likewise.
3668         * optabs.c: Include rtx-vector-builder.h.
3669         (expand_vec_perm_var): Use rtx_vector_builder and create a repeating
3670         sequence of "u" values.
3671         * vec-perm-indices.c: Include rtx-vector-builder.h.
3672         (vec_perm_indices_to_rtx): Use rtx_vector_builder and operate
3673         directly on the vec_perm_indices encoding.
3675 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
3677         * doc/rtl.texi (const_vector): Describe new encoding scheme.
3678         * Makefile.in (OBJS): Add rtx-vector-builder.o.
3679         * rtx-vector-builder.h: New file.
3680         * rtx-vector-builder.c: Likewise.
3681         * rtl.h (rtx_def::u2): Add a const_vector field.
3682         (CONST_VECTOR_NPATTERNS): New macro.
3683         (CONST_VECTOR_NELTS_PER_PATTERN): Likewise.
3684         (CONST_VECTOR_DUPLICATE_P): Likewise.
3685         (CONST_VECTOR_STEPPED_P): Likewise.
3686         (CONST_VECTOR_ENCODED_ELT): Likewise.
3687         (const_vec_duplicate_p): Check for a duplicated vector encoding.
3688         (unwrap_const_vec_duplicate): Likewise.
3689         (const_vec_series_p): Check for a non-duplicated vector encoding.
3690         Say that the function only returns true for integer vectors.
3691         * emit-rtl.c: Include rtx-vector-builder.h.
3692         (gen_const_vec_duplicate_1): Delete.
3693         (gen_const_vector): Call gen_const_vec_duplicate instead of
3694         gen_const_vec_duplicate_1.
3695         (const_vec_series_p_1): Operate directly on the CONST_VECTOR encoding.
3696         (gen_const_vec_duplicate): Use rtx_vector_builder.
3697         (gen_const_vec_series): Likewise.
3698         (gen_rtx_CONST_VECTOR): Likewise.
3699         * config/powerpcspe/powerpcspe.c: Include rtx-vector-builder.h.
3700         (swap_const_vector_halves): Take an rtx pointer rather than rtx.
3701         Build a new vector rather than modifying a CONST_VECTOR in-place.
3702         (handle_special_swappables): Update call accordingly.
3703         * config/rs6000/rs6000-p8swap.c: Include rtx-vector-builder.h.
3704         (swap_const_vector_halves): Take an rtx pointer rather than rtx.
3705         Build a new vector rather than modifying a CONST_VECTOR in-place.
3706         (handle_special_swappables): Update call accordingly.
3708 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
3710         * simplify-rtx.c (simplify_const_binary_operation): Use
3711         CONST_VECTOR_ELT instead of XVECEXP.
3713 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
3715         * tree-cfg.c (verify_gimple_assign_ternary): Allow the size of
3716         the selector elements to be different from the data elements
3717         if the selector is a VECTOR_CST.
3718         * tree-vect-stmts.c (vect_gen_perm_mask_any): Use a vector of
3719         ssizetype for the selector.
3721 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
3723         * optabs.c (shift_amt_for_vec_perm_mask): Try using series_p
3724         before testing each element individually.
3725         * tree-vect-generic.c (lower_vec_perm): Likewise.
3727 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
3729         * selftest.h (selftest::vec_perm_indices_c_tests): Declare.
3730         * selftest-run-tests.c (selftest::run_tests): Call it.
3731         * vector-builder.h (vector_builder::operator ==): New function.
3732         (vector_builder::operator !=): Likewise.
3733         * vec-perm-indices.h (vec_perm_indices::series_p): Declare.
3734         (vec_perm_indices::all_from_input_p): New function.
3735         * vec-perm-indices.c (vec_perm_indices::series_p): Likewise.
3736         (test_vec_perm_12, selftest::vec_perm_indices_c_tests): Likewise.
3737         * fold-const.c (fold_ternary_loc): Use tree_to_vec_perm_builder
3738         instead of reading the VECTOR_CST directly.  Detect whether both
3739         vector inputs are the same before constructing the vec_perm_indices,
3740         and update the number of inputs argument accordingly.  Use the
3741         utility functions added above.  Only construct sel2 if we need to.
3743 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
3745         * optabs.c (expand_vec_perm_var): Use an explicit encoding for
3746         the broadcast of the low byte.
3747         (expand_mult_highpart): Use an explicit encoding for the permutes.
3748         * optabs-query.c (can_mult_highpart_p): Likewise.
3749         * tree-vect-loop.c (calc_vec_perm_mask_for_shift): Likewise.
3750         * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
3751         (vectorizable_bswap): Likewise.
3752         * tree-vect-data-refs.c (vect_grouped_store_supported): Use an
3753         explicit encoding for the power-of-2 permutes.
3754         (vect_permute_store_chain): Likewise.
3755         (vect_grouped_load_supported): Likewise.
3756         (vect_permute_load_chain): Likewise.
3758 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
3760         * vec-perm-indices.h (vec_perm_indices_to_tree): Declare.
3761         * vec-perm-indices.c (vec_perm_indices_to_tree): New function.
3762         * tree-ssa-forwprop.c (simplify_vector_constructor): Use it.
3763         * tree-vect-slp.c (vect_transform_slp_perm_load): Likewise.
3764         * tree-vect-stmts.c (vectorizable_bswap): Likewise.
3765         (vect_gen_perm_mask_any): Likewise.
3767 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
3769         * int-vector-builder.h: New file.
3770         * vec-perm-indices.h: Include int-vector-builder.h.
3771         (vec_perm_indices): Redefine as an int_vector_builder.
3772         (auto_vec_perm_indices): Delete.
3773         (vec_perm_builder): Redefine as a stand-alone class.
3774         (vec_perm_indices::vec_perm_indices): New function.
3775         (vec_perm_indices::clamp): Likewise.
3776         * vec-perm-indices.c: Include fold-const.h and tree-vector-builder.h.
3777         (vec_perm_indices::new_vector): New function.
3778         (vec_perm_indices::new_expanded_vector): Update for new
3779         vec_perm_indices class.
3780         (vec_perm_indices::rotate_inputs): New function.
3781         (vec_perm_indices::all_in_range_p): Operate directly on the
3782         encoded form, without computing elided elements.
3783         (tree_to_vec_perm_builder): Operate directly on the VECTOR_CST
3784         encoding.  Update for new vec_perm_indices class.
3785         * optabs.c (expand_vec_perm_const): Create a vec_perm_indices for
3786         the given vec_perm_builder.
3787         (expand_vec_perm_var): Update vec_perm_builder constructor.
3788         (expand_mult_highpart): Use vec_perm_builder instead of
3789         auto_vec_perm_indices.
3790         * optabs-query.c (can_mult_highpart_p): Use vec_perm_builder and
3791         vec_perm_indices instead of auto_vec_perm_indices.  Use a single
3792         or double series encoding as appropriate.
3793         * fold-const.c (fold_ternary_loc): Use vec_perm_builder and
3794         vec_perm_indices instead of auto_vec_perm_indices.
3795         * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
3796         * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
3797         (vect_permute_store_chain): Likewise.
3798         (vect_grouped_load_supported): Likewise.
3799         (vect_permute_load_chain): Likewise.
3800         (vect_shift_permute_load_chain): Likewise.
3801         * tree-vect-slp.c (vect_build_slp_tree_1): Likewise.
3802         (vect_transform_slp_perm_load): Likewise.
3803         (vect_schedule_slp_instance): Likewise.
3804         * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
3805         (vectorizable_mask_load_store): Likewise.
3806         (vectorizable_bswap): Likewise.
3807         (vectorizable_store): Likewise.
3808         (vectorizable_load): Likewise.
3809         * tree-vect-generic.c (lower_vec_perm): Use vec_perm_builder and
3810         vec_perm_indices instead of auto_vec_perm_indices.  Use
3811         tree_to_vec_perm_builder to read the vector from a tree.
3812         * tree-vect-loop.c (calc_vec_perm_mask_for_shift): Take a
3813         vec_perm_builder instead of a vec_perm_indices.
3814         (have_whole_vector_shift): Use vec_perm_builder and
3815         vec_perm_indices instead of auto_vec_perm_indices.  Leave the
3816         truncation to calc_vec_perm_mask_for_shift.
3817         (vect_create_epilog_for_reduction): Likewise.
3818         * config/aarch64/aarch64.c (expand_vec_perm_d::perm): Change
3819         from auto_vec_perm_indices to vec_perm_indices.
3820         (aarch64_expand_vec_perm_const_1): Use rotate_inputs on d.perm
3821         instead of changing individual elements.
3822         (aarch64_vectorize_vec_perm_const): Use new_vector to install
3823         the vector in d.perm.
3824         * config/arm/arm.c (expand_vec_perm_d::perm): Change
3825         from auto_vec_perm_indices to vec_perm_indices.
3826         (arm_expand_vec_perm_const_1): Use rotate_inputs on d.perm
3827         instead of changing individual elements.
3828         (arm_vectorize_vec_perm_const): Use new_vector to install
3829         the vector in d.perm.
3830         * config/powerpcspe/powerpcspe.c (rs6000_expand_extract_even):
3831         Update vec_perm_builder constructor.
3832         (rs6000_expand_interleave): Likewise.
3833         * config/rs6000/rs6000.c (rs6000_expand_extract_even): Likewise.
3834         (rs6000_expand_interleave): Likewise.
3836 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
3838         * optabs-query.c (can_vec_perm_var_p): Check whether lowering
3839         to qimode could truncate the indices.
3840         * optabs.c (expand_vec_perm_var): Likewise.
3842 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
3844         * Makefile.in (OBJS): Add vec-perm-indices.o.
3845         * vec-perm-indices.h: New file.
3846         * vec-perm-indices.c: Likewise.
3847         * target.h (vec_perm_indices): Replace with a forward class
3848         declaration.
3849         (auto_vec_perm_indices): Move to vec-perm-indices.h.
3850         * optabs.h: Include vec-perm-indices.h.
3851         (expand_vec_perm): Delete.
3852         (selector_fits_mode_p, expand_vec_perm_var): Declare.
3853         (expand_vec_perm_const): Declare.
3854         * target.def (vec_perm_const_ok): Replace with...
3855         (vec_perm_const): ...this new hook.
3856         * doc/tm.texi.in (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Replace with...
3857         (TARGET_VECTORIZE_VEC_PERM_CONST): ...this new hook.
3858         * doc/tm.texi: Regenerate.
3859         * optabs.def (vec_perm_const): Delete.
3860         * doc/md.texi (vec_perm_const): Likewise.
3861         (vec_perm): Refer to TARGET_VECTORIZE_VEC_PERM_CONST.
3862         * expr.c (expand_expr_real_2): Use expand_vec_perm_const rather than
3863         expand_vec_perm for constant permutation vectors.  Assert that
3864         the mode of variable permutation vectors is the integer equivalent
3865         of the mode that is being permuted.
3866         * optabs-query.h (selector_fits_mode_p): Declare.
3867         * optabs-query.c: Include vec-perm-indices.h.
3868         (selector_fits_mode_p): New function.
3869         (can_vec_perm_const_p): Check whether targetm.vectorize.vec_perm_const
3870         is defined, instead of checking whether the vec_perm_const_optab
3871         exists.  Use targetm.vectorize.vec_perm_const instead of
3872         targetm.vectorize.vec_perm_const_ok.  Check whether the indices
3873         fit in the vector mode before using a variable permute.
3874         * optabs.c (shift_amt_for_vec_perm_mask): Take a mode and a
3875         vec_perm_indices instead of an rtx.
3876         (expand_vec_perm): Replace with...
3877         (expand_vec_perm_const): ...this new function.  Take the selector
3878         as a vec_perm_indices rather than an rtx.  Also take the mode of
3879         the selector.  Update call to shift_amt_for_vec_perm_mask.
3880         Use targetm.vectorize.vec_perm_const instead of vec_perm_const_optab.
3881         Use vec_perm_indices::new_expanded_vector to expand the original
3882         selector into bytes.  Check whether the indices fit in the vector
3883         mode before using a variable permute.
3884         (expand_vec_perm_var): Make global.
3885         (expand_mult_highpart): Use expand_vec_perm_const.
3886         * fold-const.c: Includes vec-perm-indices.h.
3887         * tree-ssa-forwprop.c: Likewise.
3888         * tree-vect-data-refs.c: Likewise.
3889         * tree-vect-generic.c: Likewise.
3890         * tree-vect-loop.c: Likewise.
3891         * tree-vect-slp.c: Likewise.
3892         * tree-vect-stmts.c: Likewise.
3893         * config/aarch64/aarch64-protos.h (aarch64_expand_vec_perm_const):
3894         Delete.
3895         * config/aarch64/aarch64-simd.md (vec_perm_const<mode>): Delete.
3896         * config/aarch64/aarch64.c (aarch64_expand_vec_perm_const)
3897         (aarch64_vectorize_vec_perm_const_ok): Fuse into...
3898         (aarch64_vectorize_vec_perm_const): ...this new function.
3899         (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
3900         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
3901         * config/arm/arm-protos.h (arm_expand_vec_perm_const): Delete.
3902         * config/arm/vec-common.md (vec_perm_const<mode>): Delete.
3903         * config/arm/arm.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
3904         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
3905         (arm_expand_vec_perm_const, arm_vectorize_vec_perm_const_ok): Merge
3906         into...
3907         (arm_vectorize_vec_perm_const): ...this new function.  Explicitly
3908         check for NEON modes.
3909         * config/i386/i386-protos.h (ix86_expand_vec_perm_const): Delete.
3910         * config/i386/sse.md (VEC_PERM_CONST, vec_perm_const<mode>): Delete.
3911         * config/i386/i386.c (ix86_expand_vec_perm_const_1): Update comment.
3912         (ix86_expand_vec_perm_const, ix86_vectorize_vec_perm_const_ok): Merge
3913         into...
3914         (ix86_vectorize_vec_perm_const): ...this new function.  Incorporate
3915         the old VEC_PERM_CONST conditions.
3916         * config/ia64/ia64-protos.h (ia64_expand_vec_perm_const): Delete.
3917         * config/ia64/vect.md (vec_perm_const<mode>): Delete.
3918         * config/ia64/ia64.c (ia64_expand_vec_perm_const)
3919         (ia64_vectorize_vec_perm_const_ok): Merge into...
3920         (ia64_vectorize_vec_perm_const): ...this new function.
3921         * config/mips/loongson.md (vec_perm_const<mode>): Delete.
3922         * config/mips/mips-msa.md (vec_perm_const<mode>): Delete.
3923         * config/mips/mips-ps-3d.md (vec_perm_constv2sf): Delete.
3924         * config/mips/mips-protos.h (mips_expand_vec_perm_const): Delete.
3925         * config/mips/mips.c (mips_expand_vec_perm_const)
3926         (mips_vectorize_vec_perm_const_ok): Merge into...
3927         (mips_vectorize_vec_perm_const): ...this new function.
3928         * config/powerpcspe/altivec.md (vec_perm_constv16qi): Delete.
3929         * config/powerpcspe/paired.md (vec_perm_constv2sf): Delete.
3930         * config/powerpcspe/spe.md (vec_perm_constv2si): Delete.
3931         * config/powerpcspe/vsx.md (vec_perm_const<mode>): Delete.
3932         * config/powerpcspe/powerpcspe-protos.h (altivec_expand_vec_perm_const)
3933         (rs6000_expand_vec_perm_const): Delete.
3934         * config/powerpcspe/powerpcspe.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK):
3935         Delete.
3936         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
3937         (altivec_expand_vec_perm_const_le): Take each operand individually.
3938         Operate on constant selectors rather than rtxes.
3939         (altivec_expand_vec_perm_const): Likewise.  Update call to
3940         altivec_expand_vec_perm_const_le.
3941         (rs6000_expand_vec_perm_const): Delete.
3942         (rs6000_vectorize_vec_perm_const_ok): Delete.
3943         (rs6000_vectorize_vec_perm_const): New function.
3944         (rs6000_do_expand_vec_perm): Take a vec_perm_builder instead of
3945         an element count and rtx array.
3946         (rs6000_expand_extract_even): Update call accordingly.
3947         (rs6000_expand_interleave): Likewise.
3948         * config/rs6000/altivec.md (vec_perm_constv16qi): Delete.
3949         * config/rs6000/paired.md (vec_perm_constv2sf): Delete.
3950         * config/rs6000/vsx.md (vec_perm_const<mode>): Delete.
3951         * config/rs6000/rs6000-protos.h (altivec_expand_vec_perm_const)
3952         (rs6000_expand_vec_perm_const): Delete.
3953         * config/rs6000/rs6000.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
3954         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
3955         (altivec_expand_vec_perm_const_le): Take each operand individually.
3956         Operate on constant selectors rather than rtxes.
3957         (altivec_expand_vec_perm_const): Likewise.  Update call to
3958         altivec_expand_vec_perm_const_le.
3959         (rs6000_expand_vec_perm_const): Delete.
3960         (rs6000_vectorize_vec_perm_const_ok): Delete.
3961         (rs6000_vectorize_vec_perm_const): New function.  Remove stray
3962         reference to the SPE evmerge intructions.
3963         (rs6000_do_expand_vec_perm): Take a vec_perm_builder instead of
3964         an element count and rtx array.
3965         (rs6000_expand_extract_even): Update call accordingly.
3966         (rs6000_expand_interleave): Likewise.
3967         * config/sparc/sparc.md (vec_perm_constv8qi): Delete in favor of...
3968         * config/sparc/sparc.c (sparc_vectorize_vec_perm_const): ...this
3969         new function.
3970         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
3972 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
3974         * optabs.c (expand_vec_perm_1): Assert that SEL has an integer
3975         vector mode and that that mode matches the mode of the data
3976         being permuted.
3977         (expand_vec_perm): Split handling of non-CONST_VECTOR selectors
3978         out into expand_vec_perm_var.  Do all CONST_VECTOR handling here,
3979         directly using expand_vec_perm_1 when forcing selectors into
3980         registers.
3981         (expand_vec_perm_var): New function, split out from expand_vec_perm.
3983 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
3985         * optabs-query.h (can_vec_perm_p): Delete.
3986         (can_vec_perm_var_p, can_vec_perm_const_p): Declare.
3987         * optabs-query.c (can_vec_perm_p): Split into...
3988         (can_vec_perm_var_p, can_vec_perm_const_p): ...these two functions.
3989         (can_mult_highpart_p): Use can_vec_perm_const_p to test whether a
3990         particular selector is valid.
3991         * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
3992         * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
3993         (vect_grouped_load_supported): Likewise.
3994         (vect_shift_permute_load_chain): Likewise.
3995         * tree-vect-slp.c (vect_build_slp_tree_1): Likewise.
3996         (vect_transform_slp_perm_load): Likewise.
3997         * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
3998         (vectorizable_bswap): Likewise.
3999         (vect_gen_perm_mask_checked): Likewise.
4000         * fold-const.c (fold_ternary_loc): Likewise.  Don't take
4001         implementations of variable permutation vectors into account
4002         when deciding which selector to use.
4003         * tree-vect-loop.c (have_whole_vector_shift): Don't check whether
4004         vec_perm_const_optab is supported; instead use can_vec_perm_const_p
4005         with a false third argument.
4006         * tree-vect-generic.c (lower_vec_perm): Use can_vec_perm_const_p
4007         to test whether the constant selector is valid and can_vec_perm_var_p
4008         to test whether a variable selector is valid.
4010 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
4012         * optabs-query.h (can_vec_perm_p): Take a const vec_perm_indices *.
4013         * optabs-query.c (can_vec_perm_p): Likewise.
4014         * fold-const.c (fold_vec_perm): Take a const vec_perm_indices &
4015         instead of vec_perm_indices.
4016         * tree-vectorizer.h (vect_gen_perm_mask_any): Likewise,
4017         (vect_gen_perm_mask_checked): Likewise,
4018         * tree-vect-stmts.c (vect_gen_perm_mask_any): Likewise,
4019         (vect_gen_perm_mask_checked): Likewise,
4021 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
4023         * optabs-query.h (qimode_for_vec_perm): Declare.
4024         * optabs-query.c (can_vec_perm_p): Split out qimode search to...
4025         (qimode_for_vec_perm): ...this new function.
4026         * optabs.c (expand_vec_perm): Use qimode_for_vec_perm.
4028 2018-01-02  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>
4030         * rtlanal.c (canonicalize_condition): Return 0 if final rtx
4031         does not have a conditional at the top.
4033 2018-01-02  Richard Biener  <rguenther@suse.de>
4035         * ipa-inline.c (big_speedup_p): Fix expression.
4037 2018-01-02  Jan Hubicka  <hubicka@ucw.cz>
4039         PR target/81616
4040         * config/i386/x86-tune-costs.h: Increase cost of integer load costs
4041         for generic 4->6.
4043 2018-01-02  Jan Hubicka  <hubicka@ucw.cz>
4045         PR target/81616
4046         Generic tuning.
4047         * x86-tune-costs.h (generic_cost): Reduce cost of FDIV 20->17,
4048         cost of sqrt 20->14, DIVSS 18->13, DIVSD 32->17, SQRtSS 30->14
4049         and SQRTsD 58->18, cond_not_taken_branch_cost. 2->1. Increase
4050         cond_taken_branch_cost 3->4.
4052 2018-01-01  Jakub Jelinek  <jakub@redhat.com>
4054         PR tree-optimization/83581
4055         * tree-loop-distribution.c (pass_loop_distribution::execute): Return
4056         TODO_cleanup_cfg if any changes have been made.
4058         PR middle-end/83608
4059         * expr.c (store_expr_with_bounds): Use simplify_gen_subreg instead of
4060         convert_modes if target mode has the right side, but different mode
4061         class.
4063         PR middle-end/83609
4064         * expr.c (expand_assignment): Fix up a typo in simplify_gen_subreg
4065         last argument when extracting from CONCAT.  If either from_real or
4066         from_imag is NULL, use expansion through memory.  If result is not
4067         a CONCAT and simplify_gen_subreg fails, try to simplify_gen_subreg
4068         the parts directly to inner mode, if even that fails, use expansion
4069         through memory.
4071         PR middle-end/83623
4072         * expmed.c (expand_shift_1): For 2-byte rotates by BITS_PER_UNIT,
4073         check for bswap in mode rather than HImode and use that in expand_unop
4074         too.
4076 Copyright (C) 2018 Free Software Foundation, Inc.
4078 Copying and distribution of this file, with or without modification,
4079 are permitted in any medium without royalty provided the copyright
4080 notice and this notice are preserved.