Revert DECL_USER_ALIGN part of r241959
[official-gcc.git] / gcc / ChangeLog
bloba419f02e2a55e47763aa728b76b5eefbf1e3280a
1 2018-01-05  Richard Sandiford  <richard.sandiford@linaro.org>
3         * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Don't
4         punt for user-aligned variables.
6 2018-01-05  Richard Sandiford  <richard.sandiford@linaro.org>
8         * tree-chrec.c (chrec_contains_symbols): Return true for
9         POLY_INT_CST.
11 2018-01-05  Sudakshina Das  <sudi.das@arm.com>
13         PR target/82439
14         * simplify-rtx.c (simplify_relational_operation_1): Add simplifications
15         of (x|y) == x for BICS pattern.
17 2018-01-05  Jakub Jelinek  <jakub@redhat.com>
19         PR tree-optimization/83605
20         * gimple-ssa-strength-reduction.c: Include tree-eh.h.
21         (find_candidates_dom_walker::before_dom_children): Ignore stmts that
22         can throw.
24 2018-01-05  Sebastian Huber  <sebastian.huber@embedded-brains.de>
26         * config.gcc (epiphany-*-elf*): Add (epiphany-*-rtems*) configuration.
27         * config/epiphany/rtems.h: New file.
29 2018-01-04  Jakub Jelinek  <jakub@redhat.com>
30             Uros Bizjak  <ubizjak@gmail.com>
32         PR target/83554
33         * config/i386/i386.md (*<rotate_insn>hi3_1 splitter): Use
34         QIreg_operand instead of register_operand predicate.
35         * config/i386/i386.c (ix86_rop_should_change_byte_p,
36         set_rop_modrm_reg_bits, ix86_mitigate_rop): Use -mmitigate-rop in
37         comments instead of -fmitigate[-_]rop.
39 2018-01-04  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
41         PR bootstrap/81926
42         * cgraphunit.c (symbol_table::compile): Switch to text_section
43         before calling assembly_start debug hook.
44         * run-rtl-passes.c (run_rtl_passes): Likewise.
45         Include output.h.
47 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
49         * tree-vrp.c (extract_range_from_binary_expr_1): Check
50         range_int_cst_p rather than !symbolic_range_p before calling
51         extract_range_from_multiplicative_op_1.
53 2017-01-04  Jeff Law  <law@redhat.com>
55         * tree-ssa-math-opts.c (execute_cse_reciprocals_1): Remove
56         redundant test in assertion.
58 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
60         * doc/rtl.texi: Document machine_mode wrapper classes.
62 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
64         * fold-const.c (fold_ternary_loc): Check tree_fits_uhwi_p before
65         using tree_to_uhwi.
67 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
69         * tree-ssa-forwprop.c (is_combined_permutation_identity): Allow
70         the VEC_PERM_EXPR fold to fail.
72 2018-01-04  Jakub Jelinek  <jakub@redhat.com>
74         PR debug/83585
75         * bb-reorder.c (insert_section_boundary_note): Set has_bb_partition
76         to switched_sections.
78 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
80         PR target/83680
81         * config/arm/arm.c (arm_vectorize_vec_perm_const): Fix inverted
82         test for d.testing.
84 2018-01-04  Peter Bergner  <bergner@vnet.ibm.com>
86         PR target/83387
87         * config/rs6000/rs6000.c (rs6000_discover_homogeneous_aggregate): Do not
88         allow arguments in FP registers if TARGET_HARD_FLOAT is false.
90 2018-01-04  Jakub Jelinek  <jakub@redhat.com>
92         PR debug/83666
93         * cfgexpand.c (expand_dbeug_expr) <case BIT_FIELD_REF>: Punt if mode
94         is BLKmode and bitpos not zero or mode change is needed.
96 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
98         PR target/83675
99         * config/sparc/sparc.c (sparc_vectorize_vec_perm_const): Require
100         TARGET_VIS2.
102 2018-01-04  Uros Bizjak  <ubizjak@gmail.com>
104         PR target/83628
105         * config/alpha/alpha.md (*sadd<modesuffix>): Use ASHIFT
106         instead of MULT rtx.  Update all corresponding splitters.
107         (*saddl_se): Ditto.
108         (*ssub<modesuffix>): Ditto.
109         (*ssubl_se): Ditto.
110         (*cmp_sadd_di): Update split patterns.
111         (*cmp_sadd_si): Ditto.
112         (*cmp_sadd_sidi): Ditto.
113         (*cmp_ssub_di): Ditto.
114         (*cmp_ssub_si): Ditto.
115         (*cmp_ssub_sidi): Ditto.
116         * config/alpha/predicates.md (const23_operand): New predicate.
117         * config/alpha/alpha.c (alpha_rtx_costs) [PLUS, MINUS]:
118         Look for ASHIFT, not MULT inner operand.
119         (alpha_split_conditional_move): Update for *sadd<modesuffix> change.
121 2018-01-04  Martin Liska  <mliska@suse.cz>
123         PR gcov-profile/83669
124         * gcov.c (output_intermediate_file): Add version to intermediate
125         gcov file.
126         * doc/gcov.texi: Document new field 'version' in intermediate
127         file format. Fix location of '-k' option of gcov command.
129 2018-01-04  Martin Liska  <mliska@suse.cz>
131         PR ipa/82352
132         * ipa-icf.c (sem_function::merge): Do not cross comdat boundary.
134 2018-01-04  Jakub Jelinek  <jakub@redhat.com>
136         * gimple-ssa-sprintf.c (parse_directive): Cast second dir.len to uhwi.
138 2018-01-03  Martin Sebor  <msebor@redhat.com>
140         PR tree-optimization/83655
141         * gimple-ssa-warn-restrict.c (wrestrict_dom_walker::check_call): Avoid
142         checking calls with invalid arguments.
144 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
146         * tree-vect-stmts.c (vect_get_store_rhs): New function.
147         (vectorizable_mask_load_store): Delete.
148         (vectorizable_call): Return false for masked loads and stores.
149         (vectorizable_store): Handle IFN_MASK_STORE.  Use vect_get_store_rhs
150         instead of gimple_assign_rhs1.
151         (vectorizable_load): Handle IFN_MASK_LOAD.
152         (vect_transform_stmt): Don't set is_store for call_vec_info_type.
154 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
156         * tree-vect-stmts.c (vect_build_gather_load_calls): New function,
157         split out from..,
158         (vectorizable_mask_load_store): ...here.
159         (vectorizable_load): ...and here.
161 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
163         * tree-vect-stmts.c (vect_build_all_ones_mask)
164         (vect_build_zero_merge_argument): New functions, split out from...
165         (vectorizable_load): ...here.
167 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
169         * tree-vect-stmts.c (vect_check_store_rhs): New function,
170         split out from...
171         (vectorizable_mask_load_store): ...here.
172         (vectorizable_store): ...and here.
174 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
176         * tree-vect-stmts.c (vect_check_load_store_mask): New function,
177         split out from...
178         (vectorizable_mask_load_store): ...here.
180 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
182         * tree-vectorizer.h (vec_load_store_type): Moved from tree-vec-stmts.c
183         (vect_model_store_cost): Take a vec_load_store_type instead of a
184         vect_def_type.
185         * tree-vect-stmts.c (vec_load_store_type): Move to tree-vectorizer.h.
186         (vect_model_store_cost): Take a vec_load_store_type instead of a
187         vect_def_type.
188         (vectorizable_mask_load_store): Update accordingly.
189         (vectorizable_store): Likewise.
190         * tree-vect-slp.c (vect_analyze_slp_cost_1): Update accordingly.
192 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
194         * tree-vect-loop.c (vect_transform_loop): Stub out scalar
195         IFN_MASK_LOAD calls here rather than...
196         * tree-vect-stmts.c (vectorizable_mask_load_store): ...here.
198 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
199             Alan Hayward  <alan.hayward@arm.com>
200             David Sherwood  <david.sherwood@arm.com>
202         * expmed.c (extract_bit_field_1): For vector extracts,
203         fall back to extract_bit_field_as_subreg if vec_extract
204         isn't available.
206 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
207             Alan Hayward  <alan.hayward@arm.com>
208             David Sherwood  <david.sherwood@arm.com>
210         * lra-spills.c (pseudo_reg_slot_compare): Sort slots by whether
211         they are variable or constant sized.
212         (assign_stack_slot_num_and_sort_pseudos): Don't reuse variable-sized
213         slots for constant-sized data.
215 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
216             Alan Hayward  <alan.hayward@arm.com>
217             David Sherwood  <david.sherwood@arm.com>
219         * tree-vect-patterns.c (vect_recog_mask_conversion_pattern): When
220         handling COND_EXPRs with boolean comparisons, try to find a better
221         basis for the mask type than the boolean itself.
223 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
225         * doc/rtl.texi (MAX_BITSIZE_MODE_ANY_MODE): Describe how the default
226         is calculated and how it can be overridden.
227         * genmodes.c (max_bitsize_mode_any_mode): New variable.
228         (create_modes): Initialize it from MAX_BITSIZE_MODE_ANY_MODE,
229         if defined.
230         (emit_max_int): Use it to set the output MAX_BITSIZE_MODE_ANY_MODE,
231         if nonzero.
233 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
234             Alan Hayward  <alan.hayward@arm.com>
235             David Sherwood  <david.sherwood@arm.com>
237         * config/aarch64/aarch64-protos.h (aarch64_output_simd_mov_immediate):
238         Remove the mode argument.
239         (aarch64_simd_valid_immediate): Remove the mode and inverse
240         arguments.
241         * config/aarch64/iterators.md (bitsize): New iterator.
242         * config/aarch64/aarch64-simd.md (*aarch64_simd_mov<mode>, and<mode>3)
243         (ior<mode>3): Update calls to aarch64_output_simd_mov_immediate.
244         * config/aarch64/constraints.md (Do, Db, Dn): Update calls to
245         aarch64_simd_valid_immediate.
246         * config/aarch64/predicates.md (aarch64_reg_or_orr_imm): Likewise.
247         (aarch64_reg_or_bic_imm): Likewise.
248         * config/aarch64/aarch64.c (simd_immediate_info): Replace mvn
249         with an insn_type enum and msl with a modifier_type enum.
250         Replace element_width with a scalar_mode.  Change the shift
251         to unsigned int.  Add constructors for scalar_float_mode and
252         scalar_int_mode elements.
253         (aarch64_vect_float_const_representable_p): Delete.
254         (aarch64_can_const_movi_rtx_p)
255         (aarch64_simd_scalar_immediate_valid_for_move)
256         (aarch64_simd_make_constant): Update call to
257         aarch64_simd_valid_immediate.
258         (aarch64_advsimd_valid_immediate_hs): New function.
259         (aarch64_advsimd_valid_immediate): Likewise.
260         (aarch64_simd_valid_immediate): Remove mode and inverse
261         arguments.  Rewrite to use the above.  Use const_vec_duplicate_p
262         to detect duplicated constants and use aarch64_float_const_zero_rtx_p
263         and aarch64_float_const_representable_p on the result.
264         (aarch64_output_simd_mov_immediate): Remove mode argument.
265         Update call to aarch64_simd_valid_immediate and use of
266         simd_immediate_info.
267         (aarch64_output_scalar_simd_mov_immediate): Update call
268         accordingly.
270 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
271             Alan Hayward  <alan.hayward@arm.com>
272             David Sherwood  <david.sherwood@arm.com>
274         * machmode.h (mode_precision): Prefix with CONST_MODE_PRECISION.
275         (mode_nunits): Likewise CONST_MODE_NUNITS.
276         * machmode.def (ADJUST_NUNITS): Document.
277         * genmodes.c (mode_data::need_nunits_adj): New field.
278         (blank_mode): Update accordingly.
279         (adj_nunits): New variable.
280         (print_maybe_const_decl): Replace CATEGORY with a NEEDS_ADJ
281         parameter.
282         (emit_mode_size_inline): Set need_bytesize_adj for all modes
283         listed in adj_nunits.
284         (emit_mode_nunits_inline): Set need_nunits_adj for all modes
285         listed in adj_nunits.  Don't emit case statements for such modes.
286         (emit_insn_modes_h): Emit definitions of CONST_MODE_NUNITS
287         and CONST_MODE_PRECISION.  Make CONST_MODE_SIZE expand to
288         nothing if adj_nunits is nonnull.
289         (emit_mode_precision, emit_mode_nunits): Use print_maybe_const_decl.
290         (emit_mode_unit_size, emit_mode_base_align, emit_mode_ibit)
291         (emit_mode_fbit): Update use of print_maybe_const_decl.
292         (emit_move_size): Likewise.  Treat the array as non-const
293         if adj_nunits.
294         (emit_mode_adjustments): Handle adj_nunits.
296 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
298         * machmode.def (VECTOR_MODES_WITH_PREFIX): Document.
299         * genmodes.c (VECTOR_MODES_WITH_PREFIX): New macro.
300         (VECTOR_MODES): Use it.
301         (make_vector_modes): Take the prefix as an argument.
303 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
304             Alan Hayward  <alan.hayward@arm.com>
305             David Sherwood  <david.sherwood@arm.com>
307         * mode-classes.def (MODE_VECTOR_BOOL): New mode class.
308         * machmode.h (INTEGRAL_MODE_P, VECTOR_MODE_P): Return true
309         for MODE_VECTOR_BOOL.
310         * machmode.def (VECTOR_BOOL_MODE): Document.
311         * genmodes.c (VECTOR_BOOL_MODE): New macro.
312         (make_vector_bool_mode): New function.
313         (complete_mode, emit_mode_wider, emit_mode_adjustments): Handle
314         MODE_VECTOR_BOOL.
315         * lto-streamer-in.c (lto_input_mode_table): Likewise.
316         * rtx-vector-builder.c (rtx_vector_builder::find_cached_value):
317         Likewise.
318         * stor-layout.c (int_mode_for_mode): Likewise.
319         * tree.c (build_vector_type_for_mode): Likewise.
320         * varasm.c (output_constant_pool_2): Likewise.
321         * emit-rtl.c (init_emit_once): Make sure that CONST1_RTX (BImode) and
322         CONSTM1_RTX (BImode) are the same thing.  Initialize const_tiny_rtx
323         for MODE_VECTOR_BOOL.
324         * expr.c (expand_expr_real_1): Use VECTOR_MODE_P instead of a list
325         of mode class checks.
326         * tree-vect-generic.c (expand_vector_operation): Use VECTOR_MODE_P
327         instead of a list of mode class checks.
328         (expand_vector_scalar_condition): Likewise.
329         (type_for_widest_vector_mode): Handle BImode as an inner mode.
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         * machmode.h (mode_size): Change from unsigned short to
336         poly_uint16_pod.
337         (mode_to_bytes): Return a poly_uint16 rather than an unsigned short.
338         (GET_MODE_SIZE): Return a constant if ONLY_FIXED_SIZE_MODES,
339         or if measurement_type is not polynomial.
340         (fixed_size_mode::includes_p): Check for constant-sized modes.
341         * genmodes.c (emit_mode_size_inline): Make mode_size_inline
342         return a poly_uint16 rather than an unsigned short.
343         (emit_mode_size): Change the type of mode_size from unsigned short
344         to poly_uint16_pod.  Use ZERO_COEFFS for the initializer.
345         (emit_mode_adjustments): Cope with polynomial vector sizes.
346         * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
347         for GET_MODE_SIZE.
348         * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
349         for GET_MODE_SIZE.
350         * auto-inc-dec.c (try_merge): Treat GET_MODE_SIZE as polynomial.
351         * builtins.c (expand_ifn_atomic_compare_exchange_into_call): Likewise.
352         * caller-save.c (setup_save_areas): Likewise.
353         (replace_reg_with_saved_mem): Likewise.
354         * calls.c (emit_library_call_value_1): Likewise.
355         * combine-stack-adj.c (combine_stack_adjustments_for_block): Likewise.
356         * combine.c (simplify_set, make_extraction, simplify_shift_const_1)
357         (gen_lowpart_for_combine): Likewise.
358         * convert.c (convert_to_integer_1): Likewise.
359         * cse.c (equiv_constant, cse_insn): Likewise.
360         * cselib.c (autoinc_split, cselib_hash_rtx): Likewise.
361         (cselib_subst_to_values): Likewise.
362         * dce.c (word_dce_process_block): Likewise.
363         * df-problems.c (df_word_lr_mark_ref): Likewise.
364         * dwarf2cfi.c (init_one_dwarf_reg_size): Likewise.
365         * dwarf2out.c (multiple_reg_loc_descriptor, mem_loc_descriptor)
366         (concat_loc_descriptor, concatn_loc_descriptor, loc_descriptor)
367         (rtl_for_decl_location): Likewise.
368         * emit-rtl.c (gen_highpart, widen_memory_access): Likewise.
369         * expmed.c (extract_bit_field_1, extract_integral_bit_field): Likewise.
370         * expr.c (emit_group_load_1, clear_storage_hints): Likewise.
371         (emit_move_complex, emit_move_multi_word, emit_push_insn): Likewise.
372         (expand_expr_real_1): Likewise.
373         * function.c (assign_parm_setup_block_p, assign_parm_setup_block)
374         (pad_below): Likewise.
375         * gimple-fold.c (optimize_atomic_compare_exchange_p): Likewise.
376         * gimple-ssa-store-merging.c (rhs_valid_for_store_merging_p): Likewise.
377         * ira.c (get_subreg_tracking_sizes): Likewise.
378         * ira-build.c (ira_create_allocno_objects): Likewise.
379         * ira-color.c (coalesced_pseudo_reg_slot_compare): Likewise.
380         (ira_sort_regnos_for_alter_reg): Likewise.
381         * ira-costs.c (record_operand_costs): Likewise.
382         * lower-subreg.c (interesting_mode_p, simplify_gen_subreg_concatn)
383         (resolve_simple_move): Likewise.
384         * lra-constraints.c (get_reload_reg, operands_match_p): Likewise.
385         (process_addr_reg, simplify_operand_subreg, curr_insn_transform)
386         (lra_constraints): Likewise.
387         (CONST_POOL_OK_P): Reject variable-sized modes.
388         * lra-spills.c (slot, assign_mem_slot, pseudo_reg_slot_compare)
389         (add_pseudo_to_slot, lra_spill): Likewise.
390         * omp-low.c (omp_clause_aligned_alignment): Likewise.
391         * optabs-query.c (get_best_extraction_insn): Likewise.
392         * optabs-tree.c (expand_vec_cond_expr_p): Likewise.
393         * optabs.c (expand_vec_perm_var, expand_vec_cond_expr): Likewise.
394         (expand_mult_highpart, valid_multiword_target_p): Likewise.
395         * recog.c (offsettable_address_addr_space_p): Likewise.
396         * regcprop.c (maybe_mode_change): Likewise.
397         * reginfo.c (choose_hard_reg_mode, record_subregs_of_mode): Likewise.
398         * regrename.c (build_def_use): Likewise.
399         * regstat.c (dump_reg_info): Likewise.
400         * reload.c (complex_word_subreg_p, push_reload, find_dummy_reload)
401         (find_reloads, find_reloads_subreg_address): Likewise.
402         * reload1.c (eliminate_regs_1): Likewise.
403         * rtlanal.c (for_each_inc_dec_find_inc_dec, rtx_cost): Likewise.
404         * simplify-rtx.c (avoid_constant_pool_reference): Likewise.
405         (simplify_binary_operation_1, simplify_subreg): Likewise.
406         * targhooks.c (default_function_arg_padding): Likewise.
407         (default_hard_regno_nregs, default_class_max_nregs): Likewise.
408         * tree-cfg.c (verify_gimple_assign_binary): Likewise.
409         (verify_gimple_assign_ternary): Likewise.
410         * tree-inline.c (estimate_move_cost): Likewise.
411         * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
412         * tree-ssa-loop-ivopts.c (add_autoinc_candidates): Likewise.
413         (get_address_cost_ainc): Likewise.
414         * tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Likewise.
415         (vect_supportable_dr_alignment): Likewise.
416         * tree-vect-loop.c (vect_determine_vectorization_factor): Likewise.
417         (vectorizable_reduction): Likewise.
418         * tree-vect-stmts.c (vectorizable_assignment, vectorizable_shift)
419         (vectorizable_operation, vectorizable_load): Likewise.
420         * tree.c (build_same_sized_truth_vector_type): Likewise.
421         * valtrack.c (cleanup_auto_inc_dec): Likewise.
422         * var-tracking.c (emit_note_insn_var_location): Likewise.
423         * config/arc/arc.h (ASM_OUTPUT_CASE_END): Use as_a <scalar_int_mode>.
424         (ADDR_VEC_ALIGN): Likewise.
426 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
427             Alan Hayward  <alan.hayward@arm.com>
428             David Sherwood  <david.sherwood@arm.com>
430         * machmode.h (mode_to_bits): Return a poly_uint16 rather than an
431         unsigned short.
432         (GET_MODE_BITSIZE): Return a constant if ONLY_FIXED_SIZE_MODES,
433         or if measurement_type is polynomial.
434         * calls.c (shift_return_value): Treat GET_MODE_BITSIZE as polynomial.
435         * combine.c (make_extraction): Likewise.
436         * dse.c (find_shift_sequence): Likewise.
437         * dwarf2out.c (mem_loc_descriptor): Likewise.
438         * expmed.c (store_integral_bit_field, extract_bit_field_1): Likewise.
439         (extract_bit_field, extract_low_bits): Likewise.
440         * expr.c (convert_move, convert_modes, emit_move_insn_1): Likewise.
441         (optimize_bitfield_assignment_op, expand_assignment): Likewise.
442         (store_expr_with_bounds, store_field, expand_expr_real_1): Likewise.
443         * fold-const.c (optimize_bit_field_compare, merge_ranges): Likewise.
444         * gimple-fold.c (optimize_atomic_compare_exchange_p): Likewise.
445         * reload.c (find_reloads): Likewise.
446         * reload1.c (alter_reg): Likewise.
447         * stor-layout.c (bitwise_mode_for_mode, compute_record_mode): Likewise.
448         * targhooks.c (default_secondary_memory_needed_mode): Likewise.
449         * tree-if-conv.c (predicate_mem_writes): Likewise.
450         * tree-ssa-strlen.c (handle_builtin_memcmp): Likewise.
451         * tree-vect-patterns.c (adjust_bool_pattern): Likewise.
452         * tree-vect-stmts.c (vectorizable_simd_clone_call): Likewise.
453         * valtrack.c (dead_debug_insert_temp): Likewise.
454         * varasm.c (mergeable_constant_section): Likewise.
455         * config/sh/sh.h (LOCAL_ALIGNMENT): Use as_a <fixed_size_mode>.
457 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
458             Alan Hayward  <alan.hayward@arm.com>
459             David Sherwood  <david.sherwood@arm.com>
461         * expr.c (expand_assignment): Cope with polynomial mode sizes
462         when assigning to a CONCAT.
464 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
465             Alan Hayward  <alan.hayward@arm.com>
466             David Sherwood  <david.sherwood@arm.com>
468         * machmode.h (mode_precision): Change from unsigned short to
469         poly_uint16_pod.
470         (mode_to_precision): Return a poly_uint16 rather than an unsigned
471         short.
472         (GET_MODE_PRECISION): Return a constant if ONLY_FIXED_SIZE_MODES,
473         or if measurement_type is not polynomial.
474         (HWI_COMPUTABLE_MODE_P): Turn into a function.  Optimize the case
475         in which the mode is already known to be a scalar_int_mode.
476         * genmodes.c (emit_mode_precision): Change the type of mode_precision
477         from unsigned short to poly_uint16_pod.  Use ZERO_COEFFS for the
478         initializer.
479         * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
480         for GET_MODE_PRECISION.
481         * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
482         for GET_MODE_PRECISION.
483         * combine.c (update_rsp_from_reg_equal): Treat GET_MODE_PRECISION
484         as polynomial.
485         (try_combine, find_split_point, combine_simplify_rtx): Likewise.
486         (expand_field_assignment, make_extraction): Likewise.
487         (make_compound_operation_int, record_dead_and_set_regs_1): Likewise.
488         (get_last_value): Likewise.
489         * convert.c (convert_to_integer_1): Likewise.
490         * cse.c (cse_insn): Likewise.
491         * expr.c (expand_expr_real_1): Likewise.
492         * lra-constraints.c (simplify_operand_subreg): Likewise.
493         * optabs-query.c (can_atomic_load_p): Likewise.
494         * optabs.c (expand_atomic_load): Likewise.
495         (expand_atomic_store): Likewise.
496         * ree.c (combine_reaching_defs): Likewise.
497         * rtl.h (partial_subreg_p, paradoxical_subreg_p): Likewise.
498         * rtlanal.c (nonzero_bits1, lsb_bitfield_op_p): Likewise.
499         * tree.h (type_has_mode_precision_p): Likewise.
500         * ubsan.c (instrument_si_overflow): Likewise.
502 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
503             Alan Hayward  <alan.hayward@arm.com>
504             David Sherwood  <david.sherwood@arm.com>
506         * tree.h (TYPE_VECTOR_SUBPARTS): Turn into a function and handle
507         polynomial numbers of units.
508         (SET_TYPE_VECTOR_SUBPARTS): Likewise.
509         (valid_vector_subparts_p): New function.
510         (build_vector_type): Remove temporary shim and take the number
511         of units as a poly_uint64 rather than an int.
512         (build_opaque_vector_type): Take the number of units as a
513         poly_uint64 rather than an int.
514         * tree.c (build_vector_from_ctor): Handle polynomial
515         TYPE_VECTOR_SUBPARTS.
516         (type_hash_canon_hash, type_cache_hasher::equal): Likewise.
517         (uniform_vector_p, vector_type_mode, build_vector): Likewise.
518         (build_vector_from_val): If the number of units is variable,
519         use build_vec_duplicate_cst for constant operands and
520         VEC_DUPLICATE_EXPR otherwise.
521         (make_vector_type): Remove temporary is_constant ().
522         (build_vector_type, build_opaque_vector_type): Take the number of
523         units as a poly_uint64 rather than an int.
524         (check_vector_cst): Handle polynomial TYPE_VECTOR_SUBPARTS and
525         VECTOR_CST_NELTS.
526         * cfgexpand.c (expand_debug_expr): Likewise.
527         * expr.c (count_type_elements, categorize_ctor_elements_1): Likewise.
528         (store_constructor, expand_expr_real_1): Likewise.
529         (const_scalar_mask_from_tree): Likewise.
530         * fold-const-call.c (fold_const_reduction): Likewise.
531         * fold-const.c (const_binop, const_unop, fold_convert_const): Likewise.
532         (operand_equal_p, fold_vec_perm, fold_ternary_loc): Likewise.
533         (native_encode_vector, vec_cst_ctor_to_array): Likewise.
534         (fold_relational_const): Likewise.
535         (native_interpret_vector): Likewise.  Change the size from an
536         int to an unsigned int.
537         * gimple-fold.c (gimple_fold_stmt_to_constant_1): Handle polynomial
538         TYPE_VECTOR_SUBPARTS.
539         (gimple_fold_indirect_ref, gimple_build_vector): Likewise.
540         (gimple_build_vector_from_val): Use VEC_DUPLICATE_EXPR when
541         duplicating a non-constant operand into a variable-length vector.
542         * hsa-brig.c (hsa_op_immed::emit_to_buffer): Handle polynomial
543         TYPE_VECTOR_SUBPARTS and VECTOR_CST_NELTS.
544         * ipa-icf.c (sem_variable::equals): Likewise.
545         * match.pd: Likewise.
546         * omp-simd-clone.c (simd_clone_subparts): Likewise.
547         * print-tree.c (print_node): Likewise.
548         * stor-layout.c (layout_type): Likewise.
549         * targhooks.c (default_builtin_vectorization_cost): Likewise.
550         * tree-cfg.c (verify_gimple_comparison): Likewise.
551         (verify_gimple_assign_binary): Likewise.
552         (verify_gimple_assign_ternary): Likewise.
553         (verify_gimple_assign_single): Likewise.
554         * tree-pretty-print.c (dump_generic_node): Likewise.
555         * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
556         (simplify_bitfield_ref, is_combined_permutation_identity): Likewise.
557         * tree-vect-data-refs.c (vect_permute_store_chain): Likewise.
558         (vect_grouped_load_supported, vect_permute_load_chain): Likewise.
559         (vect_shift_permute_load_chain): Likewise.
560         * tree-vect-generic.c (nunits_for_known_piecewise_op): Likewise.
561         (expand_vector_condition, optimize_vector_constructor): Likewise.
562         (lower_vec_perm, get_compute_type): Likewise.
563         * tree-vect-loop.c (vect_determine_vectorization_factor): Likewise.
564         (get_initial_defs_for_reduction, vect_transform_loop): Likewise.
565         * tree-vect-patterns.c (vect_recog_bool_pattern): Likewise.
566         (vect_recog_mask_conversion_pattern): Likewise.
567         * tree-vect-slp.c (vect_supported_load_permutation_p): Likewise.
568         (vect_get_constant_vectors, vect_transform_slp_perm_load): Likewise.
569         * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
570         (get_group_load_store_type, vectorizable_mask_load_store): Likewise.
571         (vectorizable_bswap, simd_clone_subparts, vectorizable_assignment)
572         (vectorizable_shift, vectorizable_operation, vectorizable_store)
573         (vectorizable_load, vect_is_simple_cond, vectorizable_comparison)
574         (supportable_widening_operation): Likewise.
575         (supportable_narrowing_operation): Likewise.
576         * tree-vector-builder.c (tree_vector_builder::binary_encoded_nelts):
577         Likewise.
578         * varasm.c (output_constant): Likewise.
580 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
581             Alan Hayward  <alan.hayward@arm.com>
582             David Sherwood  <david.sherwood@arm.com>
584         * tree-vect-data-refs.c (vect_permute_store_chain): Reorganize
585         so that both the length == 3 and length != 3 cases set up their
586         own permute vectors.  Add comments explaining why we know the
587         number of elements is constant.
588         (vect_permute_load_chain): Likewise.
590 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
591             Alan Hayward  <alan.hayward@arm.com>
592             David Sherwood  <david.sherwood@arm.com>
594         * machmode.h (mode_nunits): Change from unsigned char to
595         poly_uint16_pod.
596         (ONLY_FIXED_SIZE_MODES): New macro.
597         (pod_mode::measurement_type, scalar_int_mode::measurement_type)
598         (scalar_float_mode::measurement_type, scalar_mode::measurement_type)
599         (complex_mode::measurement_type, fixed_size_mode::measurement_type):
600         New typedefs.
601         (mode_to_nunits): Return a poly_uint16 rather than an unsigned short.
602         (GET_MODE_NUNITS): Return a constant if ONLY_FIXED_SIZE_MODES,
603         or if measurement_type is not polynomial.
604         * genmodes.c (ZERO_COEFFS): New macro.
605         (emit_mode_nunits_inline): Make mode_nunits_inline return a
606         poly_uint16.
607         (emit_mode_nunits): Change the type of mode_nunits to poly_uint16_pod.
608         Use ZERO_COEFFS when emitting initializers.
609         * data-streamer.h (bp_pack_poly_value): New function.
610         (bp_unpack_poly_value): Likewise.
611         * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
612         for GET_MODE_NUNITS.
613         * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
614         for GET_MODE_NUNITS.
615         * tree.c (make_vector_type): Remove temporary shim and make
616         the real function take the number of units as a poly_uint64
617         rather than an int.
618         (build_vector_type_for_mode): Handle polynomial nunits.
619         * dwarf2out.c (loc_descriptor, add_const_value_attribute): Likewise.
620         * emit-rtl.c (const_vec_series_p_1): Likewise.
621         (gen_rtx_CONST_VECTOR): Likewise.
622         * fold-const.c (test_vec_duplicate_folding): Likewise.
623         * genrecog.c (validate_pattern): Likewise.
624         * optabs-query.c (can_vec_perm_var_p, can_mult_highpart_p): Likewise.
625         * optabs-tree.c (expand_vec_cond_expr_p): Likewise.
626         * optabs.c (expand_vector_broadcast, expand_binop_directly): Likewise.
627         (shift_amt_for_vec_perm_mask, expand_vec_perm_var): Likewise.
628         (expand_vec_cond_expr, expand_mult_highpart): Likewise.
629         * rtlanal.c (subreg_get_info): Likewise.
630         * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
631         (vect_grouped_load_supported): Likewise.
632         * tree-vect-generic.c (type_for_widest_vector_mode): Likewise.
633         * tree-vect-loop.c (have_whole_vector_shift): Likewise.
634         * simplify-rtx.c (simplify_unary_operation_1): Likewise.
635         (simplify_const_unary_operation, simplify_binary_operation_1)
636         (simplify_const_binary_operation, simplify_ternary_operation)
637         (test_vector_ops_duplicate, test_vector_ops): Likewise.
638         (simplify_immed_subreg): Use GET_MODE_NUNITS on a fixed_size_mode
639         instead of CONST_VECTOR_NUNITS.
640         * varasm.c (output_constant_pool_2): Likewise.
641         * rtx-vector-builder.c (rtx_vector_builder::build): Only include the
642         explicit-encoded elements in the XVEC for variable-length vectors.
644 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
646         * lra-constraints.c (curr_insn_transform): Use partial_subreg_p.
648 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
649             Alan Hayward  <alan.hayward@arm.com>
650             David Sherwood  <david.sherwood@arm.com>
652         * coretypes.h (fixed_size_mode): Declare.
653         (fixed_size_mode_pod): New typedef.
654         * builtins.h (target_builtins::x_apply_args_mode)
655         (target_builtins::x_apply_result_mode): Change type to
656         fixed_size_mode_pod.
657         * builtins.c (apply_args_size, apply_result_size, result_vector)
658         (expand_builtin_apply_args_1, expand_builtin_apply)
659         (expand_builtin_return): Update accordingly.
661 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
663         * cse.c (hash_rtx_cb): Hash only the encoded elements.
664         * cselib.c (cselib_hash_rtx): Likewise.
665         * expmed.c (make_tree): Build VECTOR_CSTs directly from the
666         CONST_VECTOR encoding.
668 2017-01-03  Jakub Jelinek  <jakub@redhat.com>
669             Jeff Law  <law@redhat.com>
671         PR target/83641
672         * config/i386/i386.c (ix86_adjust_stack_and_probe_stack_clash): For
673         noreturn probe, use gen_pop instead of ix86_emit_restore_reg_using_pop,
674         only set RTX_FRAME_RELATED_P on both the push and pop if cfa_reg is sp
675         and add REG_CFA_ADJUST_CFA notes in that case to both insns.
677         PR target/83641
678         * config/i386/i386.c (ix86_adjust_stack_and_probe_stack_clash): Do not
679         explicitly probe *sp in a noreturn function if there were any callee
680         register saves or frame pointer is needed.
682 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
684         PR debug/83621
685         * cfgexpand.c (expand_debug_expr): Return NULL if mode is
686         BLKmode for ternary, binary or unary expressions.
688         PR debug/83645
689         * var-tracking.c (delete_vta_debug_insn): New inline function.
690         (delete_vta_debug_insns): Add USE_CFG argument, if true, walk just
691         insns from get_insns () to NULL instead of each bb separately.
692         Use delete_vta_debug_insn.  No longer static.
693         (vt_debug_insns_local, variable_tracking_main_1): Adjust
694         delete_vta_debug_insns callers.
695         * rtl.h (delete_vta_debug_insns): Declare.
696         * final.c (rest_of_handle_final): Call delete_vta_debug_insns
697         instead of variable_tracking_main.
699 2018-01-03  Martin Sebor  <msebor@redhat.com>
701         PR tree-optimization/83603
702         * calls.c (maybe_warn_nonstring_arg): Avoid accessing function
703         arguments past the endof the argument list in functions declared
704         without a prototype.
705         * gimple-ssa-warn-restrict.c (wrestrict_dom_walker::check_call):
706         Avoid checking when arguments are null.
708 2018-01-03  Martin Sebor  <msebor@redhat.com>
710         PR c/83559
711         * doc/extend.texi (attribute const): Fix a typo.
712         * ipa-pure-const.c ((warn_function_const, warn_function_pure): Avoid
713         issuing -Wsuggest-attribute for void functions.
715 2018-01-03  Martin Sebor  <msebor@redhat.com>
717         * gimple-ssa-warn-restrict.c (builtin_memref::builtin_memref): Use
718         offset_int::from instead of wide_int::to_shwi.
719         (maybe_diag_overlap): Remove assertion.
720         Use HOST_WIDE_INT_PRINT_DEC instead of %lli.
721         * gimple-ssa-sprintf.c (format_directive): Same.
722         (parse_directive): Same.
723         (sprintf_dom_walker::compute_format_length): Same.
724         (try_substitute_return_value): Same.
726 2017-01-03  Jeff Law  <law@redhat.com>
728         PR middle-end/83654
729         * explow.c (anti_adjust_stack_and_probe_stack_clash): Test a
730         non-constant residual for zero at runtime and avoid probing in
731         that case.  Reorganize code for trailing problem to mirror handling
732         of the residual.
734 2018-01-03  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
736         PR tree-optimization/83501
737         * tree-ssa-strlen.c (get_string_cst): New.
738         (handle_char_store): Call get_string_cst.
740 2018-01-03  Martin Liska  <mliska@suse.cz>
742         PR tree-optimization/83593
743         * tree-ssa-strlen.c: Include tree-cfg.h.
744         (strlen_check_and_optimize_stmt): Add new argument cleanup_eh.
745         (strlen_dom_walker): Add new member variable m_cleanup_cfg.
746         (strlen_dom_walker::strlen_dom_walker): Initialize m_cleanup_cfg
747         to false.
748         (strlen_dom_walker::before_dom_children): Call
749         gimple_purge_dead_eh_edges. Dump tranformation with details
750         dump flags.
751         (strlen_dom_walker::before_dom_children): Update call by adding
752         new argument cleanup_eh.
753         (pass_strlen::execute): Return TODO_cleanup_cfg if needed.
755 2018-01-03  Martin Liska  <mliska@suse.cz>
757         PR ipa/83549
758         * cif-code.def (VARIADIC_THUNK): New enum value.
759         * ipa-fnsummary.c (compute_fn_summary): Do not inline variadic
760         thunks.
762 2018-01-03  Jan Beulich  <jbeulich@suse.com>
764         * sse.md (mov<mode>_internal): Tighten condition for when to use
765         vmovdqu<ssescalarsize> for TI and OI modes.
767 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
769         Update copyright years.
771 2018-01-03  Martin Liska  <mliska@suse.cz>
773         PR ipa/83594
774         * ipa-visibility.c (function_and_variable_visibility): Skip
775         functions with noipa attribure.
777 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
779         * gcc.c (process_command): Update copyright notice dates.
780         * gcov-dump.c (print_version): Ditto.
781         * gcov.c (print_version): Ditto.
782         * gcov-tool.c (print_version): Ditto.
783         * gengtype.c (create_file): Ditto.
784         * doc/cpp.texi: Bump @copying's copyright year.
785         * doc/cppinternals.texi: Ditto.
786         * doc/gcc.texi: Ditto.
787         * doc/gccint.texi: Ditto.
788         * doc/gcov.texi: Ditto.
789         * doc/install.texi: Ditto.
790         * doc/invoke.texi: Ditto.
792 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
794         * vector-builder.h (vector_builder::m_full_nelts): Change from
795         unsigned int to poly_uint64.
796         (vector_builder::full_nelts): Update prototype accordingly.
797         (vector_builder::new_vector): Likewise.
798         (vector_builder::encoded_full_vector_p): Handle polynomial full_nelts.
799         (vector_builder::operator ==): Likewise.
800         (vector_builder::finalize): Likewise.
801         * int-vector-builder.h (int_vector_builder::int_vector_builder):
802         Take the number of elements as a poly_uint64 rather than an
803         unsigned int.
804         * vec-perm-indices.h (vec_perm_indices::m_nelts_per_input): Change
805         from unsigned int to poly_uint64.
806         (vec_perm_indices::vec_perm_indices): Update prototype accordingly.
807         (vec_perm_indices::new_vector): Likewise.
808         (vec_perm_indices::length): Likewise.
809         (vec_perm_indices::nelts_per_input): Likewise.
810         (vec_perm_indices::input_nelts): Likewise.
811         * vec-perm-indices.c (vec_perm_indices::new_vector): Take the
812         number of elements per input as a poly_uint64 rather than an
813         unsigned int.  Use the original encoding for variable-length
814         vectors, rather than clamping each individual element.
815         For the second and subsequent elements in each pattern,
816         clamp the step and base before clamping their sum.
817         (vec_perm_indices::series_p): Handle polynomial element counts.
818         (vec_perm_indices::all_in_range_p): Likewise.
819         (vec_perm_indices_to_tree): Likewise.
820         (vec_perm_indices_to_rtx): Likewise.
821         * tree-vect-stmts.c (vect_gen_perm_mask_any): Likewise.
822         * tree-vector-builder.c (tree_vector_builder::new_unary_operation)
823         (tree_vector_builder::new_binary_operation): Handle polynomial
824         element counts.  Return false if we need to know the number
825         of elements at compile time.
826         * fold-const.c (fold_vec_perm): Punt if the number of elements
827         isn't known at compile time.
829 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
831         * vec-perm-indices.h (vec_perm_builder): Change element type
832         from HOST_WIDE_INT to poly_int64.
833         (vec_perm_indices::element_type): Update accordingly.
834         (vec_perm_indices::clamp): Handle polynomial element_types.
835         * vec-perm-indices.c (vec_perm_indices::series_p): Likewise.
836         (vec_perm_indices::all_in_range_p): Likewise.
837         (tree_to_vec_perm_builder): Check for poly_int64 trees rather
838         than shwi trees.
839         * vector-builder.h (vector_builder::stepped_sequence_p): Handle
840         polynomial vec_perm_indices element types.
841         * int-vector-builder.h (int_vector_builder::equal_p): Likewise.
842         * fold-const.c (fold_vec_perm): Likewise.
843         * optabs.c (shift_amt_for_vec_perm_mask): Likewise.
844         * tree-vect-generic.c (lower_vec_perm): Likewise.
845         * tree-vect-slp.c (vect_transform_slp_perm_load): Likewise.
846         * config/aarch64/aarch64.c (aarch64_evpc_tbl): Cast d->perm
847         element type to HOST_WIDE_INT.
849 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
850             Alan Hayward  <alan.hayward@arm.com>
851             David Sherwood  <david.sherwood@arm.com>
853         * alias.c (addr_side_effect_eval): Take the size as a poly_int64
854         rather than an int.  Use plus_constant.
855         (memrefs_conflict_p): Take the sizes as poly_int64s rather than ints.
856         Take the offset "c" as a poly_int64 rather than a HOST_WIDE_INT.
858 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
859             Alan Hayward  <alan.hayward@arm.com>
860             David Sherwood  <david.sherwood@arm.com>
862         * calls.c (emit_call_1, expand_call): Change struct_value_size from
863         a HOST_WIDE_INT to a poly_int64.
865 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
866             Alan Hayward  <alan.hayward@arm.com>
867             David Sherwood  <david.sherwood@arm.com>
869         * calls.c (load_register_parameters): Cope with polynomial
870         mode sizes.  Require a constant size for BLKmode parameters
871         that aren't described by a PARALLEL.  If BLOCK_REG_PADDING
872         forces a parameter to be padded at the lsb end in order to
873         fill a complete number of words, require the parameter size
874         to be ordered wrt UNITS_PER_WORD.
876 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
877             Alan Hayward  <alan.hayward@arm.com>
878             David Sherwood  <david.sherwood@arm.com>
880         * reload1.c (spill_stack_slot_width): Change element type
881         from unsigned int to poly_uint64_pod.
882         (alter_reg): Treat mode sizes as polynomial.
884 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
885             Alan Hayward  <alan.hayward@arm.com>
886             David Sherwood  <david.sherwood@arm.com>
888         * reload.c (complex_word_subreg_p): New function.
889         (reload_inner_reg_of_subreg, push_reload): Use it.
891 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
892             Alan Hayward  <alan.hayward@arm.com>
893             David Sherwood  <david.sherwood@arm.com>
895         * lra-constraints.c (process_alt_operands): Reject matched
896         operands whose sizes aren't ordered.
897         (match_reload): Refer to this check here.
899 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
900             Alan Hayward  <alan.hayward@arm.com>
901             David Sherwood  <david.sherwood@arm.com>
903         * builtins.c (expand_ifn_atomic_compare_exchange_into_call): Assert
904         that the mode size is in the set {1, 2, 4, 8, 16}.
906 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
907             Alan Hayward  <alan.hayward@arm.com>
908             David Sherwood  <david.sherwood@arm.com>
910         * var-tracking.c (adjust_mems): Treat mode sizes as polynomial.
911         Use plus_constant instead of gen_rtx_PLUS.
913 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
914             Alan Hayward  <alan.hayward@arm.com>
915             David Sherwood  <david.sherwood@arm.com>
917         * config/cr16/cr16-protos.h (cr16_push_rounding): Declare.
918         * config/cr16/cr16.h (PUSH_ROUNDING): Move implementation to...
919         * config/cr16/cr16.c (cr16_push_rounding): ...this new function.
920         * config/h8300/h8300-protos.h (h8300_push_rounding): Declare.
921         * config/h8300/h8300.h (PUSH_ROUNDING): Move implementation to...
922         * config/h8300/h8300.c (h8300_push_rounding): ...this new function.
923         * config/i386/i386-protos.h (ix86_push_rounding): Declare.
924         * config/i386/i386.h (PUSH_ROUNDING): Move implementation to...
925         * config/i386/i386.c (ix86_push_rounding): ...this new function.
926         * config/m32c/m32c-protos.h (m32c_push_rounding): Take and return
927         a poly_int64.
928         * config/m32c/m32c.c (m32c_push_rounding): Likewise.
929         * config/m68k/m68k-protos.h (m68k_push_rounding): Declare.
930         * config/m68k/m68k.h (PUSH_ROUNDING): Move implementation to...
931         * config/m68k/m68k.c (m68k_push_rounding): ...this new function.
932         * config/pdp11/pdp11-protos.h (pdp11_push_rounding): Declare.
933         * config/pdp11/pdp11.h (PUSH_ROUNDING): Move implementation to...
934         * config/pdp11/pdp11.c (pdp11_push_rounding): ...this new function.
935         * config/stormy16/stormy16-protos.h (xstormy16_push_rounding): Declare.
936         * config/stormy16/stormy16.h (PUSH_ROUNDING): Move implementation to...
937         * config/stormy16/stormy16.c (xstormy16_push_rounding): ...this new
938         function.
939         * expr.c (emit_move_resolve_push): Treat the input and result
940         of PUSH_ROUNDING as a poly_int64.
941         (emit_move_complex_push, emit_single_push_insn_1): Likewise.
942         (emit_push_insn): Likewise.
943         * lra-eliminations.c (mark_not_eliminable): Likewise.
944         * recog.c (push_operand): Likewise.
945         * reload1.c (elimination_effects): Likewise.
946         * rtlanal.c (nonzero_bits1): Likewise.
947         * calls.c (store_one_arg): Likewise.  Require the padding to be
948         known at compile time.
950 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
951             Alan Hayward  <alan.hayward@arm.com>
952             David Sherwood  <david.sherwood@arm.com>
954         * expr.c (emit_single_push_insn_1): Treat mode sizes as polynomial.
955         Use plus_constant instead of gen_rtx_PLUS.
957 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
958             Alan Hayward  <alan.hayward@arm.com>
959             David Sherwood  <david.sherwood@arm.com>
961         * auto-inc-dec.c (set_inc_state): Take the mode size as a poly_int64
962         rather than an int.
964 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
965             Alan Hayward  <alan.hayward@arm.com>
966             David Sherwood  <david.sherwood@arm.com>
968         * expr.c (expand_expr_real_1): Use tree_to_poly_uint64
969         instead of int_size_in_bytes when handling VIEW_CONVERT_EXPRs
970         via stack temporaries.  Treat the mode size as polynomial too.
972 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
973             Alan Hayward  <alan.hayward@arm.com>
974             David Sherwood  <david.sherwood@arm.com>
976         * expr.c (expand_expr_real_2): When handling conversions involving
977         unions, apply tree_to_poly_uint64 to the TYPE_SIZE rather than
978         multiplying int_size_in_bytes by BITS_PER_UNIT.  Treat GET_MODE_BISIZE
979         as a poly_uint64 too.
981 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
982             Alan Hayward  <alan.hayward@arm.com>
983             David Sherwood  <david.sherwood@arm.com>
985         * rtlanal.c (subreg_get_info): Handle polynomial mode sizes.
987 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
988             Alan Hayward  <alan.hayward@arm.com>
989             David Sherwood  <david.sherwood@arm.com>
991         * combine.c (can_change_dest_mode): Handle polynomial
992         REGMODE_NATURAL_SIZE.
993         * expmed.c (store_bit_field_1): Likewise.
994         * expr.c (store_constructor): Likewise.
995         * emit-rtl.c (validate_subreg): Operate on polynomial mode sizes
996         and polynomial REGMODE_NATURAL_SIZE.
997         (gen_lowpart_common): Likewise.
998         * reginfo.c (record_subregs_of_mode): Likewise.
999         * rtlanal.c (read_modify_subreg_p): Likewise.
1001 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1002             Alan Hayward  <alan.hayward@arm.com>
1003             David Sherwood  <david.sherwood@arm.com>
1005         * internal-fn.c (expand_vector_ubsan_overflow): Handle polynomial
1006         numbers of elements.
1008 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1009             Alan Hayward  <alan.hayward@arm.com>
1010             David Sherwood  <david.sherwood@arm.com>
1012         * match.pd: Cope with polynomial numbers of vector elements.
1014 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1015             Alan Hayward  <alan.hayward@arm.com>
1016             David Sherwood  <david.sherwood@arm.com>
1018         * fold-const.c (fold_indirect_ref_1): Handle polynomial offsets
1019         in a POINTER_PLUS_EXPR.
1021 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1022             Alan Hayward  <alan.hayward@arm.com>
1023             David Sherwood  <david.sherwood@arm.com>
1025         * omp-simd-clone.c (simd_clone_subparts): New function.
1026         (simd_clone_init_simd_arrays): Use it instead of TYPE_VECTOR_SUBPARTS.
1027         (ipa_simd_modify_function_body): Likewise.
1029 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1030             Alan Hayward  <alan.hayward@arm.com>
1031             David Sherwood  <david.sherwood@arm.com>
1033         * tree-vect-generic.c (nunits_for_known_piecewise_op): New function.
1034         (expand_vector_piecewise): Use it instead of TYPE_VECTOR_SUBPARTS.
1035         (expand_vector_addition, add_rshift, expand_vector_divmod): Likewise.
1036         (expand_vector_condition, vector_element): Likewise.
1037         (subparts_gt): New function.
1038         (get_compute_type): Use subparts_gt.
1039         (count_type_subparts): Delete.
1040         (expand_vector_operations_1): Use subparts_gt instead of
1041         count_type_subparts.
1043 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1044             Alan Hayward  <alan.hayward@arm.com>
1045             David Sherwood  <david.sherwood@arm.com>
1047         * tree-vect-data-refs.c (vect_no_alias_p): Replace with...
1048         (vect_compile_time_alias): ...this new function.  Do the calculation
1049         on poly_ints rather than trees.
1050         (vect_prune_runtime_alias_test_list): Update call accordingly.
1052 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1053             Alan Hayward  <alan.hayward@arm.com>
1054             David Sherwood  <david.sherwood@arm.com>
1056         * tree-vect-slp.c (vect_build_slp_tree_1): Handle polynomial
1057         numbers of units.
1058         (vect_schedule_slp_instance): Likewise.
1060 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1061             Alan Hayward  <alan.hayward@arm.com>
1062             David Sherwood  <david.sherwood@arm.com>
1064         * tree-vect-slp.c (vect_get_and_check_slp_defs): Reject
1065         constant and extern definitions for variable-length vectors.
1066         (vect_get_constant_vectors): Note that the number of units
1067         is known to be constant.
1069 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1070             Alan Hayward  <alan.hayward@arm.com>
1071             David Sherwood  <david.sherwood@arm.com>
1073         * tree-vect-stmts.c (vectorizable_conversion): Treat the number
1074         of units as polynomial.  Choose between WIDE and NARROW based
1075         on multiple_p.
1077 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1078             Alan Hayward  <alan.hayward@arm.com>
1079             David Sherwood  <david.sherwood@arm.com>
1081         * tree-vect-stmts.c (simd_clone_subparts): New function.
1082         (vectorizable_simd_clone_call): Use it instead of TYPE_VECTOR_SUBPARTS.
1084 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1085             Alan Hayward  <alan.hayward@arm.com>
1086             David Sherwood  <david.sherwood@arm.com>
1088         * tree-vect-stmts.c (vectorizable_call): Treat the number of
1089         vectors as polynomial.  Use build_index_vector for
1090         IFN_GOMP_SIMD_LANE.
1092 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1093             Alan Hayward  <alan.hayward@arm.com>
1094             David Sherwood  <david.sherwood@arm.com>
1096         * tree-vect-stmts.c (get_load_store_type): Treat the number of
1097         units as polynomial.  Reject VMAT_ELEMENTWISE and VMAT_STRIDED_SLP
1098         for variable-length vectors.
1099         (vectorizable_mask_load_store): Treat the number of units as
1100         polynomial, asserting that it is constant if the condition has
1101         already been enforced.
1102         (vectorizable_store, vectorizable_load): Likewise.
1104 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1105             Alan Hayward  <alan.hayward@arm.com>
1106             David Sherwood  <david.sherwood@arm.com>
1108         * tree-vect-loop.c (vectorizable_live_operation): Treat the number
1109         of units as polynomial.  Punt if we can't tell at compile time
1110         which vector contains the final result.
1112 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1113             Alan Hayward  <alan.hayward@arm.com>
1114             David Sherwood  <david.sherwood@arm.com>
1116         * tree-vect-loop.c (vectorizable_induction): Treat the number
1117         of units as polynomial.  Punt on SLP inductions.  Use an integer
1118         VEC_SERIES_EXPR for variable-length integer reductions.  Use a
1119         cast of such a series for variable-length floating-point
1120         reductions.
1122 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1123             Alan Hayward  <alan.hayward@arm.com>
1124             David Sherwood  <david.sherwood@arm.com>
1126         * tree.h (build_index_vector): Declare.
1127         * tree.c (build_index_vector): New function.
1128         * tree-vect-loop.c (get_initial_defs_for_reduction): Treat the number
1129         of units as polynomial, forcibly converting it to a constant if
1130         vectorizable_reduction has already enforced the condition.
1131         (vect_create_epilog_for_reduction): Likewise.  Use build_index_vector
1132         to create a {1,2,3,...} vector.
1133         (vectorizable_reduction): Treat the number of units as polynomial.
1134         Choose vectype_in based on the largest scalar element size rather
1135         than the smallest number of units.  Enforce the restrictions
1136         relied on above.
1138 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1139             Alan Hayward  <alan.hayward@arm.com>
1140             David Sherwood  <david.sherwood@arm.com>
1142         * tree-vect-data-refs.c (vector_alignment_reachable_p): Treat the
1143         number of units as polynomial.
1145 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1146             Alan Hayward  <alan.hayward@arm.com>
1147             David Sherwood  <david.sherwood@arm.com>
1149         * target.h (vector_sizes, auto_vector_sizes): New typedefs.
1150         * target.def (autovectorize_vector_sizes): Return the vector sizes
1151         by pointer, using vector_sizes rather than a bitmask.
1152         * targhooks.h (default_autovectorize_vector_sizes): Update accordingly.
1153         * targhooks.c (default_autovectorize_vector_sizes): Likewise.
1154         * config/aarch64/aarch64.c (aarch64_autovectorize_vector_sizes):
1155         Likewise.
1156         * config/arc/arc.c (arc_autovectorize_vector_sizes): Likewise.
1157         * config/arm/arm.c (arm_autovectorize_vector_sizes): Likewise.
1158         * config/i386/i386.c (ix86_autovectorize_vector_sizes): Likewise.
1159         * config/mips/mips.c (mips_autovectorize_vector_sizes): Likewise.
1160         * omp-general.c (omp_max_vf): Likewise.
1161         * omp-low.c (omp_clause_aligned_alignment): Likewise.
1162         * optabs-query.c (can_vec_mask_load_store_p): Likewise.
1163         * tree-vect-loop.c (vect_analyze_loop): Likewise.
1164         * tree-vect-slp.c (vect_slp_bb): Likewise.
1165         * doc/tm.texi: Regenerate.
1166         * tree-vectorizer.h (current_vector_size): Change from an unsigned int
1167         to a poly_uint64.
1168         * tree-vect-stmts.c (get_vectype_for_scalar_type_and_size): Take
1169         the vector size as a poly_uint64 rather than an unsigned int.
1170         (current_vector_size): Change from an unsigned int to a poly_uint64.
1171         (get_vectype_for_scalar_type): Update accordingly.
1172         * tree.h (build_truth_vector_type): Take the size and number of
1173         units as a poly_uint64 rather than an unsigned int.
1174         (build_vector_type): Add a temporary overload that takes
1175         the number of units as a poly_uint64 rather than an unsigned int.
1176         * tree.c (make_vector_type): Likewise.
1177         (build_truth_vector_type): Take the number of units as a poly_uint64
1178         rather than an unsigned int.
1180 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1181             Alan Hayward  <alan.hayward@arm.com>
1182             David Sherwood  <david.sherwood@arm.com>
1184         * target.def (get_mask_mode): Take the number of units and length
1185         as poly_uint64s rather than unsigned ints.
1186         * targhooks.h (default_get_mask_mode): Update accordingly.
1187         * targhooks.c (default_get_mask_mode): Likewise.
1188         * config/i386/i386.c (ix86_get_mask_mode): Likewise.
1189         * doc/tm.texi: Regenerate.
1191 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1192             Alan Hayward  <alan.hayward@arm.com>
1193             David Sherwood  <david.sherwood@arm.com>
1195         * omp-general.h (omp_max_vf): Return a poly_uint64 instead of an int.
1196         * omp-general.c (omp_max_vf): Likewise.
1197         * omp-expand.c (omp_adjust_chunk_size): Update call to omp_max_vf.
1198         (expand_omp_simd): Handle polynomial safelen.
1199         * omp-low.c (omplow_simd_context): Add a default constructor.
1200         (omplow_simd_context::max_vf): Change from int to poly_uint64.
1201         (lower_rec_simd_input_clauses): Update accordingly.
1202         (lower_rec_input_clauses): Likewise.
1204 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1205             Alan Hayward  <alan.hayward@arm.com>
1206             David Sherwood  <david.sherwood@arm.com>
1208         * tree-vectorizer.h (vect_nunits_for_cost): New function.
1209         * tree-vect-loop.c (vect_model_reduction_cost): Use it.
1210         * tree-vect-slp.c (vect_analyze_slp_cost_1): Likewise.
1211         (vect_analyze_slp_cost): Likewise.
1212         * tree-vect-stmts.c (vect_model_store_cost): Likewise.
1213         (vect_model_load_cost): Likewise.
1215 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1216             Alan Hayward  <alan.hayward@arm.com>
1217             David Sherwood  <david.sherwood@arm.com>
1219         * tree-vect-slp.c (vect_record_max_nunits, vect_build_slp_tree_1)
1220         (vect_build_slp_tree_2, vect_build_slp_tree): Change max_nunits
1221         from an unsigned int * to a poly_uint64_pod *.
1222         (calculate_unrolling_factor): New function.
1223         (vect_analyze_slp_instance): Use it.  Track polynomial max_nunits.
1225 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1226             Alan Hayward  <alan.hayward@arm.com>
1227             David Sherwood  <david.sherwood@arm.com>
1229         * tree-vectorizer.h (_slp_instance::unrolling_factor): Change
1230         from an unsigned int to a poly_uint64.
1231         (_loop_vec_info::slp_unrolling_factor): Likewise.
1232         (_loop_vec_info::vectorization_factor): Change from an int
1233         to a poly_uint64.
1234         (MAX_VECTORIZATION_FACTOR): Bump from 64 to INT_MAX.
1235         (vect_get_num_vectors): New function.
1236         (vect_update_max_nunits, vect_vf_for_cost): Likewise.
1237         (vect_get_num_copies): Use vect_get_num_vectors.
1238         (vect_analyze_data_ref_dependences): Change max_vf from an int *
1239         to an unsigned int *.
1240         (vect_analyze_data_refs): Change min_vf from an int * to a
1241         poly_uint64 *.
1242         (vect_transform_slp_perm_load): Take the vf as a poly_uint64 rather
1243         than an unsigned HOST_WIDE_INT.
1244         * tree-vect-data-refs.c (vect_analyze_possibly_independent_ddr)
1245         (vect_analyze_data_ref_dependence): Change max_vf from an int *
1246         to an unsigned int *.
1247         (vect_analyze_data_ref_dependences): Likewise.
1248         (vect_compute_data_ref_alignment): Handle polynomial vf.
1249         (vect_enhance_data_refs_alignment): Likewise.
1250         (vect_prune_runtime_alias_test_list): Likewise.
1251         (vect_shift_permute_load_chain): Likewise.
1252         (vect_supportable_dr_alignment): Likewise.
1253         (dependence_distance_ge_vf): Take the vectorization factor as a
1254         poly_uint64 rather than an unsigned HOST_WIDE_INT.
1255         (vect_analyze_data_refs): Change min_vf from an int * to a
1256         poly_uint64 *.
1257         * tree-vect-loop-manip.c (vect_gen_scalar_loop_niters): Take
1258         vfm1 as a poly_uint64 rather than an int.  Make the same change
1259         for the returned bound_scalar.
1260         (vect_gen_vector_loop_niters): Handle polynomial vf.
1261         (vect_do_peeling): Likewise.  Update call to
1262         vect_gen_scalar_loop_niters and handle polynomial bound_scalars.
1263         (vect_gen_vector_loop_niters_mult_vf): Assert that the vf must
1264         be constant.
1265         * tree-vect-loop.c (vect_determine_vectorization_factor)
1266         (vect_update_vf_for_slp, vect_analyze_loop_2): Handle polynomial vf.
1267         (vect_get_known_peeling_cost): Likewise.
1268         (vect_estimate_min_profitable_iters, vectorizable_reduction): Likewise.
1269         (vect_worthwhile_without_simd_p, vectorizable_induction): Likewise.
1270         (vect_transform_loop): Likewise.  Use the lowest possible VF when
1271         updating the upper bounds of the loop.
1272         (vect_min_worthwhile_factor): Make static.  Return an unsigned int
1273         rather than an int.
1274         * tree-vect-slp.c (vect_attempt_slp_rearrange_stmts): Cope with
1275         polynomial unroll factors.
1276         (vect_analyze_slp_cost_1, vect_analyze_slp_instance): Likewise.
1277         (vect_make_slp_decision): Likewise.
1278         (vect_supported_load_permutation_p): Likewise, and polynomial
1279         vf too.
1280         (vect_analyze_slp_cost): Handle polynomial vf.
1281         (vect_slp_analyze_node_operations): Likewise.
1282         (vect_slp_analyze_bb_1): Likewise.
1283         (vect_transform_slp_perm_load): Take the vf as a poly_uint64 rather
1284         than an unsigned HOST_WIDE_INT.
1285         * tree-vect-stmts.c (vectorizable_simd_clone_call, vectorizable_store)
1286         (vectorizable_load): Handle polynomial vf.
1287         * tree-vectorizer.c (simduid_to_vf::vf): Change from an int to
1288         a poly_uint64.
1289         (adjust_simduid_builtins, shrink_simd_arrays): Update accordingly.
1291 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1292             Alan Hayward  <alan.hayward@arm.com>
1293             David Sherwood  <david.sherwood@arm.com>
1295         * match.pd: Handle bit operations involving three constants
1296         and try to fold one pair.
1298 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1300         * tree-vect-loop-manip.c: Include gimple-fold.h.
1301         (slpeel_make_loop_iterate_ntimes): Add step, final_iv and
1302         niters_maybe_zero parameters.  Handle other cases besides a step of 1.
1303         (vect_gen_vector_loop_niters): Add a step_vector_ptr parameter.
1304         Add a path that uses a step of VF instead of 1, but disable it
1305         for now.
1306         (vect_do_peeling): Add step_vector, niters_vector_mult_vf_var
1307         and niters_no_overflow parameters.  Update calls to
1308         slpeel_make_loop_iterate_ntimes and vect_gen_vector_loop_niters.
1309         Create a new SSA name if the latter choses to use a ste other
1310         than zero, and return it via niters_vector_mult_vf_var.
1311         * tree-vect-loop.c (vect_transform_loop): Update calls to
1312         vect_do_peeling, vect_gen_vector_loop_niters and
1313         slpeel_make_loop_iterate_ntimes.
1314         * tree-vectorizer.h (slpeel_make_loop_iterate_ntimes, vect_do_peeling)
1315         (vect_gen_vector_loop_niters): Update declarations after above changes.
1317 2018-01-02  Michael Meissner  <meissner@linux.vnet.ibm.com>
1319         * config/rs6000/rs6000.md (floor<mode>2): Add support for IEEE
1320         128-bit round to integer instructions.
1321         (ceil<mode>2): Likewise.
1322         (btrunc<mode>2): Likewise.
1323         (round<mode>2): Likewise.
1325 2018-01-02  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>
1327         * config/rs6000/rs6000-string.c (expand_block_move): Allow the use of
1328         unaligned VSX load/store on P8/P9.
1329         (expand_block_clear): Allow the use of unaligned VSX
1330         load/store on P8/P9.
1332 2018-01-02  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
1334         * config/rs6000/rs6000-p8swap.c (swap_feeds_both_load_and_store):
1335         New function.
1336         (rs6000_analyze_swaps): Mark a web unoptimizable if it contains a
1337         swap associated with both a load and a store.
1339 2018-01-02  Andrew Waterman  <andrew@sifive.com>
1341         * config/riscv/linux.h (ICACHE_FLUSH_FUNC): New.
1342         * config/riscv/riscv.md (clear_cache): Use it.
1344 2018-01-02  Artyom Skrobov  <tyomitch@gmail.com>
1346         * web.c: Remove out-of-date comment.
1348 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1350         * expr.c (fixup_args_size_notes): Check that any existing
1351         REG_ARGS_SIZE notes are correct, and don't try to re-add them.
1352         (emit_single_push_insn_1): Move stack_pointer_delta adjustment to...
1353         (emit_single_push_insn): ...here.
1355 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1357         * rtl.h (CONST_VECTOR_ELT): Redefine to const_vector_elt.
1358         (const_vector_encoded_nelts): New function.
1359         (CONST_VECTOR_NUNITS): Redefine to use GET_MODE_NUNITS.
1360         (const_vector_int_elt, const_vector_elt): Declare.
1361         * emit-rtl.c (const_vector_int_elt_1): New function.
1362         (const_vector_elt): Likewise.
1363         * simplify-rtx.c (simplify_immed_subreg): Avoid taking the address
1364         of CONST_VECTOR_ELT.
1366 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1368         * expr.c: Include rtx-vector-builder.h.
1369         (const_vector_mask_from_tree): Use rtx_vector_builder and operate
1370         directly on the tree encoding.
1371         (const_vector_from_tree): Likewise.
1372         * optabs.c: Include rtx-vector-builder.h.
1373         (expand_vec_perm_var): Use rtx_vector_builder and create a repeating
1374         sequence of "u" values.
1375         * vec-perm-indices.c: Include rtx-vector-builder.h.
1376         (vec_perm_indices_to_rtx): Use rtx_vector_builder and operate
1377         directly on the vec_perm_indices encoding.
1379 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1381         * doc/rtl.texi (const_vector): Describe new encoding scheme.
1382         * Makefile.in (OBJS): Add rtx-vector-builder.o.
1383         * rtx-vector-builder.h: New file.
1384         * rtx-vector-builder.c: Likewise.
1385         * rtl.h (rtx_def::u2): Add a const_vector field.
1386         (CONST_VECTOR_NPATTERNS): New macro.
1387         (CONST_VECTOR_NELTS_PER_PATTERN): Likewise.
1388         (CONST_VECTOR_DUPLICATE_P): Likewise.
1389         (CONST_VECTOR_STEPPED_P): Likewise.
1390         (CONST_VECTOR_ENCODED_ELT): Likewise.
1391         (const_vec_duplicate_p): Check for a duplicated vector encoding.
1392         (unwrap_const_vec_duplicate): Likewise.
1393         (const_vec_series_p): Check for a non-duplicated vector encoding.
1394         Say that the function only returns true for integer vectors.
1395         * emit-rtl.c: Include rtx-vector-builder.h.
1396         (gen_const_vec_duplicate_1): Delete.
1397         (gen_const_vector): Call gen_const_vec_duplicate instead of
1398         gen_const_vec_duplicate_1.
1399         (const_vec_series_p_1): Operate directly on the CONST_VECTOR encoding.
1400         (gen_const_vec_duplicate): Use rtx_vector_builder.
1401         (gen_const_vec_series): Likewise.
1402         (gen_rtx_CONST_VECTOR): Likewise.
1403         * config/powerpcspe/powerpcspe.c: Include rtx-vector-builder.h.
1404         (swap_const_vector_halves): Take an rtx pointer rather than rtx.
1405         Build a new vector rather than modifying a CONST_VECTOR in-place.
1406         (handle_special_swappables): Update call accordingly.
1407         * config/rs6000/rs6000-p8swap.c: Include rtx-vector-builder.h.
1408         (swap_const_vector_halves): Take an rtx pointer rather than rtx.
1409         Build a new vector rather than modifying a CONST_VECTOR in-place.
1410         (handle_special_swappables): Update call accordingly.
1412 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1414         * simplify-rtx.c (simplify_const_binary_operation): Use
1415         CONST_VECTOR_ELT instead of XVECEXP.
1417 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1419         * tree-cfg.c (verify_gimple_assign_ternary): Allow the size of
1420         the selector elements to be different from the data elements
1421         if the selector is a VECTOR_CST.
1422         * tree-vect-stmts.c (vect_gen_perm_mask_any): Use a vector of
1423         ssizetype for the selector.
1425 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1427         * optabs.c (shift_amt_for_vec_perm_mask): Try using series_p
1428         before testing each element individually.
1429         * tree-vect-generic.c (lower_vec_perm): Likewise.
1431 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1433         * selftest.h (selftest::vec_perm_indices_c_tests): Declare.
1434         * selftest-run-tests.c (selftest::run_tests): Call it.
1435         * vector-builder.h (vector_builder::operator ==): New function.
1436         (vector_builder::operator !=): Likewise.
1437         * vec-perm-indices.h (vec_perm_indices::series_p): Declare.
1438         (vec_perm_indices::all_from_input_p): New function.
1439         * vec-perm-indices.c (vec_perm_indices::series_p): Likewise.
1440         (test_vec_perm_12, selftest::vec_perm_indices_c_tests): Likewise.
1441         * fold-const.c (fold_ternary_loc): Use tree_to_vec_perm_builder
1442         instead of reading the VECTOR_CST directly.  Detect whether both
1443         vector inputs are the same before constructing the vec_perm_indices,
1444         and update the number of inputs argument accordingly.  Use the
1445         utility functions added above.  Only construct sel2 if we need to.
1447 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1449         * optabs.c (expand_vec_perm_var): Use an explicit encoding for
1450         the broadcast of the low byte.
1451         (expand_mult_highpart): Use an explicit encoding for the permutes.
1452         * optabs-query.c (can_mult_highpart_p): Likewise.
1453         * tree-vect-loop.c (calc_vec_perm_mask_for_shift): Likewise.
1454         * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
1455         (vectorizable_bswap): Likewise.
1456         * tree-vect-data-refs.c (vect_grouped_store_supported): Use an
1457         explicit encoding for the power-of-2 permutes.
1458         (vect_permute_store_chain): Likewise.
1459         (vect_grouped_load_supported): Likewise.
1460         (vect_permute_load_chain): Likewise.
1462 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1464         * vec-perm-indices.h (vec_perm_indices_to_tree): Declare.
1465         * vec-perm-indices.c (vec_perm_indices_to_tree): New function.
1466         * tree-ssa-forwprop.c (simplify_vector_constructor): Use it.
1467         * tree-vect-slp.c (vect_transform_slp_perm_load): Likewise.
1468         * tree-vect-stmts.c (vectorizable_bswap): Likewise.
1469         (vect_gen_perm_mask_any): Likewise.
1471 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1473         * int-vector-builder.h: New file.
1474         * vec-perm-indices.h: Include int-vector-builder.h.
1475         (vec_perm_indices): Redefine as an int_vector_builder.
1476         (auto_vec_perm_indices): Delete.
1477         (vec_perm_builder): Redefine as a stand-alone class.
1478         (vec_perm_indices::vec_perm_indices): New function.
1479         (vec_perm_indices::clamp): Likewise.
1480         * vec-perm-indices.c: Include fold-const.h and tree-vector-builder.h.
1481         (vec_perm_indices::new_vector): New function.
1482         (vec_perm_indices::new_expanded_vector): Update for new
1483         vec_perm_indices class.
1484         (vec_perm_indices::rotate_inputs): New function.
1485         (vec_perm_indices::all_in_range_p): Operate directly on the
1486         encoded form, without computing elided elements.
1487         (tree_to_vec_perm_builder): Operate directly on the VECTOR_CST
1488         encoding.  Update for new vec_perm_indices class.
1489         * optabs.c (expand_vec_perm_const): Create a vec_perm_indices for
1490         the given vec_perm_builder.
1491         (expand_vec_perm_var): Update vec_perm_builder constructor.
1492         (expand_mult_highpart): Use vec_perm_builder instead of
1493         auto_vec_perm_indices.
1494         * optabs-query.c (can_mult_highpart_p): Use vec_perm_builder and
1495         vec_perm_indices instead of auto_vec_perm_indices.  Use a single
1496         or double series encoding as appropriate.
1497         * fold-const.c (fold_ternary_loc): Use vec_perm_builder and
1498         vec_perm_indices instead of auto_vec_perm_indices.
1499         * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
1500         * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
1501         (vect_permute_store_chain): Likewise.
1502         (vect_grouped_load_supported): Likewise.
1503         (vect_permute_load_chain): Likewise.
1504         (vect_shift_permute_load_chain): Likewise.
1505         * tree-vect-slp.c (vect_build_slp_tree_1): Likewise.
1506         (vect_transform_slp_perm_load): Likewise.
1507         (vect_schedule_slp_instance): Likewise.
1508         * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
1509         (vectorizable_mask_load_store): Likewise.
1510         (vectorizable_bswap): Likewise.
1511         (vectorizable_store): Likewise.
1512         (vectorizable_load): Likewise.
1513         * tree-vect-generic.c (lower_vec_perm): Use vec_perm_builder and
1514         vec_perm_indices instead of auto_vec_perm_indices.  Use
1515         tree_to_vec_perm_builder to read the vector from a tree.
1516         * tree-vect-loop.c (calc_vec_perm_mask_for_shift): Take a
1517         vec_perm_builder instead of a vec_perm_indices.
1518         (have_whole_vector_shift): Use vec_perm_builder and
1519         vec_perm_indices instead of auto_vec_perm_indices.  Leave the
1520         truncation to calc_vec_perm_mask_for_shift.
1521         (vect_create_epilog_for_reduction): Likewise.
1522         * config/aarch64/aarch64.c (expand_vec_perm_d::perm): Change
1523         from auto_vec_perm_indices to vec_perm_indices.
1524         (aarch64_expand_vec_perm_const_1): Use rotate_inputs on d.perm
1525         instead of changing individual elements.
1526         (aarch64_vectorize_vec_perm_const): Use new_vector to install
1527         the vector in d.perm.
1528         * config/arm/arm.c (expand_vec_perm_d::perm): Change
1529         from auto_vec_perm_indices to vec_perm_indices.
1530         (arm_expand_vec_perm_const_1): Use rotate_inputs on d.perm
1531         instead of changing individual elements.
1532         (arm_vectorize_vec_perm_const): Use new_vector to install
1533         the vector in d.perm.
1534         * config/powerpcspe/powerpcspe.c (rs6000_expand_extract_even):
1535         Update vec_perm_builder constructor.
1536         (rs6000_expand_interleave): Likewise.
1537         * config/rs6000/rs6000.c (rs6000_expand_extract_even): Likewise.
1538         (rs6000_expand_interleave): Likewise.
1540 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1542         * optabs-query.c (can_vec_perm_var_p): Check whether lowering
1543         to qimode could truncate the indices.
1544         * optabs.c (expand_vec_perm_var): Likewise.
1546 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1548         * Makefile.in (OBJS): Add vec-perm-indices.o.
1549         * vec-perm-indices.h: New file.
1550         * vec-perm-indices.c: Likewise.
1551         * target.h (vec_perm_indices): Replace with a forward class
1552         declaration.
1553         (auto_vec_perm_indices): Move to vec-perm-indices.h.
1554         * optabs.h: Include vec-perm-indices.h.
1555         (expand_vec_perm): Delete.
1556         (selector_fits_mode_p, expand_vec_perm_var): Declare.
1557         (expand_vec_perm_const): Declare.
1558         * target.def (vec_perm_const_ok): Replace with...
1559         (vec_perm_const): ...this new hook.
1560         * doc/tm.texi.in (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Replace with...
1561         (TARGET_VECTORIZE_VEC_PERM_CONST): ...this new hook.
1562         * doc/tm.texi: Regenerate.
1563         * optabs.def (vec_perm_const): Delete.
1564         * doc/md.texi (vec_perm_const): Likewise.
1565         (vec_perm): Refer to TARGET_VECTORIZE_VEC_PERM_CONST.
1566         * expr.c (expand_expr_real_2): Use expand_vec_perm_const rather than
1567         expand_vec_perm for constant permutation vectors.  Assert that
1568         the mode of variable permutation vectors is the integer equivalent
1569         of the mode that is being permuted.
1570         * optabs-query.h (selector_fits_mode_p): Declare.
1571         * optabs-query.c: Include vec-perm-indices.h.
1572         (selector_fits_mode_p): New function.
1573         (can_vec_perm_const_p): Check whether targetm.vectorize.vec_perm_const
1574         is defined, instead of checking whether the vec_perm_const_optab
1575         exists.  Use targetm.vectorize.vec_perm_const instead of
1576         targetm.vectorize.vec_perm_const_ok.  Check whether the indices
1577         fit in the vector mode before using a variable permute.
1578         * optabs.c (shift_amt_for_vec_perm_mask): Take a mode and a
1579         vec_perm_indices instead of an rtx.
1580         (expand_vec_perm): Replace with...
1581         (expand_vec_perm_const): ...this new function.  Take the selector
1582         as a vec_perm_indices rather than an rtx.  Also take the mode of
1583         the selector.  Update call to shift_amt_for_vec_perm_mask.
1584         Use targetm.vectorize.vec_perm_const instead of vec_perm_const_optab.
1585         Use vec_perm_indices::new_expanded_vector to expand the original
1586         selector into bytes.  Check whether the indices fit in the vector
1587         mode before using a variable permute.
1588         (expand_vec_perm_var): Make global.
1589         (expand_mult_highpart): Use expand_vec_perm_const.
1590         * fold-const.c: Includes vec-perm-indices.h.
1591         * tree-ssa-forwprop.c: Likewise.
1592         * tree-vect-data-refs.c: Likewise.
1593         * tree-vect-generic.c: Likewise.
1594         * tree-vect-loop.c: Likewise.
1595         * tree-vect-slp.c: Likewise.
1596         * tree-vect-stmts.c: Likewise.
1597         * config/aarch64/aarch64-protos.h (aarch64_expand_vec_perm_const):
1598         Delete.
1599         * config/aarch64/aarch64-simd.md (vec_perm_const<mode>): Delete.
1600         * config/aarch64/aarch64.c (aarch64_expand_vec_perm_const)
1601         (aarch64_vectorize_vec_perm_const_ok): Fuse into...
1602         (aarch64_vectorize_vec_perm_const): ...this new function.
1603         (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
1604         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
1605         * config/arm/arm-protos.h (arm_expand_vec_perm_const): Delete.
1606         * config/arm/vec-common.md (vec_perm_const<mode>): Delete.
1607         * config/arm/arm.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
1608         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
1609         (arm_expand_vec_perm_const, arm_vectorize_vec_perm_const_ok): Merge
1610         into...
1611         (arm_vectorize_vec_perm_const): ...this new function.  Explicitly
1612         check for NEON modes.
1613         * config/i386/i386-protos.h (ix86_expand_vec_perm_const): Delete.
1614         * config/i386/sse.md (VEC_PERM_CONST, vec_perm_const<mode>): Delete.
1615         * config/i386/i386.c (ix86_expand_vec_perm_const_1): Update comment.
1616         (ix86_expand_vec_perm_const, ix86_vectorize_vec_perm_const_ok): Merge
1617         into...
1618         (ix86_vectorize_vec_perm_const): ...this new function.  Incorporate
1619         the old VEC_PERM_CONST conditions.
1620         * config/ia64/ia64-protos.h (ia64_expand_vec_perm_const): Delete.
1621         * config/ia64/vect.md (vec_perm_const<mode>): Delete.
1622         * config/ia64/ia64.c (ia64_expand_vec_perm_const)
1623         (ia64_vectorize_vec_perm_const_ok): Merge into...
1624         (ia64_vectorize_vec_perm_const): ...this new function.
1625         * config/mips/loongson.md (vec_perm_const<mode>): Delete.
1626         * config/mips/mips-msa.md (vec_perm_const<mode>): Delete.
1627         * config/mips/mips-ps-3d.md (vec_perm_constv2sf): Delete.
1628         * config/mips/mips-protos.h (mips_expand_vec_perm_const): Delete.
1629         * config/mips/mips.c (mips_expand_vec_perm_const)
1630         (mips_vectorize_vec_perm_const_ok): Merge into...
1631         (mips_vectorize_vec_perm_const): ...this new function.
1632         * config/powerpcspe/altivec.md (vec_perm_constv16qi): Delete.
1633         * config/powerpcspe/paired.md (vec_perm_constv2sf): Delete.
1634         * config/powerpcspe/spe.md (vec_perm_constv2si): Delete.
1635         * config/powerpcspe/vsx.md (vec_perm_const<mode>): Delete.
1636         * config/powerpcspe/powerpcspe-protos.h (altivec_expand_vec_perm_const)
1637         (rs6000_expand_vec_perm_const): Delete.
1638         * config/powerpcspe/powerpcspe.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK):
1639         Delete.
1640         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
1641         (altivec_expand_vec_perm_const_le): Take each operand individually.
1642         Operate on constant selectors rather than rtxes.
1643         (altivec_expand_vec_perm_const): Likewise.  Update call to
1644         altivec_expand_vec_perm_const_le.
1645         (rs6000_expand_vec_perm_const): Delete.
1646         (rs6000_vectorize_vec_perm_const_ok): Delete.
1647         (rs6000_vectorize_vec_perm_const): New function.
1648         (rs6000_do_expand_vec_perm): Take a vec_perm_builder instead of
1649         an element count and rtx array.
1650         (rs6000_expand_extract_even): Update call accordingly.
1651         (rs6000_expand_interleave): Likewise.
1652         * config/rs6000/altivec.md (vec_perm_constv16qi): Delete.
1653         * config/rs6000/paired.md (vec_perm_constv2sf): Delete.
1654         * config/rs6000/vsx.md (vec_perm_const<mode>): Delete.
1655         * config/rs6000/rs6000-protos.h (altivec_expand_vec_perm_const)
1656         (rs6000_expand_vec_perm_const): Delete.
1657         * config/rs6000/rs6000.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
1658         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
1659         (altivec_expand_vec_perm_const_le): Take each operand individually.
1660         Operate on constant selectors rather than rtxes.
1661         (altivec_expand_vec_perm_const): Likewise.  Update call to
1662         altivec_expand_vec_perm_const_le.
1663         (rs6000_expand_vec_perm_const): Delete.
1664         (rs6000_vectorize_vec_perm_const_ok): Delete.
1665         (rs6000_vectorize_vec_perm_const): New function.  Remove stray
1666         reference to the SPE evmerge intructions.
1667         (rs6000_do_expand_vec_perm): Take a vec_perm_builder instead of
1668         an element count and rtx array.
1669         (rs6000_expand_extract_even): Update call accordingly.
1670         (rs6000_expand_interleave): Likewise.
1671         * config/sparc/sparc.md (vec_perm_constv8qi): Delete in favor of...
1672         * config/sparc/sparc.c (sparc_vectorize_vec_perm_const): ...this
1673         new function.
1674         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
1676 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1678         * optabs.c (expand_vec_perm_1): Assert that SEL has an integer
1679         vector mode and that that mode matches the mode of the data
1680         being permuted.
1681         (expand_vec_perm): Split handling of non-CONST_VECTOR selectors
1682         out into expand_vec_perm_var.  Do all CONST_VECTOR handling here,
1683         directly using expand_vec_perm_1 when forcing selectors into
1684         registers.
1685         (expand_vec_perm_var): New function, split out from expand_vec_perm.
1687 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1689         * optabs-query.h (can_vec_perm_p): Delete.
1690         (can_vec_perm_var_p, can_vec_perm_const_p): Declare.
1691         * optabs-query.c (can_vec_perm_p): Split into...
1692         (can_vec_perm_var_p, can_vec_perm_const_p): ...these two functions.
1693         (can_mult_highpart_p): Use can_vec_perm_const_p to test whether a
1694         particular selector is valid.
1695         * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
1696         * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
1697         (vect_grouped_load_supported): Likewise.
1698         (vect_shift_permute_load_chain): Likewise.
1699         * tree-vect-slp.c (vect_build_slp_tree_1): Likewise.
1700         (vect_transform_slp_perm_load): Likewise.
1701         * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
1702         (vectorizable_bswap): Likewise.
1703         (vect_gen_perm_mask_checked): Likewise.
1704         * fold-const.c (fold_ternary_loc): Likewise.  Don't take
1705         implementations of variable permutation vectors into account
1706         when deciding which selector to use.
1707         * tree-vect-loop.c (have_whole_vector_shift): Don't check whether
1708         vec_perm_const_optab is supported; instead use can_vec_perm_const_p
1709         with a false third argument.
1710         * tree-vect-generic.c (lower_vec_perm): Use can_vec_perm_const_p
1711         to test whether the constant selector is valid and can_vec_perm_var_p
1712         to test whether a variable selector is valid.
1714 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1716         * optabs-query.h (can_vec_perm_p): Take a const vec_perm_indices *.
1717         * optabs-query.c (can_vec_perm_p): Likewise.
1718         * fold-const.c (fold_vec_perm): Take a const vec_perm_indices &
1719         instead of vec_perm_indices.
1720         * tree-vectorizer.h (vect_gen_perm_mask_any): Likewise,
1721         (vect_gen_perm_mask_checked): Likewise,
1722         * tree-vect-stmts.c (vect_gen_perm_mask_any): Likewise,
1723         (vect_gen_perm_mask_checked): Likewise,
1725 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1727         * optabs-query.h (qimode_for_vec_perm): Declare.
1728         * optabs-query.c (can_vec_perm_p): Split out qimode search to...
1729         (qimode_for_vec_perm): ...this new function.
1730         * optabs.c (expand_vec_perm): Use qimode_for_vec_perm.
1732 2018-01-02  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>
1734         * rtlanal.c (canonicalize_condition): Return 0 if final rtx
1735         does not have a conditional at the top.
1737 2018-01-02  Richard Biener  <rguenther@suse.de>
1739         * ipa-inline.c (big_speedup_p): Fix expression.
1741 2018-01-02  Jan Hubicka  <hubicka@ucw.cz>
1743         PR target/81616
1744         * config/i386/x86-tune-costs.h: Increase cost of integer load costs
1745         for generic 4->6.
1747 2018-01-02  Jan Hubicka  <hubicka@ucw.cz>
1749         PR target/81616
1750         Generic tuning.
1751         * x86-tune-costs.h (generic_cost): Reduce cost of FDIV 20->17,
1752         cost of sqrt 20->14, DIVSS 18->13, DIVSD 32->17, SQRtSS 30->14
1753         and SQRTsD 58->18, cond_not_taken_branch_cost. 2->1. Increase
1754         cond_taken_branch_cost 3->4.
1756 2018-01-01  Jakub Jelinek  <jakub@redhat.com>
1758         PR tree-optimization/83581
1759         * tree-loop-distribution.c (pass_loop_distribution::execute): Return
1760         TODO_cleanup_cfg if any changes have been made.
1762         PR middle-end/83608
1763         * expr.c (store_expr_with_bounds): Use simplify_gen_subreg instead of
1764         convert_modes if target mode has the right side, but different mode
1765         class.
1767         PR middle-end/83609
1768         * expr.c (expand_assignment): Fix up a typo in simplify_gen_subreg
1769         last argument when extracting from CONCAT.  If either from_real or
1770         from_imag is NULL, use expansion through memory.  If result is not
1771         a CONCAT and simplify_gen_subreg fails, try to simplify_gen_subreg
1772         the parts directly to inner mode, if even that fails, use expansion
1773         through memory.
1775         PR middle-end/83623
1776         * expmed.c (expand_shift_1): For 2-byte rotates by BITS_PER_UNIT,
1777         check for bswap in mode rather than HImode and use that in expand_unop
1778         too.
1780 Copyright (C) 2018 Free Software Foundation, Inc.
1782 Copying and distribution of this file, with or without modification,
1783 are permitted in any medium without royalty provided the copyright
1784 notice and this notice are preserved.