1 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
2 Alan Hayward <alan.hayward@arm.com>
3 David Sherwood <david.sherwood@arm.com>
5 * machmode.h (mode_to_bits): Return a poly_uint16 rather than an
7 (GET_MODE_BITSIZE): Return a constant if ONLY_FIXED_SIZE_MODES,
8 or if measurement_type is polynomial.
9 * calls.c (shift_return_value): Treat GET_MODE_BITSIZE as polynomial.
10 * combine.c (make_extraction): Likewise.
11 * dse.c (find_shift_sequence): Likewise.
12 * dwarf2out.c (mem_loc_descriptor): Likewise.
13 * expmed.c (store_integral_bit_field, extract_bit_field_1): Likewise.
14 (extract_bit_field, extract_low_bits): Likewise.
15 * expr.c (convert_move, convert_modes, emit_move_insn_1): Likewise.
16 (optimize_bitfield_assignment_op, expand_assignment): Likewise.
17 (store_expr_with_bounds, store_field, expand_expr_real_1): Likewise.
18 * fold-const.c (optimize_bit_field_compare, merge_ranges): Likewise.
19 * gimple-fold.c (optimize_atomic_compare_exchange_p): Likewise.
20 * reload.c (find_reloads): Likewise.
21 * reload1.c (alter_reg): Likewise.
22 * stor-layout.c (bitwise_mode_for_mode, compute_record_mode): Likewise.
23 * targhooks.c (default_secondary_memory_needed_mode): Likewise.
24 * tree-if-conv.c (predicate_mem_writes): Likewise.
25 * tree-ssa-strlen.c (handle_builtin_memcmp): Likewise.
26 * tree-vect-patterns.c (adjust_bool_pattern): Likewise.
27 * tree-vect-stmts.c (vectorizable_simd_clone_call): Likewise.
28 * valtrack.c (dead_debug_insert_temp): Likewise.
29 * varasm.c (mergeable_constant_section): Likewise.
30 * config/sh/sh.h (LOCAL_ALIGNMENT): Use as_a <fixed_size_mode>.
32 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
33 Alan Hayward <alan.hayward@arm.com>
34 David Sherwood <david.sherwood@arm.com>
36 * expr.c (expand_assignment): Cope with polynomial mode sizes
37 when assigning to a CONCAT.
39 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
40 Alan Hayward <alan.hayward@arm.com>
41 David Sherwood <david.sherwood@arm.com>
43 * machmode.h (mode_precision): Change from unsigned short to
45 (mode_to_precision): Return a poly_uint16 rather than an unsigned
47 (GET_MODE_PRECISION): Return a constant if ONLY_FIXED_SIZE_MODES,
48 or if measurement_type is not polynomial.
49 (HWI_COMPUTABLE_MODE_P): Turn into a function. Optimize the case
50 in which the mode is already known to be a scalar_int_mode.
51 * genmodes.c (emit_mode_precision): Change the type of mode_precision
52 from unsigned short to poly_uint16_pod. Use ZERO_COEFFS for the
54 * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
55 for GET_MODE_PRECISION.
56 * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
57 for GET_MODE_PRECISION.
58 * combine.c (update_rsp_from_reg_equal): Treat GET_MODE_PRECISION
60 (try_combine, find_split_point, combine_simplify_rtx): Likewise.
61 (expand_field_assignment, make_extraction): Likewise.
62 (make_compound_operation_int, record_dead_and_set_regs_1): Likewise.
63 (get_last_value): Likewise.
64 * convert.c (convert_to_integer_1): Likewise.
65 * cse.c (cse_insn): Likewise.
66 * expr.c (expand_expr_real_1): Likewise.
67 * lra-constraints.c (simplify_operand_subreg): Likewise.
68 * optabs-query.c (can_atomic_load_p): Likewise.
69 * optabs.c (expand_atomic_load): Likewise.
70 (expand_atomic_store): Likewise.
71 * ree.c (combine_reaching_defs): Likewise.
72 * rtl.h (partial_subreg_p, paradoxical_subreg_p): Likewise.
73 * rtlanal.c (nonzero_bits1, lsb_bitfield_op_p): Likewise.
74 * tree.h (type_has_mode_precision_p): Likewise.
75 * ubsan.c (instrument_si_overflow): Likewise.
77 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
78 Alan Hayward <alan.hayward@arm.com>
79 David Sherwood <david.sherwood@arm.com>
81 * tree.h (TYPE_VECTOR_SUBPARTS): Turn into a function and handle
82 polynomial numbers of units.
83 (SET_TYPE_VECTOR_SUBPARTS): Likewise.
84 (valid_vector_subparts_p): New function.
85 (build_vector_type): Remove temporary shim and take the number
86 of units as a poly_uint64 rather than an int.
87 (build_opaque_vector_type): Take the number of units as a
88 poly_uint64 rather than an int.
89 * tree.c (build_vector_from_ctor): Handle polynomial
91 (type_hash_canon_hash, type_cache_hasher::equal): Likewise.
92 (uniform_vector_p, vector_type_mode, build_vector): Likewise.
93 (build_vector_from_val): If the number of units is variable,
94 use build_vec_duplicate_cst for constant operands and
95 VEC_DUPLICATE_EXPR otherwise.
96 (make_vector_type): Remove temporary is_constant ().
97 (build_vector_type, build_opaque_vector_type): Take the number of
98 units as a poly_uint64 rather than an int.
99 (check_vector_cst): Handle polynomial TYPE_VECTOR_SUBPARTS and
101 * cfgexpand.c (expand_debug_expr): Likewise.
102 * expr.c (count_type_elements, categorize_ctor_elements_1): Likewise.
103 (store_constructor, expand_expr_real_1): Likewise.
104 (const_scalar_mask_from_tree): Likewise.
105 * fold-const-call.c (fold_const_reduction): Likewise.
106 * fold-const.c (const_binop, const_unop, fold_convert_const): Likewise.
107 (operand_equal_p, fold_vec_perm, fold_ternary_loc): Likewise.
108 (native_encode_vector, vec_cst_ctor_to_array): Likewise.
109 (fold_relational_const): Likewise.
110 (native_interpret_vector): Likewise. Change the size from an
111 int to an unsigned int.
112 * gimple-fold.c (gimple_fold_stmt_to_constant_1): Handle polynomial
113 TYPE_VECTOR_SUBPARTS.
114 (gimple_fold_indirect_ref, gimple_build_vector): Likewise.
115 (gimple_build_vector_from_val): Use VEC_DUPLICATE_EXPR when
116 duplicating a non-constant operand into a variable-length vector.
117 * hsa-brig.c (hsa_op_immed::emit_to_buffer): Handle polynomial
118 TYPE_VECTOR_SUBPARTS and VECTOR_CST_NELTS.
119 * ipa-icf.c (sem_variable::equals): Likewise.
120 * match.pd: Likewise.
121 * omp-simd-clone.c (simd_clone_subparts): Likewise.
122 * print-tree.c (print_node): Likewise.
123 * stor-layout.c (layout_type): Likewise.
124 * targhooks.c (default_builtin_vectorization_cost): Likewise.
125 * tree-cfg.c (verify_gimple_comparison): Likewise.
126 (verify_gimple_assign_binary): Likewise.
127 (verify_gimple_assign_ternary): Likewise.
128 (verify_gimple_assign_single): Likewise.
129 * tree-pretty-print.c (dump_generic_node): Likewise.
130 * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
131 (simplify_bitfield_ref, is_combined_permutation_identity): Likewise.
132 * tree-vect-data-refs.c (vect_permute_store_chain): Likewise.
133 (vect_grouped_load_supported, vect_permute_load_chain): Likewise.
134 (vect_shift_permute_load_chain): Likewise.
135 * tree-vect-generic.c (nunits_for_known_piecewise_op): Likewise.
136 (expand_vector_condition, optimize_vector_constructor): Likewise.
137 (lower_vec_perm, get_compute_type): Likewise.
138 * tree-vect-loop.c (vect_determine_vectorization_factor): Likewise.
139 (get_initial_defs_for_reduction, vect_transform_loop): Likewise.
140 * tree-vect-patterns.c (vect_recog_bool_pattern): Likewise.
141 (vect_recog_mask_conversion_pattern): Likewise.
142 * tree-vect-slp.c (vect_supported_load_permutation_p): Likewise.
143 (vect_get_constant_vectors, vect_transform_slp_perm_load): Likewise.
144 * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
145 (get_group_load_store_type, vectorizable_mask_load_store): Likewise.
146 (vectorizable_bswap, simd_clone_subparts, vectorizable_assignment)
147 (vectorizable_shift, vectorizable_operation, vectorizable_store)
148 (vectorizable_load, vect_is_simple_cond, vectorizable_comparison)
149 (supportable_widening_operation): Likewise.
150 (supportable_narrowing_operation): Likewise.
151 * tree-vector-builder.c (tree_vector_builder::binary_encoded_nelts):
153 * varasm.c (output_constant): Likewise.
155 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
156 Alan Hayward <alan.hayward@arm.com>
157 David Sherwood <david.sherwood@arm.com>
159 * tree-vect-data-refs.c (vect_permute_store_chain): Reorganize
160 so that both the length == 3 and length != 3 cases set up their
161 own permute vectors. Add comments explaining why we know the
162 number of elements is constant.
163 (vect_permute_load_chain): Likewise.
165 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
166 Alan Hayward <alan.hayward@arm.com>
167 David Sherwood <david.sherwood@arm.com>
169 * machmode.h (mode_nunits): Change from unsigned char to
171 (ONLY_FIXED_SIZE_MODES): New macro.
172 (pod_mode::measurement_type, scalar_int_mode::measurement_type)
173 (scalar_float_mode::measurement_type, scalar_mode::measurement_type)
174 (complex_mode::measurement_type, fixed_size_mode::measurement_type):
176 (mode_to_nunits): Return a poly_uint16 rather than an unsigned short.
177 (GET_MODE_NUNITS): Return a constant if ONLY_FIXED_SIZE_MODES,
178 or if measurement_type is not polynomial.
179 * genmodes.c (ZERO_COEFFS): New macro.
180 (emit_mode_nunits_inline): Make mode_nunits_inline return a
182 (emit_mode_nunits): Change the type of mode_nunits to poly_uint16_pod.
183 Use ZERO_COEFFS when emitting initializers.
184 * data-streamer.h (bp_pack_poly_value): New function.
185 (bp_unpack_poly_value): Likewise.
186 * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
188 * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
190 * tree.c (make_vector_type): Remove temporary shim and make
191 the real function take the number of units as a poly_uint64
193 (build_vector_type_for_mode): Handle polynomial nunits.
194 * dwarf2out.c (loc_descriptor, add_const_value_attribute): Likewise.
195 * emit-rtl.c (const_vec_series_p_1): Likewise.
196 (gen_rtx_CONST_VECTOR): Likewise.
197 * fold-const.c (test_vec_duplicate_folding): Likewise.
198 * genrecog.c (validate_pattern): Likewise.
199 * optabs-query.c (can_vec_perm_var_p, can_mult_highpart_p): Likewise.
200 * optabs-tree.c (expand_vec_cond_expr_p): Likewise.
201 * optabs.c (expand_vector_broadcast, expand_binop_directly): Likewise.
202 (shift_amt_for_vec_perm_mask, expand_vec_perm_var): Likewise.
203 (expand_vec_cond_expr, expand_mult_highpart): Likewise.
204 * rtlanal.c (subreg_get_info): Likewise.
205 * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
206 (vect_grouped_load_supported): Likewise.
207 * tree-vect-generic.c (type_for_widest_vector_mode): Likewise.
208 * tree-vect-loop.c (have_whole_vector_shift): Likewise.
209 * simplify-rtx.c (simplify_unary_operation_1): Likewise.
210 (simplify_const_unary_operation, simplify_binary_operation_1)
211 (simplify_const_binary_operation, simplify_ternary_operation)
212 (test_vector_ops_duplicate, test_vector_ops): Likewise.
213 (simplify_immed_subreg): Use GET_MODE_NUNITS on a fixed_size_mode
214 instead of CONST_VECTOR_NUNITS.
215 * varasm.c (output_constant_pool_2): Likewise.
216 * rtx-vector-builder.c (rtx_vector_builder::build): Only include the
217 explicit-encoded elements in the XVEC for variable-length vectors.
219 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
221 * lra-constraints.c (curr_insn_transform): Use partial_subreg_p.
223 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
224 Alan Hayward <alan.hayward@arm.com>
225 David Sherwood <david.sherwood@arm.com>
227 * coretypes.h (fixed_size_mode): Declare.
228 (fixed_size_mode_pod): New typedef.
229 * builtins.h (target_builtins::x_apply_args_mode)
230 (target_builtins::x_apply_result_mode): Change type to
232 * builtins.c (apply_args_size, apply_result_size, result_vector)
233 (expand_builtin_apply_args_1, expand_builtin_apply)
234 (expand_builtin_return): Update accordingly.
236 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
238 * cse.c (hash_rtx_cb): Hash only the encoded elements.
239 * cselib.c (cselib_hash_rtx): Likewise.
240 * expmed.c (make_tree): Build VECTOR_CSTs directly from the
241 CONST_VECTOR encoding.
243 2017-01-03 Jakub Jelinek <jakub@redhat.com>
244 Jeff Law <law@redhat.com>
247 * config/i386/i386.c (ix86_adjust_stack_and_probe_stack_clash): For
248 noreturn probe, use gen_pop instead of ix86_emit_restore_reg_using_pop,
249 only set RTX_FRAME_RELATED_P on both the push and pop if cfa_reg is sp
250 and add REG_CFA_ADJUST_CFA notes in that case to both insns.
253 * config/i386/i386.c (ix86_adjust_stack_and_probe_stack_clash): Do not
254 explicitly probe *sp in a noreturn function if there were any callee
255 register saves or frame pointer is needed.
257 2018-01-03 Jakub Jelinek <jakub@redhat.com>
260 * cfgexpand.c (expand_debug_expr): Return NULL if mode is
261 BLKmode for ternary, binary or unary expressions.
264 * var-tracking.c (delete_vta_debug_insn): New inline function.
265 (delete_vta_debug_insns): Add USE_CFG argument, if true, walk just
266 insns from get_insns () to NULL instead of each bb separately.
267 Use delete_vta_debug_insn. No longer static.
268 (vt_debug_insns_local, variable_tracking_main_1): Adjust
269 delete_vta_debug_insns callers.
270 * rtl.h (delete_vta_debug_insns): Declare.
271 * final.c (rest_of_handle_final): Call delete_vta_debug_insns
272 instead of variable_tracking_main.
274 2018-01-03 Martin Sebor <msebor@redhat.com>
277 * doc/extend.texi (attribute const): Fix a typo.
278 * ipa-pure-const.c ((warn_function_const, warn_function_pure): Avoid
279 issuing -Wsuggest-attribute for void functions.
281 2018-01-03 Martin Sebor <msebor@redhat.com>
283 * gimple-ssa-warn-restrict.c (builtin_memref::builtin_memref): Use
284 offset_int::from instead of wide_int::to_shwi.
285 (maybe_diag_overlap): Remove assertion.
286 Use HOST_WIDE_INT_PRINT_DEC instead of %lli.
287 * gimple-ssa-sprintf.c (format_directive): Same.
288 (parse_directive): Same.
289 (sprintf_dom_walker::compute_format_length): Same.
290 (try_substitute_return_value): Same.
292 2017-01-03 Jeff Law <law@redhat.com>
295 * explow.c (anti_adjust_stack_and_probe_stack_clash): Test a
296 non-constant residual for zero at runtime and avoid probing in
297 that case. Reorganize code for trailing problem to mirror handling
300 2018-01-03 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
302 PR tree-optimization/83501
303 * tree-ssa-strlen.c (get_string_cst): New.
304 (handle_char_store): Call get_string_cst.
306 2018-01-03 Martin Liska <mliska@suse.cz>
308 PR tree-optimization/83593
309 * tree-ssa-strlen.c: Include tree-cfg.h.
310 (strlen_check_and_optimize_stmt): Add new argument cleanup_eh.
311 (strlen_dom_walker): Add new member variable m_cleanup_cfg.
312 (strlen_dom_walker::strlen_dom_walker): Initialize m_cleanup_cfg
314 (strlen_dom_walker::before_dom_children): Call
315 gimple_purge_dead_eh_edges. Dump tranformation with details
317 (strlen_dom_walker::before_dom_children): Update call by adding
318 new argument cleanup_eh.
319 (pass_strlen::execute): Return TODO_cleanup_cfg if needed.
321 2018-01-03 Martin Liska <mliska@suse.cz>
324 * cif-code.def (VARIADIC_THUNK): New enum value.
325 * ipa-fnsummary.c (compute_fn_summary): Do not inline variadic
328 2018-01-03 Jan Beulich <jbeulich@suse.com>
330 * sse.md (mov<mode>_internal): Tighten condition for when to use
331 vmovdqu<ssescalarsize> for TI and OI modes.
333 2018-01-03 Jakub Jelinek <jakub@redhat.com>
335 Update copyright years.
337 2018-01-03 Martin Liska <mliska@suse.cz>
340 * ipa-visibility.c (function_and_variable_visibility): Skip
341 functions with noipa attribure.
343 2018-01-03 Jakub Jelinek <jakub@redhat.com>
345 * gcc.c (process_command): Update copyright notice dates.
346 * gcov-dump.c (print_version): Ditto.
347 * gcov.c (print_version): Ditto.
348 * gcov-tool.c (print_version): Ditto.
349 * gengtype.c (create_file): Ditto.
350 * doc/cpp.texi: Bump @copying's copyright year.
351 * doc/cppinternals.texi: Ditto.
352 * doc/gcc.texi: Ditto.
353 * doc/gccint.texi: Ditto.
354 * doc/gcov.texi: Ditto.
355 * doc/install.texi: Ditto.
356 * doc/invoke.texi: Ditto.
358 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
360 * vector-builder.h (vector_builder::m_full_nelts): Change from
361 unsigned int to poly_uint64.
362 (vector_builder::full_nelts): Update prototype accordingly.
363 (vector_builder::new_vector): Likewise.
364 (vector_builder::encoded_full_vector_p): Handle polynomial full_nelts.
365 (vector_builder::operator ==): Likewise.
366 (vector_builder::finalize): Likewise.
367 * int-vector-builder.h (int_vector_builder::int_vector_builder):
368 Take the number of elements as a poly_uint64 rather than an
370 * vec-perm-indices.h (vec_perm_indices::m_nelts_per_input): Change
371 from unsigned int to poly_uint64.
372 (vec_perm_indices::vec_perm_indices): Update prototype accordingly.
373 (vec_perm_indices::new_vector): Likewise.
374 (vec_perm_indices::length): Likewise.
375 (vec_perm_indices::nelts_per_input): Likewise.
376 (vec_perm_indices::input_nelts): Likewise.
377 * vec-perm-indices.c (vec_perm_indices::new_vector): Take the
378 number of elements per input as a poly_uint64 rather than an
379 unsigned int. Use the original encoding for variable-length
380 vectors, rather than clamping each individual element.
381 For the second and subsequent elements in each pattern,
382 clamp the step and base before clamping their sum.
383 (vec_perm_indices::series_p): Handle polynomial element counts.
384 (vec_perm_indices::all_in_range_p): Likewise.
385 (vec_perm_indices_to_tree): Likewise.
386 (vec_perm_indices_to_rtx): Likewise.
387 * tree-vect-stmts.c (vect_gen_perm_mask_any): Likewise.
388 * tree-vector-builder.c (tree_vector_builder::new_unary_operation)
389 (tree_vector_builder::new_binary_operation): Handle polynomial
390 element counts. Return false if we need to know the number
391 of elements at compile time.
392 * fold-const.c (fold_vec_perm): Punt if the number of elements
393 isn't known at compile time.
395 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
397 * vec-perm-indices.h (vec_perm_builder): Change element type
398 from HOST_WIDE_INT to poly_int64.
399 (vec_perm_indices::element_type): Update accordingly.
400 (vec_perm_indices::clamp): Handle polynomial element_types.
401 * vec-perm-indices.c (vec_perm_indices::series_p): Likewise.
402 (vec_perm_indices::all_in_range_p): Likewise.
403 (tree_to_vec_perm_builder): Check for poly_int64 trees rather
405 * vector-builder.h (vector_builder::stepped_sequence_p): Handle
406 polynomial vec_perm_indices element types.
407 * int-vector-builder.h (int_vector_builder::equal_p): Likewise.
408 * fold-const.c (fold_vec_perm): Likewise.
409 * optabs.c (shift_amt_for_vec_perm_mask): Likewise.
410 * tree-vect-generic.c (lower_vec_perm): Likewise.
411 * tree-vect-slp.c (vect_transform_slp_perm_load): Likewise.
412 * config/aarch64/aarch64.c (aarch64_evpc_tbl): Cast d->perm
413 element type to HOST_WIDE_INT.
415 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
416 Alan Hayward <alan.hayward@arm.com>
417 David Sherwood <david.sherwood@arm.com>
419 * alias.c (addr_side_effect_eval): Take the size as a poly_int64
420 rather than an int. Use plus_constant.
421 (memrefs_conflict_p): Take the sizes as poly_int64s rather than ints.
422 Take the offset "c" as a poly_int64 rather than a HOST_WIDE_INT.
424 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
425 Alan Hayward <alan.hayward@arm.com>
426 David Sherwood <david.sherwood@arm.com>
428 * calls.c (emit_call_1, expand_call): Change struct_value_size from
429 a HOST_WIDE_INT to a poly_int64.
431 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
432 Alan Hayward <alan.hayward@arm.com>
433 David Sherwood <david.sherwood@arm.com>
435 * calls.c (load_register_parameters): Cope with polynomial
436 mode sizes. Require a constant size for BLKmode parameters
437 that aren't described by a PARALLEL. If BLOCK_REG_PADDING
438 forces a parameter to be padded at the lsb end in order to
439 fill a complete number of words, require the parameter size
440 to be ordered wrt UNITS_PER_WORD.
442 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
443 Alan Hayward <alan.hayward@arm.com>
444 David Sherwood <david.sherwood@arm.com>
446 * reload1.c (spill_stack_slot_width): Change element type
447 from unsigned int to poly_uint64_pod.
448 (alter_reg): Treat mode sizes as polynomial.
450 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
451 Alan Hayward <alan.hayward@arm.com>
452 David Sherwood <david.sherwood@arm.com>
454 * reload.c (complex_word_subreg_p): New function.
455 (reload_inner_reg_of_subreg, push_reload): Use it.
457 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
458 Alan Hayward <alan.hayward@arm.com>
459 David Sherwood <david.sherwood@arm.com>
461 * lra-constraints.c (process_alt_operands): Reject matched
462 operands whose sizes aren't ordered.
463 (match_reload): Refer to this check here.
465 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
466 Alan Hayward <alan.hayward@arm.com>
467 David Sherwood <david.sherwood@arm.com>
469 * builtins.c (expand_ifn_atomic_compare_exchange_into_call): Assert
470 that the mode size is in the set {1, 2, 4, 8, 16}.
472 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
473 Alan Hayward <alan.hayward@arm.com>
474 David Sherwood <david.sherwood@arm.com>
476 * var-tracking.c (adjust_mems): Treat mode sizes as polynomial.
477 Use plus_constant instead of gen_rtx_PLUS.
479 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
480 Alan Hayward <alan.hayward@arm.com>
481 David Sherwood <david.sherwood@arm.com>
483 * config/cr16/cr16-protos.h (cr16_push_rounding): Declare.
484 * config/cr16/cr16.h (PUSH_ROUNDING): Move implementation to...
485 * config/cr16/cr16.c (cr16_push_rounding): ...this new function.
486 * config/h8300/h8300-protos.h (h8300_push_rounding): Declare.
487 * config/h8300/h8300.h (PUSH_ROUNDING): Move implementation to...
488 * config/h8300/h8300.c (h8300_push_rounding): ...this new function.
489 * config/i386/i386-protos.h (ix86_push_rounding): Declare.
490 * config/i386/i386.h (PUSH_ROUNDING): Move implementation to...
491 * config/i386/i386.c (ix86_push_rounding): ...this new function.
492 * config/m32c/m32c-protos.h (m32c_push_rounding): Take and return
494 * config/m32c/m32c.c (m32c_push_rounding): Likewise.
495 * config/m68k/m68k-protos.h (m68k_push_rounding): Declare.
496 * config/m68k/m68k.h (PUSH_ROUNDING): Move implementation to...
497 * config/m68k/m68k.c (m68k_push_rounding): ...this new function.
498 * config/pdp11/pdp11-protos.h (pdp11_push_rounding): Declare.
499 * config/pdp11/pdp11.h (PUSH_ROUNDING): Move implementation to...
500 * config/pdp11/pdp11.c (pdp11_push_rounding): ...this new function.
501 * config/stormy16/stormy16-protos.h (xstormy16_push_rounding): Declare.
502 * config/stormy16/stormy16.h (PUSH_ROUNDING): Move implementation to...
503 * config/stormy16/stormy16.c (xstormy16_push_rounding): ...this new
505 * expr.c (emit_move_resolve_push): Treat the input and result
506 of PUSH_ROUNDING as a poly_int64.
507 (emit_move_complex_push, emit_single_push_insn_1): Likewise.
508 (emit_push_insn): Likewise.
509 * lra-eliminations.c (mark_not_eliminable): Likewise.
510 * recog.c (push_operand): Likewise.
511 * reload1.c (elimination_effects): Likewise.
512 * rtlanal.c (nonzero_bits1): Likewise.
513 * calls.c (store_one_arg): Likewise. Require the padding to be
514 known at compile time.
516 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
517 Alan Hayward <alan.hayward@arm.com>
518 David Sherwood <david.sherwood@arm.com>
520 * expr.c (emit_single_push_insn_1): Treat mode sizes as polynomial.
521 Use plus_constant instead of gen_rtx_PLUS.
523 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
524 Alan Hayward <alan.hayward@arm.com>
525 David Sherwood <david.sherwood@arm.com>
527 * auto-inc-dec.c (set_inc_state): Take the mode size as a poly_int64
530 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
531 Alan Hayward <alan.hayward@arm.com>
532 David Sherwood <david.sherwood@arm.com>
534 * expr.c (expand_expr_real_1): Use tree_to_poly_uint64
535 instead of int_size_in_bytes when handling VIEW_CONVERT_EXPRs
536 via stack temporaries. Treat the mode size as polynomial too.
538 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
539 Alan Hayward <alan.hayward@arm.com>
540 David Sherwood <david.sherwood@arm.com>
542 * expr.c (expand_expr_real_2): When handling conversions involving
543 unions, apply tree_to_poly_uint64 to the TYPE_SIZE rather than
544 multiplying int_size_in_bytes by BITS_PER_UNIT. Treat GET_MODE_BISIZE
545 as a poly_uint64 too.
547 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
548 Alan Hayward <alan.hayward@arm.com>
549 David Sherwood <david.sherwood@arm.com>
551 * rtlanal.c (subreg_get_info): Handle polynomial mode sizes.
553 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
554 Alan Hayward <alan.hayward@arm.com>
555 David Sherwood <david.sherwood@arm.com>
557 * combine.c (can_change_dest_mode): Handle polynomial
558 REGMODE_NATURAL_SIZE.
559 * expmed.c (store_bit_field_1): Likewise.
560 * expr.c (store_constructor): Likewise.
561 * emit-rtl.c (validate_subreg): Operate on polynomial mode sizes
562 and polynomial REGMODE_NATURAL_SIZE.
563 (gen_lowpart_common): Likewise.
564 * reginfo.c (record_subregs_of_mode): Likewise.
565 * rtlanal.c (read_modify_subreg_p): Likewise.
567 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
568 Alan Hayward <alan.hayward@arm.com>
569 David Sherwood <david.sherwood@arm.com>
571 * internal-fn.c (expand_vector_ubsan_overflow): Handle polynomial
574 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
575 Alan Hayward <alan.hayward@arm.com>
576 David Sherwood <david.sherwood@arm.com>
578 * match.pd: Cope with polynomial numbers of vector elements.
580 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
581 Alan Hayward <alan.hayward@arm.com>
582 David Sherwood <david.sherwood@arm.com>
584 * fold-const.c (fold_indirect_ref_1): Handle polynomial offsets
585 in a POINTER_PLUS_EXPR.
587 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
588 Alan Hayward <alan.hayward@arm.com>
589 David Sherwood <david.sherwood@arm.com>
591 * omp-simd-clone.c (simd_clone_subparts): New function.
592 (simd_clone_init_simd_arrays): Use it instead of TYPE_VECTOR_SUBPARTS.
593 (ipa_simd_modify_function_body): Likewise.
595 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
596 Alan Hayward <alan.hayward@arm.com>
597 David Sherwood <david.sherwood@arm.com>
599 * tree-vect-generic.c (nunits_for_known_piecewise_op): New function.
600 (expand_vector_piecewise): Use it instead of TYPE_VECTOR_SUBPARTS.
601 (expand_vector_addition, add_rshift, expand_vector_divmod): Likewise.
602 (expand_vector_condition, vector_element): Likewise.
603 (subparts_gt): New function.
604 (get_compute_type): Use subparts_gt.
605 (count_type_subparts): Delete.
606 (expand_vector_operations_1): Use subparts_gt instead of
609 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
610 Alan Hayward <alan.hayward@arm.com>
611 David Sherwood <david.sherwood@arm.com>
613 * tree-vect-data-refs.c (vect_no_alias_p): Replace with...
614 (vect_compile_time_alias): ...this new function. Do the calculation
615 on poly_ints rather than trees.
616 (vect_prune_runtime_alias_test_list): Update call accordingly.
618 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
619 Alan Hayward <alan.hayward@arm.com>
620 David Sherwood <david.sherwood@arm.com>
622 * tree-vect-slp.c (vect_build_slp_tree_1): Handle polynomial
624 (vect_schedule_slp_instance): Likewise.
626 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
627 Alan Hayward <alan.hayward@arm.com>
628 David Sherwood <david.sherwood@arm.com>
630 * tree-vect-slp.c (vect_get_and_check_slp_defs): Reject
631 constant and extern definitions for variable-length vectors.
632 (vect_get_constant_vectors): Note that the number of units
633 is known to be constant.
635 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
636 Alan Hayward <alan.hayward@arm.com>
637 David Sherwood <david.sherwood@arm.com>
639 * tree-vect-stmts.c (vectorizable_conversion): Treat the number
640 of units as polynomial. Choose between WIDE and NARROW based
643 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
644 Alan Hayward <alan.hayward@arm.com>
645 David Sherwood <david.sherwood@arm.com>
647 * tree-vect-stmts.c (simd_clone_subparts): New function.
648 (vectorizable_simd_clone_call): Use it instead of TYPE_VECTOR_SUBPARTS.
650 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
651 Alan Hayward <alan.hayward@arm.com>
652 David Sherwood <david.sherwood@arm.com>
654 * tree-vect-stmts.c (vectorizable_call): Treat the number of
655 vectors as polynomial. Use build_index_vector for
658 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
659 Alan Hayward <alan.hayward@arm.com>
660 David Sherwood <david.sherwood@arm.com>
662 * tree-vect-stmts.c (get_load_store_type): Treat the number of
663 units as polynomial. Reject VMAT_ELEMENTWISE and VMAT_STRIDED_SLP
664 for variable-length vectors.
665 (vectorizable_mask_load_store): Treat the number of units as
666 polynomial, asserting that it is constant if the condition has
667 already been enforced.
668 (vectorizable_store, vectorizable_load): Likewise.
670 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
671 Alan Hayward <alan.hayward@arm.com>
672 David Sherwood <david.sherwood@arm.com>
674 * tree-vect-loop.c (vectorizable_live_operation): Treat the number
675 of units as polynomial. Punt if we can't tell at compile time
676 which vector contains the final result.
678 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
679 Alan Hayward <alan.hayward@arm.com>
680 David Sherwood <david.sherwood@arm.com>
682 * tree-vect-loop.c (vectorizable_induction): Treat the number
683 of units as polynomial. Punt on SLP inductions. Use an integer
684 VEC_SERIES_EXPR for variable-length integer reductions. Use a
685 cast of such a series for variable-length floating-point
688 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
689 Alan Hayward <alan.hayward@arm.com>
690 David Sherwood <david.sherwood@arm.com>
692 * tree.h (build_index_vector): Declare.
693 * tree.c (build_index_vector): New function.
694 * tree-vect-loop.c (get_initial_defs_for_reduction): Treat the number
695 of units as polynomial, forcibly converting it to a constant if
696 vectorizable_reduction has already enforced the condition.
697 (vect_create_epilog_for_reduction): Likewise. Use build_index_vector
698 to create a {1,2,3,...} vector.
699 (vectorizable_reduction): Treat the number of units as polynomial.
700 Choose vectype_in based on the largest scalar element size rather
701 than the smallest number of units. Enforce the restrictions
704 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
705 Alan Hayward <alan.hayward@arm.com>
706 David Sherwood <david.sherwood@arm.com>
708 * tree-vect-data-refs.c (vector_alignment_reachable_p): Treat the
709 number of units as polynomial.
711 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
712 Alan Hayward <alan.hayward@arm.com>
713 David Sherwood <david.sherwood@arm.com>
715 * target.h (vector_sizes, auto_vector_sizes): New typedefs.
716 * target.def (autovectorize_vector_sizes): Return the vector sizes
717 by pointer, using vector_sizes rather than a bitmask.
718 * targhooks.h (default_autovectorize_vector_sizes): Update accordingly.
719 * targhooks.c (default_autovectorize_vector_sizes): Likewise.
720 * config/aarch64/aarch64.c (aarch64_autovectorize_vector_sizes):
722 * config/arc/arc.c (arc_autovectorize_vector_sizes): Likewise.
723 * config/arm/arm.c (arm_autovectorize_vector_sizes): Likewise.
724 * config/i386/i386.c (ix86_autovectorize_vector_sizes): Likewise.
725 * config/mips/mips.c (mips_autovectorize_vector_sizes): Likewise.
726 * omp-general.c (omp_max_vf): Likewise.
727 * omp-low.c (omp_clause_aligned_alignment): Likewise.
728 * optabs-query.c (can_vec_mask_load_store_p): Likewise.
729 * tree-vect-loop.c (vect_analyze_loop): Likewise.
730 * tree-vect-slp.c (vect_slp_bb): Likewise.
731 * doc/tm.texi: Regenerate.
732 * tree-vectorizer.h (current_vector_size): Change from an unsigned int
734 * tree-vect-stmts.c (get_vectype_for_scalar_type_and_size): Take
735 the vector size as a poly_uint64 rather than an unsigned int.
736 (current_vector_size): Change from an unsigned int to a poly_uint64.
737 (get_vectype_for_scalar_type): Update accordingly.
738 * tree.h (build_truth_vector_type): Take the size and number of
739 units as a poly_uint64 rather than an unsigned int.
740 (build_vector_type): Add a temporary overload that takes
741 the number of units as a poly_uint64 rather than an unsigned int.
742 * tree.c (make_vector_type): Likewise.
743 (build_truth_vector_type): Take the number of units as a poly_uint64
744 rather than an unsigned int.
746 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
747 Alan Hayward <alan.hayward@arm.com>
748 David Sherwood <david.sherwood@arm.com>
750 * target.def (get_mask_mode): Take the number of units and length
751 as poly_uint64s rather than unsigned ints.
752 * targhooks.h (default_get_mask_mode): Update accordingly.
753 * targhooks.c (default_get_mask_mode): Likewise.
754 * config/i386/i386.c (ix86_get_mask_mode): Likewise.
755 * doc/tm.texi: Regenerate.
757 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
758 Alan Hayward <alan.hayward@arm.com>
759 David Sherwood <david.sherwood@arm.com>
761 * omp-general.h (omp_max_vf): Return a poly_uint64 instead of an int.
762 * omp-general.c (omp_max_vf): Likewise.
763 * omp-expand.c (omp_adjust_chunk_size): Update call to omp_max_vf.
764 (expand_omp_simd): Handle polynomial safelen.
765 * omp-low.c (omplow_simd_context): Add a default constructor.
766 (omplow_simd_context::max_vf): Change from int to poly_uint64.
767 (lower_rec_simd_input_clauses): Update accordingly.
768 (lower_rec_input_clauses): Likewise.
770 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
771 Alan Hayward <alan.hayward@arm.com>
772 David Sherwood <david.sherwood@arm.com>
774 * tree-vectorizer.h (vect_nunits_for_cost): New function.
775 * tree-vect-loop.c (vect_model_reduction_cost): Use it.
776 * tree-vect-slp.c (vect_analyze_slp_cost_1): Likewise.
777 (vect_analyze_slp_cost): Likewise.
778 * tree-vect-stmts.c (vect_model_store_cost): Likewise.
779 (vect_model_load_cost): Likewise.
781 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
782 Alan Hayward <alan.hayward@arm.com>
783 David Sherwood <david.sherwood@arm.com>
785 * tree-vect-slp.c (vect_record_max_nunits, vect_build_slp_tree_1)
786 (vect_build_slp_tree_2, vect_build_slp_tree): Change max_nunits
787 from an unsigned int * to a poly_uint64_pod *.
788 (calculate_unrolling_factor): New function.
789 (vect_analyze_slp_instance): Use it. Track polynomial max_nunits.
791 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
792 Alan Hayward <alan.hayward@arm.com>
793 David Sherwood <david.sherwood@arm.com>
795 * tree-vectorizer.h (_slp_instance::unrolling_factor): Change
796 from an unsigned int to a poly_uint64.
797 (_loop_vec_info::slp_unrolling_factor): Likewise.
798 (_loop_vec_info::vectorization_factor): Change from an int
800 (MAX_VECTORIZATION_FACTOR): Bump from 64 to INT_MAX.
801 (vect_get_num_vectors): New function.
802 (vect_update_max_nunits, vect_vf_for_cost): Likewise.
803 (vect_get_num_copies): Use vect_get_num_vectors.
804 (vect_analyze_data_ref_dependences): Change max_vf from an int *
805 to an unsigned int *.
806 (vect_analyze_data_refs): Change min_vf from an int * to a
808 (vect_transform_slp_perm_load): Take the vf as a poly_uint64 rather
809 than an unsigned HOST_WIDE_INT.
810 * tree-vect-data-refs.c (vect_analyze_possibly_independent_ddr)
811 (vect_analyze_data_ref_dependence): Change max_vf from an int *
812 to an unsigned int *.
813 (vect_analyze_data_ref_dependences): Likewise.
814 (vect_compute_data_ref_alignment): Handle polynomial vf.
815 (vect_enhance_data_refs_alignment): Likewise.
816 (vect_prune_runtime_alias_test_list): Likewise.
817 (vect_shift_permute_load_chain): Likewise.
818 (vect_supportable_dr_alignment): Likewise.
819 (dependence_distance_ge_vf): Take the vectorization factor as a
820 poly_uint64 rather than an unsigned HOST_WIDE_INT.
821 (vect_analyze_data_refs): Change min_vf from an int * to a
823 * tree-vect-loop-manip.c (vect_gen_scalar_loop_niters): Take
824 vfm1 as a poly_uint64 rather than an int. Make the same change
825 for the returned bound_scalar.
826 (vect_gen_vector_loop_niters): Handle polynomial vf.
827 (vect_do_peeling): Likewise. Update call to
828 vect_gen_scalar_loop_niters and handle polynomial bound_scalars.
829 (vect_gen_vector_loop_niters_mult_vf): Assert that the vf must
831 * tree-vect-loop.c (vect_determine_vectorization_factor)
832 (vect_update_vf_for_slp, vect_analyze_loop_2): Handle polynomial vf.
833 (vect_get_known_peeling_cost): Likewise.
834 (vect_estimate_min_profitable_iters, vectorizable_reduction): Likewise.
835 (vect_worthwhile_without_simd_p, vectorizable_induction): Likewise.
836 (vect_transform_loop): Likewise. Use the lowest possible VF when
837 updating the upper bounds of the loop.
838 (vect_min_worthwhile_factor): Make static. Return an unsigned int
840 * tree-vect-slp.c (vect_attempt_slp_rearrange_stmts): Cope with
841 polynomial unroll factors.
842 (vect_analyze_slp_cost_1, vect_analyze_slp_instance): Likewise.
843 (vect_make_slp_decision): Likewise.
844 (vect_supported_load_permutation_p): Likewise, and polynomial
846 (vect_analyze_slp_cost): Handle polynomial vf.
847 (vect_slp_analyze_node_operations): Likewise.
848 (vect_slp_analyze_bb_1): Likewise.
849 (vect_transform_slp_perm_load): Take the vf as a poly_uint64 rather
850 than an unsigned HOST_WIDE_INT.
851 * tree-vect-stmts.c (vectorizable_simd_clone_call, vectorizable_store)
852 (vectorizable_load): Handle polynomial vf.
853 * tree-vectorizer.c (simduid_to_vf::vf): Change from an int to
855 (adjust_simduid_builtins, shrink_simd_arrays): Update accordingly.
857 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
858 Alan Hayward <alan.hayward@arm.com>
859 David Sherwood <david.sherwood@arm.com>
861 * match.pd: Handle bit operations involving three constants
862 and try to fold one pair.
864 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
866 * tree-vect-loop-manip.c: Include gimple-fold.h.
867 (slpeel_make_loop_iterate_ntimes): Add step, final_iv and
868 niters_maybe_zero parameters. Handle other cases besides a step of 1.
869 (vect_gen_vector_loop_niters): Add a step_vector_ptr parameter.
870 Add a path that uses a step of VF instead of 1, but disable it
872 (vect_do_peeling): Add step_vector, niters_vector_mult_vf_var
873 and niters_no_overflow parameters. Update calls to
874 slpeel_make_loop_iterate_ntimes and vect_gen_vector_loop_niters.
875 Create a new SSA name if the latter choses to use a ste other
876 than zero, and return it via niters_vector_mult_vf_var.
877 * tree-vect-loop.c (vect_transform_loop): Update calls to
878 vect_do_peeling, vect_gen_vector_loop_niters and
879 slpeel_make_loop_iterate_ntimes.
880 * tree-vectorizer.h (slpeel_make_loop_iterate_ntimes, vect_do_peeling)
881 (vect_gen_vector_loop_niters): Update declarations after above changes.
883 2018-01-02 Michael Meissner <meissner@linux.vnet.ibm.com>
885 * config/rs6000/rs6000.md (floor<mode>2): Add support for IEEE
886 128-bit round to integer instructions.
887 (ceil<mode>2): Likewise.
888 (btrunc<mode>2): Likewise.
889 (round<mode>2): Likewise.
891 2018-01-02 Aaron Sawdey <acsawdey@linux.vnet.ibm.com>
893 * config/rs6000/rs6000-string.c (expand_block_move): Allow the use of
894 unaligned VSX load/store on P8/P9.
895 (expand_block_clear): Allow the use of unaligned VSX
898 2018-01-02 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
900 * config/rs6000/rs6000-p8swap.c (swap_feeds_both_load_and_store):
902 (rs6000_analyze_swaps): Mark a web unoptimizable if it contains a
903 swap associated with both a load and a store.
905 2018-01-02 Andrew Waterman <andrew@sifive.com>
907 * config/riscv/linux.h (ICACHE_FLUSH_FUNC): New.
908 * config/riscv/riscv.md (clear_cache): Use it.
910 2018-01-02 Artyom Skrobov <tyomitch@gmail.com>
912 * web.c: Remove out-of-date comment.
914 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
916 * expr.c (fixup_args_size_notes): Check that any existing
917 REG_ARGS_SIZE notes are correct, and don't try to re-add them.
918 (emit_single_push_insn_1): Move stack_pointer_delta adjustment to...
919 (emit_single_push_insn): ...here.
921 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
923 * rtl.h (CONST_VECTOR_ELT): Redefine to const_vector_elt.
924 (const_vector_encoded_nelts): New function.
925 (CONST_VECTOR_NUNITS): Redefine to use GET_MODE_NUNITS.
926 (const_vector_int_elt, const_vector_elt): Declare.
927 * emit-rtl.c (const_vector_int_elt_1): New function.
928 (const_vector_elt): Likewise.
929 * simplify-rtx.c (simplify_immed_subreg): Avoid taking the address
932 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
934 * expr.c: Include rtx-vector-builder.h.
935 (const_vector_mask_from_tree): Use rtx_vector_builder and operate
936 directly on the tree encoding.
937 (const_vector_from_tree): Likewise.
938 * optabs.c: Include rtx-vector-builder.h.
939 (expand_vec_perm_var): Use rtx_vector_builder and create a repeating
940 sequence of "u" values.
941 * vec-perm-indices.c: Include rtx-vector-builder.h.
942 (vec_perm_indices_to_rtx): Use rtx_vector_builder and operate
943 directly on the vec_perm_indices encoding.
945 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
947 * doc/rtl.texi (const_vector): Describe new encoding scheme.
948 * Makefile.in (OBJS): Add rtx-vector-builder.o.
949 * rtx-vector-builder.h: New file.
950 * rtx-vector-builder.c: Likewise.
951 * rtl.h (rtx_def::u2): Add a const_vector field.
952 (CONST_VECTOR_NPATTERNS): New macro.
953 (CONST_VECTOR_NELTS_PER_PATTERN): Likewise.
954 (CONST_VECTOR_DUPLICATE_P): Likewise.
955 (CONST_VECTOR_STEPPED_P): Likewise.
956 (CONST_VECTOR_ENCODED_ELT): Likewise.
957 (const_vec_duplicate_p): Check for a duplicated vector encoding.
958 (unwrap_const_vec_duplicate): Likewise.
959 (const_vec_series_p): Check for a non-duplicated vector encoding.
960 Say that the function only returns true for integer vectors.
961 * emit-rtl.c: Include rtx-vector-builder.h.
962 (gen_const_vec_duplicate_1): Delete.
963 (gen_const_vector): Call gen_const_vec_duplicate instead of
964 gen_const_vec_duplicate_1.
965 (const_vec_series_p_1): Operate directly on the CONST_VECTOR encoding.
966 (gen_const_vec_duplicate): Use rtx_vector_builder.
967 (gen_const_vec_series): Likewise.
968 (gen_rtx_CONST_VECTOR): Likewise.
969 * config/powerpcspe/powerpcspe.c: Include rtx-vector-builder.h.
970 (swap_const_vector_halves): Take an rtx pointer rather than rtx.
971 Build a new vector rather than modifying a CONST_VECTOR in-place.
972 (handle_special_swappables): Update call accordingly.
973 * config/rs6000/rs6000-p8swap.c: Include rtx-vector-builder.h.
974 (swap_const_vector_halves): Take an rtx pointer rather than rtx.
975 Build a new vector rather than modifying a CONST_VECTOR in-place.
976 (handle_special_swappables): Update call accordingly.
978 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
980 * simplify-rtx.c (simplify_const_binary_operation): Use
981 CONST_VECTOR_ELT instead of XVECEXP.
983 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
985 * tree-cfg.c (verify_gimple_assign_ternary): Allow the size of
986 the selector elements to be different from the data elements
987 if the selector is a VECTOR_CST.
988 * tree-vect-stmts.c (vect_gen_perm_mask_any): Use a vector of
989 ssizetype for the selector.
991 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
993 * optabs.c (shift_amt_for_vec_perm_mask): Try using series_p
994 before testing each element individually.
995 * tree-vect-generic.c (lower_vec_perm): Likewise.
997 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
999 * selftest.h (selftest::vec_perm_indices_c_tests): Declare.
1000 * selftest-run-tests.c (selftest::run_tests): Call it.
1001 * vector-builder.h (vector_builder::operator ==): New function.
1002 (vector_builder::operator !=): Likewise.
1003 * vec-perm-indices.h (vec_perm_indices::series_p): Declare.
1004 (vec_perm_indices::all_from_input_p): New function.
1005 * vec-perm-indices.c (vec_perm_indices::series_p): Likewise.
1006 (test_vec_perm_12, selftest::vec_perm_indices_c_tests): Likewise.
1007 * fold-const.c (fold_ternary_loc): Use tree_to_vec_perm_builder
1008 instead of reading the VECTOR_CST directly. Detect whether both
1009 vector inputs are the same before constructing the vec_perm_indices,
1010 and update the number of inputs argument accordingly. Use the
1011 utility functions added above. Only construct sel2 if we need to.
1013 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1015 * optabs.c (expand_vec_perm_var): Use an explicit encoding for
1016 the broadcast of the low byte.
1017 (expand_mult_highpart): Use an explicit encoding for the permutes.
1018 * optabs-query.c (can_mult_highpart_p): Likewise.
1019 * tree-vect-loop.c (calc_vec_perm_mask_for_shift): Likewise.
1020 * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
1021 (vectorizable_bswap): Likewise.
1022 * tree-vect-data-refs.c (vect_grouped_store_supported): Use an
1023 explicit encoding for the power-of-2 permutes.
1024 (vect_permute_store_chain): Likewise.
1025 (vect_grouped_load_supported): Likewise.
1026 (vect_permute_load_chain): Likewise.
1028 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1030 * vec-perm-indices.h (vec_perm_indices_to_tree): Declare.
1031 * vec-perm-indices.c (vec_perm_indices_to_tree): New function.
1032 * tree-ssa-forwprop.c (simplify_vector_constructor): Use it.
1033 * tree-vect-slp.c (vect_transform_slp_perm_load): Likewise.
1034 * tree-vect-stmts.c (vectorizable_bswap): Likewise.
1035 (vect_gen_perm_mask_any): Likewise.
1037 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1039 * int-vector-builder.h: New file.
1040 * vec-perm-indices.h: Include int-vector-builder.h.
1041 (vec_perm_indices): Redefine as an int_vector_builder.
1042 (auto_vec_perm_indices): Delete.
1043 (vec_perm_builder): Redefine as a stand-alone class.
1044 (vec_perm_indices::vec_perm_indices): New function.
1045 (vec_perm_indices::clamp): Likewise.
1046 * vec-perm-indices.c: Include fold-const.h and tree-vector-builder.h.
1047 (vec_perm_indices::new_vector): New function.
1048 (vec_perm_indices::new_expanded_vector): Update for new
1049 vec_perm_indices class.
1050 (vec_perm_indices::rotate_inputs): New function.
1051 (vec_perm_indices::all_in_range_p): Operate directly on the
1052 encoded form, without computing elided elements.
1053 (tree_to_vec_perm_builder): Operate directly on the VECTOR_CST
1054 encoding. Update for new vec_perm_indices class.
1055 * optabs.c (expand_vec_perm_const): Create a vec_perm_indices for
1056 the given vec_perm_builder.
1057 (expand_vec_perm_var): Update vec_perm_builder constructor.
1058 (expand_mult_highpart): Use vec_perm_builder instead of
1059 auto_vec_perm_indices.
1060 * optabs-query.c (can_mult_highpart_p): Use vec_perm_builder and
1061 vec_perm_indices instead of auto_vec_perm_indices. Use a single
1062 or double series encoding as appropriate.
1063 * fold-const.c (fold_ternary_loc): Use vec_perm_builder and
1064 vec_perm_indices instead of auto_vec_perm_indices.
1065 * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
1066 * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
1067 (vect_permute_store_chain): Likewise.
1068 (vect_grouped_load_supported): Likewise.
1069 (vect_permute_load_chain): Likewise.
1070 (vect_shift_permute_load_chain): Likewise.
1071 * tree-vect-slp.c (vect_build_slp_tree_1): Likewise.
1072 (vect_transform_slp_perm_load): Likewise.
1073 (vect_schedule_slp_instance): Likewise.
1074 * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
1075 (vectorizable_mask_load_store): Likewise.
1076 (vectorizable_bswap): Likewise.
1077 (vectorizable_store): Likewise.
1078 (vectorizable_load): Likewise.
1079 * tree-vect-generic.c (lower_vec_perm): Use vec_perm_builder and
1080 vec_perm_indices instead of auto_vec_perm_indices. Use
1081 tree_to_vec_perm_builder to read the vector from a tree.
1082 * tree-vect-loop.c (calc_vec_perm_mask_for_shift): Take a
1083 vec_perm_builder instead of a vec_perm_indices.
1084 (have_whole_vector_shift): Use vec_perm_builder and
1085 vec_perm_indices instead of auto_vec_perm_indices. Leave the
1086 truncation to calc_vec_perm_mask_for_shift.
1087 (vect_create_epilog_for_reduction): Likewise.
1088 * config/aarch64/aarch64.c (expand_vec_perm_d::perm): Change
1089 from auto_vec_perm_indices to vec_perm_indices.
1090 (aarch64_expand_vec_perm_const_1): Use rotate_inputs on d.perm
1091 instead of changing individual elements.
1092 (aarch64_vectorize_vec_perm_const): Use new_vector to install
1093 the vector in d.perm.
1094 * config/arm/arm.c (expand_vec_perm_d::perm): Change
1095 from auto_vec_perm_indices to vec_perm_indices.
1096 (arm_expand_vec_perm_const_1): Use rotate_inputs on d.perm
1097 instead of changing individual elements.
1098 (arm_vectorize_vec_perm_const): Use new_vector to install
1099 the vector in d.perm.
1100 * config/powerpcspe/powerpcspe.c (rs6000_expand_extract_even):
1101 Update vec_perm_builder constructor.
1102 (rs6000_expand_interleave): Likewise.
1103 * config/rs6000/rs6000.c (rs6000_expand_extract_even): Likewise.
1104 (rs6000_expand_interleave): Likewise.
1106 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1108 * optabs-query.c (can_vec_perm_var_p): Check whether lowering
1109 to qimode could truncate the indices.
1110 * optabs.c (expand_vec_perm_var): Likewise.
1112 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1114 * Makefile.in (OBJS): Add vec-perm-indices.o.
1115 * vec-perm-indices.h: New file.
1116 * vec-perm-indices.c: Likewise.
1117 * target.h (vec_perm_indices): Replace with a forward class
1119 (auto_vec_perm_indices): Move to vec-perm-indices.h.
1120 * optabs.h: Include vec-perm-indices.h.
1121 (expand_vec_perm): Delete.
1122 (selector_fits_mode_p, expand_vec_perm_var): Declare.
1123 (expand_vec_perm_const): Declare.
1124 * target.def (vec_perm_const_ok): Replace with...
1125 (vec_perm_const): ...this new hook.
1126 * doc/tm.texi.in (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Replace with...
1127 (TARGET_VECTORIZE_VEC_PERM_CONST): ...this new hook.
1128 * doc/tm.texi: Regenerate.
1129 * optabs.def (vec_perm_const): Delete.
1130 * doc/md.texi (vec_perm_const): Likewise.
1131 (vec_perm): Refer to TARGET_VECTORIZE_VEC_PERM_CONST.
1132 * expr.c (expand_expr_real_2): Use expand_vec_perm_const rather than
1133 expand_vec_perm for constant permutation vectors. Assert that
1134 the mode of variable permutation vectors is the integer equivalent
1135 of the mode that is being permuted.
1136 * optabs-query.h (selector_fits_mode_p): Declare.
1137 * optabs-query.c: Include vec-perm-indices.h.
1138 (selector_fits_mode_p): New function.
1139 (can_vec_perm_const_p): Check whether targetm.vectorize.vec_perm_const
1140 is defined, instead of checking whether the vec_perm_const_optab
1141 exists. Use targetm.vectorize.vec_perm_const instead of
1142 targetm.vectorize.vec_perm_const_ok. Check whether the indices
1143 fit in the vector mode before using a variable permute.
1144 * optabs.c (shift_amt_for_vec_perm_mask): Take a mode and a
1145 vec_perm_indices instead of an rtx.
1146 (expand_vec_perm): Replace with...
1147 (expand_vec_perm_const): ...this new function. Take the selector
1148 as a vec_perm_indices rather than an rtx. Also take the mode of
1149 the selector. Update call to shift_amt_for_vec_perm_mask.
1150 Use targetm.vectorize.vec_perm_const instead of vec_perm_const_optab.
1151 Use vec_perm_indices::new_expanded_vector to expand the original
1152 selector into bytes. Check whether the indices fit in the vector
1153 mode before using a variable permute.
1154 (expand_vec_perm_var): Make global.
1155 (expand_mult_highpart): Use expand_vec_perm_const.
1156 * fold-const.c: Includes vec-perm-indices.h.
1157 * tree-ssa-forwprop.c: Likewise.
1158 * tree-vect-data-refs.c: Likewise.
1159 * tree-vect-generic.c: Likewise.
1160 * tree-vect-loop.c: Likewise.
1161 * tree-vect-slp.c: Likewise.
1162 * tree-vect-stmts.c: Likewise.
1163 * config/aarch64/aarch64-protos.h (aarch64_expand_vec_perm_const):
1165 * config/aarch64/aarch64-simd.md (vec_perm_const<mode>): Delete.
1166 * config/aarch64/aarch64.c (aarch64_expand_vec_perm_const)
1167 (aarch64_vectorize_vec_perm_const_ok): Fuse into...
1168 (aarch64_vectorize_vec_perm_const): ...this new function.
1169 (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
1170 (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
1171 * config/arm/arm-protos.h (arm_expand_vec_perm_const): Delete.
1172 * config/arm/vec-common.md (vec_perm_const<mode>): Delete.
1173 * config/arm/arm.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
1174 (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
1175 (arm_expand_vec_perm_const, arm_vectorize_vec_perm_const_ok): Merge
1177 (arm_vectorize_vec_perm_const): ...this new function. Explicitly
1178 check for NEON modes.
1179 * config/i386/i386-protos.h (ix86_expand_vec_perm_const): Delete.
1180 * config/i386/sse.md (VEC_PERM_CONST, vec_perm_const<mode>): Delete.
1181 * config/i386/i386.c (ix86_expand_vec_perm_const_1): Update comment.
1182 (ix86_expand_vec_perm_const, ix86_vectorize_vec_perm_const_ok): Merge
1184 (ix86_vectorize_vec_perm_const): ...this new function. Incorporate
1185 the old VEC_PERM_CONST conditions.
1186 * config/ia64/ia64-protos.h (ia64_expand_vec_perm_const): Delete.
1187 * config/ia64/vect.md (vec_perm_const<mode>): Delete.
1188 * config/ia64/ia64.c (ia64_expand_vec_perm_const)
1189 (ia64_vectorize_vec_perm_const_ok): Merge into...
1190 (ia64_vectorize_vec_perm_const): ...this new function.
1191 * config/mips/loongson.md (vec_perm_const<mode>): Delete.
1192 * config/mips/mips-msa.md (vec_perm_const<mode>): Delete.
1193 * config/mips/mips-ps-3d.md (vec_perm_constv2sf): Delete.
1194 * config/mips/mips-protos.h (mips_expand_vec_perm_const): Delete.
1195 * config/mips/mips.c (mips_expand_vec_perm_const)
1196 (mips_vectorize_vec_perm_const_ok): Merge into...
1197 (mips_vectorize_vec_perm_const): ...this new function.
1198 * config/powerpcspe/altivec.md (vec_perm_constv16qi): Delete.
1199 * config/powerpcspe/paired.md (vec_perm_constv2sf): Delete.
1200 * config/powerpcspe/spe.md (vec_perm_constv2si): Delete.
1201 * config/powerpcspe/vsx.md (vec_perm_const<mode>): Delete.
1202 * config/powerpcspe/powerpcspe-protos.h (altivec_expand_vec_perm_const)
1203 (rs6000_expand_vec_perm_const): Delete.
1204 * config/powerpcspe/powerpcspe.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK):
1206 (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
1207 (altivec_expand_vec_perm_const_le): Take each operand individually.
1208 Operate on constant selectors rather than rtxes.
1209 (altivec_expand_vec_perm_const): Likewise. Update call to
1210 altivec_expand_vec_perm_const_le.
1211 (rs6000_expand_vec_perm_const): Delete.
1212 (rs6000_vectorize_vec_perm_const_ok): Delete.
1213 (rs6000_vectorize_vec_perm_const): New function.
1214 (rs6000_do_expand_vec_perm): Take a vec_perm_builder instead of
1215 an element count and rtx array.
1216 (rs6000_expand_extract_even): Update call accordingly.
1217 (rs6000_expand_interleave): Likewise.
1218 * config/rs6000/altivec.md (vec_perm_constv16qi): Delete.
1219 * config/rs6000/paired.md (vec_perm_constv2sf): Delete.
1220 * config/rs6000/vsx.md (vec_perm_const<mode>): Delete.
1221 * config/rs6000/rs6000-protos.h (altivec_expand_vec_perm_const)
1222 (rs6000_expand_vec_perm_const): Delete.
1223 * config/rs6000/rs6000.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
1224 (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
1225 (altivec_expand_vec_perm_const_le): Take each operand individually.
1226 Operate on constant selectors rather than rtxes.
1227 (altivec_expand_vec_perm_const): Likewise. Update call to
1228 altivec_expand_vec_perm_const_le.
1229 (rs6000_expand_vec_perm_const): Delete.
1230 (rs6000_vectorize_vec_perm_const_ok): Delete.
1231 (rs6000_vectorize_vec_perm_const): New function. Remove stray
1232 reference to the SPE evmerge intructions.
1233 (rs6000_do_expand_vec_perm): Take a vec_perm_builder instead of
1234 an element count and rtx array.
1235 (rs6000_expand_extract_even): Update call accordingly.
1236 (rs6000_expand_interleave): Likewise.
1237 * config/sparc/sparc.md (vec_perm_constv8qi): Delete in favor of...
1238 * config/sparc/sparc.c (sparc_vectorize_vec_perm_const): ...this
1240 (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
1242 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1244 * optabs.c (expand_vec_perm_1): Assert that SEL has an integer
1245 vector mode and that that mode matches the mode of the data
1247 (expand_vec_perm): Split handling of non-CONST_VECTOR selectors
1248 out into expand_vec_perm_var. Do all CONST_VECTOR handling here,
1249 directly using expand_vec_perm_1 when forcing selectors into
1251 (expand_vec_perm_var): New function, split out from expand_vec_perm.
1253 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1255 * optabs-query.h (can_vec_perm_p): Delete.
1256 (can_vec_perm_var_p, can_vec_perm_const_p): Declare.
1257 * optabs-query.c (can_vec_perm_p): Split into...
1258 (can_vec_perm_var_p, can_vec_perm_const_p): ...these two functions.
1259 (can_mult_highpart_p): Use can_vec_perm_const_p to test whether a
1260 particular selector is valid.
1261 * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
1262 * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
1263 (vect_grouped_load_supported): Likewise.
1264 (vect_shift_permute_load_chain): Likewise.
1265 * tree-vect-slp.c (vect_build_slp_tree_1): Likewise.
1266 (vect_transform_slp_perm_load): Likewise.
1267 * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
1268 (vectorizable_bswap): Likewise.
1269 (vect_gen_perm_mask_checked): Likewise.
1270 * fold-const.c (fold_ternary_loc): Likewise. Don't take
1271 implementations of variable permutation vectors into account
1272 when deciding which selector to use.
1273 * tree-vect-loop.c (have_whole_vector_shift): Don't check whether
1274 vec_perm_const_optab is supported; instead use can_vec_perm_const_p
1275 with a false third argument.
1276 * tree-vect-generic.c (lower_vec_perm): Use can_vec_perm_const_p
1277 to test whether the constant selector is valid and can_vec_perm_var_p
1278 to test whether a variable selector is valid.
1280 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1282 * optabs-query.h (can_vec_perm_p): Take a const vec_perm_indices *.
1283 * optabs-query.c (can_vec_perm_p): Likewise.
1284 * fold-const.c (fold_vec_perm): Take a const vec_perm_indices &
1285 instead of vec_perm_indices.
1286 * tree-vectorizer.h (vect_gen_perm_mask_any): Likewise,
1287 (vect_gen_perm_mask_checked): Likewise,
1288 * tree-vect-stmts.c (vect_gen_perm_mask_any): Likewise,
1289 (vect_gen_perm_mask_checked): Likewise,
1291 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1293 * optabs-query.h (qimode_for_vec_perm): Declare.
1294 * optabs-query.c (can_vec_perm_p): Split out qimode search to...
1295 (qimode_for_vec_perm): ...this new function.
1296 * optabs.c (expand_vec_perm): Use qimode_for_vec_perm.
1298 2018-01-02 Aaron Sawdey <acsawdey@linux.vnet.ibm.com>
1300 * rtlanal.c (canonicalize_condition): Return 0 if final rtx
1301 does not have a conditional at the top.
1303 2018-01-02 Richard Biener <rguenther@suse.de>
1305 * ipa-inline.c (big_speedup_p): Fix expression.
1307 2018-01-02 Jan Hubicka <hubicka@ucw.cz>
1310 * config/i386/x86-tune-costs.h: Increase cost of integer load costs
1313 2018-01-02 Jan Hubicka <hubicka@ucw.cz>
1317 * x86-tune-costs.h (generic_cost): Reduce cost of FDIV 20->17,
1318 cost of sqrt 20->14, DIVSS 18->13, DIVSD 32->17, SQRtSS 30->14
1319 and SQRTsD 58->18, cond_not_taken_branch_cost. 2->1. Increase
1320 cond_taken_branch_cost 3->4.
1322 2018-01-01 Jakub Jelinek <jakub@redhat.com>
1324 PR tree-optimization/83581
1325 * tree-loop-distribution.c (pass_loop_distribution::execute): Return
1326 TODO_cleanup_cfg if any changes have been made.
1329 * expr.c (store_expr_with_bounds): Use simplify_gen_subreg instead of
1330 convert_modes if target mode has the right side, but different mode
1334 * expr.c (expand_assignment): Fix up a typo in simplify_gen_subreg
1335 last argument when extracting from CONCAT. If either from_real or
1336 from_imag is NULL, use expansion through memory. If result is not
1337 a CONCAT and simplify_gen_subreg fails, try to simplify_gen_subreg
1338 the parts directly to inner mode, if even that fails, use expansion
1342 * expmed.c (expand_shift_1): For 2-byte rotates by BITS_PER_UNIT,
1343 check for bswap in mode rather than HImode and use that in expand_unop
1346 Copyright (C) 2018 Free Software Foundation, Inc.
1348 Copying and distribution of this file, with or without modification,
1349 are permitted in any medium without royalty provided the copyright
1350 notice and this notice are preserved.