2018-01-03 Richard Sandiford Alan Hayward David Sherwood * tree.h (TYPE_VECTOR_SUBPARTS): Turn into a function and handle polynomial numbers of units. (SET_TYPE_VECTOR_SUBPARTS): Likewise. (valid_vector_subparts_p): New function. (build_vector_type): Remove temporary shim and take the number of units as a poly_uint64 rather than an int. (build_opaque_vector_type): Take the number of units as a poly_uint64 rather than an int. * tree.c (build_vector_from_ctor): Handle polynomial TYPE_VECTOR_SUBPARTS. (type_hash_canon_hash, type_cache_hasher::equal): Likewise. (uniform_vector_p, vector_type_mode, build_vector): Likewise. (build_vector_from_val): If the number of units is variable, use build_vec_duplicate_cst for constant operands and VEC_DUPLICATE_EXPR otherwise. (make_vector_type): Remove temporary is_constant (). (build_vector_type, build_opaque_vector_type): Take the number of units as a poly_uint64 rather than an int. (check_vector_cst): Handle polynomial TYPE_VECTOR_SUBPARTS and VECTOR_CST_NELTS. * cfgexpand.c (expand_debug_expr): Likewise. * expr.c (count_type_elements, categorize_ctor_elements_1): Likewise. (store_constructor, expand_expr_real_1): Likewise. (const_scalar_mask_from_tree): Likewise. * fold-const-call.c (fold_const_reduction): Likewise. * fold-const.c (const_binop, const_unop, fold_convert_const): Likewise. (operand_equal_p, fold_vec_perm, fold_ternary_loc): Likewise. (native_encode_vector, vec_cst_ctor_to_array): Likewise. (fold_relational_const): Likewise. (native_interpret_vector): Likewise. Change the size from an int to an unsigned int. * gimple-fold.c (gimple_fold_stmt_to_constant_1): Handle polynomial TYPE_VECTOR_SUBPARTS. (gimple_fold_indirect_ref, gimple_build_vector): Likewise. (gimple_build_vector_from_val): Use VEC_DUPLICATE_EXPR when duplicating a non-constant operand into a variable-length vector. * hsa-brig.c (hsa_op_immed::emit_to_buffer): Handle polynomial TYPE_VECTOR_SUBPARTS and VECTOR_CST_NELTS. * ipa-icf.c (sem_variable::equals): Likewise. * match.pd: Likewise. * omp-simd-clone.c (simd_clone_subparts): Likewise. * print-tree.c (print_node): Likewise. * stor-layout.c (layout_type): Likewise. * targhooks.c (default_builtin_vectorization_cost): Likewise. * tree-cfg.c (verify_gimple_comparison): Likewise. (verify_gimple_assign_binary): Likewise. (verify_gimple_assign_ternary): Likewise. (verify_gimple_assign_single): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise. (simplify_bitfield_ref, is_combined_permutation_identity): Likewise. * tree-vect-data-refs.c (vect_permute_store_chain): Likewise. (vect_grouped_load_supported, vect_permute_load_chain): Likewise. (vect_shift_permute_load_chain): Likewise. * tree-vect-generic.c (nunits_for_known_piecewise_op): Likewise. (expand_vector_condition, optimize_vector_constructor): Likewise. (lower_vec_perm, get_compute_type): Likewise. * tree-vect-loop.c (vect_determine_vectorization_factor): Likewise. (get_initial_defs_for_reduction, vect_transform_loop): Likewise. * tree-vect-patterns.c (vect_recog_bool_pattern): Likewise. (vect_recog_mask_conversion_pattern): Likewise. * tree-vect-slp.c (vect_supported_load_permutation_p): Likewise. (vect_get_constant_vectors, vect_transform_slp_perm_load): Likewise. * tree-vect-stmts.c (perm_mask_for_reverse): Likewise. (get_group_load_store_type, vectorizable_mask_load_store): Likewise. (vectorizable_bswap, simd_clone_subparts, vectorizable_assignment) (vectorizable_shift, vectorizable_operation, vectorizable_store) (vectorizable_load, vect_is_simple_cond, vectorizable_comparison) (supportable_widening_operation): Likewise. (supportable_narrowing_operation): Likewise. * tree-vector-builder.c (tree_vector_builder::binary_encoded_nelts): Likewise. * varasm.c (output_constant): Likewise. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * tree-vect-data-refs.c (vect_permute_store_chain): Reorganize so that both the length == 3 and length != 3 cases set up their own permute vectors. Add comments explaining why we know the number of elements is constant. (vect_permute_load_chain): Likewise. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * machmode.h (mode_nunits): Change from unsigned char to poly_uint16_pod. (ONLY_FIXED_SIZE_MODES): New macro. (pod_mode::measurement_type, scalar_int_mode::measurement_type) (scalar_float_mode::measurement_type, scalar_mode::measurement_type) (complex_mode::measurement_type, fixed_size_mode::measurement_type): New typedefs. (mode_to_nunits): Return a poly_uint16 rather than an unsigned short. (GET_MODE_NUNITS): Return a constant if ONLY_FIXED_SIZE_MODES, or if measurement_type is not polynomial. * genmodes.c (ZERO_COEFFS): New macro. (emit_mode_nunits_inline): Make mode_nunits_inline return a poly_uint16. (emit_mode_nunits): Change the type of mode_nunits to poly_uint16_pod. Use ZERO_COEFFS when emitting initializers. * data-streamer.h (bp_pack_poly_value): New function. (bp_unpack_poly_value): Likewise. * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value for GET_MODE_NUNITS. * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value for GET_MODE_NUNITS. * tree.c (make_vector_type): Remove temporary shim and make the real function take the number of units as a poly_uint64 rather than an int. (build_vector_type_for_mode): Handle polynomial nunits. * dwarf2out.c (loc_descriptor, add_const_value_attribute): Likewise. * emit-rtl.c (const_vec_series_p_1): Likewise. (gen_rtx_CONST_VECTOR): Likewise. * fold-const.c (test_vec_duplicate_folding): Likewise. * genrecog.c (validate_pattern): Likewise. * optabs-query.c (can_vec_perm_var_p, can_mult_highpart_p): Likewise. * optabs-tree.c (expand_vec_cond_expr_p): Likewise. * optabs.c (expand_vector_broadcast, expand_binop_directly): Likewise. (shift_amt_for_vec_perm_mask, expand_vec_perm_var): Likewise. (expand_vec_cond_expr, expand_mult_highpart): Likewise. * rtlanal.c (subreg_get_info): Likewise. * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise. (vect_grouped_load_supported): Likewise. * tree-vect-generic.c (type_for_widest_vector_mode): Likewise. * tree-vect-loop.c (have_whole_vector_shift): Likewise. * simplify-rtx.c (simplify_unary_operation_1): Likewise. (simplify_const_unary_operation, simplify_binary_operation_1) (simplify_const_binary_operation, simplify_ternary_operation) (test_vector_ops_duplicate, test_vector_ops): Likewise. (simplify_immed_subreg): Use GET_MODE_NUNITS on a fixed_size_mode instead of CONST_VECTOR_NUNITS. * varasm.c (output_constant_pool_2): Likewise. * rtx-vector-builder.c (rtx_vector_builder::build): Only include the explicit-encoded elements in the XVEC for variable-length vectors. 2018-01-03 Richard Sandiford * lra-constraints.c (curr_insn_transform): Use partial_subreg_p. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * coretypes.h (fixed_size_mode): Declare. (fixed_size_mode_pod): New typedef. * builtins.h (target_builtins::x_apply_args_mode) (target_builtins::x_apply_result_mode): Change type to fixed_size_mode_pod. * builtins.c (apply_args_size, apply_result_size, result_vector) (expand_builtin_apply_args_1, expand_builtin_apply) (expand_builtin_return): Update accordingly. 2018-01-03 Richard Sandiford * cse.c (hash_rtx_cb): Hash only the encoded elements. * cselib.c (cselib_hash_rtx): Likewise. * expmed.c (make_tree): Build VECTOR_CSTs directly from the CONST_VECTOR encoding. 2017-01-03 Jakub Jelinek Jeff Law PR target/83641 * config/i386/i386.c (ix86_adjust_stack_and_probe_stack_clash): For noreturn probe, use gen_pop instead of ix86_emit_restore_reg_using_pop, only set RTX_FRAME_RELATED_P on both the push and pop if cfa_reg is sp and add REG_CFA_ADJUST_CFA notes in that case to both insns. PR target/83641 * config/i386/i386.c (ix86_adjust_stack_and_probe_stack_clash): Do not explicitly probe *sp in a noreturn function if there were any callee register saves or frame pointer is needed. 2018-01-03 Jakub Jelinek PR debug/83621 * cfgexpand.c (expand_debug_expr): Return NULL if mode is BLKmode for ternary, binary or unary expressions. PR debug/83645 * var-tracking.c (delete_vta_debug_insn): New inline function. (delete_vta_debug_insns): Add USE_CFG argument, if true, walk just insns from get_insns () to NULL instead of each bb separately. Use delete_vta_debug_insn. No longer static. (vt_debug_insns_local, variable_tracking_main_1): Adjust delete_vta_debug_insns callers. * rtl.h (delete_vta_debug_insns): Declare. * final.c (rest_of_handle_final): Call delete_vta_debug_insns instead of variable_tracking_main. 2018-01-03 Martin Sebor PR c/83559 * doc/extend.texi (attribute const): Fix a typo. * ipa-pure-const.c ((warn_function_const, warn_function_pure): Avoid issuing -Wsuggest-attribute for void functions. 2018-01-03 Martin Sebor * gimple-ssa-warn-restrict.c (builtin_memref::builtin_memref): Use offset_int::from instead of wide_int::to_shwi. (maybe_diag_overlap): Remove assertion. Use HOST_WIDE_INT_PRINT_DEC instead of %lli. * gimple-ssa-sprintf.c (format_directive): Same. (parse_directive): Same. (sprintf_dom_walker::compute_format_length): Same. (try_substitute_return_value): Same. 2017-01-03 Jeff Law PR middle-end/83654 * explow.c (anti_adjust_stack_and_probe_stack_clash): Test a non-constant residual for zero at runtime and avoid probing in that case. Reorganize code for trailing problem to mirror handling of the residual. 2018-01-03 Prathamesh Kulkarni PR tree-optimization/83501 * tree-ssa-strlen.c (get_string_cst): New. (handle_char_store): Call get_string_cst. 2018-01-03 Martin Liska PR tree-optimization/83593 * tree-ssa-strlen.c: Include tree-cfg.h. (strlen_check_and_optimize_stmt): Add new argument cleanup_eh. (strlen_dom_walker): Add new member variable m_cleanup_cfg. (strlen_dom_walker::strlen_dom_walker): Initialize m_cleanup_cfg to false. (strlen_dom_walker::before_dom_children): Call gimple_purge_dead_eh_edges. Dump tranformation with details dump flags. (strlen_dom_walker::before_dom_children): Update call by adding new argument cleanup_eh. (pass_strlen::execute): Return TODO_cleanup_cfg if needed. 2018-01-03 Martin Liska PR ipa/83549 * cif-code.def (VARIADIC_THUNK): New enum value. * ipa-fnsummary.c (compute_fn_summary): Do not inline variadic thunks. 2018-01-03 Jan Beulich * sse.md (mov_internal): Tighten condition for when to use vmovdqu for TI and OI modes. 2018-01-03 Jakub Jelinek Update copyright years. 2018-01-03 Martin Liska PR ipa/83594 * ipa-visibility.c (function_and_variable_visibility): Skip functions with noipa attribure. 2018-01-03 Jakub Jelinek * gcc.c (process_command): Update copyright notice dates. * gcov-dump.c (print_version): Ditto. * gcov.c (print_version): Ditto. * gcov-tool.c (print_version): Ditto. * gengtype.c (create_file): Ditto. * doc/cpp.texi: Bump @copying's copyright year. * doc/cppinternals.texi: Ditto. * doc/gcc.texi: Ditto. * doc/gccint.texi: Ditto. * doc/gcov.texi: Ditto. * doc/install.texi: Ditto. * doc/invoke.texi: Ditto. 2018-01-03 Richard Sandiford * vector-builder.h (vector_builder::m_full_nelts): Change from unsigned int to poly_uint64. (vector_builder::full_nelts): Update prototype accordingly. (vector_builder::new_vector): Likewise. (vector_builder::encoded_full_vector_p): Handle polynomial full_nelts. (vector_builder::operator ==): Likewise. (vector_builder::finalize): Likewise. * int-vector-builder.h (int_vector_builder::int_vector_builder): Take the number of elements as a poly_uint64 rather than an unsigned int. * vec-perm-indices.h (vec_perm_indices::m_nelts_per_input): Change from unsigned int to poly_uint64. (vec_perm_indices::vec_perm_indices): Update prototype accordingly. (vec_perm_indices::new_vector): Likewise. (vec_perm_indices::length): Likewise. (vec_perm_indices::nelts_per_input): Likewise. (vec_perm_indices::input_nelts): Likewise. * vec-perm-indices.c (vec_perm_indices::new_vector): Take the number of elements per input as a poly_uint64 rather than an unsigned int. Use the original encoding for variable-length vectors, rather than clamping each individual element. For the second and subsequent elements in each pattern, clamp the step and base before clamping their sum. (vec_perm_indices::series_p): Handle polynomial element counts. (vec_perm_indices::all_in_range_p): Likewise. (vec_perm_indices_to_tree): Likewise. (vec_perm_indices_to_rtx): Likewise. * tree-vect-stmts.c (vect_gen_perm_mask_any): Likewise. * tree-vector-builder.c (tree_vector_builder::new_unary_operation) (tree_vector_builder::new_binary_operation): Handle polynomial element counts. Return false if we need to know the number of elements at compile time. * fold-const.c (fold_vec_perm): Punt if the number of elements isn't known at compile time. 2018-01-03 Richard Sandiford * vec-perm-indices.h (vec_perm_builder): Change element type from HOST_WIDE_INT to poly_int64. (vec_perm_indices::element_type): Update accordingly. (vec_perm_indices::clamp): Handle polynomial element_types. * vec-perm-indices.c (vec_perm_indices::series_p): Likewise. (vec_perm_indices::all_in_range_p): Likewise. (tree_to_vec_perm_builder): Check for poly_int64 trees rather than shwi trees. * vector-builder.h (vector_builder::stepped_sequence_p): Handle polynomial vec_perm_indices element types. * int-vector-builder.h (int_vector_builder::equal_p): Likewise. * fold-const.c (fold_vec_perm): Likewise. * optabs.c (shift_amt_for_vec_perm_mask): Likewise. * tree-vect-generic.c (lower_vec_perm): Likewise. * tree-vect-slp.c (vect_transform_slp_perm_load): Likewise. * config/aarch64/aarch64.c (aarch64_evpc_tbl): Cast d->perm element type to HOST_WIDE_INT. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * alias.c (addr_side_effect_eval): Take the size as a poly_int64 rather than an int. Use plus_constant. (memrefs_conflict_p): Take the sizes as poly_int64s rather than ints. Take the offset "c" as a poly_int64 rather than a HOST_WIDE_INT. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * calls.c (emit_call_1, expand_call): Change struct_value_size from a HOST_WIDE_INT to a poly_int64. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * calls.c (load_register_parameters): Cope with polynomial mode sizes. Require a constant size for BLKmode parameters that aren't described by a PARALLEL. If BLOCK_REG_PADDING forces a parameter to be padded at the lsb end in order to fill a complete number of words, require the parameter size to be ordered wrt UNITS_PER_WORD. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * reload1.c (spill_stack_slot_width): Change element type from unsigned int to poly_uint64_pod. (alter_reg): Treat mode sizes as polynomial. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * reload.c (complex_word_subreg_p): New function. (reload_inner_reg_of_subreg, push_reload): Use it. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * lra-constraints.c (process_alt_operands): Reject matched operands whose sizes aren't ordered. (match_reload): Refer to this check here. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * builtins.c (expand_ifn_atomic_compare_exchange_into_call): Assert that the mode size is in the set {1, 2, 4, 8, 16}. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * var-tracking.c (adjust_mems): Treat mode sizes as polynomial. Use plus_constant instead of gen_rtx_PLUS. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * config/cr16/cr16-protos.h (cr16_push_rounding): Declare. * config/cr16/cr16.h (PUSH_ROUNDING): Move implementation to... * config/cr16/cr16.c (cr16_push_rounding): ...this new function. * config/h8300/h8300-protos.h (h8300_push_rounding): Declare. * config/h8300/h8300.h (PUSH_ROUNDING): Move implementation to... * config/h8300/h8300.c (h8300_push_rounding): ...this new function. * config/i386/i386-protos.h (ix86_push_rounding): Declare. * config/i386/i386.h (PUSH_ROUNDING): Move implementation to... * config/i386/i386.c (ix86_push_rounding): ...this new function. * config/m32c/m32c-protos.h (m32c_push_rounding): Take and return a poly_int64. * config/m32c/m32c.c (m32c_push_rounding): Likewise. * config/m68k/m68k-protos.h (m68k_push_rounding): Declare. * config/m68k/m68k.h (PUSH_ROUNDING): Move implementation to... * config/m68k/m68k.c (m68k_push_rounding): ...this new function. * config/pdp11/pdp11-protos.h (pdp11_push_rounding): Declare. * config/pdp11/pdp11.h (PUSH_ROUNDING): Move implementation to... * config/pdp11/pdp11.c (pdp11_push_rounding): ...this new function. * config/stormy16/stormy16-protos.h (xstormy16_push_rounding): Declare. * config/stormy16/stormy16.h (PUSH_ROUNDING): Move implementation to... * config/stormy16/stormy16.c (xstormy16_push_rounding): ...this new function. * expr.c (emit_move_resolve_push): Treat the input and result of PUSH_ROUNDING as a poly_int64. (emit_move_complex_push, emit_single_push_insn_1): Likewise. (emit_push_insn): Likewise. * lra-eliminations.c (mark_not_eliminable): Likewise. * recog.c (push_operand): Likewise. * reload1.c (elimination_effects): Likewise. * rtlanal.c (nonzero_bits1): Likewise. * calls.c (store_one_arg): Likewise. Require the padding to be known at compile time. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * expr.c (emit_single_push_insn_1): Treat mode sizes as polynomial. Use plus_constant instead of gen_rtx_PLUS. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * auto-inc-dec.c (set_inc_state): Take the mode size as a poly_int64 rather than an int. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * expr.c (expand_expr_real_1): Use tree_to_poly_uint64 instead of int_size_in_bytes when handling VIEW_CONVERT_EXPRs via stack temporaries. Treat the mode size as polynomial too. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * expr.c (expand_expr_real_2): When handling conversions involving unions, apply tree_to_poly_uint64 to the TYPE_SIZE rather than multiplying int_size_in_bytes by BITS_PER_UNIT. Treat GET_MODE_BISIZE as a poly_uint64 too. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * rtlanal.c (subreg_get_info): Handle polynomial mode sizes. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * combine.c (can_change_dest_mode): Handle polynomial REGMODE_NATURAL_SIZE. * expmed.c (store_bit_field_1): Likewise. * expr.c (store_constructor): Likewise. * emit-rtl.c (validate_subreg): Operate on polynomial mode sizes and polynomial REGMODE_NATURAL_SIZE. (gen_lowpart_common): Likewise. * reginfo.c (record_subregs_of_mode): Likewise. * rtlanal.c (read_modify_subreg_p): Likewise. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * internal-fn.c (expand_vector_ubsan_overflow): Handle polynomial numbers of elements. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * match.pd: Cope with polynomial numbers of vector elements. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * fold-const.c (fold_indirect_ref_1): Handle polynomial offsets in a POINTER_PLUS_EXPR. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * omp-simd-clone.c (simd_clone_subparts): New function. (simd_clone_init_simd_arrays): Use it instead of TYPE_VECTOR_SUBPARTS. (ipa_simd_modify_function_body): Likewise. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * tree-vect-generic.c (nunits_for_known_piecewise_op): New function. (expand_vector_piecewise): Use it instead of TYPE_VECTOR_SUBPARTS. (expand_vector_addition, add_rshift, expand_vector_divmod): Likewise. (expand_vector_condition, vector_element): Likewise. (subparts_gt): New function. (get_compute_type): Use subparts_gt. (count_type_subparts): Delete. (expand_vector_operations_1): Use subparts_gt instead of count_type_subparts. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * tree-vect-data-refs.c (vect_no_alias_p): Replace with... (vect_compile_time_alias): ...this new function. Do the calculation on poly_ints rather than trees. (vect_prune_runtime_alias_test_list): Update call accordingly. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * tree-vect-slp.c (vect_build_slp_tree_1): Handle polynomial numbers of units. (vect_schedule_slp_instance): Likewise. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * tree-vect-slp.c (vect_get_and_check_slp_defs): Reject constant and extern definitions for variable-length vectors. (vect_get_constant_vectors): Note that the number of units is known to be constant. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * tree-vect-stmts.c (vectorizable_conversion): Treat the number of units as polynomial. Choose between WIDE and NARROW based on multiple_p. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * tree-vect-stmts.c (simd_clone_subparts): New function. (vectorizable_simd_clone_call): Use it instead of TYPE_VECTOR_SUBPARTS. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * tree-vect-stmts.c (vectorizable_call): Treat the number of vectors as polynomial. Use build_index_vector for IFN_GOMP_SIMD_LANE. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * tree-vect-stmts.c (get_load_store_type): Treat the number of units as polynomial. Reject VMAT_ELEMENTWISE and VMAT_STRIDED_SLP for variable-length vectors. (vectorizable_mask_load_store): Treat the number of units as polynomial, asserting that it is constant if the condition has already been enforced. (vectorizable_store, vectorizable_load): Likewise. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * tree-vect-loop.c (vectorizable_live_operation): Treat the number of units as polynomial. Punt if we can't tell at compile time which vector contains the final result. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * tree-vect-loop.c (vectorizable_induction): Treat the number of units as polynomial. Punt on SLP inductions. Use an integer VEC_SERIES_EXPR for variable-length integer reductions. Use a cast of such a series for variable-length floating-point reductions. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * tree.h (build_index_vector): Declare. * tree.c (build_index_vector): New function. * tree-vect-loop.c (get_initial_defs_for_reduction): Treat the number of units as polynomial, forcibly converting it to a constant if vectorizable_reduction has already enforced the condition. (vect_create_epilog_for_reduction): Likewise. Use build_index_vector to create a {1,2,3,...} vector. (vectorizable_reduction): Treat the number of units as polynomial. Choose vectype_in based on the largest scalar element size rather than the smallest number of units. Enforce the restrictions relied on above. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * tree-vect-data-refs.c (vector_alignment_reachable_p): Treat the number of units as polynomial. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * target.h (vector_sizes, auto_vector_sizes): New typedefs. * target.def (autovectorize_vector_sizes): Return the vector sizes by pointer, using vector_sizes rather than a bitmask. * targhooks.h (default_autovectorize_vector_sizes): Update accordingly. * targhooks.c (default_autovectorize_vector_sizes): Likewise. * config/aarch64/aarch64.c (aarch64_autovectorize_vector_sizes): Likewise. * config/arc/arc.c (arc_autovectorize_vector_sizes): Likewise. * config/arm/arm.c (arm_autovectorize_vector_sizes): Likewise. * config/i386/i386.c (ix86_autovectorize_vector_sizes): Likewise. * config/mips/mips.c (mips_autovectorize_vector_sizes): Likewise. * omp-general.c (omp_max_vf): Likewise. * omp-low.c (omp_clause_aligned_alignment): Likewise. * optabs-query.c (can_vec_mask_load_store_p): Likewise. * tree-vect-loop.c (vect_analyze_loop): Likewise. * tree-vect-slp.c (vect_slp_bb): Likewise. * doc/tm.texi: Regenerate. * tree-vectorizer.h (current_vector_size): Change from an unsigned int to a poly_uint64. * tree-vect-stmts.c (get_vectype_for_scalar_type_and_size): Take the vector size as a poly_uint64 rather than an unsigned int. (current_vector_size): Change from an unsigned int to a poly_uint64. (get_vectype_for_scalar_type): Update accordingly. * tree.h (build_truth_vector_type): Take the size and number of units as a poly_uint64 rather than an unsigned int. (build_vector_type): Add a temporary overload that takes the number of units as a poly_uint64 rather than an unsigned int. * tree.c (make_vector_type): Likewise. (build_truth_vector_type): Take the number of units as a poly_uint64 rather than an unsigned int. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * target.def (get_mask_mode): Take the number of units and length as poly_uint64s rather than unsigned ints. * targhooks.h (default_get_mask_mode): Update accordingly. * targhooks.c (default_get_mask_mode): Likewise. * config/i386/i386.c (ix86_get_mask_mode): Likewise. * doc/tm.texi: Regenerate. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * omp-general.h (omp_max_vf): Return a poly_uint64 instead of an int. * omp-general.c (omp_max_vf): Likewise. * omp-expand.c (omp_adjust_chunk_size): Update call to omp_max_vf. (expand_omp_simd): Handle polynomial safelen. * omp-low.c (omplow_simd_context): Add a default constructor. (omplow_simd_context::max_vf): Change from int to poly_uint64. (lower_rec_simd_input_clauses): Update accordingly. (lower_rec_input_clauses): Likewise. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * tree-vectorizer.h (vect_nunits_for_cost): New function. * tree-vect-loop.c (vect_model_reduction_cost): Use it. * tree-vect-slp.c (vect_analyze_slp_cost_1): Likewise. (vect_analyze_slp_cost): Likewise. * tree-vect-stmts.c (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * tree-vect-slp.c (vect_record_max_nunits, vect_build_slp_tree_1) (vect_build_slp_tree_2, vect_build_slp_tree): Change max_nunits from an unsigned int * to a poly_uint64_pod *. (calculate_unrolling_factor): New function. (vect_analyze_slp_instance): Use it. Track polynomial max_nunits. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * tree-vectorizer.h (_slp_instance::unrolling_factor): Change from an unsigned int to a poly_uint64. (_loop_vec_info::slp_unrolling_factor): Likewise. (_loop_vec_info::vectorization_factor): Change from an int to a poly_uint64. (MAX_VECTORIZATION_FACTOR): Bump from 64 to INT_MAX. (vect_get_num_vectors): New function. (vect_update_max_nunits, vect_vf_for_cost): Likewise. (vect_get_num_copies): Use vect_get_num_vectors. (vect_analyze_data_ref_dependences): Change max_vf from an int * to an unsigned int *. (vect_analyze_data_refs): Change min_vf from an int * to a poly_uint64 *. (vect_transform_slp_perm_load): Take the vf as a poly_uint64 rather than an unsigned HOST_WIDE_INT. * tree-vect-data-refs.c (vect_analyze_possibly_independent_ddr) (vect_analyze_data_ref_dependence): Change max_vf from an int * to an unsigned int *. (vect_analyze_data_ref_dependences): Likewise. (vect_compute_data_ref_alignment): Handle polynomial vf. (vect_enhance_data_refs_alignment): Likewise. (vect_prune_runtime_alias_test_list): Likewise. (vect_shift_permute_load_chain): Likewise. (vect_supportable_dr_alignment): Likewise. (dependence_distance_ge_vf): Take the vectorization factor as a poly_uint64 rather than an unsigned HOST_WIDE_INT. (vect_analyze_data_refs): Change min_vf from an int * to a poly_uint64 *. * tree-vect-loop-manip.c (vect_gen_scalar_loop_niters): Take vfm1 as a poly_uint64 rather than an int. Make the same change for the returned bound_scalar. (vect_gen_vector_loop_niters): Handle polynomial vf. (vect_do_peeling): Likewise. Update call to vect_gen_scalar_loop_niters and handle polynomial bound_scalars. (vect_gen_vector_loop_niters_mult_vf): Assert that the vf must be constant. * tree-vect-loop.c (vect_determine_vectorization_factor) (vect_update_vf_for_slp, vect_analyze_loop_2): Handle polynomial vf. (vect_get_known_peeling_cost): Likewise. (vect_estimate_min_profitable_iters, vectorizable_reduction): Likewise. (vect_worthwhile_without_simd_p, vectorizable_induction): Likewise. (vect_transform_loop): Likewise. Use the lowest possible VF when updating the upper bounds of the loop. (vect_min_worthwhile_factor): Make static. Return an unsigned int rather than an int. * tree-vect-slp.c (vect_attempt_slp_rearrange_stmts): Cope with polynomial unroll factors. (vect_analyze_slp_cost_1, vect_analyze_slp_instance): Likewise. (vect_make_slp_decision): Likewise. (vect_supported_load_permutation_p): Likewise, and polynomial vf too. (vect_analyze_slp_cost): Handle polynomial vf. (vect_slp_analyze_node_operations): Likewise. (vect_slp_analyze_bb_1): Likewise. (vect_transform_slp_perm_load): Take the vf as a poly_uint64 rather than an unsigned HOST_WIDE_INT. * tree-vect-stmts.c (vectorizable_simd_clone_call, vectorizable_store) (vectorizable_load): Handle polynomial vf. * tree-vectorizer.c (simduid_to_vf::vf): Change from an int to a poly_uint64. (adjust_simduid_builtins, shrink_simd_arrays): Update accordingly. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood * match.pd: Handle bit operations involving three constants and try to fold one pair. 2018-01-03 Richard Sandiford * tree-vect-loop-manip.c: Include gimple-fold.h. (slpeel_make_loop_iterate_ntimes): Add step, final_iv and niters_maybe_zero parameters. Handle other cases besides a step of 1. (vect_gen_vector_loop_niters): Add a step_vector_ptr parameter. Add a path that uses a step of VF instead of 1, but disable it for now. (vect_do_peeling): Add step_vector, niters_vector_mult_vf_var and niters_no_overflow parameters. Update calls to slpeel_make_loop_iterate_ntimes and vect_gen_vector_loop_niters. Create a new SSA name if the latter choses to use a ste other than zero, and return it via niters_vector_mult_vf_var. * tree-vect-loop.c (vect_transform_loop): Update calls to vect_do_peeling, vect_gen_vector_loop_niters and slpeel_make_loop_iterate_ntimes. * tree-vectorizer.h (slpeel_make_loop_iterate_ntimes, vect_do_peeling) (vect_gen_vector_loop_niters): Update declarations after above changes. 2018-01-02 Michael Meissner * config/rs6000/rs6000.md (floor2): Add support for IEEE 128-bit round to integer instructions. (ceil2): Likewise. (btrunc2): Likewise. (round2): Likewise. 2018-01-02 Aaron Sawdey * config/rs6000/rs6000-string.c (expand_block_move): Allow the use of unaligned VSX load/store on P8/P9. (expand_block_clear): Allow the use of unaligned VSX load/store on P8/P9. 2018-01-02 Bill Schmidt * config/rs6000/rs6000-p8swap.c (swap_feeds_both_load_and_store): New function. (rs6000_analyze_swaps): Mark a web unoptimizable if it contains a swap associated with both a load and a store. 2018-01-02 Andrew Waterman * config/riscv/linux.h (ICACHE_FLUSH_FUNC): New. * config/riscv/riscv.md (clear_cache): Use it. 2018-01-02 Artyom Skrobov * web.c: Remove out-of-date comment. 2018-01-02 Richard Sandiford * expr.c (fixup_args_size_notes): Check that any existing REG_ARGS_SIZE notes are correct, and don't try to re-add them. (emit_single_push_insn_1): Move stack_pointer_delta adjustment to... (emit_single_push_insn): ...here. 2018-01-02 Richard Sandiford * rtl.h (CONST_VECTOR_ELT): Redefine to const_vector_elt. (const_vector_encoded_nelts): New function. (CONST_VECTOR_NUNITS): Redefine to use GET_MODE_NUNITS. (const_vector_int_elt, const_vector_elt): Declare. * emit-rtl.c (const_vector_int_elt_1): New function. (const_vector_elt): Likewise. * simplify-rtx.c (simplify_immed_subreg): Avoid taking the address of CONST_VECTOR_ELT. 2018-01-02 Richard Sandiford * expr.c: Include rtx-vector-builder.h. (const_vector_mask_from_tree): Use rtx_vector_builder and operate directly on the tree encoding. (const_vector_from_tree): Likewise. * optabs.c: Include rtx-vector-builder.h. (expand_vec_perm_var): Use rtx_vector_builder and create a repeating sequence of "u" values. * vec-perm-indices.c: Include rtx-vector-builder.h. (vec_perm_indices_to_rtx): Use rtx_vector_builder and operate directly on the vec_perm_indices encoding. 2018-01-02 Richard Sandiford * doc/rtl.texi (const_vector): Describe new encoding scheme. * Makefile.in (OBJS): Add rtx-vector-builder.o. * rtx-vector-builder.h: New file. * rtx-vector-builder.c: Likewise. * rtl.h (rtx_def::u2): Add a const_vector field. (CONST_VECTOR_NPATTERNS): New macro. (CONST_VECTOR_NELTS_PER_PATTERN): Likewise. (CONST_VECTOR_DUPLICATE_P): Likewise. (CONST_VECTOR_STEPPED_P): Likewise. (CONST_VECTOR_ENCODED_ELT): Likewise. (const_vec_duplicate_p): Check for a duplicated vector encoding. (unwrap_const_vec_duplicate): Likewise. (const_vec_series_p): Check for a non-duplicated vector encoding. Say that the function only returns true for integer vectors. * emit-rtl.c: Include rtx-vector-builder.h. (gen_const_vec_duplicate_1): Delete. (gen_const_vector): Call gen_const_vec_duplicate instead of gen_const_vec_duplicate_1. (const_vec_series_p_1): Operate directly on the CONST_VECTOR encoding. (gen_const_vec_duplicate): Use rtx_vector_builder. (gen_const_vec_series): Likewise. (gen_rtx_CONST_VECTOR): Likewise. * config/powerpcspe/powerpcspe.c: Include rtx-vector-builder.h. (swap_const_vector_halves): Take an rtx pointer rather than rtx. Build a new vector rather than modifying a CONST_VECTOR in-place. (handle_special_swappables): Update call accordingly. * config/rs6000/rs6000-p8swap.c: Include rtx-vector-builder.h. (swap_const_vector_halves): Take an rtx pointer rather than rtx. Build a new vector rather than modifying a CONST_VECTOR in-place. (handle_special_swappables): Update call accordingly. 2018-01-02 Richard Sandiford * simplify-rtx.c (simplify_const_binary_operation): Use CONST_VECTOR_ELT instead of XVECEXP. 2018-01-02 Richard Sandiford * tree-cfg.c (verify_gimple_assign_ternary): Allow the size of the selector elements to be different from the data elements if the selector is a VECTOR_CST. * tree-vect-stmts.c (vect_gen_perm_mask_any): Use a vector of ssizetype for the selector. 2018-01-02 Richard Sandiford * optabs.c (shift_amt_for_vec_perm_mask): Try using series_p before testing each element individually. * tree-vect-generic.c (lower_vec_perm): Likewise. 2018-01-02 Richard Sandiford * selftest.h (selftest::vec_perm_indices_c_tests): Declare. * selftest-run-tests.c (selftest::run_tests): Call it. * vector-builder.h (vector_builder::operator ==): New function. (vector_builder::operator !=): Likewise. * vec-perm-indices.h (vec_perm_indices::series_p): Declare. (vec_perm_indices::all_from_input_p): New function. * vec-perm-indices.c (vec_perm_indices::series_p): Likewise. (test_vec_perm_12, selftest::vec_perm_indices_c_tests): Likewise. * fold-const.c (fold_ternary_loc): Use tree_to_vec_perm_builder instead of reading the VECTOR_CST directly. Detect whether both vector inputs are the same before constructing the vec_perm_indices, and update the number of inputs argument accordingly. Use the utility functions added above. Only construct sel2 if we need to. 2018-01-02 Richard Sandiford * optabs.c (expand_vec_perm_var): Use an explicit encoding for the broadcast of the low byte. (expand_mult_highpart): Use an explicit encoding for the permutes. * optabs-query.c (can_mult_highpart_p): Likewise. * tree-vect-loop.c (calc_vec_perm_mask_for_shift): Likewise. * tree-vect-stmts.c (perm_mask_for_reverse): Likewise. (vectorizable_bswap): Likewise. * tree-vect-data-refs.c (vect_grouped_store_supported): Use an explicit encoding for the power-of-2 permutes. (vect_permute_store_chain): Likewise. (vect_grouped_load_supported): Likewise. (vect_permute_load_chain): Likewise. 2018-01-02 Richard Sandiford * vec-perm-indices.h (vec_perm_indices_to_tree): Declare. * vec-perm-indices.c (vec_perm_indices_to_tree): New function. * tree-ssa-forwprop.c (simplify_vector_constructor): Use it. * tree-vect-slp.c (vect_transform_slp_perm_load): Likewise. * tree-vect-stmts.c (vectorizable_bswap): Likewise. (vect_gen_perm_mask_any): Likewise. 2018-01-02 Richard Sandiford * int-vector-builder.h: New file. * vec-perm-indices.h: Include int-vector-builder.h. (vec_perm_indices): Redefine as an int_vector_builder. (auto_vec_perm_indices): Delete. (vec_perm_builder): Redefine as a stand-alone class. (vec_perm_indices::vec_perm_indices): New function. (vec_perm_indices::clamp): Likewise. * vec-perm-indices.c: Include fold-const.h and tree-vector-builder.h. (vec_perm_indices::new_vector): New function. (vec_perm_indices::new_expanded_vector): Update for new vec_perm_indices class. (vec_perm_indices::rotate_inputs): New function. (vec_perm_indices::all_in_range_p): Operate directly on the encoded form, without computing elided elements. (tree_to_vec_perm_builder): Operate directly on the VECTOR_CST encoding. Update for new vec_perm_indices class. * optabs.c (expand_vec_perm_const): Create a vec_perm_indices for the given vec_perm_builder. (expand_vec_perm_var): Update vec_perm_builder constructor. (expand_mult_highpart): Use vec_perm_builder instead of auto_vec_perm_indices. * optabs-query.c (can_mult_highpart_p): Use vec_perm_builder and vec_perm_indices instead of auto_vec_perm_indices. Use a single or double series encoding as appropriate. * fold-const.c (fold_ternary_loc): Use vec_perm_builder and vec_perm_indices instead of auto_vec_perm_indices. * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise. * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise. (vect_permute_store_chain): Likewise. (vect_grouped_load_supported): Likewise. (vect_permute_load_chain): Likewise. (vect_shift_permute_load_chain): Likewise. * tree-vect-slp.c (vect_build_slp_tree_1): Likewise. (vect_transform_slp_perm_load): Likewise. (vect_schedule_slp_instance): Likewise. * tree-vect-stmts.c (perm_mask_for_reverse): Likewise. (vectorizable_mask_load_store): Likewise. (vectorizable_bswap): Likewise. (vectorizable_store): Likewise. (vectorizable_load): Likewise. * tree-vect-generic.c (lower_vec_perm): Use vec_perm_builder and vec_perm_indices instead of auto_vec_perm_indices. Use tree_to_vec_perm_builder to read the vector from a tree. * tree-vect-loop.c (calc_vec_perm_mask_for_shift): Take a vec_perm_builder instead of a vec_perm_indices. (have_whole_vector_shift): Use vec_perm_builder and vec_perm_indices instead of auto_vec_perm_indices. Leave the truncation to calc_vec_perm_mask_for_shift. (vect_create_epilog_for_reduction): Likewise. * config/aarch64/aarch64.c (expand_vec_perm_d::perm): Change from auto_vec_perm_indices to vec_perm_indices. (aarch64_expand_vec_perm_const_1): Use rotate_inputs on d.perm instead of changing individual elements. (aarch64_vectorize_vec_perm_const): Use new_vector to install the vector in d.perm. * config/arm/arm.c (expand_vec_perm_d::perm): Change from auto_vec_perm_indices to vec_perm_indices. (arm_expand_vec_perm_const_1): Use rotate_inputs on d.perm instead of changing individual elements. (arm_vectorize_vec_perm_const): Use new_vector to install the vector in d.perm. * config/powerpcspe/powerpcspe.c (rs6000_expand_extract_even): Update vec_perm_builder constructor. (rs6000_expand_interleave): Likewise. * config/rs6000/rs6000.c (rs6000_expand_extract_even): Likewise. (rs6000_expand_interleave): Likewise. 2018-01-02 Richard Sandiford * optabs-query.c (can_vec_perm_var_p): Check whether lowering to qimode could truncate the indices. * optabs.c (expand_vec_perm_var): Likewise. 2018-01-02 Richard Sandiford * Makefile.in (OBJS): Add vec-perm-indices.o. * vec-perm-indices.h: New file. * vec-perm-indices.c: Likewise. * target.h (vec_perm_indices): Replace with a forward class declaration. (auto_vec_perm_indices): Move to vec-perm-indices.h. * optabs.h: Include vec-perm-indices.h. (expand_vec_perm): Delete. (selector_fits_mode_p, expand_vec_perm_var): Declare. (expand_vec_perm_const): Declare. * target.def (vec_perm_const_ok): Replace with... (vec_perm_const): ...this new hook. * doc/tm.texi.in (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Replace with... (TARGET_VECTORIZE_VEC_PERM_CONST): ...this new hook. * doc/tm.texi: Regenerate. * optabs.def (vec_perm_const): Delete. * doc/md.texi (vec_perm_const): Likewise. (vec_perm): Refer to TARGET_VECTORIZE_VEC_PERM_CONST. * expr.c (expand_expr_real_2): Use expand_vec_perm_const rather than expand_vec_perm for constant permutation vectors. Assert that the mode of variable permutation vectors is the integer equivalent of the mode that is being permuted. * optabs-query.h (selector_fits_mode_p): Declare. * optabs-query.c: Include vec-perm-indices.h. (selector_fits_mode_p): New function. (can_vec_perm_const_p): Check whether targetm.vectorize.vec_perm_const is defined, instead of checking whether the vec_perm_const_optab exists. Use targetm.vectorize.vec_perm_const instead of targetm.vectorize.vec_perm_const_ok. Check whether the indices fit in the vector mode before using a variable permute. * optabs.c (shift_amt_for_vec_perm_mask): Take a mode and a vec_perm_indices instead of an rtx. (expand_vec_perm): Replace with... (expand_vec_perm_const): ...this new function. Take the selector as a vec_perm_indices rather than an rtx. Also take the mode of the selector. Update call to shift_amt_for_vec_perm_mask. Use targetm.vectorize.vec_perm_const instead of vec_perm_const_optab. Use vec_perm_indices::new_expanded_vector to expand the original selector into bytes. Check whether the indices fit in the vector mode before using a variable permute. (expand_vec_perm_var): Make global. (expand_mult_highpart): Use expand_vec_perm_const. * fold-const.c: Includes vec-perm-indices.h. * tree-ssa-forwprop.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * config/aarch64/aarch64-protos.h (aarch64_expand_vec_perm_const): Delete. * config/aarch64/aarch64-simd.md (vec_perm_const): Delete. * config/aarch64/aarch64.c (aarch64_expand_vec_perm_const) (aarch64_vectorize_vec_perm_const_ok): Fuse into... (aarch64_vectorize_vec_perm_const): ...this new function. (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete. (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine. * config/arm/arm-protos.h (arm_expand_vec_perm_const): Delete. * config/arm/vec-common.md (vec_perm_const): Delete. * config/arm/arm.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete. (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine. (arm_expand_vec_perm_const, arm_vectorize_vec_perm_const_ok): Merge into... (arm_vectorize_vec_perm_const): ...this new function. Explicitly check for NEON modes. * config/i386/i386-protos.h (ix86_expand_vec_perm_const): Delete. * config/i386/sse.md (VEC_PERM_CONST, vec_perm_const): Delete. * config/i386/i386.c (ix86_expand_vec_perm_const_1): Update comment. (ix86_expand_vec_perm_const, ix86_vectorize_vec_perm_const_ok): Merge into... (ix86_vectorize_vec_perm_const): ...this new function. Incorporate the old VEC_PERM_CONST conditions. * config/ia64/ia64-protos.h (ia64_expand_vec_perm_const): Delete. * config/ia64/vect.md (vec_perm_const): Delete. * config/ia64/ia64.c (ia64_expand_vec_perm_const) (ia64_vectorize_vec_perm_const_ok): Merge into... (ia64_vectorize_vec_perm_const): ...this new function. * config/mips/loongson.md (vec_perm_const): Delete. * config/mips/mips-msa.md (vec_perm_const): Delete. * config/mips/mips-ps-3d.md (vec_perm_constv2sf): Delete. * config/mips/mips-protos.h (mips_expand_vec_perm_const): Delete. * config/mips/mips.c (mips_expand_vec_perm_const) (mips_vectorize_vec_perm_const_ok): Merge into... (mips_vectorize_vec_perm_const): ...this new function. * config/powerpcspe/altivec.md (vec_perm_constv16qi): Delete. * config/powerpcspe/paired.md (vec_perm_constv2sf): Delete. * config/powerpcspe/spe.md (vec_perm_constv2si): Delete. * config/powerpcspe/vsx.md (vec_perm_const): Delete. * config/powerpcspe/powerpcspe-protos.h (altivec_expand_vec_perm_const) (rs6000_expand_vec_perm_const): Delete. * config/powerpcspe/powerpcspe.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete. (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine. (altivec_expand_vec_perm_const_le): Take each operand individually. Operate on constant selectors rather than rtxes. (altivec_expand_vec_perm_const): Likewise. Update call to altivec_expand_vec_perm_const_le. (rs6000_expand_vec_perm_const): Delete. (rs6000_vectorize_vec_perm_const_ok): Delete. (rs6000_vectorize_vec_perm_const): New function. (rs6000_do_expand_vec_perm): Take a vec_perm_builder instead of an element count and rtx array. (rs6000_expand_extract_even): Update call accordingly. (rs6000_expand_interleave): Likewise. * config/rs6000/altivec.md (vec_perm_constv16qi): Delete. * config/rs6000/paired.md (vec_perm_constv2sf): Delete. * config/rs6000/vsx.md (vec_perm_const): Delete. * config/rs6000/rs6000-protos.h (altivec_expand_vec_perm_const) (rs6000_expand_vec_perm_const): Delete. * config/rs6000/rs6000.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete. (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine. (altivec_expand_vec_perm_const_le): Take each operand individually. Operate on constant selectors rather than rtxes. (altivec_expand_vec_perm_const): Likewise. Update call to altivec_expand_vec_perm_const_le. (rs6000_expand_vec_perm_const): Delete. (rs6000_vectorize_vec_perm_const_ok): Delete. (rs6000_vectorize_vec_perm_const): New function. Remove stray reference to the SPE evmerge intructions. (rs6000_do_expand_vec_perm): Take a vec_perm_builder instead of an element count and rtx array. (rs6000_expand_extract_even): Update call accordingly. (rs6000_expand_interleave): Likewise. * config/sparc/sparc.md (vec_perm_constv8qi): Delete in favor of... * config/sparc/sparc.c (sparc_vectorize_vec_perm_const): ...this new function. (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine. 2018-01-02 Richard Sandiford * optabs.c (expand_vec_perm_1): Assert that SEL has an integer vector mode and that that mode matches the mode of the data being permuted. (expand_vec_perm): Split handling of non-CONST_VECTOR selectors out into expand_vec_perm_var. Do all CONST_VECTOR handling here, directly using expand_vec_perm_1 when forcing selectors into registers. (expand_vec_perm_var): New function, split out from expand_vec_perm. 2018-01-02 Richard Sandiford * optabs-query.h (can_vec_perm_p): Delete. (can_vec_perm_var_p, can_vec_perm_const_p): Declare. * optabs-query.c (can_vec_perm_p): Split into... (can_vec_perm_var_p, can_vec_perm_const_p): ...these two functions. (can_mult_highpart_p): Use can_vec_perm_const_p to test whether a particular selector is valid. * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise. * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise. (vect_grouped_load_supported): Likewise. (vect_shift_permute_load_chain): Likewise. * tree-vect-slp.c (vect_build_slp_tree_1): Likewise. (vect_transform_slp_perm_load): Likewise. * tree-vect-stmts.c (perm_mask_for_reverse): Likewise. (vectorizable_bswap): Likewise. (vect_gen_perm_mask_checked): Likewise. * fold-const.c (fold_ternary_loc): Likewise. Don't take implementations of variable permutation vectors into account when deciding which selector to use. * tree-vect-loop.c (have_whole_vector_shift): Don't check whether vec_perm_const_optab is supported; instead use can_vec_perm_const_p with a false third argument. * tree-vect-generic.c (lower_vec_perm): Use can_vec_perm_const_p to test whether the constant selector is valid and can_vec_perm_var_p to test whether a variable selector is valid. 2018-01-02 Richard Sandiford * optabs-query.h (can_vec_perm_p): Take a const vec_perm_indices *. * optabs-query.c (can_vec_perm_p): Likewise. * fold-const.c (fold_vec_perm): Take a const vec_perm_indices & instead of vec_perm_indices. * tree-vectorizer.h (vect_gen_perm_mask_any): Likewise, (vect_gen_perm_mask_checked): Likewise, * tree-vect-stmts.c (vect_gen_perm_mask_any): Likewise, (vect_gen_perm_mask_checked): Likewise, 2018-01-02 Richard Sandiford * optabs-query.h (qimode_for_vec_perm): Declare. * optabs-query.c (can_vec_perm_p): Split out qimode search to... (qimode_for_vec_perm): ...this new function. * optabs.c (expand_vec_perm): Use qimode_for_vec_perm. 2018-01-02 Aaron Sawdey * rtlanal.c (canonicalize_condition): Return 0 if final rtx does not have a conditional at the top. 2018-01-02 Richard Biener * ipa-inline.c (big_speedup_p): Fix expression. 2018-01-02 Jan Hubicka PR target/81616 * config/i386/x86-tune-costs.h: Increase cost of integer load costs for generic 4->6. 2018-01-02 Jan Hubicka PR target/81616 Generic tuning. * x86-tune-costs.h (generic_cost): Reduce cost of FDIV 20->17, cost of sqrt 20->14, DIVSS 18->13, DIVSD 32->17, SQRtSS 30->14 and SQRTsD 58->18, cond_not_taken_branch_cost. 2->1. Increase cond_taken_branch_cost 3->4. 2018-01-01 Jakub Jelinek PR tree-optimization/83581 * tree-loop-distribution.c (pass_loop_distribution::execute): Return TODO_cleanup_cfg if any changes have been made. PR middle-end/83608 * expr.c (store_expr_with_bounds): Use simplify_gen_subreg instead of convert_modes if target mode has the right side, but different mode class. PR middle-end/83609 * expr.c (expand_assignment): Fix up a typo in simplify_gen_subreg last argument when extracting from CONCAT. If either from_real or from_imag is NULL, use expansion through memory. If result is not a CONCAT and simplify_gen_subreg fails, try to simplify_gen_subreg the parts directly to inner mode, if even that fails, use expansion through memory. PR middle-end/83623 * expmed.c (expand_shift_1): For 2-byte rotates by BITS_PER_UNIT, check for bswap in mode rather than HImode and use that in expand_unop too. Copyright (C) 2018 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.