1 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
3 * machmode.def (VECTOR_MODES_WITH_PREFIX): Document.
4 * genmodes.c (VECTOR_MODES_WITH_PREFIX): New macro.
5 (VECTOR_MODES): Use it.
6 (make_vector_modes): Take the prefix as an argument.
8 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
9 Alan Hayward <alan.hayward@arm.com>
10 David Sherwood <david.sherwood@arm.com>
12 * mode-classes.def (MODE_VECTOR_BOOL): New mode class.
13 * machmode.h (INTEGRAL_MODE_P, VECTOR_MODE_P): Return true
15 * machmode.def (VECTOR_BOOL_MODE): Document.
16 * genmodes.c (VECTOR_BOOL_MODE): New macro.
17 (make_vector_bool_mode): New function.
18 (complete_mode, emit_mode_wider, emit_mode_adjustments): Handle
20 * lto-streamer-in.c (lto_input_mode_table): Likewise.
21 * rtx-vector-builder.c (rtx_vector_builder::find_cached_value):
23 * stor-layout.c (int_mode_for_mode): Likewise.
24 * tree.c (build_vector_type_for_mode): Likewise.
25 * varasm.c (output_constant_pool_2): Likewise.
26 * emit-rtl.c (init_emit_once): Make sure that CONST1_RTX (BImode) and
27 CONSTM1_RTX (BImode) are the same thing. Initialize const_tiny_rtx
29 * expr.c (expand_expr_real_1): Use VECTOR_MODE_P instead of a list
31 * tree-vect-generic.c (expand_vector_operation): Use VECTOR_MODE_P
32 instead of a list of mode class checks.
33 (expand_vector_scalar_condition): Likewise.
34 (type_for_widest_vector_mode): Handle BImode as an inner mode.
36 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
37 Alan Hayward <alan.hayward@arm.com>
38 David Sherwood <david.sherwood@arm.com>
40 * machmode.h (mode_size): Change from unsigned short to
42 (mode_to_bytes): Return a poly_uint16 rather than an unsigned short.
43 (GET_MODE_SIZE): Return a constant if ONLY_FIXED_SIZE_MODES,
44 or if measurement_type is not polynomial.
45 (fixed_size_mode::includes_p): Check for constant-sized modes.
46 * genmodes.c (emit_mode_size_inline): Make mode_size_inline
47 return a poly_uint16 rather than an unsigned short.
48 (emit_mode_size): Change the type of mode_size from unsigned short
49 to poly_uint16_pod. Use ZERO_COEFFS for the initializer.
50 (emit_mode_adjustments): Cope with polynomial vector sizes.
51 * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
53 * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
55 * auto-inc-dec.c (try_merge): Treat GET_MODE_SIZE as polynomial.
56 * builtins.c (expand_ifn_atomic_compare_exchange_into_call): Likewise.
57 * caller-save.c (setup_save_areas): Likewise.
58 (replace_reg_with_saved_mem): Likewise.
59 * calls.c (emit_library_call_value_1): Likewise.
60 * combine-stack-adj.c (combine_stack_adjustments_for_block): Likewise.
61 * combine.c (simplify_set, make_extraction, simplify_shift_const_1)
62 (gen_lowpart_for_combine): Likewise.
63 * convert.c (convert_to_integer_1): Likewise.
64 * cse.c (equiv_constant, cse_insn): Likewise.
65 * cselib.c (autoinc_split, cselib_hash_rtx): Likewise.
66 (cselib_subst_to_values): Likewise.
67 * dce.c (word_dce_process_block): Likewise.
68 * df-problems.c (df_word_lr_mark_ref): Likewise.
69 * dwarf2cfi.c (init_one_dwarf_reg_size): Likewise.
70 * dwarf2out.c (multiple_reg_loc_descriptor, mem_loc_descriptor)
71 (concat_loc_descriptor, concatn_loc_descriptor, loc_descriptor)
72 (rtl_for_decl_location): Likewise.
73 * emit-rtl.c (gen_highpart, widen_memory_access): Likewise.
74 * expmed.c (extract_bit_field_1, extract_integral_bit_field): Likewise.
75 * expr.c (emit_group_load_1, clear_storage_hints): Likewise.
76 (emit_move_complex, emit_move_multi_word, emit_push_insn): Likewise.
77 (expand_expr_real_1): Likewise.
78 * function.c (assign_parm_setup_block_p, assign_parm_setup_block)
79 (pad_below): Likewise.
80 * gimple-fold.c (optimize_atomic_compare_exchange_p): Likewise.
81 * gimple-ssa-store-merging.c (rhs_valid_for_store_merging_p): Likewise.
82 * ira.c (get_subreg_tracking_sizes): Likewise.
83 * ira-build.c (ira_create_allocno_objects): Likewise.
84 * ira-color.c (coalesced_pseudo_reg_slot_compare): Likewise.
85 (ira_sort_regnos_for_alter_reg): Likewise.
86 * ira-costs.c (record_operand_costs): Likewise.
87 * lower-subreg.c (interesting_mode_p, simplify_gen_subreg_concatn)
88 (resolve_simple_move): Likewise.
89 * lra-constraints.c (get_reload_reg, operands_match_p): Likewise.
90 (process_addr_reg, simplify_operand_subreg, curr_insn_transform)
91 (lra_constraints): Likewise.
92 (CONST_POOL_OK_P): Reject variable-sized modes.
93 * lra-spills.c (slot, assign_mem_slot, pseudo_reg_slot_compare)
94 (add_pseudo_to_slot, lra_spill): Likewise.
95 * omp-low.c (omp_clause_aligned_alignment): Likewise.
96 * optabs-query.c (get_best_extraction_insn): Likewise.
97 * optabs-tree.c (expand_vec_cond_expr_p): Likewise.
98 * optabs.c (expand_vec_perm_var, expand_vec_cond_expr): Likewise.
99 (expand_mult_highpart, valid_multiword_target_p): Likewise.
100 * recog.c (offsettable_address_addr_space_p): Likewise.
101 * regcprop.c (maybe_mode_change): Likewise.
102 * reginfo.c (choose_hard_reg_mode, record_subregs_of_mode): Likewise.
103 * regrename.c (build_def_use): Likewise.
104 * regstat.c (dump_reg_info): Likewise.
105 * reload.c (complex_word_subreg_p, push_reload, find_dummy_reload)
106 (find_reloads, find_reloads_subreg_address): Likewise.
107 * reload1.c (eliminate_regs_1): Likewise.
108 * rtlanal.c (for_each_inc_dec_find_inc_dec, rtx_cost): Likewise.
109 * simplify-rtx.c (avoid_constant_pool_reference): Likewise.
110 (simplify_binary_operation_1, simplify_subreg): Likewise.
111 * targhooks.c (default_function_arg_padding): Likewise.
112 (default_hard_regno_nregs, default_class_max_nregs): Likewise.
113 * tree-cfg.c (verify_gimple_assign_binary): Likewise.
114 (verify_gimple_assign_ternary): Likewise.
115 * tree-inline.c (estimate_move_cost): Likewise.
116 * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
117 * tree-ssa-loop-ivopts.c (add_autoinc_candidates): Likewise.
118 (get_address_cost_ainc): Likewise.
119 * tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Likewise.
120 (vect_supportable_dr_alignment): Likewise.
121 * tree-vect-loop.c (vect_determine_vectorization_factor): Likewise.
122 (vectorizable_reduction): Likewise.
123 * tree-vect-stmts.c (vectorizable_assignment, vectorizable_shift)
124 (vectorizable_operation, vectorizable_load): Likewise.
125 * tree.c (build_same_sized_truth_vector_type): Likewise.
126 * valtrack.c (cleanup_auto_inc_dec): Likewise.
127 * var-tracking.c (emit_note_insn_var_location): Likewise.
128 * config/arc/arc.h (ASM_OUTPUT_CASE_END): Use as_a <scalar_int_mode>.
129 (ADDR_VEC_ALIGN): Likewise.
131 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
132 Alan Hayward <alan.hayward@arm.com>
133 David Sherwood <david.sherwood@arm.com>
135 * machmode.h (mode_to_bits): Return a poly_uint16 rather than an
137 (GET_MODE_BITSIZE): Return a constant if ONLY_FIXED_SIZE_MODES,
138 or if measurement_type is polynomial.
139 * calls.c (shift_return_value): Treat GET_MODE_BITSIZE as polynomial.
140 * combine.c (make_extraction): Likewise.
141 * dse.c (find_shift_sequence): Likewise.
142 * dwarf2out.c (mem_loc_descriptor): Likewise.
143 * expmed.c (store_integral_bit_field, extract_bit_field_1): Likewise.
144 (extract_bit_field, extract_low_bits): Likewise.
145 * expr.c (convert_move, convert_modes, emit_move_insn_1): Likewise.
146 (optimize_bitfield_assignment_op, expand_assignment): Likewise.
147 (store_expr_with_bounds, store_field, expand_expr_real_1): Likewise.
148 * fold-const.c (optimize_bit_field_compare, merge_ranges): Likewise.
149 * gimple-fold.c (optimize_atomic_compare_exchange_p): Likewise.
150 * reload.c (find_reloads): Likewise.
151 * reload1.c (alter_reg): Likewise.
152 * stor-layout.c (bitwise_mode_for_mode, compute_record_mode): Likewise.
153 * targhooks.c (default_secondary_memory_needed_mode): Likewise.
154 * tree-if-conv.c (predicate_mem_writes): Likewise.
155 * tree-ssa-strlen.c (handle_builtin_memcmp): Likewise.
156 * tree-vect-patterns.c (adjust_bool_pattern): Likewise.
157 * tree-vect-stmts.c (vectorizable_simd_clone_call): Likewise.
158 * valtrack.c (dead_debug_insert_temp): Likewise.
159 * varasm.c (mergeable_constant_section): Likewise.
160 * config/sh/sh.h (LOCAL_ALIGNMENT): Use as_a <fixed_size_mode>.
162 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
163 Alan Hayward <alan.hayward@arm.com>
164 David Sherwood <david.sherwood@arm.com>
166 * expr.c (expand_assignment): Cope with polynomial mode sizes
167 when assigning to a CONCAT.
169 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
170 Alan Hayward <alan.hayward@arm.com>
171 David Sherwood <david.sherwood@arm.com>
173 * machmode.h (mode_precision): Change from unsigned short to
175 (mode_to_precision): Return a poly_uint16 rather than an unsigned
177 (GET_MODE_PRECISION): Return a constant if ONLY_FIXED_SIZE_MODES,
178 or if measurement_type is not polynomial.
179 (HWI_COMPUTABLE_MODE_P): Turn into a function. Optimize the case
180 in which the mode is already known to be a scalar_int_mode.
181 * genmodes.c (emit_mode_precision): Change the type of mode_precision
182 from unsigned short to poly_uint16_pod. Use ZERO_COEFFS for the
184 * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
185 for GET_MODE_PRECISION.
186 * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
187 for GET_MODE_PRECISION.
188 * combine.c (update_rsp_from_reg_equal): Treat GET_MODE_PRECISION
190 (try_combine, find_split_point, combine_simplify_rtx): Likewise.
191 (expand_field_assignment, make_extraction): Likewise.
192 (make_compound_operation_int, record_dead_and_set_regs_1): Likewise.
193 (get_last_value): Likewise.
194 * convert.c (convert_to_integer_1): Likewise.
195 * cse.c (cse_insn): Likewise.
196 * expr.c (expand_expr_real_1): Likewise.
197 * lra-constraints.c (simplify_operand_subreg): Likewise.
198 * optabs-query.c (can_atomic_load_p): Likewise.
199 * optabs.c (expand_atomic_load): Likewise.
200 (expand_atomic_store): Likewise.
201 * ree.c (combine_reaching_defs): Likewise.
202 * rtl.h (partial_subreg_p, paradoxical_subreg_p): Likewise.
203 * rtlanal.c (nonzero_bits1, lsb_bitfield_op_p): Likewise.
204 * tree.h (type_has_mode_precision_p): Likewise.
205 * ubsan.c (instrument_si_overflow): Likewise.
207 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
208 Alan Hayward <alan.hayward@arm.com>
209 David Sherwood <david.sherwood@arm.com>
211 * tree.h (TYPE_VECTOR_SUBPARTS): Turn into a function and handle
212 polynomial numbers of units.
213 (SET_TYPE_VECTOR_SUBPARTS): Likewise.
214 (valid_vector_subparts_p): New function.
215 (build_vector_type): Remove temporary shim and take the number
216 of units as a poly_uint64 rather than an int.
217 (build_opaque_vector_type): Take the number of units as a
218 poly_uint64 rather than an int.
219 * tree.c (build_vector_from_ctor): Handle polynomial
220 TYPE_VECTOR_SUBPARTS.
221 (type_hash_canon_hash, type_cache_hasher::equal): Likewise.
222 (uniform_vector_p, vector_type_mode, build_vector): Likewise.
223 (build_vector_from_val): If the number of units is variable,
224 use build_vec_duplicate_cst for constant operands and
225 VEC_DUPLICATE_EXPR otherwise.
226 (make_vector_type): Remove temporary is_constant ().
227 (build_vector_type, build_opaque_vector_type): Take the number of
228 units as a poly_uint64 rather than an int.
229 (check_vector_cst): Handle polynomial TYPE_VECTOR_SUBPARTS and
231 * cfgexpand.c (expand_debug_expr): Likewise.
232 * expr.c (count_type_elements, categorize_ctor_elements_1): Likewise.
233 (store_constructor, expand_expr_real_1): Likewise.
234 (const_scalar_mask_from_tree): Likewise.
235 * fold-const-call.c (fold_const_reduction): Likewise.
236 * fold-const.c (const_binop, const_unop, fold_convert_const): Likewise.
237 (operand_equal_p, fold_vec_perm, fold_ternary_loc): Likewise.
238 (native_encode_vector, vec_cst_ctor_to_array): Likewise.
239 (fold_relational_const): Likewise.
240 (native_interpret_vector): Likewise. Change the size from an
241 int to an unsigned int.
242 * gimple-fold.c (gimple_fold_stmt_to_constant_1): Handle polynomial
243 TYPE_VECTOR_SUBPARTS.
244 (gimple_fold_indirect_ref, gimple_build_vector): Likewise.
245 (gimple_build_vector_from_val): Use VEC_DUPLICATE_EXPR when
246 duplicating a non-constant operand into a variable-length vector.
247 * hsa-brig.c (hsa_op_immed::emit_to_buffer): Handle polynomial
248 TYPE_VECTOR_SUBPARTS and VECTOR_CST_NELTS.
249 * ipa-icf.c (sem_variable::equals): Likewise.
250 * match.pd: Likewise.
251 * omp-simd-clone.c (simd_clone_subparts): Likewise.
252 * print-tree.c (print_node): Likewise.
253 * stor-layout.c (layout_type): Likewise.
254 * targhooks.c (default_builtin_vectorization_cost): Likewise.
255 * tree-cfg.c (verify_gimple_comparison): Likewise.
256 (verify_gimple_assign_binary): Likewise.
257 (verify_gimple_assign_ternary): Likewise.
258 (verify_gimple_assign_single): Likewise.
259 * tree-pretty-print.c (dump_generic_node): Likewise.
260 * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
261 (simplify_bitfield_ref, is_combined_permutation_identity): Likewise.
262 * tree-vect-data-refs.c (vect_permute_store_chain): Likewise.
263 (vect_grouped_load_supported, vect_permute_load_chain): Likewise.
264 (vect_shift_permute_load_chain): Likewise.
265 * tree-vect-generic.c (nunits_for_known_piecewise_op): Likewise.
266 (expand_vector_condition, optimize_vector_constructor): Likewise.
267 (lower_vec_perm, get_compute_type): Likewise.
268 * tree-vect-loop.c (vect_determine_vectorization_factor): Likewise.
269 (get_initial_defs_for_reduction, vect_transform_loop): Likewise.
270 * tree-vect-patterns.c (vect_recog_bool_pattern): Likewise.
271 (vect_recog_mask_conversion_pattern): Likewise.
272 * tree-vect-slp.c (vect_supported_load_permutation_p): Likewise.
273 (vect_get_constant_vectors, vect_transform_slp_perm_load): Likewise.
274 * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
275 (get_group_load_store_type, vectorizable_mask_load_store): Likewise.
276 (vectorizable_bswap, simd_clone_subparts, vectorizable_assignment)
277 (vectorizable_shift, vectorizable_operation, vectorizable_store)
278 (vectorizable_load, vect_is_simple_cond, vectorizable_comparison)
279 (supportable_widening_operation): Likewise.
280 (supportable_narrowing_operation): Likewise.
281 * tree-vector-builder.c (tree_vector_builder::binary_encoded_nelts):
283 * varasm.c (output_constant): Likewise.
285 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
286 Alan Hayward <alan.hayward@arm.com>
287 David Sherwood <david.sherwood@arm.com>
289 * tree-vect-data-refs.c (vect_permute_store_chain): Reorganize
290 so that both the length == 3 and length != 3 cases set up their
291 own permute vectors. Add comments explaining why we know the
292 number of elements is constant.
293 (vect_permute_load_chain): Likewise.
295 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
296 Alan Hayward <alan.hayward@arm.com>
297 David Sherwood <david.sherwood@arm.com>
299 * machmode.h (mode_nunits): Change from unsigned char to
301 (ONLY_FIXED_SIZE_MODES): New macro.
302 (pod_mode::measurement_type, scalar_int_mode::measurement_type)
303 (scalar_float_mode::measurement_type, scalar_mode::measurement_type)
304 (complex_mode::measurement_type, fixed_size_mode::measurement_type):
306 (mode_to_nunits): Return a poly_uint16 rather than an unsigned short.
307 (GET_MODE_NUNITS): Return a constant if ONLY_FIXED_SIZE_MODES,
308 or if measurement_type is not polynomial.
309 * genmodes.c (ZERO_COEFFS): New macro.
310 (emit_mode_nunits_inline): Make mode_nunits_inline return a
312 (emit_mode_nunits): Change the type of mode_nunits to poly_uint16_pod.
313 Use ZERO_COEFFS when emitting initializers.
314 * data-streamer.h (bp_pack_poly_value): New function.
315 (bp_unpack_poly_value): Likewise.
316 * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
318 * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
320 * tree.c (make_vector_type): Remove temporary shim and make
321 the real function take the number of units as a poly_uint64
323 (build_vector_type_for_mode): Handle polynomial nunits.
324 * dwarf2out.c (loc_descriptor, add_const_value_attribute): Likewise.
325 * emit-rtl.c (const_vec_series_p_1): Likewise.
326 (gen_rtx_CONST_VECTOR): Likewise.
327 * fold-const.c (test_vec_duplicate_folding): Likewise.
328 * genrecog.c (validate_pattern): Likewise.
329 * optabs-query.c (can_vec_perm_var_p, can_mult_highpart_p): Likewise.
330 * optabs-tree.c (expand_vec_cond_expr_p): Likewise.
331 * optabs.c (expand_vector_broadcast, expand_binop_directly): Likewise.
332 (shift_amt_for_vec_perm_mask, expand_vec_perm_var): Likewise.
333 (expand_vec_cond_expr, expand_mult_highpart): Likewise.
334 * rtlanal.c (subreg_get_info): Likewise.
335 * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
336 (vect_grouped_load_supported): Likewise.
337 * tree-vect-generic.c (type_for_widest_vector_mode): Likewise.
338 * tree-vect-loop.c (have_whole_vector_shift): Likewise.
339 * simplify-rtx.c (simplify_unary_operation_1): Likewise.
340 (simplify_const_unary_operation, simplify_binary_operation_1)
341 (simplify_const_binary_operation, simplify_ternary_operation)
342 (test_vector_ops_duplicate, test_vector_ops): Likewise.
343 (simplify_immed_subreg): Use GET_MODE_NUNITS on a fixed_size_mode
344 instead of CONST_VECTOR_NUNITS.
345 * varasm.c (output_constant_pool_2): Likewise.
346 * rtx-vector-builder.c (rtx_vector_builder::build): Only include the
347 explicit-encoded elements in the XVEC for variable-length vectors.
349 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
351 * lra-constraints.c (curr_insn_transform): Use partial_subreg_p.
353 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
354 Alan Hayward <alan.hayward@arm.com>
355 David Sherwood <david.sherwood@arm.com>
357 * coretypes.h (fixed_size_mode): Declare.
358 (fixed_size_mode_pod): New typedef.
359 * builtins.h (target_builtins::x_apply_args_mode)
360 (target_builtins::x_apply_result_mode): Change type to
362 * builtins.c (apply_args_size, apply_result_size, result_vector)
363 (expand_builtin_apply_args_1, expand_builtin_apply)
364 (expand_builtin_return): Update accordingly.
366 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
368 * cse.c (hash_rtx_cb): Hash only the encoded elements.
369 * cselib.c (cselib_hash_rtx): Likewise.
370 * expmed.c (make_tree): Build VECTOR_CSTs directly from the
371 CONST_VECTOR encoding.
373 2017-01-03 Jakub Jelinek <jakub@redhat.com>
374 Jeff Law <law@redhat.com>
377 * config/i386/i386.c (ix86_adjust_stack_and_probe_stack_clash): For
378 noreturn probe, use gen_pop instead of ix86_emit_restore_reg_using_pop,
379 only set RTX_FRAME_RELATED_P on both the push and pop if cfa_reg is sp
380 and add REG_CFA_ADJUST_CFA notes in that case to both insns.
383 * config/i386/i386.c (ix86_adjust_stack_and_probe_stack_clash): Do not
384 explicitly probe *sp in a noreturn function if there were any callee
385 register saves or frame pointer is needed.
387 2018-01-03 Jakub Jelinek <jakub@redhat.com>
390 * cfgexpand.c (expand_debug_expr): Return NULL if mode is
391 BLKmode for ternary, binary or unary expressions.
394 * var-tracking.c (delete_vta_debug_insn): New inline function.
395 (delete_vta_debug_insns): Add USE_CFG argument, if true, walk just
396 insns from get_insns () to NULL instead of each bb separately.
397 Use delete_vta_debug_insn. No longer static.
398 (vt_debug_insns_local, variable_tracking_main_1): Adjust
399 delete_vta_debug_insns callers.
400 * rtl.h (delete_vta_debug_insns): Declare.
401 * final.c (rest_of_handle_final): Call delete_vta_debug_insns
402 instead of variable_tracking_main.
404 2018-01-03 Martin Sebor <msebor@redhat.com>
407 * doc/extend.texi (attribute const): Fix a typo.
408 * ipa-pure-const.c ((warn_function_const, warn_function_pure): Avoid
409 issuing -Wsuggest-attribute for void functions.
411 2018-01-03 Martin Sebor <msebor@redhat.com>
413 * gimple-ssa-warn-restrict.c (builtin_memref::builtin_memref): Use
414 offset_int::from instead of wide_int::to_shwi.
415 (maybe_diag_overlap): Remove assertion.
416 Use HOST_WIDE_INT_PRINT_DEC instead of %lli.
417 * gimple-ssa-sprintf.c (format_directive): Same.
418 (parse_directive): Same.
419 (sprintf_dom_walker::compute_format_length): Same.
420 (try_substitute_return_value): Same.
422 2017-01-03 Jeff Law <law@redhat.com>
425 * explow.c (anti_adjust_stack_and_probe_stack_clash): Test a
426 non-constant residual for zero at runtime and avoid probing in
427 that case. Reorganize code for trailing problem to mirror handling
430 2018-01-03 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
432 PR tree-optimization/83501
433 * tree-ssa-strlen.c (get_string_cst): New.
434 (handle_char_store): Call get_string_cst.
436 2018-01-03 Martin Liska <mliska@suse.cz>
438 PR tree-optimization/83593
439 * tree-ssa-strlen.c: Include tree-cfg.h.
440 (strlen_check_and_optimize_stmt): Add new argument cleanup_eh.
441 (strlen_dom_walker): Add new member variable m_cleanup_cfg.
442 (strlen_dom_walker::strlen_dom_walker): Initialize m_cleanup_cfg
444 (strlen_dom_walker::before_dom_children): Call
445 gimple_purge_dead_eh_edges. Dump tranformation with details
447 (strlen_dom_walker::before_dom_children): Update call by adding
448 new argument cleanup_eh.
449 (pass_strlen::execute): Return TODO_cleanup_cfg if needed.
451 2018-01-03 Martin Liska <mliska@suse.cz>
454 * cif-code.def (VARIADIC_THUNK): New enum value.
455 * ipa-fnsummary.c (compute_fn_summary): Do not inline variadic
458 2018-01-03 Jan Beulich <jbeulich@suse.com>
460 * sse.md (mov<mode>_internal): Tighten condition for when to use
461 vmovdqu<ssescalarsize> for TI and OI modes.
463 2018-01-03 Jakub Jelinek <jakub@redhat.com>
465 Update copyright years.
467 2018-01-03 Martin Liska <mliska@suse.cz>
470 * ipa-visibility.c (function_and_variable_visibility): Skip
471 functions with noipa attribure.
473 2018-01-03 Jakub Jelinek <jakub@redhat.com>
475 * gcc.c (process_command): Update copyright notice dates.
476 * gcov-dump.c (print_version): Ditto.
477 * gcov.c (print_version): Ditto.
478 * gcov-tool.c (print_version): Ditto.
479 * gengtype.c (create_file): Ditto.
480 * doc/cpp.texi: Bump @copying's copyright year.
481 * doc/cppinternals.texi: Ditto.
482 * doc/gcc.texi: Ditto.
483 * doc/gccint.texi: Ditto.
484 * doc/gcov.texi: Ditto.
485 * doc/install.texi: Ditto.
486 * doc/invoke.texi: Ditto.
488 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
490 * vector-builder.h (vector_builder::m_full_nelts): Change from
491 unsigned int to poly_uint64.
492 (vector_builder::full_nelts): Update prototype accordingly.
493 (vector_builder::new_vector): Likewise.
494 (vector_builder::encoded_full_vector_p): Handle polynomial full_nelts.
495 (vector_builder::operator ==): Likewise.
496 (vector_builder::finalize): Likewise.
497 * int-vector-builder.h (int_vector_builder::int_vector_builder):
498 Take the number of elements as a poly_uint64 rather than an
500 * vec-perm-indices.h (vec_perm_indices::m_nelts_per_input): Change
501 from unsigned int to poly_uint64.
502 (vec_perm_indices::vec_perm_indices): Update prototype accordingly.
503 (vec_perm_indices::new_vector): Likewise.
504 (vec_perm_indices::length): Likewise.
505 (vec_perm_indices::nelts_per_input): Likewise.
506 (vec_perm_indices::input_nelts): Likewise.
507 * vec-perm-indices.c (vec_perm_indices::new_vector): Take the
508 number of elements per input as a poly_uint64 rather than an
509 unsigned int. Use the original encoding for variable-length
510 vectors, rather than clamping each individual element.
511 For the second and subsequent elements in each pattern,
512 clamp the step and base before clamping their sum.
513 (vec_perm_indices::series_p): Handle polynomial element counts.
514 (vec_perm_indices::all_in_range_p): Likewise.
515 (vec_perm_indices_to_tree): Likewise.
516 (vec_perm_indices_to_rtx): Likewise.
517 * tree-vect-stmts.c (vect_gen_perm_mask_any): Likewise.
518 * tree-vector-builder.c (tree_vector_builder::new_unary_operation)
519 (tree_vector_builder::new_binary_operation): Handle polynomial
520 element counts. Return false if we need to know the number
521 of elements at compile time.
522 * fold-const.c (fold_vec_perm): Punt if the number of elements
523 isn't known at compile time.
525 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
527 * vec-perm-indices.h (vec_perm_builder): Change element type
528 from HOST_WIDE_INT to poly_int64.
529 (vec_perm_indices::element_type): Update accordingly.
530 (vec_perm_indices::clamp): Handle polynomial element_types.
531 * vec-perm-indices.c (vec_perm_indices::series_p): Likewise.
532 (vec_perm_indices::all_in_range_p): Likewise.
533 (tree_to_vec_perm_builder): Check for poly_int64 trees rather
535 * vector-builder.h (vector_builder::stepped_sequence_p): Handle
536 polynomial vec_perm_indices element types.
537 * int-vector-builder.h (int_vector_builder::equal_p): Likewise.
538 * fold-const.c (fold_vec_perm): Likewise.
539 * optabs.c (shift_amt_for_vec_perm_mask): Likewise.
540 * tree-vect-generic.c (lower_vec_perm): Likewise.
541 * tree-vect-slp.c (vect_transform_slp_perm_load): Likewise.
542 * config/aarch64/aarch64.c (aarch64_evpc_tbl): Cast d->perm
543 element type to HOST_WIDE_INT.
545 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
546 Alan Hayward <alan.hayward@arm.com>
547 David Sherwood <david.sherwood@arm.com>
549 * alias.c (addr_side_effect_eval): Take the size as a poly_int64
550 rather than an int. Use plus_constant.
551 (memrefs_conflict_p): Take the sizes as poly_int64s rather than ints.
552 Take the offset "c" as a poly_int64 rather than a HOST_WIDE_INT.
554 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
555 Alan Hayward <alan.hayward@arm.com>
556 David Sherwood <david.sherwood@arm.com>
558 * calls.c (emit_call_1, expand_call): Change struct_value_size from
559 a HOST_WIDE_INT to a poly_int64.
561 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
562 Alan Hayward <alan.hayward@arm.com>
563 David Sherwood <david.sherwood@arm.com>
565 * calls.c (load_register_parameters): Cope with polynomial
566 mode sizes. Require a constant size for BLKmode parameters
567 that aren't described by a PARALLEL. If BLOCK_REG_PADDING
568 forces a parameter to be padded at the lsb end in order to
569 fill a complete number of words, require the parameter size
570 to be ordered wrt UNITS_PER_WORD.
572 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
573 Alan Hayward <alan.hayward@arm.com>
574 David Sherwood <david.sherwood@arm.com>
576 * reload1.c (spill_stack_slot_width): Change element type
577 from unsigned int to poly_uint64_pod.
578 (alter_reg): Treat mode sizes as polynomial.
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 * reload.c (complex_word_subreg_p): New function.
585 (reload_inner_reg_of_subreg, push_reload): Use it.
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 * lra-constraints.c (process_alt_operands): Reject matched
592 operands whose sizes aren't ordered.
593 (match_reload): Refer to this check here.
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 * builtins.c (expand_ifn_atomic_compare_exchange_into_call): Assert
600 that the mode size is in the set {1, 2, 4, 8, 16}.
602 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
603 Alan Hayward <alan.hayward@arm.com>
604 David Sherwood <david.sherwood@arm.com>
606 * var-tracking.c (adjust_mems): Treat mode sizes as polynomial.
607 Use plus_constant instead of gen_rtx_PLUS.
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 * config/cr16/cr16-protos.h (cr16_push_rounding): Declare.
614 * config/cr16/cr16.h (PUSH_ROUNDING): Move implementation to...
615 * config/cr16/cr16.c (cr16_push_rounding): ...this new function.
616 * config/h8300/h8300-protos.h (h8300_push_rounding): Declare.
617 * config/h8300/h8300.h (PUSH_ROUNDING): Move implementation to...
618 * config/h8300/h8300.c (h8300_push_rounding): ...this new function.
619 * config/i386/i386-protos.h (ix86_push_rounding): Declare.
620 * config/i386/i386.h (PUSH_ROUNDING): Move implementation to...
621 * config/i386/i386.c (ix86_push_rounding): ...this new function.
622 * config/m32c/m32c-protos.h (m32c_push_rounding): Take and return
624 * config/m32c/m32c.c (m32c_push_rounding): Likewise.
625 * config/m68k/m68k-protos.h (m68k_push_rounding): Declare.
626 * config/m68k/m68k.h (PUSH_ROUNDING): Move implementation to...
627 * config/m68k/m68k.c (m68k_push_rounding): ...this new function.
628 * config/pdp11/pdp11-protos.h (pdp11_push_rounding): Declare.
629 * config/pdp11/pdp11.h (PUSH_ROUNDING): Move implementation to...
630 * config/pdp11/pdp11.c (pdp11_push_rounding): ...this new function.
631 * config/stormy16/stormy16-protos.h (xstormy16_push_rounding): Declare.
632 * config/stormy16/stormy16.h (PUSH_ROUNDING): Move implementation to...
633 * config/stormy16/stormy16.c (xstormy16_push_rounding): ...this new
635 * expr.c (emit_move_resolve_push): Treat the input and result
636 of PUSH_ROUNDING as a poly_int64.
637 (emit_move_complex_push, emit_single_push_insn_1): Likewise.
638 (emit_push_insn): Likewise.
639 * lra-eliminations.c (mark_not_eliminable): Likewise.
640 * recog.c (push_operand): Likewise.
641 * reload1.c (elimination_effects): Likewise.
642 * rtlanal.c (nonzero_bits1): Likewise.
643 * calls.c (store_one_arg): Likewise. Require the padding to be
644 known at compile time.
646 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
647 Alan Hayward <alan.hayward@arm.com>
648 David Sherwood <david.sherwood@arm.com>
650 * expr.c (emit_single_push_insn_1): Treat mode sizes as polynomial.
651 Use plus_constant instead of gen_rtx_PLUS.
653 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
654 Alan Hayward <alan.hayward@arm.com>
655 David Sherwood <david.sherwood@arm.com>
657 * auto-inc-dec.c (set_inc_state): Take the mode size as a poly_int64
660 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
661 Alan Hayward <alan.hayward@arm.com>
662 David Sherwood <david.sherwood@arm.com>
664 * expr.c (expand_expr_real_1): Use tree_to_poly_uint64
665 instead of int_size_in_bytes when handling VIEW_CONVERT_EXPRs
666 via stack temporaries. Treat the mode size as polynomial too.
668 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
669 Alan Hayward <alan.hayward@arm.com>
670 David Sherwood <david.sherwood@arm.com>
672 * expr.c (expand_expr_real_2): When handling conversions involving
673 unions, apply tree_to_poly_uint64 to the TYPE_SIZE rather than
674 multiplying int_size_in_bytes by BITS_PER_UNIT. Treat GET_MODE_BISIZE
675 as a poly_uint64 too.
677 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
678 Alan Hayward <alan.hayward@arm.com>
679 David Sherwood <david.sherwood@arm.com>
681 * rtlanal.c (subreg_get_info): Handle polynomial mode sizes.
683 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
684 Alan Hayward <alan.hayward@arm.com>
685 David Sherwood <david.sherwood@arm.com>
687 * combine.c (can_change_dest_mode): Handle polynomial
688 REGMODE_NATURAL_SIZE.
689 * expmed.c (store_bit_field_1): Likewise.
690 * expr.c (store_constructor): Likewise.
691 * emit-rtl.c (validate_subreg): Operate on polynomial mode sizes
692 and polynomial REGMODE_NATURAL_SIZE.
693 (gen_lowpart_common): Likewise.
694 * reginfo.c (record_subregs_of_mode): Likewise.
695 * rtlanal.c (read_modify_subreg_p): Likewise.
697 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
698 Alan Hayward <alan.hayward@arm.com>
699 David Sherwood <david.sherwood@arm.com>
701 * internal-fn.c (expand_vector_ubsan_overflow): Handle polynomial
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 * match.pd: Cope with polynomial numbers of vector elements.
710 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
711 Alan Hayward <alan.hayward@arm.com>
712 David Sherwood <david.sherwood@arm.com>
714 * fold-const.c (fold_indirect_ref_1): Handle polynomial offsets
715 in a POINTER_PLUS_EXPR.
717 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
718 Alan Hayward <alan.hayward@arm.com>
719 David Sherwood <david.sherwood@arm.com>
721 * omp-simd-clone.c (simd_clone_subparts): New function.
722 (simd_clone_init_simd_arrays): Use it instead of TYPE_VECTOR_SUBPARTS.
723 (ipa_simd_modify_function_body): Likewise.
725 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
726 Alan Hayward <alan.hayward@arm.com>
727 David Sherwood <david.sherwood@arm.com>
729 * tree-vect-generic.c (nunits_for_known_piecewise_op): New function.
730 (expand_vector_piecewise): Use it instead of TYPE_VECTOR_SUBPARTS.
731 (expand_vector_addition, add_rshift, expand_vector_divmod): Likewise.
732 (expand_vector_condition, vector_element): Likewise.
733 (subparts_gt): New function.
734 (get_compute_type): Use subparts_gt.
735 (count_type_subparts): Delete.
736 (expand_vector_operations_1): Use subparts_gt instead of
739 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
740 Alan Hayward <alan.hayward@arm.com>
741 David Sherwood <david.sherwood@arm.com>
743 * tree-vect-data-refs.c (vect_no_alias_p): Replace with...
744 (vect_compile_time_alias): ...this new function. Do the calculation
745 on poly_ints rather than trees.
746 (vect_prune_runtime_alias_test_list): Update call accordingly.
748 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
749 Alan Hayward <alan.hayward@arm.com>
750 David Sherwood <david.sherwood@arm.com>
752 * tree-vect-slp.c (vect_build_slp_tree_1): Handle polynomial
754 (vect_schedule_slp_instance): Likewise.
756 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
757 Alan Hayward <alan.hayward@arm.com>
758 David Sherwood <david.sherwood@arm.com>
760 * tree-vect-slp.c (vect_get_and_check_slp_defs): Reject
761 constant and extern definitions for variable-length vectors.
762 (vect_get_constant_vectors): Note that the number of units
763 is known to be constant.
765 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
766 Alan Hayward <alan.hayward@arm.com>
767 David Sherwood <david.sherwood@arm.com>
769 * tree-vect-stmts.c (vectorizable_conversion): Treat the number
770 of units as polynomial. Choose between WIDE and NARROW based
773 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
774 Alan Hayward <alan.hayward@arm.com>
775 David Sherwood <david.sherwood@arm.com>
777 * tree-vect-stmts.c (simd_clone_subparts): New function.
778 (vectorizable_simd_clone_call): Use it instead of TYPE_VECTOR_SUBPARTS.
780 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
781 Alan Hayward <alan.hayward@arm.com>
782 David Sherwood <david.sherwood@arm.com>
784 * tree-vect-stmts.c (vectorizable_call): Treat the number of
785 vectors as polynomial. Use build_index_vector for
788 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
789 Alan Hayward <alan.hayward@arm.com>
790 David Sherwood <david.sherwood@arm.com>
792 * tree-vect-stmts.c (get_load_store_type): Treat the number of
793 units as polynomial. Reject VMAT_ELEMENTWISE and VMAT_STRIDED_SLP
794 for variable-length vectors.
795 (vectorizable_mask_load_store): Treat the number of units as
796 polynomial, asserting that it is constant if the condition has
797 already been enforced.
798 (vectorizable_store, vectorizable_load): Likewise.
800 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
801 Alan Hayward <alan.hayward@arm.com>
802 David Sherwood <david.sherwood@arm.com>
804 * tree-vect-loop.c (vectorizable_live_operation): Treat the number
805 of units as polynomial. Punt if we can't tell at compile time
806 which vector contains the final result.
808 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
809 Alan Hayward <alan.hayward@arm.com>
810 David Sherwood <david.sherwood@arm.com>
812 * tree-vect-loop.c (vectorizable_induction): Treat the number
813 of units as polynomial. Punt on SLP inductions. Use an integer
814 VEC_SERIES_EXPR for variable-length integer reductions. Use a
815 cast of such a series for variable-length floating-point
818 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
819 Alan Hayward <alan.hayward@arm.com>
820 David Sherwood <david.sherwood@arm.com>
822 * tree.h (build_index_vector): Declare.
823 * tree.c (build_index_vector): New function.
824 * tree-vect-loop.c (get_initial_defs_for_reduction): Treat the number
825 of units as polynomial, forcibly converting it to a constant if
826 vectorizable_reduction has already enforced the condition.
827 (vect_create_epilog_for_reduction): Likewise. Use build_index_vector
828 to create a {1,2,3,...} vector.
829 (vectorizable_reduction): Treat the number of units as polynomial.
830 Choose vectype_in based on the largest scalar element size rather
831 than the smallest number of units. Enforce the restrictions
834 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
835 Alan Hayward <alan.hayward@arm.com>
836 David Sherwood <david.sherwood@arm.com>
838 * tree-vect-data-refs.c (vector_alignment_reachable_p): Treat the
839 number of units as polynomial.
841 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
842 Alan Hayward <alan.hayward@arm.com>
843 David Sherwood <david.sherwood@arm.com>
845 * target.h (vector_sizes, auto_vector_sizes): New typedefs.
846 * target.def (autovectorize_vector_sizes): Return the vector sizes
847 by pointer, using vector_sizes rather than a bitmask.
848 * targhooks.h (default_autovectorize_vector_sizes): Update accordingly.
849 * targhooks.c (default_autovectorize_vector_sizes): Likewise.
850 * config/aarch64/aarch64.c (aarch64_autovectorize_vector_sizes):
852 * config/arc/arc.c (arc_autovectorize_vector_sizes): Likewise.
853 * config/arm/arm.c (arm_autovectorize_vector_sizes): Likewise.
854 * config/i386/i386.c (ix86_autovectorize_vector_sizes): Likewise.
855 * config/mips/mips.c (mips_autovectorize_vector_sizes): Likewise.
856 * omp-general.c (omp_max_vf): Likewise.
857 * omp-low.c (omp_clause_aligned_alignment): Likewise.
858 * optabs-query.c (can_vec_mask_load_store_p): Likewise.
859 * tree-vect-loop.c (vect_analyze_loop): Likewise.
860 * tree-vect-slp.c (vect_slp_bb): Likewise.
861 * doc/tm.texi: Regenerate.
862 * tree-vectorizer.h (current_vector_size): Change from an unsigned int
864 * tree-vect-stmts.c (get_vectype_for_scalar_type_and_size): Take
865 the vector size as a poly_uint64 rather than an unsigned int.
866 (current_vector_size): Change from an unsigned int to a poly_uint64.
867 (get_vectype_for_scalar_type): Update accordingly.
868 * tree.h (build_truth_vector_type): Take the size and number of
869 units as a poly_uint64 rather than an unsigned int.
870 (build_vector_type): Add a temporary overload that takes
871 the number of units as a poly_uint64 rather than an unsigned int.
872 * tree.c (make_vector_type): Likewise.
873 (build_truth_vector_type): Take the number of units as a poly_uint64
874 rather than an unsigned int.
876 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
877 Alan Hayward <alan.hayward@arm.com>
878 David Sherwood <david.sherwood@arm.com>
880 * target.def (get_mask_mode): Take the number of units and length
881 as poly_uint64s rather than unsigned ints.
882 * targhooks.h (default_get_mask_mode): Update accordingly.
883 * targhooks.c (default_get_mask_mode): Likewise.
884 * config/i386/i386.c (ix86_get_mask_mode): Likewise.
885 * doc/tm.texi: Regenerate.
887 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
888 Alan Hayward <alan.hayward@arm.com>
889 David Sherwood <david.sherwood@arm.com>
891 * omp-general.h (omp_max_vf): Return a poly_uint64 instead of an int.
892 * omp-general.c (omp_max_vf): Likewise.
893 * omp-expand.c (omp_adjust_chunk_size): Update call to omp_max_vf.
894 (expand_omp_simd): Handle polynomial safelen.
895 * omp-low.c (omplow_simd_context): Add a default constructor.
896 (omplow_simd_context::max_vf): Change from int to poly_uint64.
897 (lower_rec_simd_input_clauses): Update accordingly.
898 (lower_rec_input_clauses): Likewise.
900 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
901 Alan Hayward <alan.hayward@arm.com>
902 David Sherwood <david.sherwood@arm.com>
904 * tree-vectorizer.h (vect_nunits_for_cost): New function.
905 * tree-vect-loop.c (vect_model_reduction_cost): Use it.
906 * tree-vect-slp.c (vect_analyze_slp_cost_1): Likewise.
907 (vect_analyze_slp_cost): Likewise.
908 * tree-vect-stmts.c (vect_model_store_cost): Likewise.
909 (vect_model_load_cost): Likewise.
911 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
912 Alan Hayward <alan.hayward@arm.com>
913 David Sherwood <david.sherwood@arm.com>
915 * tree-vect-slp.c (vect_record_max_nunits, vect_build_slp_tree_1)
916 (vect_build_slp_tree_2, vect_build_slp_tree): Change max_nunits
917 from an unsigned int * to a poly_uint64_pod *.
918 (calculate_unrolling_factor): New function.
919 (vect_analyze_slp_instance): Use it. Track polynomial max_nunits.
921 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
922 Alan Hayward <alan.hayward@arm.com>
923 David Sherwood <david.sherwood@arm.com>
925 * tree-vectorizer.h (_slp_instance::unrolling_factor): Change
926 from an unsigned int to a poly_uint64.
927 (_loop_vec_info::slp_unrolling_factor): Likewise.
928 (_loop_vec_info::vectorization_factor): Change from an int
930 (MAX_VECTORIZATION_FACTOR): Bump from 64 to INT_MAX.
931 (vect_get_num_vectors): New function.
932 (vect_update_max_nunits, vect_vf_for_cost): Likewise.
933 (vect_get_num_copies): Use vect_get_num_vectors.
934 (vect_analyze_data_ref_dependences): Change max_vf from an int *
935 to an unsigned int *.
936 (vect_analyze_data_refs): Change min_vf from an int * to a
938 (vect_transform_slp_perm_load): Take the vf as a poly_uint64 rather
939 than an unsigned HOST_WIDE_INT.
940 * tree-vect-data-refs.c (vect_analyze_possibly_independent_ddr)
941 (vect_analyze_data_ref_dependence): Change max_vf from an int *
942 to an unsigned int *.
943 (vect_analyze_data_ref_dependences): Likewise.
944 (vect_compute_data_ref_alignment): Handle polynomial vf.
945 (vect_enhance_data_refs_alignment): Likewise.
946 (vect_prune_runtime_alias_test_list): Likewise.
947 (vect_shift_permute_load_chain): Likewise.
948 (vect_supportable_dr_alignment): Likewise.
949 (dependence_distance_ge_vf): Take the vectorization factor as a
950 poly_uint64 rather than an unsigned HOST_WIDE_INT.
951 (vect_analyze_data_refs): Change min_vf from an int * to a
953 * tree-vect-loop-manip.c (vect_gen_scalar_loop_niters): Take
954 vfm1 as a poly_uint64 rather than an int. Make the same change
955 for the returned bound_scalar.
956 (vect_gen_vector_loop_niters): Handle polynomial vf.
957 (vect_do_peeling): Likewise. Update call to
958 vect_gen_scalar_loop_niters and handle polynomial bound_scalars.
959 (vect_gen_vector_loop_niters_mult_vf): Assert that the vf must
961 * tree-vect-loop.c (vect_determine_vectorization_factor)
962 (vect_update_vf_for_slp, vect_analyze_loop_2): Handle polynomial vf.
963 (vect_get_known_peeling_cost): Likewise.
964 (vect_estimate_min_profitable_iters, vectorizable_reduction): Likewise.
965 (vect_worthwhile_without_simd_p, vectorizable_induction): Likewise.
966 (vect_transform_loop): Likewise. Use the lowest possible VF when
967 updating the upper bounds of the loop.
968 (vect_min_worthwhile_factor): Make static. Return an unsigned int
970 * tree-vect-slp.c (vect_attempt_slp_rearrange_stmts): Cope with
971 polynomial unroll factors.
972 (vect_analyze_slp_cost_1, vect_analyze_slp_instance): Likewise.
973 (vect_make_slp_decision): Likewise.
974 (vect_supported_load_permutation_p): Likewise, and polynomial
976 (vect_analyze_slp_cost): Handle polynomial vf.
977 (vect_slp_analyze_node_operations): Likewise.
978 (vect_slp_analyze_bb_1): Likewise.
979 (vect_transform_slp_perm_load): Take the vf as a poly_uint64 rather
980 than an unsigned HOST_WIDE_INT.
981 * tree-vect-stmts.c (vectorizable_simd_clone_call, vectorizable_store)
982 (vectorizable_load): Handle polynomial vf.
983 * tree-vectorizer.c (simduid_to_vf::vf): Change from an int to
985 (adjust_simduid_builtins, shrink_simd_arrays): Update accordingly.
987 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
988 Alan Hayward <alan.hayward@arm.com>
989 David Sherwood <david.sherwood@arm.com>
991 * match.pd: Handle bit operations involving three constants
992 and try to fold one pair.
994 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
996 * tree-vect-loop-manip.c: Include gimple-fold.h.
997 (slpeel_make_loop_iterate_ntimes): Add step, final_iv and
998 niters_maybe_zero parameters. Handle other cases besides a step of 1.
999 (vect_gen_vector_loop_niters): Add a step_vector_ptr parameter.
1000 Add a path that uses a step of VF instead of 1, but disable it
1002 (vect_do_peeling): Add step_vector, niters_vector_mult_vf_var
1003 and niters_no_overflow parameters. Update calls to
1004 slpeel_make_loop_iterate_ntimes and vect_gen_vector_loop_niters.
1005 Create a new SSA name if the latter choses to use a ste other
1006 than zero, and return it via niters_vector_mult_vf_var.
1007 * tree-vect-loop.c (vect_transform_loop): Update calls to
1008 vect_do_peeling, vect_gen_vector_loop_niters and
1009 slpeel_make_loop_iterate_ntimes.
1010 * tree-vectorizer.h (slpeel_make_loop_iterate_ntimes, vect_do_peeling)
1011 (vect_gen_vector_loop_niters): Update declarations after above changes.
1013 2018-01-02 Michael Meissner <meissner@linux.vnet.ibm.com>
1015 * config/rs6000/rs6000.md (floor<mode>2): Add support for IEEE
1016 128-bit round to integer instructions.
1017 (ceil<mode>2): Likewise.
1018 (btrunc<mode>2): Likewise.
1019 (round<mode>2): Likewise.
1021 2018-01-02 Aaron Sawdey <acsawdey@linux.vnet.ibm.com>
1023 * config/rs6000/rs6000-string.c (expand_block_move): Allow the use of
1024 unaligned VSX load/store on P8/P9.
1025 (expand_block_clear): Allow the use of unaligned VSX
1026 load/store on P8/P9.
1028 2018-01-02 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
1030 * config/rs6000/rs6000-p8swap.c (swap_feeds_both_load_and_store):
1032 (rs6000_analyze_swaps): Mark a web unoptimizable if it contains a
1033 swap associated with both a load and a store.
1035 2018-01-02 Andrew Waterman <andrew@sifive.com>
1037 * config/riscv/linux.h (ICACHE_FLUSH_FUNC): New.
1038 * config/riscv/riscv.md (clear_cache): Use it.
1040 2018-01-02 Artyom Skrobov <tyomitch@gmail.com>
1042 * web.c: Remove out-of-date comment.
1044 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1046 * expr.c (fixup_args_size_notes): Check that any existing
1047 REG_ARGS_SIZE notes are correct, and don't try to re-add them.
1048 (emit_single_push_insn_1): Move stack_pointer_delta adjustment to...
1049 (emit_single_push_insn): ...here.
1051 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1053 * rtl.h (CONST_VECTOR_ELT): Redefine to const_vector_elt.
1054 (const_vector_encoded_nelts): New function.
1055 (CONST_VECTOR_NUNITS): Redefine to use GET_MODE_NUNITS.
1056 (const_vector_int_elt, const_vector_elt): Declare.
1057 * emit-rtl.c (const_vector_int_elt_1): New function.
1058 (const_vector_elt): Likewise.
1059 * simplify-rtx.c (simplify_immed_subreg): Avoid taking the address
1060 of CONST_VECTOR_ELT.
1062 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1064 * expr.c: Include rtx-vector-builder.h.
1065 (const_vector_mask_from_tree): Use rtx_vector_builder and operate
1066 directly on the tree encoding.
1067 (const_vector_from_tree): Likewise.
1068 * optabs.c: Include rtx-vector-builder.h.
1069 (expand_vec_perm_var): Use rtx_vector_builder and create a repeating
1070 sequence of "u" values.
1071 * vec-perm-indices.c: Include rtx-vector-builder.h.
1072 (vec_perm_indices_to_rtx): Use rtx_vector_builder and operate
1073 directly on the vec_perm_indices encoding.
1075 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1077 * doc/rtl.texi (const_vector): Describe new encoding scheme.
1078 * Makefile.in (OBJS): Add rtx-vector-builder.o.
1079 * rtx-vector-builder.h: New file.
1080 * rtx-vector-builder.c: Likewise.
1081 * rtl.h (rtx_def::u2): Add a const_vector field.
1082 (CONST_VECTOR_NPATTERNS): New macro.
1083 (CONST_VECTOR_NELTS_PER_PATTERN): Likewise.
1084 (CONST_VECTOR_DUPLICATE_P): Likewise.
1085 (CONST_VECTOR_STEPPED_P): Likewise.
1086 (CONST_VECTOR_ENCODED_ELT): Likewise.
1087 (const_vec_duplicate_p): Check for a duplicated vector encoding.
1088 (unwrap_const_vec_duplicate): Likewise.
1089 (const_vec_series_p): Check for a non-duplicated vector encoding.
1090 Say that the function only returns true for integer vectors.
1091 * emit-rtl.c: Include rtx-vector-builder.h.
1092 (gen_const_vec_duplicate_1): Delete.
1093 (gen_const_vector): Call gen_const_vec_duplicate instead of
1094 gen_const_vec_duplicate_1.
1095 (const_vec_series_p_1): Operate directly on the CONST_VECTOR encoding.
1096 (gen_const_vec_duplicate): Use rtx_vector_builder.
1097 (gen_const_vec_series): Likewise.
1098 (gen_rtx_CONST_VECTOR): Likewise.
1099 * config/powerpcspe/powerpcspe.c: Include rtx-vector-builder.h.
1100 (swap_const_vector_halves): Take an rtx pointer rather than rtx.
1101 Build a new vector rather than modifying a CONST_VECTOR in-place.
1102 (handle_special_swappables): Update call accordingly.
1103 * config/rs6000/rs6000-p8swap.c: Include rtx-vector-builder.h.
1104 (swap_const_vector_halves): Take an rtx pointer rather than rtx.
1105 Build a new vector rather than modifying a CONST_VECTOR in-place.
1106 (handle_special_swappables): Update call accordingly.
1108 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1110 * simplify-rtx.c (simplify_const_binary_operation): Use
1111 CONST_VECTOR_ELT instead of XVECEXP.
1113 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1115 * tree-cfg.c (verify_gimple_assign_ternary): Allow the size of
1116 the selector elements to be different from the data elements
1117 if the selector is a VECTOR_CST.
1118 * tree-vect-stmts.c (vect_gen_perm_mask_any): Use a vector of
1119 ssizetype for the selector.
1121 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1123 * optabs.c (shift_amt_for_vec_perm_mask): Try using series_p
1124 before testing each element individually.
1125 * tree-vect-generic.c (lower_vec_perm): Likewise.
1127 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1129 * selftest.h (selftest::vec_perm_indices_c_tests): Declare.
1130 * selftest-run-tests.c (selftest::run_tests): Call it.
1131 * vector-builder.h (vector_builder::operator ==): New function.
1132 (vector_builder::operator !=): Likewise.
1133 * vec-perm-indices.h (vec_perm_indices::series_p): Declare.
1134 (vec_perm_indices::all_from_input_p): New function.
1135 * vec-perm-indices.c (vec_perm_indices::series_p): Likewise.
1136 (test_vec_perm_12, selftest::vec_perm_indices_c_tests): Likewise.
1137 * fold-const.c (fold_ternary_loc): Use tree_to_vec_perm_builder
1138 instead of reading the VECTOR_CST directly. Detect whether both
1139 vector inputs are the same before constructing the vec_perm_indices,
1140 and update the number of inputs argument accordingly. Use the
1141 utility functions added above. Only construct sel2 if we need to.
1143 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1145 * optabs.c (expand_vec_perm_var): Use an explicit encoding for
1146 the broadcast of the low byte.
1147 (expand_mult_highpart): Use an explicit encoding for the permutes.
1148 * optabs-query.c (can_mult_highpart_p): Likewise.
1149 * tree-vect-loop.c (calc_vec_perm_mask_for_shift): Likewise.
1150 * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
1151 (vectorizable_bswap): Likewise.
1152 * tree-vect-data-refs.c (vect_grouped_store_supported): Use an
1153 explicit encoding for the power-of-2 permutes.
1154 (vect_permute_store_chain): Likewise.
1155 (vect_grouped_load_supported): Likewise.
1156 (vect_permute_load_chain): Likewise.
1158 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1160 * vec-perm-indices.h (vec_perm_indices_to_tree): Declare.
1161 * vec-perm-indices.c (vec_perm_indices_to_tree): New function.
1162 * tree-ssa-forwprop.c (simplify_vector_constructor): Use it.
1163 * tree-vect-slp.c (vect_transform_slp_perm_load): Likewise.
1164 * tree-vect-stmts.c (vectorizable_bswap): Likewise.
1165 (vect_gen_perm_mask_any): Likewise.
1167 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1169 * int-vector-builder.h: New file.
1170 * vec-perm-indices.h: Include int-vector-builder.h.
1171 (vec_perm_indices): Redefine as an int_vector_builder.
1172 (auto_vec_perm_indices): Delete.
1173 (vec_perm_builder): Redefine as a stand-alone class.
1174 (vec_perm_indices::vec_perm_indices): New function.
1175 (vec_perm_indices::clamp): Likewise.
1176 * vec-perm-indices.c: Include fold-const.h and tree-vector-builder.h.
1177 (vec_perm_indices::new_vector): New function.
1178 (vec_perm_indices::new_expanded_vector): Update for new
1179 vec_perm_indices class.
1180 (vec_perm_indices::rotate_inputs): New function.
1181 (vec_perm_indices::all_in_range_p): Operate directly on the
1182 encoded form, without computing elided elements.
1183 (tree_to_vec_perm_builder): Operate directly on the VECTOR_CST
1184 encoding. Update for new vec_perm_indices class.
1185 * optabs.c (expand_vec_perm_const): Create a vec_perm_indices for
1186 the given vec_perm_builder.
1187 (expand_vec_perm_var): Update vec_perm_builder constructor.
1188 (expand_mult_highpart): Use vec_perm_builder instead of
1189 auto_vec_perm_indices.
1190 * optabs-query.c (can_mult_highpart_p): Use vec_perm_builder and
1191 vec_perm_indices instead of auto_vec_perm_indices. Use a single
1192 or double series encoding as appropriate.
1193 * fold-const.c (fold_ternary_loc): Use vec_perm_builder and
1194 vec_perm_indices instead of auto_vec_perm_indices.
1195 * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
1196 * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
1197 (vect_permute_store_chain): Likewise.
1198 (vect_grouped_load_supported): Likewise.
1199 (vect_permute_load_chain): Likewise.
1200 (vect_shift_permute_load_chain): Likewise.
1201 * tree-vect-slp.c (vect_build_slp_tree_1): Likewise.
1202 (vect_transform_slp_perm_load): Likewise.
1203 (vect_schedule_slp_instance): Likewise.
1204 * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
1205 (vectorizable_mask_load_store): Likewise.
1206 (vectorizable_bswap): Likewise.
1207 (vectorizable_store): Likewise.
1208 (vectorizable_load): Likewise.
1209 * tree-vect-generic.c (lower_vec_perm): Use vec_perm_builder and
1210 vec_perm_indices instead of auto_vec_perm_indices. Use
1211 tree_to_vec_perm_builder to read the vector from a tree.
1212 * tree-vect-loop.c (calc_vec_perm_mask_for_shift): Take a
1213 vec_perm_builder instead of a vec_perm_indices.
1214 (have_whole_vector_shift): Use vec_perm_builder and
1215 vec_perm_indices instead of auto_vec_perm_indices. Leave the
1216 truncation to calc_vec_perm_mask_for_shift.
1217 (vect_create_epilog_for_reduction): Likewise.
1218 * config/aarch64/aarch64.c (expand_vec_perm_d::perm): Change
1219 from auto_vec_perm_indices to vec_perm_indices.
1220 (aarch64_expand_vec_perm_const_1): Use rotate_inputs on d.perm
1221 instead of changing individual elements.
1222 (aarch64_vectorize_vec_perm_const): Use new_vector to install
1223 the vector in d.perm.
1224 * config/arm/arm.c (expand_vec_perm_d::perm): Change
1225 from auto_vec_perm_indices to vec_perm_indices.
1226 (arm_expand_vec_perm_const_1): Use rotate_inputs on d.perm
1227 instead of changing individual elements.
1228 (arm_vectorize_vec_perm_const): Use new_vector to install
1229 the vector in d.perm.
1230 * config/powerpcspe/powerpcspe.c (rs6000_expand_extract_even):
1231 Update vec_perm_builder constructor.
1232 (rs6000_expand_interleave): Likewise.
1233 * config/rs6000/rs6000.c (rs6000_expand_extract_even): Likewise.
1234 (rs6000_expand_interleave): Likewise.
1236 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1238 * optabs-query.c (can_vec_perm_var_p): Check whether lowering
1239 to qimode could truncate the indices.
1240 * optabs.c (expand_vec_perm_var): Likewise.
1242 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1244 * Makefile.in (OBJS): Add vec-perm-indices.o.
1245 * vec-perm-indices.h: New file.
1246 * vec-perm-indices.c: Likewise.
1247 * target.h (vec_perm_indices): Replace with a forward class
1249 (auto_vec_perm_indices): Move to vec-perm-indices.h.
1250 * optabs.h: Include vec-perm-indices.h.
1251 (expand_vec_perm): Delete.
1252 (selector_fits_mode_p, expand_vec_perm_var): Declare.
1253 (expand_vec_perm_const): Declare.
1254 * target.def (vec_perm_const_ok): Replace with...
1255 (vec_perm_const): ...this new hook.
1256 * doc/tm.texi.in (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Replace with...
1257 (TARGET_VECTORIZE_VEC_PERM_CONST): ...this new hook.
1258 * doc/tm.texi: Regenerate.
1259 * optabs.def (vec_perm_const): Delete.
1260 * doc/md.texi (vec_perm_const): Likewise.
1261 (vec_perm): Refer to TARGET_VECTORIZE_VEC_PERM_CONST.
1262 * expr.c (expand_expr_real_2): Use expand_vec_perm_const rather than
1263 expand_vec_perm for constant permutation vectors. Assert that
1264 the mode of variable permutation vectors is the integer equivalent
1265 of the mode that is being permuted.
1266 * optabs-query.h (selector_fits_mode_p): Declare.
1267 * optabs-query.c: Include vec-perm-indices.h.
1268 (selector_fits_mode_p): New function.
1269 (can_vec_perm_const_p): Check whether targetm.vectorize.vec_perm_const
1270 is defined, instead of checking whether the vec_perm_const_optab
1271 exists. Use targetm.vectorize.vec_perm_const instead of
1272 targetm.vectorize.vec_perm_const_ok. Check whether the indices
1273 fit in the vector mode before using a variable permute.
1274 * optabs.c (shift_amt_for_vec_perm_mask): Take a mode and a
1275 vec_perm_indices instead of an rtx.
1276 (expand_vec_perm): Replace with...
1277 (expand_vec_perm_const): ...this new function. Take the selector
1278 as a vec_perm_indices rather than an rtx. Also take the mode of
1279 the selector. Update call to shift_amt_for_vec_perm_mask.
1280 Use targetm.vectorize.vec_perm_const instead of vec_perm_const_optab.
1281 Use vec_perm_indices::new_expanded_vector to expand the original
1282 selector into bytes. Check whether the indices fit in the vector
1283 mode before using a variable permute.
1284 (expand_vec_perm_var): Make global.
1285 (expand_mult_highpart): Use expand_vec_perm_const.
1286 * fold-const.c: Includes vec-perm-indices.h.
1287 * tree-ssa-forwprop.c: Likewise.
1288 * tree-vect-data-refs.c: Likewise.
1289 * tree-vect-generic.c: Likewise.
1290 * tree-vect-loop.c: Likewise.
1291 * tree-vect-slp.c: Likewise.
1292 * tree-vect-stmts.c: Likewise.
1293 * config/aarch64/aarch64-protos.h (aarch64_expand_vec_perm_const):
1295 * config/aarch64/aarch64-simd.md (vec_perm_const<mode>): Delete.
1296 * config/aarch64/aarch64.c (aarch64_expand_vec_perm_const)
1297 (aarch64_vectorize_vec_perm_const_ok): Fuse into...
1298 (aarch64_vectorize_vec_perm_const): ...this new function.
1299 (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
1300 (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
1301 * config/arm/arm-protos.h (arm_expand_vec_perm_const): Delete.
1302 * config/arm/vec-common.md (vec_perm_const<mode>): Delete.
1303 * config/arm/arm.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
1304 (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
1305 (arm_expand_vec_perm_const, arm_vectorize_vec_perm_const_ok): Merge
1307 (arm_vectorize_vec_perm_const): ...this new function. Explicitly
1308 check for NEON modes.
1309 * config/i386/i386-protos.h (ix86_expand_vec_perm_const): Delete.
1310 * config/i386/sse.md (VEC_PERM_CONST, vec_perm_const<mode>): Delete.
1311 * config/i386/i386.c (ix86_expand_vec_perm_const_1): Update comment.
1312 (ix86_expand_vec_perm_const, ix86_vectorize_vec_perm_const_ok): Merge
1314 (ix86_vectorize_vec_perm_const): ...this new function. Incorporate
1315 the old VEC_PERM_CONST conditions.
1316 * config/ia64/ia64-protos.h (ia64_expand_vec_perm_const): Delete.
1317 * config/ia64/vect.md (vec_perm_const<mode>): Delete.
1318 * config/ia64/ia64.c (ia64_expand_vec_perm_const)
1319 (ia64_vectorize_vec_perm_const_ok): Merge into...
1320 (ia64_vectorize_vec_perm_const): ...this new function.
1321 * config/mips/loongson.md (vec_perm_const<mode>): Delete.
1322 * config/mips/mips-msa.md (vec_perm_const<mode>): Delete.
1323 * config/mips/mips-ps-3d.md (vec_perm_constv2sf): Delete.
1324 * config/mips/mips-protos.h (mips_expand_vec_perm_const): Delete.
1325 * config/mips/mips.c (mips_expand_vec_perm_const)
1326 (mips_vectorize_vec_perm_const_ok): Merge into...
1327 (mips_vectorize_vec_perm_const): ...this new function.
1328 * config/powerpcspe/altivec.md (vec_perm_constv16qi): Delete.
1329 * config/powerpcspe/paired.md (vec_perm_constv2sf): Delete.
1330 * config/powerpcspe/spe.md (vec_perm_constv2si): Delete.
1331 * config/powerpcspe/vsx.md (vec_perm_const<mode>): Delete.
1332 * config/powerpcspe/powerpcspe-protos.h (altivec_expand_vec_perm_const)
1333 (rs6000_expand_vec_perm_const): Delete.
1334 * config/powerpcspe/powerpcspe.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK):
1336 (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
1337 (altivec_expand_vec_perm_const_le): Take each operand individually.
1338 Operate on constant selectors rather than rtxes.
1339 (altivec_expand_vec_perm_const): Likewise. Update call to
1340 altivec_expand_vec_perm_const_le.
1341 (rs6000_expand_vec_perm_const): Delete.
1342 (rs6000_vectorize_vec_perm_const_ok): Delete.
1343 (rs6000_vectorize_vec_perm_const): New function.
1344 (rs6000_do_expand_vec_perm): Take a vec_perm_builder instead of
1345 an element count and rtx array.
1346 (rs6000_expand_extract_even): Update call accordingly.
1347 (rs6000_expand_interleave): Likewise.
1348 * config/rs6000/altivec.md (vec_perm_constv16qi): Delete.
1349 * config/rs6000/paired.md (vec_perm_constv2sf): Delete.
1350 * config/rs6000/vsx.md (vec_perm_const<mode>): Delete.
1351 * config/rs6000/rs6000-protos.h (altivec_expand_vec_perm_const)
1352 (rs6000_expand_vec_perm_const): Delete.
1353 * config/rs6000/rs6000.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
1354 (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
1355 (altivec_expand_vec_perm_const_le): Take each operand individually.
1356 Operate on constant selectors rather than rtxes.
1357 (altivec_expand_vec_perm_const): Likewise. Update call to
1358 altivec_expand_vec_perm_const_le.
1359 (rs6000_expand_vec_perm_const): Delete.
1360 (rs6000_vectorize_vec_perm_const_ok): Delete.
1361 (rs6000_vectorize_vec_perm_const): New function. Remove stray
1362 reference to the SPE evmerge intructions.
1363 (rs6000_do_expand_vec_perm): Take a vec_perm_builder instead of
1364 an element count and rtx array.
1365 (rs6000_expand_extract_even): Update call accordingly.
1366 (rs6000_expand_interleave): Likewise.
1367 * config/sparc/sparc.md (vec_perm_constv8qi): Delete in favor of...
1368 * config/sparc/sparc.c (sparc_vectorize_vec_perm_const): ...this
1370 (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
1372 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1374 * optabs.c (expand_vec_perm_1): Assert that SEL has an integer
1375 vector mode and that that mode matches the mode of the data
1377 (expand_vec_perm): Split handling of non-CONST_VECTOR selectors
1378 out into expand_vec_perm_var. Do all CONST_VECTOR handling here,
1379 directly using expand_vec_perm_1 when forcing selectors into
1381 (expand_vec_perm_var): New function, split out from expand_vec_perm.
1383 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1385 * optabs-query.h (can_vec_perm_p): Delete.
1386 (can_vec_perm_var_p, can_vec_perm_const_p): Declare.
1387 * optabs-query.c (can_vec_perm_p): Split into...
1388 (can_vec_perm_var_p, can_vec_perm_const_p): ...these two functions.
1389 (can_mult_highpart_p): Use can_vec_perm_const_p to test whether a
1390 particular selector is valid.
1391 * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
1392 * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
1393 (vect_grouped_load_supported): Likewise.
1394 (vect_shift_permute_load_chain): Likewise.
1395 * tree-vect-slp.c (vect_build_slp_tree_1): Likewise.
1396 (vect_transform_slp_perm_load): Likewise.
1397 * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
1398 (vectorizable_bswap): Likewise.
1399 (vect_gen_perm_mask_checked): Likewise.
1400 * fold-const.c (fold_ternary_loc): Likewise. Don't take
1401 implementations of variable permutation vectors into account
1402 when deciding which selector to use.
1403 * tree-vect-loop.c (have_whole_vector_shift): Don't check whether
1404 vec_perm_const_optab is supported; instead use can_vec_perm_const_p
1405 with a false third argument.
1406 * tree-vect-generic.c (lower_vec_perm): Use can_vec_perm_const_p
1407 to test whether the constant selector is valid and can_vec_perm_var_p
1408 to test whether a variable selector is valid.
1410 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1412 * optabs-query.h (can_vec_perm_p): Take a const vec_perm_indices *.
1413 * optabs-query.c (can_vec_perm_p): Likewise.
1414 * fold-const.c (fold_vec_perm): Take a const vec_perm_indices &
1415 instead of vec_perm_indices.
1416 * tree-vectorizer.h (vect_gen_perm_mask_any): Likewise,
1417 (vect_gen_perm_mask_checked): Likewise,
1418 * tree-vect-stmts.c (vect_gen_perm_mask_any): Likewise,
1419 (vect_gen_perm_mask_checked): Likewise,
1421 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1423 * optabs-query.h (qimode_for_vec_perm): Declare.
1424 * optabs-query.c (can_vec_perm_p): Split out qimode search to...
1425 (qimode_for_vec_perm): ...this new function.
1426 * optabs.c (expand_vec_perm): Use qimode_for_vec_perm.
1428 2018-01-02 Aaron Sawdey <acsawdey@linux.vnet.ibm.com>
1430 * rtlanal.c (canonicalize_condition): Return 0 if final rtx
1431 does not have a conditional at the top.
1433 2018-01-02 Richard Biener <rguenther@suse.de>
1435 * ipa-inline.c (big_speedup_p): Fix expression.
1437 2018-01-02 Jan Hubicka <hubicka@ucw.cz>
1440 * config/i386/x86-tune-costs.h: Increase cost of integer load costs
1443 2018-01-02 Jan Hubicka <hubicka@ucw.cz>
1447 * x86-tune-costs.h (generic_cost): Reduce cost of FDIV 20->17,
1448 cost of sqrt 20->14, DIVSS 18->13, DIVSD 32->17, SQRtSS 30->14
1449 and SQRTsD 58->18, cond_not_taken_branch_cost. 2->1. Increase
1450 cond_taken_branch_cost 3->4.
1452 2018-01-01 Jakub Jelinek <jakub@redhat.com>
1454 PR tree-optimization/83581
1455 * tree-loop-distribution.c (pass_loop_distribution::execute): Return
1456 TODO_cleanup_cfg if any changes have been made.
1459 * expr.c (store_expr_with_bounds): Use simplify_gen_subreg instead of
1460 convert_modes if target mode has the right side, but different mode
1464 * expr.c (expand_assignment): Fix up a typo in simplify_gen_subreg
1465 last argument when extracting from CONCAT. If either from_real or
1466 from_imag is NULL, use expansion through memory. If result is not
1467 a CONCAT and simplify_gen_subreg fails, try to simplify_gen_subreg
1468 the parts directly to inner mode, if even that fails, use expansion
1472 * expmed.c (expand_shift_1): For 2-byte rotates by BITS_PER_UNIT,
1473 check for bswap in mode rather than HImode and use that in expand_unop
1476 Copyright (C) 2018 Free Software Foundation, Inc.
1478 Copying and distribution of this file, with or without modification,
1479 are permitted in any medium without royalty provided the copyright
1480 notice and this notice are preserved.