Use partial_subreg_p in curr_insn_transform
[official-gcc.git] / gcc / ChangeLog
blob560825346f232d44a322d1558a6adce58c0fd079
1 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
3         * lra-constraints.c (curr_insn_transform): Use partial_subreg_p.
5 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
6             Alan Hayward  <alan.hayward@arm.com>
7             David Sherwood  <david.sherwood@arm.com>
9         * coretypes.h (fixed_size_mode): Declare.
10         (fixed_size_mode_pod): New typedef.
11         * builtins.h (target_builtins::x_apply_args_mode)
12         (target_builtins::x_apply_result_mode): Change type to
13         fixed_size_mode_pod.
14         * builtins.c (apply_args_size, apply_result_size, result_vector)
15         (expand_builtin_apply_args_1, expand_builtin_apply)
16         (expand_builtin_return): Update accordingly.
18 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
20         * cse.c (hash_rtx_cb): Hash only the encoded elements.
21         * cselib.c (cselib_hash_rtx): Likewise.
22         * expmed.c (make_tree): Build VECTOR_CSTs directly from the
23         CONST_VECTOR encoding.
25 2017-01-03  Jakub Jelinek  <jakub@redhat.com>
26             Jeff Law  <law@redhat.com>
28         PR target/83641
29         * config/i386/i386.c (ix86_adjust_stack_and_probe_stack_clash): For
30         noreturn probe, use gen_pop instead of ix86_emit_restore_reg_using_pop,
31         only set RTX_FRAME_RELATED_P on both the push and pop if cfa_reg is sp
32         and add REG_CFA_ADJUST_CFA notes in that case to both insns.
34         PR target/83641
35         * config/i386/i386.c (ix86_adjust_stack_and_probe_stack_clash): Do not
36         explicitly probe *sp in a noreturn function if there were any callee
37         register saves or frame pointer is needed.
39 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
41         PR debug/83621
42         * cfgexpand.c (expand_debug_expr): Return NULL if mode is
43         BLKmode for ternary, binary or unary expressions.
45         PR debug/83645
46         * var-tracking.c (delete_vta_debug_insn): New inline function.
47         (delete_vta_debug_insns): Add USE_CFG argument, if true, walk just
48         insns from get_insns () to NULL instead of each bb separately.
49         Use delete_vta_debug_insn.  No longer static.
50         (vt_debug_insns_local, variable_tracking_main_1): Adjust
51         delete_vta_debug_insns callers.
52         * rtl.h (delete_vta_debug_insns): Declare.
53         * final.c (rest_of_handle_final): Call delete_vta_debug_insns
54         instead of variable_tracking_main.
56 2018-01-03  Martin Sebor  <msebor@redhat.com>
58         PR c/83559
59         * doc/extend.texi (attribute const): Fix a typo.
60         * ipa-pure-const.c ((warn_function_const, warn_function_pure): Avoid
61         issuing -Wsuggest-attribute for void functions.
63 2018-01-03  Martin Sebor  <msebor@redhat.com>
65         * gimple-ssa-warn-restrict.c (builtin_memref::builtin_memref): Use
66         offset_int::from instead of wide_int::to_shwi.
67         (maybe_diag_overlap): Remove assertion.
68         Use HOST_WIDE_INT_PRINT_DEC instead of %lli.
69         * gimple-ssa-sprintf.c (format_directive): Same.
70         (parse_directive): Same.
71         (sprintf_dom_walker::compute_format_length): Same.
72         (try_substitute_return_value): Same.
74 2017-01-03  Jeff Law  <law@redhat.com>
76         PR middle-end/83654
77         * explow.c (anti_adjust_stack_and_probe_stack_clash): Test a
78         non-constant residual for zero at runtime and avoid probing in
79         that case.  Reorganize code for trailing problem to mirror handling
80         of the residual.
82 2018-01-03  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
84         PR tree-optimization/83501
85         * tree-ssa-strlen.c (get_string_cst): New.
86         (handle_char_store): Call get_string_cst.
88 2018-01-03  Martin Liska  <mliska@suse.cz>
90         PR tree-optimization/83593
91         * tree-ssa-strlen.c: Include tree-cfg.h.
92         (strlen_check_and_optimize_stmt): Add new argument cleanup_eh.
93         (strlen_dom_walker): Add new member variable m_cleanup_cfg.
94         (strlen_dom_walker::strlen_dom_walker): Initialize m_cleanup_cfg
95         to false.
96         (strlen_dom_walker::before_dom_children): Call
97         gimple_purge_dead_eh_edges. Dump tranformation with details
98         dump flags.
99         (strlen_dom_walker::before_dom_children): Update call by adding
100         new argument cleanup_eh.
101         (pass_strlen::execute): Return TODO_cleanup_cfg if needed.
103 2018-01-03  Martin Liska  <mliska@suse.cz>
105         PR ipa/83549
106         * cif-code.def (VARIADIC_THUNK): New enum value.
107         * ipa-fnsummary.c (compute_fn_summary): Do not inline variadic
108         thunks.
110 2018-01-03  Jan Beulich  <jbeulich@suse.com>
112         * sse.md (mov<mode>_internal): Tighten condition for when to use
113         vmovdqu<ssescalarsize> for TI and OI modes.
115 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
117         Update copyright years.
119 2018-01-03  Martin Liska  <mliska@suse.cz>
121         PR ipa/83594
122         * ipa-visibility.c (function_and_variable_visibility): Skip
123         functions with noipa attribure.
125 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
127         * gcc.c (process_command): Update copyright notice dates.
128         * gcov-dump.c (print_version): Ditto.
129         * gcov.c (print_version): Ditto.
130         * gcov-tool.c (print_version): Ditto.
131         * gengtype.c (create_file): Ditto.
132         * doc/cpp.texi: Bump @copying's copyright year.
133         * doc/cppinternals.texi: Ditto.
134         * doc/gcc.texi: Ditto.
135         * doc/gccint.texi: Ditto.
136         * doc/gcov.texi: Ditto.
137         * doc/install.texi: Ditto.
138         * doc/invoke.texi: Ditto.
140 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
142         * vector-builder.h (vector_builder::m_full_nelts): Change from
143         unsigned int to poly_uint64.
144         (vector_builder::full_nelts): Update prototype accordingly.
145         (vector_builder::new_vector): Likewise.
146         (vector_builder::encoded_full_vector_p): Handle polynomial full_nelts.
147         (vector_builder::operator ==): Likewise.
148         (vector_builder::finalize): Likewise.
149         * int-vector-builder.h (int_vector_builder::int_vector_builder):
150         Take the number of elements as a poly_uint64 rather than an
151         unsigned int.
152         * vec-perm-indices.h (vec_perm_indices::m_nelts_per_input): Change
153         from unsigned int to poly_uint64.
154         (vec_perm_indices::vec_perm_indices): Update prototype accordingly.
155         (vec_perm_indices::new_vector): Likewise.
156         (vec_perm_indices::length): Likewise.
157         (vec_perm_indices::nelts_per_input): Likewise.
158         (vec_perm_indices::input_nelts): Likewise.
159         * vec-perm-indices.c (vec_perm_indices::new_vector): Take the
160         number of elements per input as a poly_uint64 rather than an
161         unsigned int.  Use the original encoding for variable-length
162         vectors, rather than clamping each individual element.
163         For the second and subsequent elements in each pattern,
164         clamp the step and base before clamping their sum.
165         (vec_perm_indices::series_p): Handle polynomial element counts.
166         (vec_perm_indices::all_in_range_p): Likewise.
167         (vec_perm_indices_to_tree): Likewise.
168         (vec_perm_indices_to_rtx): Likewise.
169         * tree-vect-stmts.c (vect_gen_perm_mask_any): Likewise.
170         * tree-vector-builder.c (tree_vector_builder::new_unary_operation)
171         (tree_vector_builder::new_binary_operation): Handle polynomial
172         element counts.  Return false if we need to know the number
173         of elements at compile time.
174         * fold-const.c (fold_vec_perm): Punt if the number of elements
175         isn't known at compile time.
177 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
179         * vec-perm-indices.h (vec_perm_builder): Change element type
180         from HOST_WIDE_INT to poly_int64.
181         (vec_perm_indices::element_type): Update accordingly.
182         (vec_perm_indices::clamp): Handle polynomial element_types.
183         * vec-perm-indices.c (vec_perm_indices::series_p): Likewise.
184         (vec_perm_indices::all_in_range_p): Likewise.
185         (tree_to_vec_perm_builder): Check for poly_int64 trees rather
186         than shwi trees.
187         * vector-builder.h (vector_builder::stepped_sequence_p): Handle
188         polynomial vec_perm_indices element types.
189         * int-vector-builder.h (int_vector_builder::equal_p): Likewise.
190         * fold-const.c (fold_vec_perm): Likewise.
191         * optabs.c (shift_amt_for_vec_perm_mask): Likewise.
192         * tree-vect-generic.c (lower_vec_perm): Likewise.
193         * tree-vect-slp.c (vect_transform_slp_perm_load): Likewise.
194         * config/aarch64/aarch64.c (aarch64_evpc_tbl): Cast d->perm
195         element type to HOST_WIDE_INT.
197 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
198             Alan Hayward  <alan.hayward@arm.com>
199             David Sherwood  <david.sherwood@arm.com>
201         * alias.c (addr_side_effect_eval): Take the size as a poly_int64
202         rather than an int.  Use plus_constant.
203         (memrefs_conflict_p): Take the sizes as poly_int64s rather than ints.
204         Take the offset "c" as a poly_int64 rather than a HOST_WIDE_INT.
206 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
207             Alan Hayward  <alan.hayward@arm.com>
208             David Sherwood  <david.sherwood@arm.com>
210         * calls.c (emit_call_1, expand_call): Change struct_value_size from
211         a HOST_WIDE_INT to a poly_int64.
213 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
214             Alan Hayward  <alan.hayward@arm.com>
215             David Sherwood  <david.sherwood@arm.com>
217         * calls.c (load_register_parameters): Cope with polynomial
218         mode sizes.  Require a constant size for BLKmode parameters
219         that aren't described by a PARALLEL.  If BLOCK_REG_PADDING
220         forces a parameter to be padded at the lsb end in order to
221         fill a complete number of words, require the parameter size
222         to be ordered wrt UNITS_PER_WORD.
224 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
225             Alan Hayward  <alan.hayward@arm.com>
226             David Sherwood  <david.sherwood@arm.com>
228         * reload1.c (spill_stack_slot_width): Change element type
229         from unsigned int to poly_uint64_pod.
230         (alter_reg): Treat mode sizes as polynomial.
232 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
233             Alan Hayward  <alan.hayward@arm.com>
234             David Sherwood  <david.sherwood@arm.com>
236         * reload.c (complex_word_subreg_p): New function.
237         (reload_inner_reg_of_subreg, push_reload): Use it.
239 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
240             Alan Hayward  <alan.hayward@arm.com>
241             David Sherwood  <david.sherwood@arm.com>
243         * lra-constraints.c (process_alt_operands): Reject matched
244         operands whose sizes aren't ordered.
245         (match_reload): Refer to this check here.
247 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
248             Alan Hayward  <alan.hayward@arm.com>
249             David Sherwood  <david.sherwood@arm.com>
251         * builtins.c (expand_ifn_atomic_compare_exchange_into_call): Assert
252         that the mode size is in the set {1, 2, 4, 8, 16}.
254 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
255             Alan Hayward  <alan.hayward@arm.com>
256             David Sherwood  <david.sherwood@arm.com>
258         * var-tracking.c (adjust_mems): Treat mode sizes as polynomial.
259         Use plus_constant instead of gen_rtx_PLUS.
261 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
262             Alan Hayward  <alan.hayward@arm.com>
263             David Sherwood  <david.sherwood@arm.com>
265         * config/cr16/cr16-protos.h (cr16_push_rounding): Declare.
266         * config/cr16/cr16.h (PUSH_ROUNDING): Move implementation to...
267         * config/cr16/cr16.c (cr16_push_rounding): ...this new function.
268         * config/h8300/h8300-protos.h (h8300_push_rounding): Declare.
269         * config/h8300/h8300.h (PUSH_ROUNDING): Move implementation to...
270         * config/h8300/h8300.c (h8300_push_rounding): ...this new function.
271         * config/i386/i386-protos.h (ix86_push_rounding): Declare.
272         * config/i386/i386.h (PUSH_ROUNDING): Move implementation to...
273         * config/i386/i386.c (ix86_push_rounding): ...this new function.
274         * config/m32c/m32c-protos.h (m32c_push_rounding): Take and return
275         a poly_int64.
276         * config/m32c/m32c.c (m32c_push_rounding): Likewise.
277         * config/m68k/m68k-protos.h (m68k_push_rounding): Declare.
278         * config/m68k/m68k.h (PUSH_ROUNDING): Move implementation to...
279         * config/m68k/m68k.c (m68k_push_rounding): ...this new function.
280         * config/pdp11/pdp11-protos.h (pdp11_push_rounding): Declare.
281         * config/pdp11/pdp11.h (PUSH_ROUNDING): Move implementation to...
282         * config/pdp11/pdp11.c (pdp11_push_rounding): ...this new function.
283         * config/stormy16/stormy16-protos.h (xstormy16_push_rounding): Declare.
284         * config/stormy16/stormy16.h (PUSH_ROUNDING): Move implementation to...
285         * config/stormy16/stormy16.c (xstormy16_push_rounding): ...this new
286         function.
287         * expr.c (emit_move_resolve_push): Treat the input and result
288         of PUSH_ROUNDING as a poly_int64.
289         (emit_move_complex_push, emit_single_push_insn_1): Likewise.
290         (emit_push_insn): Likewise.
291         * lra-eliminations.c (mark_not_eliminable): Likewise.
292         * recog.c (push_operand): Likewise.
293         * reload1.c (elimination_effects): Likewise.
294         * rtlanal.c (nonzero_bits1): Likewise.
295         * calls.c (store_one_arg): Likewise.  Require the padding to be
296         known at compile time.
298 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
299             Alan Hayward  <alan.hayward@arm.com>
300             David Sherwood  <david.sherwood@arm.com>
302         * expr.c (emit_single_push_insn_1): Treat mode sizes as polynomial.
303         Use plus_constant instead of gen_rtx_PLUS.
305 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
306             Alan Hayward  <alan.hayward@arm.com>
307             David Sherwood  <david.sherwood@arm.com>
309         * auto-inc-dec.c (set_inc_state): Take the mode size as a poly_int64
310         rather than an int.
312 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
313             Alan Hayward  <alan.hayward@arm.com>
314             David Sherwood  <david.sherwood@arm.com>
316         * expr.c (expand_expr_real_1): Use tree_to_poly_uint64
317         instead of int_size_in_bytes when handling VIEW_CONVERT_EXPRs
318         via stack temporaries.  Treat the mode size as polynomial too.
320 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
321             Alan Hayward  <alan.hayward@arm.com>
322             David Sherwood  <david.sherwood@arm.com>
324         * expr.c (expand_expr_real_2): When handling conversions involving
325         unions, apply tree_to_poly_uint64 to the TYPE_SIZE rather than
326         multiplying int_size_in_bytes by BITS_PER_UNIT.  Treat GET_MODE_BISIZE
327         as a poly_uint64 too.
329 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
330             Alan Hayward  <alan.hayward@arm.com>
331             David Sherwood  <david.sherwood@arm.com>
333         * rtlanal.c (subreg_get_info): Handle polynomial mode sizes.
335 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
336             Alan Hayward  <alan.hayward@arm.com>
337             David Sherwood  <david.sherwood@arm.com>
339         * combine.c (can_change_dest_mode): Handle polynomial
340         REGMODE_NATURAL_SIZE.
341         * expmed.c (store_bit_field_1): Likewise.
342         * expr.c (store_constructor): Likewise.
343         * emit-rtl.c (validate_subreg): Operate on polynomial mode sizes
344         and polynomial REGMODE_NATURAL_SIZE.
345         (gen_lowpart_common): Likewise.
346         * reginfo.c (record_subregs_of_mode): Likewise.
347         * rtlanal.c (read_modify_subreg_p): Likewise.
349 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
350             Alan Hayward  <alan.hayward@arm.com>
351             David Sherwood  <david.sherwood@arm.com>
353         * internal-fn.c (expand_vector_ubsan_overflow): Handle polynomial
354         numbers of elements.
356 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
357             Alan Hayward  <alan.hayward@arm.com>
358             David Sherwood  <david.sherwood@arm.com>
360         * match.pd: Cope with polynomial numbers of vector elements.
362 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
363             Alan Hayward  <alan.hayward@arm.com>
364             David Sherwood  <david.sherwood@arm.com>
366         * fold-const.c (fold_indirect_ref_1): Handle polynomial offsets
367         in a POINTER_PLUS_EXPR.
369 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
370             Alan Hayward  <alan.hayward@arm.com>
371             David Sherwood  <david.sherwood@arm.com>
373         * omp-simd-clone.c (simd_clone_subparts): New function.
374         (simd_clone_init_simd_arrays): Use it instead of TYPE_VECTOR_SUBPARTS.
375         (ipa_simd_modify_function_body): Likewise.
377 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
378             Alan Hayward  <alan.hayward@arm.com>
379             David Sherwood  <david.sherwood@arm.com>
381         * tree-vect-generic.c (nunits_for_known_piecewise_op): New function.
382         (expand_vector_piecewise): Use it instead of TYPE_VECTOR_SUBPARTS.
383         (expand_vector_addition, add_rshift, expand_vector_divmod): Likewise.
384         (expand_vector_condition, vector_element): Likewise.
385         (subparts_gt): New function.
386         (get_compute_type): Use subparts_gt.
387         (count_type_subparts): Delete.
388         (expand_vector_operations_1): Use subparts_gt instead of
389         count_type_subparts.
391 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
392             Alan Hayward  <alan.hayward@arm.com>
393             David Sherwood  <david.sherwood@arm.com>
395         * tree-vect-data-refs.c (vect_no_alias_p): Replace with...
396         (vect_compile_time_alias): ...this new function.  Do the calculation
397         on poly_ints rather than trees.
398         (vect_prune_runtime_alias_test_list): Update call accordingly.
400 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
401             Alan Hayward  <alan.hayward@arm.com>
402             David Sherwood  <david.sherwood@arm.com>
404         * tree-vect-slp.c (vect_build_slp_tree_1): Handle polynomial
405         numbers of units.
406         (vect_schedule_slp_instance): Likewise.
408 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
409             Alan Hayward  <alan.hayward@arm.com>
410             David Sherwood  <david.sherwood@arm.com>
412         * tree-vect-slp.c (vect_get_and_check_slp_defs): Reject
413         constant and extern definitions for variable-length vectors.
414         (vect_get_constant_vectors): Note that the number of units
415         is known to be constant.
417 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
418             Alan Hayward  <alan.hayward@arm.com>
419             David Sherwood  <david.sherwood@arm.com>
421         * tree-vect-stmts.c (vectorizable_conversion): Treat the number
422         of units as polynomial.  Choose between WIDE and NARROW based
423         on multiple_p.
425 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
426             Alan Hayward  <alan.hayward@arm.com>
427             David Sherwood  <david.sherwood@arm.com>
429         * tree-vect-stmts.c (simd_clone_subparts): New function.
430         (vectorizable_simd_clone_call): Use it instead of TYPE_VECTOR_SUBPARTS.
432 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
433             Alan Hayward  <alan.hayward@arm.com>
434             David Sherwood  <david.sherwood@arm.com>
436         * tree-vect-stmts.c (vectorizable_call): Treat the number of
437         vectors as polynomial.  Use build_index_vector for
438         IFN_GOMP_SIMD_LANE.
440 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
441             Alan Hayward  <alan.hayward@arm.com>
442             David Sherwood  <david.sherwood@arm.com>
444         * tree-vect-stmts.c (get_load_store_type): Treat the number of
445         units as polynomial.  Reject VMAT_ELEMENTWISE and VMAT_STRIDED_SLP
446         for variable-length vectors.
447         (vectorizable_mask_load_store): Treat the number of units as
448         polynomial, asserting that it is constant if the condition has
449         already been enforced.
450         (vectorizable_store, vectorizable_load): Likewise.
452 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
453             Alan Hayward  <alan.hayward@arm.com>
454             David Sherwood  <david.sherwood@arm.com>
456         * tree-vect-loop.c (vectorizable_live_operation): Treat the number
457         of units as polynomial.  Punt if we can't tell at compile time
458         which vector contains the final result.
460 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
461             Alan Hayward  <alan.hayward@arm.com>
462             David Sherwood  <david.sherwood@arm.com>
464         * tree-vect-loop.c (vectorizable_induction): Treat the number
465         of units as polynomial.  Punt on SLP inductions.  Use an integer
466         VEC_SERIES_EXPR for variable-length integer reductions.  Use a
467         cast of such a series for variable-length floating-point
468         reductions.
470 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
471             Alan Hayward  <alan.hayward@arm.com>
472             David Sherwood  <david.sherwood@arm.com>
474         * tree.h (build_index_vector): Declare.
475         * tree.c (build_index_vector): New function.
476         * tree-vect-loop.c (get_initial_defs_for_reduction): Treat the number
477         of units as polynomial, forcibly converting it to a constant if
478         vectorizable_reduction has already enforced the condition.
479         (vect_create_epilog_for_reduction): Likewise.  Use build_index_vector
480         to create a {1,2,3,...} vector.
481         (vectorizable_reduction): Treat the number of units as polynomial.
482         Choose vectype_in based on the largest scalar element size rather
483         than the smallest number of units.  Enforce the restrictions
484         relied on above.
486 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
487             Alan Hayward  <alan.hayward@arm.com>
488             David Sherwood  <david.sherwood@arm.com>
490         * tree-vect-data-refs.c (vector_alignment_reachable_p): Treat the
491         number of units as polynomial.
493 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
494             Alan Hayward  <alan.hayward@arm.com>
495             David Sherwood  <david.sherwood@arm.com>
497         * target.h (vector_sizes, auto_vector_sizes): New typedefs.
498         * target.def (autovectorize_vector_sizes): Return the vector sizes
499         by pointer, using vector_sizes rather than a bitmask.
500         * targhooks.h (default_autovectorize_vector_sizes): Update accordingly.
501         * targhooks.c (default_autovectorize_vector_sizes): Likewise.
502         * config/aarch64/aarch64.c (aarch64_autovectorize_vector_sizes):
503         Likewise.
504         * config/arc/arc.c (arc_autovectorize_vector_sizes): Likewise.
505         * config/arm/arm.c (arm_autovectorize_vector_sizes): Likewise.
506         * config/i386/i386.c (ix86_autovectorize_vector_sizes): Likewise.
507         * config/mips/mips.c (mips_autovectorize_vector_sizes): Likewise.
508         * omp-general.c (omp_max_vf): Likewise.
509         * omp-low.c (omp_clause_aligned_alignment): Likewise.
510         * optabs-query.c (can_vec_mask_load_store_p): Likewise.
511         * tree-vect-loop.c (vect_analyze_loop): Likewise.
512         * tree-vect-slp.c (vect_slp_bb): Likewise.
513         * doc/tm.texi: Regenerate.
514         * tree-vectorizer.h (current_vector_size): Change from an unsigned int
515         to a poly_uint64.
516         * tree-vect-stmts.c (get_vectype_for_scalar_type_and_size): Take
517         the vector size as a poly_uint64 rather than an unsigned int.
518         (current_vector_size): Change from an unsigned int to a poly_uint64.
519         (get_vectype_for_scalar_type): Update accordingly.
520         * tree.h (build_truth_vector_type): Take the size and number of
521         units as a poly_uint64 rather than an unsigned int.
522         (build_vector_type): Add a temporary overload that takes
523         the number of units as a poly_uint64 rather than an unsigned int.
524         * tree.c (make_vector_type): Likewise.
525         (build_truth_vector_type): Take the number of units as a poly_uint64
526         rather than an unsigned int.
528 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
529             Alan Hayward  <alan.hayward@arm.com>
530             David Sherwood  <david.sherwood@arm.com>
532         * target.def (get_mask_mode): Take the number of units and length
533         as poly_uint64s rather than unsigned ints.
534         * targhooks.h (default_get_mask_mode): Update accordingly.
535         * targhooks.c (default_get_mask_mode): Likewise.
536         * config/i386/i386.c (ix86_get_mask_mode): Likewise.
537         * doc/tm.texi: Regenerate.
539 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
540             Alan Hayward  <alan.hayward@arm.com>
541             David Sherwood  <david.sherwood@arm.com>
543         * omp-general.h (omp_max_vf): Return a poly_uint64 instead of an int.
544         * omp-general.c (omp_max_vf): Likewise.
545         * omp-expand.c (omp_adjust_chunk_size): Update call to omp_max_vf.
546         (expand_omp_simd): Handle polynomial safelen.
547         * omp-low.c (omplow_simd_context): Add a default constructor.
548         (omplow_simd_context::max_vf): Change from int to poly_uint64.
549         (lower_rec_simd_input_clauses): Update accordingly.
550         (lower_rec_input_clauses): Likewise.
552 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
553             Alan Hayward  <alan.hayward@arm.com>
554             David Sherwood  <david.sherwood@arm.com>
556         * tree-vectorizer.h (vect_nunits_for_cost): New function.
557         * tree-vect-loop.c (vect_model_reduction_cost): Use it.
558         * tree-vect-slp.c (vect_analyze_slp_cost_1): Likewise.
559         (vect_analyze_slp_cost): Likewise.
560         * tree-vect-stmts.c (vect_model_store_cost): Likewise.
561         (vect_model_load_cost): Likewise.
563 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
564             Alan Hayward  <alan.hayward@arm.com>
565             David Sherwood  <david.sherwood@arm.com>
567         * tree-vect-slp.c (vect_record_max_nunits, vect_build_slp_tree_1)
568         (vect_build_slp_tree_2, vect_build_slp_tree): Change max_nunits
569         from an unsigned int * to a poly_uint64_pod *.
570         (calculate_unrolling_factor): New function.
571         (vect_analyze_slp_instance): Use it.  Track polynomial max_nunits.
573 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
574             Alan Hayward  <alan.hayward@arm.com>
575             David Sherwood  <david.sherwood@arm.com>
577         * tree-vectorizer.h (_slp_instance::unrolling_factor): Change
578         from an unsigned int to a poly_uint64.
579         (_loop_vec_info::slp_unrolling_factor): Likewise.
580         (_loop_vec_info::vectorization_factor): Change from an int
581         to a poly_uint64.
582         (MAX_VECTORIZATION_FACTOR): Bump from 64 to INT_MAX.
583         (vect_get_num_vectors): New function.
584         (vect_update_max_nunits, vect_vf_for_cost): Likewise.
585         (vect_get_num_copies): Use vect_get_num_vectors.
586         (vect_analyze_data_ref_dependences): Change max_vf from an int *
587         to an unsigned int *.
588         (vect_analyze_data_refs): Change min_vf from an int * to a
589         poly_uint64 *.
590         (vect_transform_slp_perm_load): Take the vf as a poly_uint64 rather
591         than an unsigned HOST_WIDE_INT.
592         * tree-vect-data-refs.c (vect_analyze_possibly_independent_ddr)
593         (vect_analyze_data_ref_dependence): Change max_vf from an int *
594         to an unsigned int *.
595         (vect_analyze_data_ref_dependences): Likewise.
596         (vect_compute_data_ref_alignment): Handle polynomial vf.
597         (vect_enhance_data_refs_alignment): Likewise.
598         (vect_prune_runtime_alias_test_list): Likewise.
599         (vect_shift_permute_load_chain): Likewise.
600         (vect_supportable_dr_alignment): Likewise.
601         (dependence_distance_ge_vf): Take the vectorization factor as a
602         poly_uint64 rather than an unsigned HOST_WIDE_INT.
603         (vect_analyze_data_refs): Change min_vf from an int * to a
604         poly_uint64 *.
605         * tree-vect-loop-manip.c (vect_gen_scalar_loop_niters): Take
606         vfm1 as a poly_uint64 rather than an int.  Make the same change
607         for the returned bound_scalar.
608         (vect_gen_vector_loop_niters): Handle polynomial vf.
609         (vect_do_peeling): Likewise.  Update call to
610         vect_gen_scalar_loop_niters and handle polynomial bound_scalars.
611         (vect_gen_vector_loop_niters_mult_vf): Assert that the vf must
612         be constant.
613         * tree-vect-loop.c (vect_determine_vectorization_factor)
614         (vect_update_vf_for_slp, vect_analyze_loop_2): Handle polynomial vf.
615         (vect_get_known_peeling_cost): Likewise.
616         (vect_estimate_min_profitable_iters, vectorizable_reduction): Likewise.
617         (vect_worthwhile_without_simd_p, vectorizable_induction): Likewise.
618         (vect_transform_loop): Likewise.  Use the lowest possible VF when
619         updating the upper bounds of the loop.
620         (vect_min_worthwhile_factor): Make static.  Return an unsigned int
621         rather than an int.
622         * tree-vect-slp.c (vect_attempt_slp_rearrange_stmts): Cope with
623         polynomial unroll factors.
624         (vect_analyze_slp_cost_1, vect_analyze_slp_instance): Likewise.
625         (vect_make_slp_decision): Likewise.
626         (vect_supported_load_permutation_p): Likewise, and polynomial
627         vf too.
628         (vect_analyze_slp_cost): Handle polynomial vf.
629         (vect_slp_analyze_node_operations): Likewise.
630         (vect_slp_analyze_bb_1): Likewise.
631         (vect_transform_slp_perm_load): Take the vf as a poly_uint64 rather
632         than an unsigned HOST_WIDE_INT.
633         * tree-vect-stmts.c (vectorizable_simd_clone_call, vectorizable_store)
634         (vectorizable_load): Handle polynomial vf.
635         * tree-vectorizer.c (simduid_to_vf::vf): Change from an int to
636         a poly_uint64.
637         (adjust_simduid_builtins, shrink_simd_arrays): Update accordingly.
639 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
640             Alan Hayward  <alan.hayward@arm.com>
641             David Sherwood  <david.sherwood@arm.com>
643         * match.pd: Handle bit operations involving three constants
644         and try to fold one pair.
646 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
648         * tree-vect-loop-manip.c: Include gimple-fold.h.
649         (slpeel_make_loop_iterate_ntimes): Add step, final_iv and
650         niters_maybe_zero parameters.  Handle other cases besides a step of 1.
651         (vect_gen_vector_loop_niters): Add a step_vector_ptr parameter.
652         Add a path that uses a step of VF instead of 1, but disable it
653         for now.
654         (vect_do_peeling): Add step_vector, niters_vector_mult_vf_var
655         and niters_no_overflow parameters.  Update calls to
656         slpeel_make_loop_iterate_ntimes and vect_gen_vector_loop_niters.
657         Create a new SSA name if the latter choses to use a ste other
658         than zero, and return it via niters_vector_mult_vf_var.
659         * tree-vect-loop.c (vect_transform_loop): Update calls to
660         vect_do_peeling, vect_gen_vector_loop_niters and
661         slpeel_make_loop_iterate_ntimes.
662         * tree-vectorizer.h (slpeel_make_loop_iterate_ntimes, vect_do_peeling)
663         (vect_gen_vector_loop_niters): Update declarations after above changes.
665 2018-01-02  Michael Meissner  <meissner@linux.vnet.ibm.com>
667         * config/rs6000/rs6000.md (floor<mode>2): Add support for IEEE
668         128-bit round to integer instructions.
669         (ceil<mode>2): Likewise.
670         (btrunc<mode>2): Likewise.
671         (round<mode>2): Likewise.
673 2018-01-02  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>
675         * config/rs6000/rs6000-string.c (expand_block_move): Allow the use of
676         unaligned VSX load/store on P8/P9.
677         (expand_block_clear): Allow the use of unaligned VSX
678         load/store on P8/P9.
680 2018-01-02  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
682         * config/rs6000/rs6000-p8swap.c (swap_feeds_both_load_and_store):
683         New function.
684         (rs6000_analyze_swaps): Mark a web unoptimizable if it contains a
685         swap associated with both a load and a store.
687 2018-01-02  Andrew Waterman  <andrew@sifive.com>
689         * config/riscv/linux.h (ICACHE_FLUSH_FUNC): New.
690         * config/riscv/riscv.md (clear_cache): Use it.
692 2018-01-02  Artyom Skrobov  <tyomitch@gmail.com>
694         * web.c: Remove out-of-date comment.
696 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
698         * expr.c (fixup_args_size_notes): Check that any existing
699         REG_ARGS_SIZE notes are correct, and don't try to re-add them.
700         (emit_single_push_insn_1): Move stack_pointer_delta adjustment to...
701         (emit_single_push_insn): ...here.
703 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
705         * rtl.h (CONST_VECTOR_ELT): Redefine to const_vector_elt.
706         (const_vector_encoded_nelts): New function.
707         (CONST_VECTOR_NUNITS): Redefine to use GET_MODE_NUNITS.
708         (const_vector_int_elt, const_vector_elt): Declare.
709         * emit-rtl.c (const_vector_int_elt_1): New function.
710         (const_vector_elt): Likewise.
711         * simplify-rtx.c (simplify_immed_subreg): Avoid taking the address
712         of CONST_VECTOR_ELT.
714 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
716         * expr.c: Include rtx-vector-builder.h.
717         (const_vector_mask_from_tree): Use rtx_vector_builder and operate
718         directly on the tree encoding.
719         (const_vector_from_tree): Likewise.
720         * optabs.c: Include rtx-vector-builder.h.
721         (expand_vec_perm_var): Use rtx_vector_builder and create a repeating
722         sequence of "u" values.
723         * vec-perm-indices.c: Include rtx-vector-builder.h.
724         (vec_perm_indices_to_rtx): Use rtx_vector_builder and operate
725         directly on the vec_perm_indices encoding.
727 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
729         * doc/rtl.texi (const_vector): Describe new encoding scheme.
730         * Makefile.in (OBJS): Add rtx-vector-builder.o.
731         * rtx-vector-builder.h: New file.
732         * rtx-vector-builder.c: Likewise.
733         * rtl.h (rtx_def::u2): Add a const_vector field.
734         (CONST_VECTOR_NPATTERNS): New macro.
735         (CONST_VECTOR_NELTS_PER_PATTERN): Likewise.
736         (CONST_VECTOR_DUPLICATE_P): Likewise.
737         (CONST_VECTOR_STEPPED_P): Likewise.
738         (CONST_VECTOR_ENCODED_ELT): Likewise.
739         (const_vec_duplicate_p): Check for a duplicated vector encoding.
740         (unwrap_const_vec_duplicate): Likewise.
741         (const_vec_series_p): Check for a non-duplicated vector encoding.
742         Say that the function only returns true for integer vectors.
743         * emit-rtl.c: Include rtx-vector-builder.h.
744         (gen_const_vec_duplicate_1): Delete.
745         (gen_const_vector): Call gen_const_vec_duplicate instead of
746         gen_const_vec_duplicate_1.
747         (const_vec_series_p_1): Operate directly on the CONST_VECTOR encoding.
748         (gen_const_vec_duplicate): Use rtx_vector_builder.
749         (gen_const_vec_series): Likewise.
750         (gen_rtx_CONST_VECTOR): Likewise.
751         * config/powerpcspe/powerpcspe.c: Include rtx-vector-builder.h.
752         (swap_const_vector_halves): Take an rtx pointer rather than rtx.
753         Build a new vector rather than modifying a CONST_VECTOR in-place.
754         (handle_special_swappables): Update call accordingly.
755         * config/rs6000/rs6000-p8swap.c: Include rtx-vector-builder.h.
756         (swap_const_vector_halves): Take an rtx pointer rather than rtx.
757         Build a new vector rather than modifying a CONST_VECTOR in-place.
758         (handle_special_swappables): Update call accordingly.
760 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
762         * simplify-rtx.c (simplify_const_binary_operation): Use
763         CONST_VECTOR_ELT instead of XVECEXP.
765 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
767         * tree-cfg.c (verify_gimple_assign_ternary): Allow the size of
768         the selector elements to be different from the data elements
769         if the selector is a VECTOR_CST.
770         * tree-vect-stmts.c (vect_gen_perm_mask_any): Use a vector of
771         ssizetype for the selector.
773 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
775         * optabs.c (shift_amt_for_vec_perm_mask): Try using series_p
776         before testing each element individually.
777         * tree-vect-generic.c (lower_vec_perm): Likewise.
779 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
781         * selftest.h (selftest::vec_perm_indices_c_tests): Declare.
782         * selftest-run-tests.c (selftest::run_tests): Call it.
783         * vector-builder.h (vector_builder::operator ==): New function.
784         (vector_builder::operator !=): Likewise.
785         * vec-perm-indices.h (vec_perm_indices::series_p): Declare.
786         (vec_perm_indices::all_from_input_p): New function.
787         * vec-perm-indices.c (vec_perm_indices::series_p): Likewise.
788         (test_vec_perm_12, selftest::vec_perm_indices_c_tests): Likewise.
789         * fold-const.c (fold_ternary_loc): Use tree_to_vec_perm_builder
790         instead of reading the VECTOR_CST directly.  Detect whether both
791         vector inputs are the same before constructing the vec_perm_indices,
792         and update the number of inputs argument accordingly.  Use the
793         utility functions added above.  Only construct sel2 if we need to.
795 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
797         * optabs.c (expand_vec_perm_var): Use an explicit encoding for
798         the broadcast of the low byte.
799         (expand_mult_highpart): Use an explicit encoding for the permutes.
800         * optabs-query.c (can_mult_highpart_p): Likewise.
801         * tree-vect-loop.c (calc_vec_perm_mask_for_shift): Likewise.
802         * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
803         (vectorizable_bswap): Likewise.
804         * tree-vect-data-refs.c (vect_grouped_store_supported): Use an
805         explicit encoding for the power-of-2 permutes.
806         (vect_permute_store_chain): Likewise.
807         (vect_grouped_load_supported): Likewise.
808         (vect_permute_load_chain): Likewise.
810 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
812         * vec-perm-indices.h (vec_perm_indices_to_tree): Declare.
813         * vec-perm-indices.c (vec_perm_indices_to_tree): New function.
814         * tree-ssa-forwprop.c (simplify_vector_constructor): Use it.
815         * tree-vect-slp.c (vect_transform_slp_perm_load): Likewise.
816         * tree-vect-stmts.c (vectorizable_bswap): Likewise.
817         (vect_gen_perm_mask_any): Likewise.
819 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
821         * int-vector-builder.h: New file.
822         * vec-perm-indices.h: Include int-vector-builder.h.
823         (vec_perm_indices): Redefine as an int_vector_builder.
824         (auto_vec_perm_indices): Delete.
825         (vec_perm_builder): Redefine as a stand-alone class.
826         (vec_perm_indices::vec_perm_indices): New function.
827         (vec_perm_indices::clamp): Likewise.
828         * vec-perm-indices.c: Include fold-const.h and tree-vector-builder.h.
829         (vec_perm_indices::new_vector): New function.
830         (vec_perm_indices::new_expanded_vector): Update for new
831         vec_perm_indices class.
832         (vec_perm_indices::rotate_inputs): New function.
833         (vec_perm_indices::all_in_range_p): Operate directly on the
834         encoded form, without computing elided elements.
835         (tree_to_vec_perm_builder): Operate directly on the VECTOR_CST
836         encoding.  Update for new vec_perm_indices class.
837         * optabs.c (expand_vec_perm_const): Create a vec_perm_indices for
838         the given vec_perm_builder.
839         (expand_vec_perm_var): Update vec_perm_builder constructor.
840         (expand_mult_highpart): Use vec_perm_builder instead of
841         auto_vec_perm_indices.
842         * optabs-query.c (can_mult_highpart_p): Use vec_perm_builder and
843         vec_perm_indices instead of auto_vec_perm_indices.  Use a single
844         or double series encoding as appropriate.
845         * fold-const.c (fold_ternary_loc): Use vec_perm_builder and
846         vec_perm_indices instead of auto_vec_perm_indices.
847         * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
848         * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
849         (vect_permute_store_chain): Likewise.
850         (vect_grouped_load_supported): Likewise.
851         (vect_permute_load_chain): Likewise.
852         (vect_shift_permute_load_chain): Likewise.
853         * tree-vect-slp.c (vect_build_slp_tree_1): Likewise.
854         (vect_transform_slp_perm_load): Likewise.
855         (vect_schedule_slp_instance): Likewise.
856         * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
857         (vectorizable_mask_load_store): Likewise.
858         (vectorizable_bswap): Likewise.
859         (vectorizable_store): Likewise.
860         (vectorizable_load): Likewise.
861         * tree-vect-generic.c (lower_vec_perm): Use vec_perm_builder and
862         vec_perm_indices instead of auto_vec_perm_indices.  Use
863         tree_to_vec_perm_builder to read the vector from a tree.
864         * tree-vect-loop.c (calc_vec_perm_mask_for_shift): Take a
865         vec_perm_builder instead of a vec_perm_indices.
866         (have_whole_vector_shift): Use vec_perm_builder and
867         vec_perm_indices instead of auto_vec_perm_indices.  Leave the
868         truncation to calc_vec_perm_mask_for_shift.
869         (vect_create_epilog_for_reduction): Likewise.
870         * config/aarch64/aarch64.c (expand_vec_perm_d::perm): Change
871         from auto_vec_perm_indices to vec_perm_indices.
872         (aarch64_expand_vec_perm_const_1): Use rotate_inputs on d.perm
873         instead of changing individual elements.
874         (aarch64_vectorize_vec_perm_const): Use new_vector to install
875         the vector in d.perm.
876         * config/arm/arm.c (expand_vec_perm_d::perm): Change
877         from auto_vec_perm_indices to vec_perm_indices.
878         (arm_expand_vec_perm_const_1): Use rotate_inputs on d.perm
879         instead of changing individual elements.
880         (arm_vectorize_vec_perm_const): Use new_vector to install
881         the vector in d.perm.
882         * config/powerpcspe/powerpcspe.c (rs6000_expand_extract_even):
883         Update vec_perm_builder constructor.
884         (rs6000_expand_interleave): Likewise.
885         * config/rs6000/rs6000.c (rs6000_expand_extract_even): Likewise.
886         (rs6000_expand_interleave): Likewise.
888 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
890         * optabs-query.c (can_vec_perm_var_p): Check whether lowering
891         to qimode could truncate the indices.
892         * optabs.c (expand_vec_perm_var): Likewise.
894 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
896         * Makefile.in (OBJS): Add vec-perm-indices.o.
897         * vec-perm-indices.h: New file.
898         * vec-perm-indices.c: Likewise.
899         * target.h (vec_perm_indices): Replace with a forward class
900         declaration.
901         (auto_vec_perm_indices): Move to vec-perm-indices.h.
902         * optabs.h: Include vec-perm-indices.h.
903         (expand_vec_perm): Delete.
904         (selector_fits_mode_p, expand_vec_perm_var): Declare.
905         (expand_vec_perm_const): Declare.
906         * target.def (vec_perm_const_ok): Replace with...
907         (vec_perm_const): ...this new hook.
908         * doc/tm.texi.in (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Replace with...
909         (TARGET_VECTORIZE_VEC_PERM_CONST): ...this new hook.
910         * doc/tm.texi: Regenerate.
911         * optabs.def (vec_perm_const): Delete.
912         * doc/md.texi (vec_perm_const): Likewise.
913         (vec_perm): Refer to TARGET_VECTORIZE_VEC_PERM_CONST.
914         * expr.c (expand_expr_real_2): Use expand_vec_perm_const rather than
915         expand_vec_perm for constant permutation vectors.  Assert that
916         the mode of variable permutation vectors is the integer equivalent
917         of the mode that is being permuted.
918         * optabs-query.h (selector_fits_mode_p): Declare.
919         * optabs-query.c: Include vec-perm-indices.h.
920         (selector_fits_mode_p): New function.
921         (can_vec_perm_const_p): Check whether targetm.vectorize.vec_perm_const
922         is defined, instead of checking whether the vec_perm_const_optab
923         exists.  Use targetm.vectorize.vec_perm_const instead of
924         targetm.vectorize.vec_perm_const_ok.  Check whether the indices
925         fit in the vector mode before using a variable permute.
926         * optabs.c (shift_amt_for_vec_perm_mask): Take a mode and a
927         vec_perm_indices instead of an rtx.
928         (expand_vec_perm): Replace with...
929         (expand_vec_perm_const): ...this new function.  Take the selector
930         as a vec_perm_indices rather than an rtx.  Also take the mode of
931         the selector.  Update call to shift_amt_for_vec_perm_mask.
932         Use targetm.vectorize.vec_perm_const instead of vec_perm_const_optab.
933         Use vec_perm_indices::new_expanded_vector to expand the original
934         selector into bytes.  Check whether the indices fit in the vector
935         mode before using a variable permute.
936         (expand_vec_perm_var): Make global.
937         (expand_mult_highpart): Use expand_vec_perm_const.
938         * fold-const.c: Includes vec-perm-indices.h.
939         * tree-ssa-forwprop.c: Likewise.
940         * tree-vect-data-refs.c: Likewise.
941         * tree-vect-generic.c: Likewise.
942         * tree-vect-loop.c: Likewise.
943         * tree-vect-slp.c: Likewise.
944         * tree-vect-stmts.c: Likewise.
945         * config/aarch64/aarch64-protos.h (aarch64_expand_vec_perm_const):
946         Delete.
947         * config/aarch64/aarch64-simd.md (vec_perm_const<mode>): Delete.
948         * config/aarch64/aarch64.c (aarch64_expand_vec_perm_const)
949         (aarch64_vectorize_vec_perm_const_ok): Fuse into...
950         (aarch64_vectorize_vec_perm_const): ...this new function.
951         (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
952         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
953         * config/arm/arm-protos.h (arm_expand_vec_perm_const): Delete.
954         * config/arm/vec-common.md (vec_perm_const<mode>): Delete.
955         * config/arm/arm.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
956         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
957         (arm_expand_vec_perm_const, arm_vectorize_vec_perm_const_ok): Merge
958         into...
959         (arm_vectorize_vec_perm_const): ...this new function.  Explicitly
960         check for NEON modes.
961         * config/i386/i386-protos.h (ix86_expand_vec_perm_const): Delete.
962         * config/i386/sse.md (VEC_PERM_CONST, vec_perm_const<mode>): Delete.
963         * config/i386/i386.c (ix86_expand_vec_perm_const_1): Update comment.
964         (ix86_expand_vec_perm_const, ix86_vectorize_vec_perm_const_ok): Merge
965         into...
966         (ix86_vectorize_vec_perm_const): ...this new function.  Incorporate
967         the old VEC_PERM_CONST conditions.
968         * config/ia64/ia64-protos.h (ia64_expand_vec_perm_const): Delete.
969         * config/ia64/vect.md (vec_perm_const<mode>): Delete.
970         * config/ia64/ia64.c (ia64_expand_vec_perm_const)
971         (ia64_vectorize_vec_perm_const_ok): Merge into...
972         (ia64_vectorize_vec_perm_const): ...this new function.
973         * config/mips/loongson.md (vec_perm_const<mode>): Delete.
974         * config/mips/mips-msa.md (vec_perm_const<mode>): Delete.
975         * config/mips/mips-ps-3d.md (vec_perm_constv2sf): Delete.
976         * config/mips/mips-protos.h (mips_expand_vec_perm_const): Delete.
977         * config/mips/mips.c (mips_expand_vec_perm_const)
978         (mips_vectorize_vec_perm_const_ok): Merge into...
979         (mips_vectorize_vec_perm_const): ...this new function.
980         * config/powerpcspe/altivec.md (vec_perm_constv16qi): Delete.
981         * config/powerpcspe/paired.md (vec_perm_constv2sf): Delete.
982         * config/powerpcspe/spe.md (vec_perm_constv2si): Delete.
983         * config/powerpcspe/vsx.md (vec_perm_const<mode>): Delete.
984         * config/powerpcspe/powerpcspe-protos.h (altivec_expand_vec_perm_const)
985         (rs6000_expand_vec_perm_const): Delete.
986         * config/powerpcspe/powerpcspe.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK):
987         Delete.
988         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
989         (altivec_expand_vec_perm_const_le): Take each operand individually.
990         Operate on constant selectors rather than rtxes.
991         (altivec_expand_vec_perm_const): Likewise.  Update call to
992         altivec_expand_vec_perm_const_le.
993         (rs6000_expand_vec_perm_const): Delete.
994         (rs6000_vectorize_vec_perm_const_ok): Delete.
995         (rs6000_vectorize_vec_perm_const): New function.
996         (rs6000_do_expand_vec_perm): Take a vec_perm_builder instead of
997         an element count and rtx array.
998         (rs6000_expand_extract_even): Update call accordingly.
999         (rs6000_expand_interleave): Likewise.
1000         * config/rs6000/altivec.md (vec_perm_constv16qi): Delete.
1001         * config/rs6000/paired.md (vec_perm_constv2sf): Delete.
1002         * config/rs6000/vsx.md (vec_perm_const<mode>): Delete.
1003         * config/rs6000/rs6000-protos.h (altivec_expand_vec_perm_const)
1004         (rs6000_expand_vec_perm_const): Delete.
1005         * config/rs6000/rs6000.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
1006         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
1007         (altivec_expand_vec_perm_const_le): Take each operand individually.
1008         Operate on constant selectors rather than rtxes.
1009         (altivec_expand_vec_perm_const): Likewise.  Update call to
1010         altivec_expand_vec_perm_const_le.
1011         (rs6000_expand_vec_perm_const): Delete.
1012         (rs6000_vectorize_vec_perm_const_ok): Delete.
1013         (rs6000_vectorize_vec_perm_const): New function.  Remove stray
1014         reference to the SPE evmerge intructions.
1015         (rs6000_do_expand_vec_perm): Take a vec_perm_builder instead of
1016         an element count and rtx array.
1017         (rs6000_expand_extract_even): Update call accordingly.
1018         (rs6000_expand_interleave): Likewise.
1019         * config/sparc/sparc.md (vec_perm_constv8qi): Delete in favor of...
1020         * config/sparc/sparc.c (sparc_vectorize_vec_perm_const): ...this
1021         new function.
1022         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
1024 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1026         * optabs.c (expand_vec_perm_1): Assert that SEL has an integer
1027         vector mode and that that mode matches the mode of the data
1028         being permuted.
1029         (expand_vec_perm): Split handling of non-CONST_VECTOR selectors
1030         out into expand_vec_perm_var.  Do all CONST_VECTOR handling here,
1031         directly using expand_vec_perm_1 when forcing selectors into
1032         registers.
1033         (expand_vec_perm_var): New function, split out from expand_vec_perm.
1035 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1037         * optabs-query.h (can_vec_perm_p): Delete.
1038         (can_vec_perm_var_p, can_vec_perm_const_p): Declare.
1039         * optabs-query.c (can_vec_perm_p): Split into...
1040         (can_vec_perm_var_p, can_vec_perm_const_p): ...these two functions.
1041         (can_mult_highpart_p): Use can_vec_perm_const_p to test whether a
1042         particular selector is valid.
1043         * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
1044         * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
1045         (vect_grouped_load_supported): Likewise.
1046         (vect_shift_permute_load_chain): Likewise.
1047         * tree-vect-slp.c (vect_build_slp_tree_1): Likewise.
1048         (vect_transform_slp_perm_load): Likewise.
1049         * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
1050         (vectorizable_bswap): Likewise.
1051         (vect_gen_perm_mask_checked): Likewise.
1052         * fold-const.c (fold_ternary_loc): Likewise.  Don't take
1053         implementations of variable permutation vectors into account
1054         when deciding which selector to use.
1055         * tree-vect-loop.c (have_whole_vector_shift): Don't check whether
1056         vec_perm_const_optab is supported; instead use can_vec_perm_const_p
1057         with a false third argument.
1058         * tree-vect-generic.c (lower_vec_perm): Use can_vec_perm_const_p
1059         to test whether the constant selector is valid and can_vec_perm_var_p
1060         to test whether a variable selector is valid.
1062 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1064         * optabs-query.h (can_vec_perm_p): Take a const vec_perm_indices *.
1065         * optabs-query.c (can_vec_perm_p): Likewise.
1066         * fold-const.c (fold_vec_perm): Take a const vec_perm_indices &
1067         instead of vec_perm_indices.
1068         * tree-vectorizer.h (vect_gen_perm_mask_any): Likewise,
1069         (vect_gen_perm_mask_checked): Likewise,
1070         * tree-vect-stmts.c (vect_gen_perm_mask_any): Likewise,
1071         (vect_gen_perm_mask_checked): Likewise,
1073 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1075         * optabs-query.h (qimode_for_vec_perm): Declare.
1076         * optabs-query.c (can_vec_perm_p): Split out qimode search to...
1077         (qimode_for_vec_perm): ...this new function.
1078         * optabs.c (expand_vec_perm): Use qimode_for_vec_perm.
1080 2018-01-02  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>
1082         * rtlanal.c (canonicalize_condition): Return 0 if final rtx
1083         does not have a conditional at the top.
1085 2018-01-02  Richard Biener  <rguenther@suse.de>
1087         * ipa-inline.c (big_speedup_p): Fix expression.
1089 2018-01-02  Jan Hubicka  <hubicka@ucw.cz>
1091         PR target/81616
1092         * config/i386/x86-tune-costs.h: Increase cost of integer load costs
1093         for generic 4->6.
1095 2018-01-02  Jan Hubicka  <hubicka@ucw.cz>
1097         PR target/81616
1098         Generic tuning.
1099         * x86-tune-costs.h (generic_cost): Reduce cost of FDIV 20->17,
1100         cost of sqrt 20->14, DIVSS 18->13, DIVSD 32->17, SQRtSS 30->14
1101         and SQRTsD 58->18, cond_not_taken_branch_cost. 2->1. Increase
1102         cond_taken_branch_cost 3->4.
1104 2018-01-01  Jakub Jelinek  <jakub@redhat.com>
1106         PR tree-optimization/83581
1107         * tree-loop-distribution.c (pass_loop_distribution::execute): Return
1108         TODO_cleanup_cfg if any changes have been made.
1110         PR middle-end/83608
1111         * expr.c (store_expr_with_bounds): Use simplify_gen_subreg instead of
1112         convert_modes if target mode has the right side, but different mode
1113         class.
1115         PR middle-end/83609
1116         * expr.c (expand_assignment): Fix up a typo in simplify_gen_subreg
1117         last argument when extracting from CONCAT.  If either from_real or
1118         from_imag is NULL, use expansion through memory.  If result is not
1119         a CONCAT and simplify_gen_subreg fails, try to simplify_gen_subreg
1120         the parts directly to inner mode, if even that fails, use expansion
1121         through memory.
1123         PR middle-end/83623
1124         * expmed.c (expand_shift_1): For 2-byte rotates by BITS_PER_UNIT,
1125         check for bswap in mode rather than HImode and use that in expand_unop
1126         too.
1128 Copyright (C) 2018 Free Software Foundation, Inc.
1130 Copying and distribution of this file, with or without modification,
1131 are permitted in any medium without royalty provided the copyright
1132 notice and this notice are preserved.