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