PR rtl-optimizatin/81308
[official-gcc.git] / gcc / ChangeLog
blob7599c556a25ecee004ad4ec3ff4a285ce663f57e
1 2017-01-08  Jeff Law  <law@redhat.com>
3         PR rtl-optimizatin/81308
4         * tree-switch-conversion.c (cfg_altered): New file scoped static.
5         (process_switch): If group_case_labels makes a change, then set
6         cfg_altered.
7         (pass_convert_switch::execute): If a switch is converted, then
8         set cfg_altered.  Return TODO_cfg_cleanup if cfg_altered is true.
10         PR rtl-optimization/81308
11         * recog.c (split_all_insns): Conditionally cleanup the CFG after
12         splitting insns.
14 2018-01-08  Vidya Praveen  <vidyapraveen@arm.com>
16         PR target/83663 - Revert r255946
17         * config/aarch64/aarch64.c (aarch64_expand_vector_init): Modify code
18         generation for cases where splatting a value is not useful.
19         * simplify-rtx.c (simplify_ternary_operation): Simplify vec_merge
20         across a vec_duplicate and a paradoxical subreg forming a vector
21         mode to a vec_concat.
23 2018-01-08  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
25         * config/arm/t-aprofile (MULTILIB_MATCHES): Add mapping rules for
26         -march=armv8.3-a variants.
27         * config/arm/t-multilib: Likewise.
28         * config/arm/t-arm-elf: Likewise.  Handle dotprod extension.
30 2018-01-08  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>
32         * config/rs6000/rs6000.md (cceq_ior_compare): Remove * so I can use it
33         to generate rtl.
34         (cceq_ior_compare_complement): Give it a name so I can use it, and
35         change boolean_or_operator predicate to boolean_operator so it can
36         be used to generate a crand.
37         (eqne): New code iterator.
38         (bd/bd_neg): New code_attrs.
39         (<bd>_<mode>): New name for ctr<mode>_internal[12] now combined into
40         a single define_insn.
41         (<bd>tf_<mode>): A new insn pattern for the conditional form branch
42         decrement (bdnzt/bdnzf/bdzt/bdzf).
43         * config/rs6000/rs6000.c (rs6000_legitimate_combined_insn): Updated
44         with the new names of the branch decrement patterns, and added the
45         names of the branch decrement conditional patterns.
47 2018-01-08  Richard Biener  <rguenther@suse.de>
49         PR tree-optimization/83563
50         * graphite.c (canonicalize_loop_closed_ssa_form): Reset the SCEV
51         cache.
53 2018-01-08  Richard Biener  <rguenther@suse.de>
55         PR middle-end/83713
56         * convert.c (do_narrow): Properly guard TYPE_OVERFLOW_WRAPS checks.
58 2018-01-08  Richard Biener  <rguenther@suse.de>
60         PR tree-optimization/83685
61         * tree-ssa-pre.c (create_expression_by_pieces): Do not insert
62         references to abnormals.
64 2018-01-08  Richard Biener  <rguenther@suse.de>
66         PR lto/83719
67         * dwarf2out.c (output_indirect_strings): Handle empty
68         skeleton_debug_str_hash.
69         (dwarf2out_early_finish): Index strings for -gsplit-dwarf.
71 2018-01-08  Claudiu Zissulescu  <claziss@synopsys.com>
73         * config/arc/arc.c (TARGET_TRAMPOLINE_ADJUST_ADDRESS): Delete.
74         (emit_store_direct): Likewise.
75         (arc_trampoline_adjust_address): Likewise.
76         (arc_asm_trampoline_template): New function.
77         (arc_initialize_trampoline): Use asm_trampoline_template.
78         (TARGET_ASM_TRAMPOLINE_TEMPLATE): Define.
79         * config/arc/arc.h (TRAMPOLINE_SIZE): Adjust to 16.
80         * config/arc/arc.md (flush_icache): Delete pattern.
82 2018-01-08  Claudiu Zissulescu  <claziss@synopsys.com>
84         * config/arc/arc-c.def (__ARC_UNALIGNED__): New define.
85         * config/arc/arc.h (STRICT_ALIGNMENT): Control this macro using
86         munaligned-access.
88 2018-01-08  Sebastian Huber  <sebastian.huber@embedded-brains.de>
90         PR target/83681
91         * config/epiphany/epiphany.h (make_pass_mode_switch_use): Guard
92         by not USED_FOR_TARGET.
93         (make_pass_resolve_sw_modes): Likewise.
95 2018-01-08  Sebastian Huber  <sebastian.huber@embedded-brains.de>
97         * config/nios2/nios2.h (nios2_section_threshold): Guard by not
98         USED_FOR_TARGET.
100 2018-01-08  Richard Biener  <rguenther@suse.de>
102         PR middle-end/83580
103         * tree-data-ref.c (split_constant_offset): Remove STRIP_NOPS.
105 2018-01-08  Richard Biener  <rguenther@suse.de>
107         PR middle-end/83517
108         * match.pd ((t * 2) / 2) -> t): Add missing :c.
110 2018-01-06  Aldy Hernandez  <aldyh@redhat.com>
112         PR middle-end/81897
113         * tree-ssa-uninit.c (compute_control_dep_chain): Do not bail on
114         basic blocks with a small number of successors.
115         (convert_control_dep_chain_into_preds): Improve handling of
116         forwarder blocks.
117         (dump_predicates): Split apart into...
118         (dump_pred_chain): ...here...
119         (dump_pred_info): ...and here.
120         (can_one_predicate_be_invalidated_p): Add debugging printfs.
121         (can_chain_union_be_invalidated_p): Improve check for invalidation
122         of paths.
123         (uninit_uses_cannot_happen): Avoid unnecessary if
124         convert_control_dep_chain_into_preds yielded nothing.
126 2018-01-06  Martin Sebor  <msebor@redhat.com>
128         PR tree-optimization/83640
129         * gimple-ssa-warn-restrict.c (builtin_access::builtin_access): Avoid
130         subtracting negative offset from size.
131         (builtin_access::overlap): Adjust offset bounds of the access to fall
132         within the size of the object if possible.
134 2018-01-06  Richard Sandiford  <richard.sandiford@linaro.org>
136         PR rtl-optimization/83699
137         * expmed.c (extract_bit_field_1): Restrict the vector usage of
138         extract_bit_field_as_subreg to cases in which the extracted
139         value is also a vector.
141         * lra-constraints.c (process_alt_operands): Test for the equivalence
142         substitutions when detecting a possible reload cycle.
144 2018-01-06  Jakub Jelinek  <jakub@redhat.com>
146         PR debug/83480
147         * toplev.c (process_options): Don't enable debug_nonbind_markers_p
148         by default if flag_selective_schedling{,2}.  Formatting fixes.
150         PR rtl-optimization/83682
151         * rtl.h (const_vec_duplicate_p): Only return true for VEC_DUPLICATE
152         if it has non-VECTOR_MODE element mode.
153         (vec_duplicate_p): Likewise.
155         PR middle-end/83694
156         * cfgexpand.c (expand_debug_expr): Punt if mode1 is VOIDmode
157         and bitsize might be greater than MAX_BITSIZE_MODE_ANY_INT.
159 2018-01-05  Jakub Jelinek  <jakub@redhat.com>
161         PR target/83604
162         * config/i386/i386-builtin.def
163         (__builtin_ia32_vgf2p8affineinvqb_v64qi,
164         __builtin_ia32_vgf2p8affineqb_v64qi, __builtin_ia32_vgf2p8mulb_v64qi):
165         Require also OPTION_MASK_ISA_AVX512F in addition to
166         OPTION_MASK_ISA_GFNI.
167         (__builtin_ia32_vgf2p8affineinvqb_v16qi_mask,
168         __builtin_ia32_vgf2p8affineqb_v16qi_mask): Require
169         OPTION_MASK_ISA_AVX512VL instead of OPTION_MASK_ISA_SSE in addition
170         to OPTION_MASK_ISA_GFNI.
171         (__builtin_ia32_vgf2p8mulb_v32qi_mask): Require
172         OPTION_MASK_ISA_AVX512VL in addition to OPTION_MASK_ISA_GFNI and
173         OPTION_MASK_ISA_AVX512BW.
174         (__builtin_ia32_vgf2p8mulb_v16qi_mask): Require
175         OPTION_MASK_ISA_AVX512VL instead of OPTION_MASK_ISA_AVX512BW in
176         addition to OPTION_MASK_ISA_GFNI.
177         (__builtin_ia32_vgf2p8affineinvqb_v16qi,
178         __builtin_ia32_vgf2p8affineqb_v16qi, __builtin_ia32_vgf2p8mulb_v16qi):
179         Require OPTION_MASK_ISA_SSE2 instead of OPTION_MASK_ISA_SSE in addition
180         to OPTION_MASK_ISA_GFNI.
181         * config/i386/i386.c (def_builtin): Change to builtin isa/isa2 being
182         a requirement for all ISAs rather than any of them with a few
183         exceptions.
184         (ix86_add_new_builtins): Clear OPTION_MASK_ISA_64BIT from isa before
185         processing.
186         (ix86_expand_builtin): Require all ISAs from builtin's isa and isa2
187         bitmasks to be enabled with 3 exceptions, instead of requiring any
188         enabled ISA with lots of exceptions.
189         * config/i386/sse.md (vgf2p8affineinvqb_<mode><mask_name>,
190         vgf2p8affineqb_<mode><mask_name>, vgf2p8mulb_<mode><mask_name>):
191         Change avx512bw in isa attribute to avx512f.
192         * config/i386/sgxintrin.h: Add license boilerplate.
193         * config/i386/vaesintrin.h: Likewise.  Fix macro spelling __AVX512F
194         to __AVX512F__ and __AVX512VL to __AVX512VL__.
195         (_mm256_aesdec_epi128, _mm256_aesdeclast_epi128, _mm256_aesenc_epi128,
196         _mm256_aesenclast_epi128): Enable temporarily avx if __AVX__ is not
197         defined.
198         * config/i386/gfniintrin.h (_mm_gf2p8mul_epi8,
199         _mm_gf2p8affineinv_epi64_epi8, _mm_gf2p8affine_epi64_epi8): Enable
200         temporarily sse2 rather than sse if not enabled already.
202         PR target/83604
203         * config/i386/sse.md (VI248_VLBW): Rename to ...
204         (VI248_AVX512VL): ... this.  Don't guard V32HI with TARGET_AVX512BW.
205         (vpshrd_<mode><mask_name>, vpshld_<mode><mask_name>,
206         vpshrdv_<mode>, vpshrdv_<mode>_mask, vpshrdv_<mode>_maskz,
207         vpshrdv_<mode>_maskz_1, vpshldv_<mode>, vpshldv_<mode>_mask,
208         vpshldv_<mode>_maskz, vpshldv_<mode>_maskz_1): Use VI248_AVX512VL
209         mode iterator instead of VI248_VLBW.
211 2018-01-05  Jan Hubicka  <hubicka@ucw.cz>
213         * ipa-fnsummary.c (record_modified_bb_info): Add OP.
214         (record_modified): Skip clobbers; add debug output.
215         (param_change_prob): Use sreal frequencies.
217 2018-01-05  Richard Sandiford  <richard.sandiford@linaro.org>
219         * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Don't
220         punt for user-aligned variables.
222 2018-01-05  Richard Sandiford  <richard.sandiford@linaro.org>
224         * tree-chrec.c (chrec_contains_symbols): Return true for
225         POLY_INT_CST.
227 2018-01-05  Sudakshina Das  <sudi.das@arm.com>
229         PR target/82439
230         * simplify-rtx.c (simplify_relational_operation_1): Add simplifications
231         of (x|y) == x for BICS pattern.
233 2018-01-05  Jakub Jelinek  <jakub@redhat.com>
235         PR tree-optimization/83605
236         * gimple-ssa-strength-reduction.c: Include tree-eh.h.
237         (find_candidates_dom_walker::before_dom_children): Ignore stmts that
238         can throw.
240 2018-01-05  Sebastian Huber  <sebastian.huber@embedded-brains.de>
242         * config.gcc (epiphany-*-elf*): Add (epiphany-*-rtems*) configuration.
243         * config/epiphany/rtems.h: New file.
245 2018-01-04  Jakub Jelinek  <jakub@redhat.com>
246             Uros Bizjak  <ubizjak@gmail.com>
248         PR target/83554
249         * config/i386/i386.md (*<rotate_insn>hi3_1 splitter): Use
250         QIreg_operand instead of register_operand predicate.
251         * config/i386/i386.c (ix86_rop_should_change_byte_p,
252         set_rop_modrm_reg_bits, ix86_mitigate_rop): Use -mmitigate-rop in
253         comments instead of -fmitigate[-_]rop.
255 2018-01-04  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
257         PR bootstrap/81926
258         * cgraphunit.c (symbol_table::compile): Switch to text_section
259         before calling assembly_start debug hook.
260         * run-rtl-passes.c (run_rtl_passes): Likewise.
261         Include output.h.
263 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
265         * tree-vrp.c (extract_range_from_binary_expr_1): Check
266         range_int_cst_p rather than !symbolic_range_p before calling
267         extract_range_from_multiplicative_op_1.
269 2017-01-04  Jeff Law  <law@redhat.com>
271         * tree-ssa-math-opts.c (execute_cse_reciprocals_1): Remove
272         redundant test in assertion.
274 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
276         * doc/rtl.texi: Document machine_mode wrapper classes.
278 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
280         * fold-const.c (fold_ternary_loc): Check tree_fits_uhwi_p before
281         using tree_to_uhwi.
283 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
285         * tree-ssa-forwprop.c (is_combined_permutation_identity): Allow
286         the VEC_PERM_EXPR fold to fail.
288 2018-01-04  Jakub Jelinek  <jakub@redhat.com>
290         PR debug/83585
291         * bb-reorder.c (insert_section_boundary_note): Set has_bb_partition
292         to switched_sections.
294 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
296         PR target/83680
297         * config/arm/arm.c (arm_vectorize_vec_perm_const): Fix inverted
298         test for d.testing.
300 2018-01-04  Peter Bergner  <bergner@vnet.ibm.com>
302         PR target/83387
303         * config/rs6000/rs6000.c (rs6000_discover_homogeneous_aggregate): Do not
304         allow arguments in FP registers if TARGET_HARD_FLOAT is false.
306 2018-01-04  Jakub Jelinek  <jakub@redhat.com>
308         PR debug/83666
309         * cfgexpand.c (expand_dbeug_expr) <case BIT_FIELD_REF>: Punt if mode
310         is BLKmode and bitpos not zero or mode change is needed.
312 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
314         PR target/83675
315         * config/sparc/sparc.c (sparc_vectorize_vec_perm_const): Require
316         TARGET_VIS2.
318 2018-01-04  Uros Bizjak  <ubizjak@gmail.com>
320         PR target/83628
321         * config/alpha/alpha.md (*sadd<modesuffix>): Use ASHIFT
322         instead of MULT rtx.  Update all corresponding splitters.
323         (*saddl_se): Ditto.
324         (*ssub<modesuffix>): Ditto.
325         (*ssubl_se): Ditto.
326         (*cmp_sadd_di): Update split patterns.
327         (*cmp_sadd_si): Ditto.
328         (*cmp_sadd_sidi): Ditto.
329         (*cmp_ssub_di): Ditto.
330         (*cmp_ssub_si): Ditto.
331         (*cmp_ssub_sidi): Ditto.
332         * config/alpha/predicates.md (const23_operand): New predicate.
333         * config/alpha/alpha.c (alpha_rtx_costs) [PLUS, MINUS]:
334         Look for ASHIFT, not MULT inner operand.
335         (alpha_split_conditional_move): Update for *sadd<modesuffix> change.
337 2018-01-04  Martin Liska  <mliska@suse.cz>
339         PR gcov-profile/83669
340         * gcov.c (output_intermediate_file): Add version to intermediate
341         gcov file.
342         * doc/gcov.texi: Document new field 'version' in intermediate
343         file format. Fix location of '-k' option of gcov command.
345 2018-01-04  Martin Liska  <mliska@suse.cz>
347         PR ipa/82352
348         * ipa-icf.c (sem_function::merge): Do not cross comdat boundary.
350 2018-01-04  Jakub Jelinek  <jakub@redhat.com>
352         * gimple-ssa-sprintf.c (parse_directive): Cast second dir.len to uhwi.
354 2018-01-03  Martin Sebor  <msebor@redhat.com>
356         PR tree-optimization/83655
357         * gimple-ssa-warn-restrict.c (wrestrict_dom_walker::check_call): Avoid
358         checking calls with invalid arguments.
360 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
362         * tree-vect-stmts.c (vect_get_store_rhs): New function.
363         (vectorizable_mask_load_store): Delete.
364         (vectorizable_call): Return false for masked loads and stores.
365         (vectorizable_store): Handle IFN_MASK_STORE.  Use vect_get_store_rhs
366         instead of gimple_assign_rhs1.
367         (vectorizable_load): Handle IFN_MASK_LOAD.
368         (vect_transform_stmt): Don't set is_store for call_vec_info_type.
370 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
372         * tree-vect-stmts.c (vect_build_gather_load_calls): New function,
373         split out from..,
374         (vectorizable_mask_load_store): ...here.
375         (vectorizable_load): ...and here.
377 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
379         * tree-vect-stmts.c (vect_build_all_ones_mask)
380         (vect_build_zero_merge_argument): New functions, split out from...
381         (vectorizable_load): ...here.
383 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
385         * tree-vect-stmts.c (vect_check_store_rhs): New function,
386         split out from...
387         (vectorizable_mask_load_store): ...here.
388         (vectorizable_store): ...and here.
390 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
392         * tree-vect-stmts.c (vect_check_load_store_mask): New function,
393         split out from...
394         (vectorizable_mask_load_store): ...here.
396 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
398         * tree-vectorizer.h (vec_load_store_type): Moved from tree-vec-stmts.c
399         (vect_model_store_cost): Take a vec_load_store_type instead of a
400         vect_def_type.
401         * tree-vect-stmts.c (vec_load_store_type): Move to tree-vectorizer.h.
402         (vect_model_store_cost): Take a vec_load_store_type instead of a
403         vect_def_type.
404         (vectorizable_mask_load_store): Update accordingly.
405         (vectorizable_store): Likewise.
406         * tree-vect-slp.c (vect_analyze_slp_cost_1): Update accordingly.
408 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
410         * tree-vect-loop.c (vect_transform_loop): Stub out scalar
411         IFN_MASK_LOAD calls here rather than...
412         * tree-vect-stmts.c (vectorizable_mask_load_store): ...here.
414 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
415             Alan Hayward  <alan.hayward@arm.com>
416             David Sherwood  <david.sherwood@arm.com>
418         * expmed.c (extract_bit_field_1): For vector extracts,
419         fall back to extract_bit_field_as_subreg if vec_extract
420         isn't available.
422 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
423             Alan Hayward  <alan.hayward@arm.com>
424             David Sherwood  <david.sherwood@arm.com>
426         * lra-spills.c (pseudo_reg_slot_compare): Sort slots by whether
427         they are variable or constant sized.
428         (assign_stack_slot_num_and_sort_pseudos): Don't reuse variable-sized
429         slots for constant-sized data.
431 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
432             Alan Hayward  <alan.hayward@arm.com>
433             David Sherwood  <david.sherwood@arm.com>
435         * tree-vect-patterns.c (vect_recog_mask_conversion_pattern): When
436         handling COND_EXPRs with boolean comparisons, try to find a better
437         basis for the mask type than the boolean itself.
439 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
441         * doc/rtl.texi (MAX_BITSIZE_MODE_ANY_MODE): Describe how the default
442         is calculated and how it can be overridden.
443         * genmodes.c (max_bitsize_mode_any_mode): New variable.
444         (create_modes): Initialize it from MAX_BITSIZE_MODE_ANY_MODE,
445         if defined.
446         (emit_max_int): Use it to set the output MAX_BITSIZE_MODE_ANY_MODE,
447         if nonzero.
449 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
450             Alan Hayward  <alan.hayward@arm.com>
451             David Sherwood  <david.sherwood@arm.com>
453         * config/aarch64/aarch64-protos.h (aarch64_output_simd_mov_immediate):
454         Remove the mode argument.
455         (aarch64_simd_valid_immediate): Remove the mode and inverse
456         arguments.
457         * config/aarch64/iterators.md (bitsize): New iterator.
458         * config/aarch64/aarch64-simd.md (*aarch64_simd_mov<mode>, and<mode>3)
459         (ior<mode>3): Update calls to aarch64_output_simd_mov_immediate.
460         * config/aarch64/constraints.md (Do, Db, Dn): Update calls to
461         aarch64_simd_valid_immediate.
462         * config/aarch64/predicates.md (aarch64_reg_or_orr_imm): Likewise.
463         (aarch64_reg_or_bic_imm): Likewise.
464         * config/aarch64/aarch64.c (simd_immediate_info): Replace mvn
465         with an insn_type enum and msl with a modifier_type enum.
466         Replace element_width with a scalar_mode.  Change the shift
467         to unsigned int.  Add constructors for scalar_float_mode and
468         scalar_int_mode elements.
469         (aarch64_vect_float_const_representable_p): Delete.
470         (aarch64_can_const_movi_rtx_p)
471         (aarch64_simd_scalar_immediate_valid_for_move)
472         (aarch64_simd_make_constant): Update call to
473         aarch64_simd_valid_immediate.
474         (aarch64_advsimd_valid_immediate_hs): New function.
475         (aarch64_advsimd_valid_immediate): Likewise.
476         (aarch64_simd_valid_immediate): Remove mode and inverse
477         arguments.  Rewrite to use the above.  Use const_vec_duplicate_p
478         to detect duplicated constants and use aarch64_float_const_zero_rtx_p
479         and aarch64_float_const_representable_p on the result.
480         (aarch64_output_simd_mov_immediate): Remove mode argument.
481         Update call to aarch64_simd_valid_immediate and use of
482         simd_immediate_info.
483         (aarch64_output_scalar_simd_mov_immediate): Update call
484         accordingly.
486 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
487             Alan Hayward  <alan.hayward@arm.com>
488             David Sherwood  <david.sherwood@arm.com>
490         * machmode.h (mode_precision): Prefix with CONST_MODE_PRECISION.
491         (mode_nunits): Likewise CONST_MODE_NUNITS.
492         * machmode.def (ADJUST_NUNITS): Document.
493         * genmodes.c (mode_data::need_nunits_adj): New field.
494         (blank_mode): Update accordingly.
495         (adj_nunits): New variable.
496         (print_maybe_const_decl): Replace CATEGORY with a NEEDS_ADJ
497         parameter.
498         (emit_mode_size_inline): Set need_bytesize_adj for all modes
499         listed in adj_nunits.
500         (emit_mode_nunits_inline): Set need_nunits_adj for all modes
501         listed in adj_nunits.  Don't emit case statements for such modes.
502         (emit_insn_modes_h): Emit definitions of CONST_MODE_NUNITS
503         and CONST_MODE_PRECISION.  Make CONST_MODE_SIZE expand to
504         nothing if adj_nunits is nonnull.
505         (emit_mode_precision, emit_mode_nunits): Use print_maybe_const_decl.
506         (emit_mode_unit_size, emit_mode_base_align, emit_mode_ibit)
507         (emit_mode_fbit): Update use of print_maybe_const_decl.
508         (emit_move_size): Likewise.  Treat the array as non-const
509         if adj_nunits.
510         (emit_mode_adjustments): Handle adj_nunits.
512 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
514         * machmode.def (VECTOR_MODES_WITH_PREFIX): Document.
515         * genmodes.c (VECTOR_MODES_WITH_PREFIX): New macro.
516         (VECTOR_MODES): Use it.
517         (make_vector_modes): Take the prefix as an argument.
519 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
520             Alan Hayward  <alan.hayward@arm.com>
521             David Sherwood  <david.sherwood@arm.com>
523         * mode-classes.def (MODE_VECTOR_BOOL): New mode class.
524         * machmode.h (INTEGRAL_MODE_P, VECTOR_MODE_P): Return true
525         for MODE_VECTOR_BOOL.
526         * machmode.def (VECTOR_BOOL_MODE): Document.
527         * genmodes.c (VECTOR_BOOL_MODE): New macro.
528         (make_vector_bool_mode): New function.
529         (complete_mode, emit_mode_wider, emit_mode_adjustments): Handle
530         MODE_VECTOR_BOOL.
531         * lto-streamer-in.c (lto_input_mode_table): Likewise.
532         * rtx-vector-builder.c (rtx_vector_builder::find_cached_value):
533         Likewise.
534         * stor-layout.c (int_mode_for_mode): Likewise.
535         * tree.c (build_vector_type_for_mode): Likewise.
536         * varasm.c (output_constant_pool_2): Likewise.
537         * emit-rtl.c (init_emit_once): Make sure that CONST1_RTX (BImode) and
538         CONSTM1_RTX (BImode) are the same thing.  Initialize const_tiny_rtx
539         for MODE_VECTOR_BOOL.
540         * expr.c (expand_expr_real_1): Use VECTOR_MODE_P instead of a list
541         of mode class checks.
542         * tree-vect-generic.c (expand_vector_operation): Use VECTOR_MODE_P
543         instead of a list of mode class checks.
544         (expand_vector_scalar_condition): Likewise.
545         (type_for_widest_vector_mode): Handle BImode as an inner mode.
547 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
548             Alan Hayward  <alan.hayward@arm.com>
549             David Sherwood  <david.sherwood@arm.com>
551         * machmode.h (mode_size): Change from unsigned short to
552         poly_uint16_pod.
553         (mode_to_bytes): Return a poly_uint16 rather than an unsigned short.
554         (GET_MODE_SIZE): Return a constant if ONLY_FIXED_SIZE_MODES,
555         or if measurement_type is not polynomial.
556         (fixed_size_mode::includes_p): Check for constant-sized modes.
557         * genmodes.c (emit_mode_size_inline): Make mode_size_inline
558         return a poly_uint16 rather than an unsigned short.
559         (emit_mode_size): Change the type of mode_size from unsigned short
560         to poly_uint16_pod.  Use ZERO_COEFFS for the initializer.
561         (emit_mode_adjustments): Cope with polynomial vector sizes.
562         * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
563         for GET_MODE_SIZE.
564         * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
565         for GET_MODE_SIZE.
566         * auto-inc-dec.c (try_merge): Treat GET_MODE_SIZE as polynomial.
567         * builtins.c (expand_ifn_atomic_compare_exchange_into_call): Likewise.
568         * caller-save.c (setup_save_areas): Likewise.
569         (replace_reg_with_saved_mem): Likewise.
570         * calls.c (emit_library_call_value_1): Likewise.
571         * combine-stack-adj.c (combine_stack_adjustments_for_block): Likewise.
572         * combine.c (simplify_set, make_extraction, simplify_shift_const_1)
573         (gen_lowpart_for_combine): Likewise.
574         * convert.c (convert_to_integer_1): Likewise.
575         * cse.c (equiv_constant, cse_insn): Likewise.
576         * cselib.c (autoinc_split, cselib_hash_rtx): Likewise.
577         (cselib_subst_to_values): Likewise.
578         * dce.c (word_dce_process_block): Likewise.
579         * df-problems.c (df_word_lr_mark_ref): Likewise.
580         * dwarf2cfi.c (init_one_dwarf_reg_size): Likewise.
581         * dwarf2out.c (multiple_reg_loc_descriptor, mem_loc_descriptor)
582         (concat_loc_descriptor, concatn_loc_descriptor, loc_descriptor)
583         (rtl_for_decl_location): Likewise.
584         * emit-rtl.c (gen_highpart, widen_memory_access): Likewise.
585         * expmed.c (extract_bit_field_1, extract_integral_bit_field): Likewise.
586         * expr.c (emit_group_load_1, clear_storage_hints): Likewise.
587         (emit_move_complex, emit_move_multi_word, emit_push_insn): Likewise.
588         (expand_expr_real_1): Likewise.
589         * function.c (assign_parm_setup_block_p, assign_parm_setup_block)
590         (pad_below): Likewise.
591         * gimple-fold.c (optimize_atomic_compare_exchange_p): Likewise.
592         * gimple-ssa-store-merging.c (rhs_valid_for_store_merging_p): Likewise.
593         * ira.c (get_subreg_tracking_sizes): Likewise.
594         * ira-build.c (ira_create_allocno_objects): Likewise.
595         * ira-color.c (coalesced_pseudo_reg_slot_compare): Likewise.
596         (ira_sort_regnos_for_alter_reg): Likewise.
597         * ira-costs.c (record_operand_costs): Likewise.
598         * lower-subreg.c (interesting_mode_p, simplify_gen_subreg_concatn)
599         (resolve_simple_move): Likewise.
600         * lra-constraints.c (get_reload_reg, operands_match_p): Likewise.
601         (process_addr_reg, simplify_operand_subreg, curr_insn_transform)
602         (lra_constraints): Likewise.
603         (CONST_POOL_OK_P): Reject variable-sized modes.
604         * lra-spills.c (slot, assign_mem_slot, pseudo_reg_slot_compare)
605         (add_pseudo_to_slot, lra_spill): Likewise.
606         * omp-low.c (omp_clause_aligned_alignment): Likewise.
607         * optabs-query.c (get_best_extraction_insn): Likewise.
608         * optabs-tree.c (expand_vec_cond_expr_p): Likewise.
609         * optabs.c (expand_vec_perm_var, expand_vec_cond_expr): Likewise.
610         (expand_mult_highpart, valid_multiword_target_p): Likewise.
611         * recog.c (offsettable_address_addr_space_p): Likewise.
612         * regcprop.c (maybe_mode_change): Likewise.
613         * reginfo.c (choose_hard_reg_mode, record_subregs_of_mode): Likewise.
614         * regrename.c (build_def_use): Likewise.
615         * regstat.c (dump_reg_info): Likewise.
616         * reload.c (complex_word_subreg_p, push_reload, find_dummy_reload)
617         (find_reloads, find_reloads_subreg_address): Likewise.
618         * reload1.c (eliminate_regs_1): Likewise.
619         * rtlanal.c (for_each_inc_dec_find_inc_dec, rtx_cost): Likewise.
620         * simplify-rtx.c (avoid_constant_pool_reference): Likewise.
621         (simplify_binary_operation_1, simplify_subreg): Likewise.
622         * targhooks.c (default_function_arg_padding): Likewise.
623         (default_hard_regno_nregs, default_class_max_nregs): Likewise.
624         * tree-cfg.c (verify_gimple_assign_binary): Likewise.
625         (verify_gimple_assign_ternary): Likewise.
626         * tree-inline.c (estimate_move_cost): Likewise.
627         * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
628         * tree-ssa-loop-ivopts.c (add_autoinc_candidates): Likewise.
629         (get_address_cost_ainc): Likewise.
630         * tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Likewise.
631         (vect_supportable_dr_alignment): Likewise.
632         * tree-vect-loop.c (vect_determine_vectorization_factor): Likewise.
633         (vectorizable_reduction): Likewise.
634         * tree-vect-stmts.c (vectorizable_assignment, vectorizable_shift)
635         (vectorizable_operation, vectorizable_load): Likewise.
636         * tree.c (build_same_sized_truth_vector_type): Likewise.
637         * valtrack.c (cleanup_auto_inc_dec): Likewise.
638         * var-tracking.c (emit_note_insn_var_location): Likewise.
639         * config/arc/arc.h (ASM_OUTPUT_CASE_END): Use as_a <scalar_int_mode>.
640         (ADDR_VEC_ALIGN): Likewise.
642 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
643             Alan Hayward  <alan.hayward@arm.com>
644             David Sherwood  <david.sherwood@arm.com>
646         * machmode.h (mode_to_bits): Return a poly_uint16 rather than an
647         unsigned short.
648         (GET_MODE_BITSIZE): Return a constant if ONLY_FIXED_SIZE_MODES,
649         or if measurement_type is polynomial.
650         * calls.c (shift_return_value): Treat GET_MODE_BITSIZE as polynomial.
651         * combine.c (make_extraction): Likewise.
652         * dse.c (find_shift_sequence): Likewise.
653         * dwarf2out.c (mem_loc_descriptor): Likewise.
654         * expmed.c (store_integral_bit_field, extract_bit_field_1): Likewise.
655         (extract_bit_field, extract_low_bits): Likewise.
656         * expr.c (convert_move, convert_modes, emit_move_insn_1): Likewise.
657         (optimize_bitfield_assignment_op, expand_assignment): Likewise.
658         (store_expr_with_bounds, store_field, expand_expr_real_1): Likewise.
659         * fold-const.c (optimize_bit_field_compare, merge_ranges): Likewise.
660         * gimple-fold.c (optimize_atomic_compare_exchange_p): Likewise.
661         * reload.c (find_reloads): Likewise.
662         * reload1.c (alter_reg): Likewise.
663         * stor-layout.c (bitwise_mode_for_mode, compute_record_mode): Likewise.
664         * targhooks.c (default_secondary_memory_needed_mode): Likewise.
665         * tree-if-conv.c (predicate_mem_writes): Likewise.
666         * tree-ssa-strlen.c (handle_builtin_memcmp): Likewise.
667         * tree-vect-patterns.c (adjust_bool_pattern): Likewise.
668         * tree-vect-stmts.c (vectorizable_simd_clone_call): Likewise.
669         * valtrack.c (dead_debug_insert_temp): Likewise.
670         * varasm.c (mergeable_constant_section): Likewise.
671         * config/sh/sh.h (LOCAL_ALIGNMENT): Use as_a <fixed_size_mode>.
673 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
674             Alan Hayward  <alan.hayward@arm.com>
675             David Sherwood  <david.sherwood@arm.com>
677         * expr.c (expand_assignment): Cope with polynomial mode sizes
678         when assigning to a CONCAT.
680 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
681             Alan Hayward  <alan.hayward@arm.com>
682             David Sherwood  <david.sherwood@arm.com>
684         * machmode.h (mode_precision): Change from unsigned short to
685         poly_uint16_pod.
686         (mode_to_precision): Return a poly_uint16 rather than an unsigned
687         short.
688         (GET_MODE_PRECISION): Return a constant if ONLY_FIXED_SIZE_MODES,
689         or if measurement_type is not polynomial.
690         (HWI_COMPUTABLE_MODE_P): Turn into a function.  Optimize the case
691         in which the mode is already known to be a scalar_int_mode.
692         * genmodes.c (emit_mode_precision): Change the type of mode_precision
693         from unsigned short to poly_uint16_pod.  Use ZERO_COEFFS for the
694         initializer.
695         * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
696         for GET_MODE_PRECISION.
697         * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
698         for GET_MODE_PRECISION.
699         * combine.c (update_rsp_from_reg_equal): Treat GET_MODE_PRECISION
700         as polynomial.
701         (try_combine, find_split_point, combine_simplify_rtx): Likewise.
702         (expand_field_assignment, make_extraction): Likewise.
703         (make_compound_operation_int, record_dead_and_set_regs_1): Likewise.
704         (get_last_value): Likewise.
705         * convert.c (convert_to_integer_1): Likewise.
706         * cse.c (cse_insn): Likewise.
707         * expr.c (expand_expr_real_1): Likewise.
708         * lra-constraints.c (simplify_operand_subreg): Likewise.
709         * optabs-query.c (can_atomic_load_p): Likewise.
710         * optabs.c (expand_atomic_load): Likewise.
711         (expand_atomic_store): Likewise.
712         * ree.c (combine_reaching_defs): Likewise.
713         * rtl.h (partial_subreg_p, paradoxical_subreg_p): Likewise.
714         * rtlanal.c (nonzero_bits1, lsb_bitfield_op_p): Likewise.
715         * tree.h (type_has_mode_precision_p): Likewise.
716         * ubsan.c (instrument_si_overflow): Likewise.
718 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
719             Alan Hayward  <alan.hayward@arm.com>
720             David Sherwood  <david.sherwood@arm.com>
722         * tree.h (TYPE_VECTOR_SUBPARTS): Turn into a function and handle
723         polynomial numbers of units.
724         (SET_TYPE_VECTOR_SUBPARTS): Likewise.
725         (valid_vector_subparts_p): New function.
726         (build_vector_type): Remove temporary shim and take the number
727         of units as a poly_uint64 rather than an int.
728         (build_opaque_vector_type): Take the number of units as a
729         poly_uint64 rather than an int.
730         * tree.c (build_vector_from_ctor): Handle polynomial
731         TYPE_VECTOR_SUBPARTS.
732         (type_hash_canon_hash, type_cache_hasher::equal): Likewise.
733         (uniform_vector_p, vector_type_mode, build_vector): Likewise.
734         (build_vector_from_val): If the number of units is variable,
735         use build_vec_duplicate_cst for constant operands and
736         VEC_DUPLICATE_EXPR otherwise.
737         (make_vector_type): Remove temporary is_constant ().
738         (build_vector_type, build_opaque_vector_type): Take the number of
739         units as a poly_uint64 rather than an int.
740         (check_vector_cst): Handle polynomial TYPE_VECTOR_SUBPARTS and
741         VECTOR_CST_NELTS.
742         * cfgexpand.c (expand_debug_expr): Likewise.
743         * expr.c (count_type_elements, categorize_ctor_elements_1): Likewise.
744         (store_constructor, expand_expr_real_1): Likewise.
745         (const_scalar_mask_from_tree): Likewise.
746         * fold-const-call.c (fold_const_reduction): Likewise.
747         * fold-const.c (const_binop, const_unop, fold_convert_const): Likewise.
748         (operand_equal_p, fold_vec_perm, fold_ternary_loc): Likewise.
749         (native_encode_vector, vec_cst_ctor_to_array): Likewise.
750         (fold_relational_const): Likewise.
751         (native_interpret_vector): Likewise.  Change the size from an
752         int to an unsigned int.
753         * gimple-fold.c (gimple_fold_stmt_to_constant_1): Handle polynomial
754         TYPE_VECTOR_SUBPARTS.
755         (gimple_fold_indirect_ref, gimple_build_vector): Likewise.
756         (gimple_build_vector_from_val): Use VEC_DUPLICATE_EXPR when
757         duplicating a non-constant operand into a variable-length vector.
758         * hsa-brig.c (hsa_op_immed::emit_to_buffer): Handle polynomial
759         TYPE_VECTOR_SUBPARTS and VECTOR_CST_NELTS.
760         * ipa-icf.c (sem_variable::equals): Likewise.
761         * match.pd: Likewise.
762         * omp-simd-clone.c (simd_clone_subparts): Likewise.
763         * print-tree.c (print_node): Likewise.
764         * stor-layout.c (layout_type): Likewise.
765         * targhooks.c (default_builtin_vectorization_cost): Likewise.
766         * tree-cfg.c (verify_gimple_comparison): Likewise.
767         (verify_gimple_assign_binary): Likewise.
768         (verify_gimple_assign_ternary): Likewise.
769         (verify_gimple_assign_single): Likewise.
770         * tree-pretty-print.c (dump_generic_node): Likewise.
771         * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
772         (simplify_bitfield_ref, is_combined_permutation_identity): Likewise.
773         * tree-vect-data-refs.c (vect_permute_store_chain): Likewise.
774         (vect_grouped_load_supported, vect_permute_load_chain): Likewise.
775         (vect_shift_permute_load_chain): Likewise.
776         * tree-vect-generic.c (nunits_for_known_piecewise_op): Likewise.
777         (expand_vector_condition, optimize_vector_constructor): Likewise.
778         (lower_vec_perm, get_compute_type): Likewise.
779         * tree-vect-loop.c (vect_determine_vectorization_factor): Likewise.
780         (get_initial_defs_for_reduction, vect_transform_loop): Likewise.
781         * tree-vect-patterns.c (vect_recog_bool_pattern): Likewise.
782         (vect_recog_mask_conversion_pattern): Likewise.
783         * tree-vect-slp.c (vect_supported_load_permutation_p): Likewise.
784         (vect_get_constant_vectors, vect_transform_slp_perm_load): Likewise.
785         * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
786         (get_group_load_store_type, vectorizable_mask_load_store): Likewise.
787         (vectorizable_bswap, simd_clone_subparts, vectorizable_assignment)
788         (vectorizable_shift, vectorizable_operation, vectorizable_store)
789         (vectorizable_load, vect_is_simple_cond, vectorizable_comparison)
790         (supportable_widening_operation): Likewise.
791         (supportable_narrowing_operation): Likewise.
792         * tree-vector-builder.c (tree_vector_builder::binary_encoded_nelts):
793         Likewise.
794         * varasm.c (output_constant): Likewise.
796 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
797             Alan Hayward  <alan.hayward@arm.com>
798             David Sherwood  <david.sherwood@arm.com>
800         * tree-vect-data-refs.c (vect_permute_store_chain): Reorganize
801         so that both the length == 3 and length != 3 cases set up their
802         own permute vectors.  Add comments explaining why we know the
803         number of elements is constant.
804         (vect_permute_load_chain): Likewise.
806 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
807             Alan Hayward  <alan.hayward@arm.com>
808             David Sherwood  <david.sherwood@arm.com>
810         * machmode.h (mode_nunits): Change from unsigned char to
811         poly_uint16_pod.
812         (ONLY_FIXED_SIZE_MODES): New macro.
813         (pod_mode::measurement_type, scalar_int_mode::measurement_type)
814         (scalar_float_mode::measurement_type, scalar_mode::measurement_type)
815         (complex_mode::measurement_type, fixed_size_mode::measurement_type):
816         New typedefs.
817         (mode_to_nunits): Return a poly_uint16 rather than an unsigned short.
818         (GET_MODE_NUNITS): Return a constant if ONLY_FIXED_SIZE_MODES,
819         or if measurement_type is not polynomial.
820         * genmodes.c (ZERO_COEFFS): New macro.
821         (emit_mode_nunits_inline): Make mode_nunits_inline return a
822         poly_uint16.
823         (emit_mode_nunits): Change the type of mode_nunits to poly_uint16_pod.
824         Use ZERO_COEFFS when emitting initializers.
825         * data-streamer.h (bp_pack_poly_value): New function.
826         (bp_unpack_poly_value): Likewise.
827         * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
828         for GET_MODE_NUNITS.
829         * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
830         for GET_MODE_NUNITS.
831         * tree.c (make_vector_type): Remove temporary shim and make
832         the real function take the number of units as a poly_uint64
833         rather than an int.
834         (build_vector_type_for_mode): Handle polynomial nunits.
835         * dwarf2out.c (loc_descriptor, add_const_value_attribute): Likewise.
836         * emit-rtl.c (const_vec_series_p_1): Likewise.
837         (gen_rtx_CONST_VECTOR): Likewise.
838         * fold-const.c (test_vec_duplicate_folding): Likewise.
839         * genrecog.c (validate_pattern): Likewise.
840         * optabs-query.c (can_vec_perm_var_p, can_mult_highpart_p): Likewise.
841         * optabs-tree.c (expand_vec_cond_expr_p): Likewise.
842         * optabs.c (expand_vector_broadcast, expand_binop_directly): Likewise.
843         (shift_amt_for_vec_perm_mask, expand_vec_perm_var): Likewise.
844         (expand_vec_cond_expr, expand_mult_highpart): Likewise.
845         * rtlanal.c (subreg_get_info): Likewise.
846         * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
847         (vect_grouped_load_supported): Likewise.
848         * tree-vect-generic.c (type_for_widest_vector_mode): Likewise.
849         * tree-vect-loop.c (have_whole_vector_shift): Likewise.
850         * simplify-rtx.c (simplify_unary_operation_1): Likewise.
851         (simplify_const_unary_operation, simplify_binary_operation_1)
852         (simplify_const_binary_operation, simplify_ternary_operation)
853         (test_vector_ops_duplicate, test_vector_ops): Likewise.
854         (simplify_immed_subreg): Use GET_MODE_NUNITS on a fixed_size_mode
855         instead of CONST_VECTOR_NUNITS.
856         * varasm.c (output_constant_pool_2): Likewise.
857         * rtx-vector-builder.c (rtx_vector_builder::build): Only include the
858         explicit-encoded elements in the XVEC for variable-length vectors.
860 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
862         * lra-constraints.c (curr_insn_transform): Use partial_subreg_p.
864 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
865             Alan Hayward  <alan.hayward@arm.com>
866             David Sherwood  <david.sherwood@arm.com>
868         * coretypes.h (fixed_size_mode): Declare.
869         (fixed_size_mode_pod): New typedef.
870         * builtins.h (target_builtins::x_apply_args_mode)
871         (target_builtins::x_apply_result_mode): Change type to
872         fixed_size_mode_pod.
873         * builtins.c (apply_args_size, apply_result_size, result_vector)
874         (expand_builtin_apply_args_1, expand_builtin_apply)
875         (expand_builtin_return): Update accordingly.
877 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
879         * cse.c (hash_rtx_cb): Hash only the encoded elements.
880         * cselib.c (cselib_hash_rtx): Likewise.
881         * expmed.c (make_tree): Build VECTOR_CSTs directly from the
882         CONST_VECTOR encoding.
884 2017-01-03  Jakub Jelinek  <jakub@redhat.com>
885             Jeff Law  <law@redhat.com>
887         PR target/83641
888         * config/i386/i386.c (ix86_adjust_stack_and_probe_stack_clash): For
889         noreturn probe, use gen_pop instead of ix86_emit_restore_reg_using_pop,
890         only set RTX_FRAME_RELATED_P on both the push and pop if cfa_reg is sp
891         and add REG_CFA_ADJUST_CFA notes in that case to both insns.
893         PR target/83641
894         * config/i386/i386.c (ix86_adjust_stack_and_probe_stack_clash): Do not
895         explicitly probe *sp in a noreturn function if there were any callee
896         register saves or frame pointer is needed.
898 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
900         PR debug/83621
901         * cfgexpand.c (expand_debug_expr): Return NULL if mode is
902         BLKmode for ternary, binary or unary expressions.
904         PR debug/83645
905         * var-tracking.c (delete_vta_debug_insn): New inline function.
906         (delete_vta_debug_insns): Add USE_CFG argument, if true, walk just
907         insns from get_insns () to NULL instead of each bb separately.
908         Use delete_vta_debug_insn.  No longer static.
909         (vt_debug_insns_local, variable_tracking_main_1): Adjust
910         delete_vta_debug_insns callers.
911         * rtl.h (delete_vta_debug_insns): Declare.
912         * final.c (rest_of_handle_final): Call delete_vta_debug_insns
913         instead of variable_tracking_main.
915 2018-01-03  Martin Sebor  <msebor@redhat.com>
917         PR tree-optimization/83603
918         * calls.c (maybe_warn_nonstring_arg): Avoid accessing function
919         arguments past the endof the argument list in functions declared
920         without a prototype.
921         * gimple-ssa-warn-restrict.c (wrestrict_dom_walker::check_call):
922         Avoid checking when arguments are null.
924 2018-01-03  Martin Sebor  <msebor@redhat.com>
926         PR c/83559
927         * doc/extend.texi (attribute const): Fix a typo.
928         * ipa-pure-const.c ((warn_function_const, warn_function_pure): Avoid
929         issuing -Wsuggest-attribute for void functions.
931 2018-01-03  Martin Sebor  <msebor@redhat.com>
933         * gimple-ssa-warn-restrict.c (builtin_memref::builtin_memref): Use
934         offset_int::from instead of wide_int::to_shwi.
935         (maybe_diag_overlap): Remove assertion.
936         Use HOST_WIDE_INT_PRINT_DEC instead of %lli.
937         * gimple-ssa-sprintf.c (format_directive): Same.
938         (parse_directive): Same.
939         (sprintf_dom_walker::compute_format_length): Same.
940         (try_substitute_return_value): Same.
942 2017-01-03  Jeff Law  <law@redhat.com>
944         PR middle-end/83654
945         * explow.c (anti_adjust_stack_and_probe_stack_clash): Test a
946         non-constant residual for zero at runtime and avoid probing in
947         that case.  Reorganize code for trailing problem to mirror handling
948         of the residual.
950 2018-01-03  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
952         PR tree-optimization/83501
953         * tree-ssa-strlen.c (get_string_cst): New.
954         (handle_char_store): Call get_string_cst.
956 2018-01-03  Martin Liska  <mliska@suse.cz>
958         PR tree-optimization/83593
959         * tree-ssa-strlen.c: Include tree-cfg.h.
960         (strlen_check_and_optimize_stmt): Add new argument cleanup_eh.
961         (strlen_dom_walker): Add new member variable m_cleanup_cfg.
962         (strlen_dom_walker::strlen_dom_walker): Initialize m_cleanup_cfg
963         to false.
964         (strlen_dom_walker::before_dom_children): Call
965         gimple_purge_dead_eh_edges. Dump tranformation with details
966         dump flags.
967         (strlen_dom_walker::before_dom_children): Update call by adding
968         new argument cleanup_eh.
969         (pass_strlen::execute): Return TODO_cleanup_cfg if needed.
971 2018-01-03  Martin Liska  <mliska@suse.cz>
973         PR ipa/83549
974         * cif-code.def (VARIADIC_THUNK): New enum value.
975         * ipa-fnsummary.c (compute_fn_summary): Do not inline variadic
976         thunks.
978 2018-01-03  Jan Beulich  <jbeulich@suse.com>
980         * sse.md (mov<mode>_internal): Tighten condition for when to use
981         vmovdqu<ssescalarsize> for TI and OI modes.
983 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
985         Update copyright years.
987 2018-01-03  Martin Liska  <mliska@suse.cz>
989         PR ipa/83594
990         * ipa-visibility.c (function_and_variable_visibility): Skip
991         functions with noipa attribure.
993 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
995         * gcc.c (process_command): Update copyright notice dates.
996         * gcov-dump.c (print_version): Ditto.
997         * gcov.c (print_version): Ditto.
998         * gcov-tool.c (print_version): Ditto.
999         * gengtype.c (create_file): Ditto.
1000         * doc/cpp.texi: Bump @copying's copyright year.
1001         * doc/cppinternals.texi: Ditto.
1002         * doc/gcc.texi: Ditto.
1003         * doc/gccint.texi: Ditto.
1004         * doc/gcov.texi: Ditto.
1005         * doc/install.texi: Ditto.
1006         * doc/invoke.texi: Ditto.
1008 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1010         * vector-builder.h (vector_builder::m_full_nelts): Change from
1011         unsigned int to poly_uint64.
1012         (vector_builder::full_nelts): Update prototype accordingly.
1013         (vector_builder::new_vector): Likewise.
1014         (vector_builder::encoded_full_vector_p): Handle polynomial full_nelts.
1015         (vector_builder::operator ==): Likewise.
1016         (vector_builder::finalize): Likewise.
1017         * int-vector-builder.h (int_vector_builder::int_vector_builder):
1018         Take the number of elements as a poly_uint64 rather than an
1019         unsigned int.
1020         * vec-perm-indices.h (vec_perm_indices::m_nelts_per_input): Change
1021         from unsigned int to poly_uint64.
1022         (vec_perm_indices::vec_perm_indices): Update prototype accordingly.
1023         (vec_perm_indices::new_vector): Likewise.
1024         (vec_perm_indices::length): Likewise.
1025         (vec_perm_indices::nelts_per_input): Likewise.
1026         (vec_perm_indices::input_nelts): Likewise.
1027         * vec-perm-indices.c (vec_perm_indices::new_vector): Take the
1028         number of elements per input as a poly_uint64 rather than an
1029         unsigned int.  Use the original encoding for variable-length
1030         vectors, rather than clamping each individual element.
1031         For the second and subsequent elements in each pattern,
1032         clamp the step and base before clamping their sum.
1033         (vec_perm_indices::series_p): Handle polynomial element counts.
1034         (vec_perm_indices::all_in_range_p): Likewise.
1035         (vec_perm_indices_to_tree): Likewise.
1036         (vec_perm_indices_to_rtx): Likewise.
1037         * tree-vect-stmts.c (vect_gen_perm_mask_any): Likewise.
1038         * tree-vector-builder.c (tree_vector_builder::new_unary_operation)
1039         (tree_vector_builder::new_binary_operation): Handle polynomial
1040         element counts.  Return false if we need to know the number
1041         of elements at compile time.
1042         * fold-const.c (fold_vec_perm): Punt if the number of elements
1043         isn't known at compile time.
1045 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1047         * vec-perm-indices.h (vec_perm_builder): Change element type
1048         from HOST_WIDE_INT to poly_int64.
1049         (vec_perm_indices::element_type): Update accordingly.
1050         (vec_perm_indices::clamp): Handle polynomial element_types.
1051         * vec-perm-indices.c (vec_perm_indices::series_p): Likewise.
1052         (vec_perm_indices::all_in_range_p): Likewise.
1053         (tree_to_vec_perm_builder): Check for poly_int64 trees rather
1054         than shwi trees.
1055         * vector-builder.h (vector_builder::stepped_sequence_p): Handle
1056         polynomial vec_perm_indices element types.
1057         * int-vector-builder.h (int_vector_builder::equal_p): Likewise.
1058         * fold-const.c (fold_vec_perm): Likewise.
1059         * optabs.c (shift_amt_for_vec_perm_mask): Likewise.
1060         * tree-vect-generic.c (lower_vec_perm): Likewise.
1061         * tree-vect-slp.c (vect_transform_slp_perm_load): Likewise.
1062         * config/aarch64/aarch64.c (aarch64_evpc_tbl): Cast d->perm
1063         element type to HOST_WIDE_INT.
1065 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1066             Alan Hayward  <alan.hayward@arm.com>
1067             David Sherwood  <david.sherwood@arm.com>
1069         * alias.c (addr_side_effect_eval): Take the size as a poly_int64
1070         rather than an int.  Use plus_constant.
1071         (memrefs_conflict_p): Take the sizes as poly_int64s rather than ints.
1072         Take the offset "c" as a poly_int64 rather than a HOST_WIDE_INT.
1074 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1075             Alan Hayward  <alan.hayward@arm.com>
1076             David Sherwood  <david.sherwood@arm.com>
1078         * calls.c (emit_call_1, expand_call): Change struct_value_size from
1079         a HOST_WIDE_INT to a poly_int64.
1081 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1082             Alan Hayward  <alan.hayward@arm.com>
1083             David Sherwood  <david.sherwood@arm.com>
1085         * calls.c (load_register_parameters): Cope with polynomial
1086         mode sizes.  Require a constant size for BLKmode parameters
1087         that aren't described by a PARALLEL.  If BLOCK_REG_PADDING
1088         forces a parameter to be padded at the lsb end in order to
1089         fill a complete number of words, require the parameter size
1090         to be ordered wrt UNITS_PER_WORD.
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         * reload1.c (spill_stack_slot_width): Change element type
1097         from unsigned int to poly_uint64_pod.
1098         (alter_reg): Treat mode sizes as polynomial.
1100 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1101             Alan Hayward  <alan.hayward@arm.com>
1102             David Sherwood  <david.sherwood@arm.com>
1104         * reload.c (complex_word_subreg_p): New function.
1105         (reload_inner_reg_of_subreg, push_reload): Use it.
1107 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1108             Alan Hayward  <alan.hayward@arm.com>
1109             David Sherwood  <david.sherwood@arm.com>
1111         * lra-constraints.c (process_alt_operands): Reject matched
1112         operands whose sizes aren't ordered.
1113         (match_reload): Refer to this check here.
1115 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1116             Alan Hayward  <alan.hayward@arm.com>
1117             David Sherwood  <david.sherwood@arm.com>
1119         * builtins.c (expand_ifn_atomic_compare_exchange_into_call): Assert
1120         that the mode size is in the set {1, 2, 4, 8, 16}.
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         * var-tracking.c (adjust_mems): Treat mode sizes as polynomial.
1127         Use plus_constant instead of gen_rtx_PLUS.
1129 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1130             Alan Hayward  <alan.hayward@arm.com>
1131             David Sherwood  <david.sherwood@arm.com>
1133         * config/cr16/cr16-protos.h (cr16_push_rounding): Declare.
1134         * config/cr16/cr16.h (PUSH_ROUNDING): Move implementation to...
1135         * config/cr16/cr16.c (cr16_push_rounding): ...this new function.
1136         * config/h8300/h8300-protos.h (h8300_push_rounding): Declare.
1137         * config/h8300/h8300.h (PUSH_ROUNDING): Move implementation to...
1138         * config/h8300/h8300.c (h8300_push_rounding): ...this new function.
1139         * config/i386/i386-protos.h (ix86_push_rounding): Declare.
1140         * config/i386/i386.h (PUSH_ROUNDING): Move implementation to...
1141         * config/i386/i386.c (ix86_push_rounding): ...this new function.
1142         * config/m32c/m32c-protos.h (m32c_push_rounding): Take and return
1143         a poly_int64.
1144         * config/m32c/m32c.c (m32c_push_rounding): Likewise.
1145         * config/m68k/m68k-protos.h (m68k_push_rounding): Declare.
1146         * config/m68k/m68k.h (PUSH_ROUNDING): Move implementation to...
1147         * config/m68k/m68k.c (m68k_push_rounding): ...this new function.
1148         * config/pdp11/pdp11-protos.h (pdp11_push_rounding): Declare.
1149         * config/pdp11/pdp11.h (PUSH_ROUNDING): Move implementation to...
1150         * config/pdp11/pdp11.c (pdp11_push_rounding): ...this new function.
1151         * config/stormy16/stormy16-protos.h (xstormy16_push_rounding): Declare.
1152         * config/stormy16/stormy16.h (PUSH_ROUNDING): Move implementation to...
1153         * config/stormy16/stormy16.c (xstormy16_push_rounding): ...this new
1154         function.
1155         * expr.c (emit_move_resolve_push): Treat the input and result
1156         of PUSH_ROUNDING as a poly_int64.
1157         (emit_move_complex_push, emit_single_push_insn_1): Likewise.
1158         (emit_push_insn): Likewise.
1159         * lra-eliminations.c (mark_not_eliminable): Likewise.
1160         * recog.c (push_operand): Likewise.
1161         * reload1.c (elimination_effects): Likewise.
1162         * rtlanal.c (nonzero_bits1): Likewise.
1163         * calls.c (store_one_arg): Likewise.  Require the padding to be
1164         known at compile time.
1166 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1167             Alan Hayward  <alan.hayward@arm.com>
1168             David Sherwood  <david.sherwood@arm.com>
1170         * expr.c (emit_single_push_insn_1): Treat mode sizes as polynomial.
1171         Use plus_constant instead of gen_rtx_PLUS.
1173 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1174             Alan Hayward  <alan.hayward@arm.com>
1175             David Sherwood  <david.sherwood@arm.com>
1177         * auto-inc-dec.c (set_inc_state): Take the mode size as a poly_int64
1178         rather than an 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         * expr.c (expand_expr_real_1): Use tree_to_poly_uint64
1185         instead of int_size_in_bytes when handling VIEW_CONVERT_EXPRs
1186         via stack temporaries.  Treat the mode size as polynomial too.
1188 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1189             Alan Hayward  <alan.hayward@arm.com>
1190             David Sherwood  <david.sherwood@arm.com>
1192         * expr.c (expand_expr_real_2): When handling conversions involving
1193         unions, apply tree_to_poly_uint64 to the TYPE_SIZE rather than
1194         multiplying int_size_in_bytes by BITS_PER_UNIT.  Treat GET_MODE_BISIZE
1195         as a poly_uint64 too.
1197 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1198             Alan Hayward  <alan.hayward@arm.com>
1199             David Sherwood  <david.sherwood@arm.com>
1201         * rtlanal.c (subreg_get_info): Handle polynomial mode sizes.
1203 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1204             Alan Hayward  <alan.hayward@arm.com>
1205             David Sherwood  <david.sherwood@arm.com>
1207         * combine.c (can_change_dest_mode): Handle polynomial
1208         REGMODE_NATURAL_SIZE.
1209         * expmed.c (store_bit_field_1): Likewise.
1210         * expr.c (store_constructor): Likewise.
1211         * emit-rtl.c (validate_subreg): Operate on polynomial mode sizes
1212         and polynomial REGMODE_NATURAL_SIZE.
1213         (gen_lowpart_common): Likewise.
1214         * reginfo.c (record_subregs_of_mode): Likewise.
1215         * rtlanal.c (read_modify_subreg_p): Likewise.
1217 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1218             Alan Hayward  <alan.hayward@arm.com>
1219             David Sherwood  <david.sherwood@arm.com>
1221         * internal-fn.c (expand_vector_ubsan_overflow): Handle polynomial
1222         numbers of elements.
1224 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1225             Alan Hayward  <alan.hayward@arm.com>
1226             David Sherwood  <david.sherwood@arm.com>
1228         * match.pd: Cope with polynomial numbers of vector elements.
1230 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1231             Alan Hayward  <alan.hayward@arm.com>
1232             David Sherwood  <david.sherwood@arm.com>
1234         * fold-const.c (fold_indirect_ref_1): Handle polynomial offsets
1235         in a POINTER_PLUS_EXPR.
1237 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1238             Alan Hayward  <alan.hayward@arm.com>
1239             David Sherwood  <david.sherwood@arm.com>
1241         * omp-simd-clone.c (simd_clone_subparts): New function.
1242         (simd_clone_init_simd_arrays): Use it instead of TYPE_VECTOR_SUBPARTS.
1243         (ipa_simd_modify_function_body): Likewise.
1245 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1246             Alan Hayward  <alan.hayward@arm.com>
1247             David Sherwood  <david.sherwood@arm.com>
1249         * tree-vect-generic.c (nunits_for_known_piecewise_op): New function.
1250         (expand_vector_piecewise): Use it instead of TYPE_VECTOR_SUBPARTS.
1251         (expand_vector_addition, add_rshift, expand_vector_divmod): Likewise.
1252         (expand_vector_condition, vector_element): Likewise.
1253         (subparts_gt): New function.
1254         (get_compute_type): Use subparts_gt.
1255         (count_type_subparts): Delete.
1256         (expand_vector_operations_1): Use subparts_gt instead of
1257         count_type_subparts.
1259 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1260             Alan Hayward  <alan.hayward@arm.com>
1261             David Sherwood  <david.sherwood@arm.com>
1263         * tree-vect-data-refs.c (vect_no_alias_p): Replace with...
1264         (vect_compile_time_alias): ...this new function.  Do the calculation
1265         on poly_ints rather than trees.
1266         (vect_prune_runtime_alias_test_list): Update call accordingly.
1268 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1269             Alan Hayward  <alan.hayward@arm.com>
1270             David Sherwood  <david.sherwood@arm.com>
1272         * tree-vect-slp.c (vect_build_slp_tree_1): Handle polynomial
1273         numbers of units.
1274         (vect_schedule_slp_instance): Likewise.
1276 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1277             Alan Hayward  <alan.hayward@arm.com>
1278             David Sherwood  <david.sherwood@arm.com>
1280         * tree-vect-slp.c (vect_get_and_check_slp_defs): Reject
1281         constant and extern definitions for variable-length vectors.
1282         (vect_get_constant_vectors): Note that the number of units
1283         is known to be constant.
1285 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1286             Alan Hayward  <alan.hayward@arm.com>
1287             David Sherwood  <david.sherwood@arm.com>
1289         * tree-vect-stmts.c (vectorizable_conversion): Treat the number
1290         of units as polynomial.  Choose between WIDE and NARROW based
1291         on multiple_p.
1293 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1294             Alan Hayward  <alan.hayward@arm.com>
1295             David Sherwood  <david.sherwood@arm.com>
1297         * tree-vect-stmts.c (simd_clone_subparts): New function.
1298         (vectorizable_simd_clone_call): Use it instead of TYPE_VECTOR_SUBPARTS.
1300 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1301             Alan Hayward  <alan.hayward@arm.com>
1302             David Sherwood  <david.sherwood@arm.com>
1304         * tree-vect-stmts.c (vectorizable_call): Treat the number of
1305         vectors as polynomial.  Use build_index_vector for
1306         IFN_GOMP_SIMD_LANE.
1308 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1309             Alan Hayward  <alan.hayward@arm.com>
1310             David Sherwood  <david.sherwood@arm.com>
1312         * tree-vect-stmts.c (get_load_store_type): Treat the number of
1313         units as polynomial.  Reject VMAT_ELEMENTWISE and VMAT_STRIDED_SLP
1314         for variable-length vectors.
1315         (vectorizable_mask_load_store): Treat the number of units as
1316         polynomial, asserting that it is constant if the condition has
1317         already been enforced.
1318         (vectorizable_store, vectorizable_load): Likewise.
1320 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1321             Alan Hayward  <alan.hayward@arm.com>
1322             David Sherwood  <david.sherwood@arm.com>
1324         * tree-vect-loop.c (vectorizable_live_operation): Treat the number
1325         of units as polynomial.  Punt if we can't tell at compile time
1326         which vector contains the final result.
1328 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1329             Alan Hayward  <alan.hayward@arm.com>
1330             David Sherwood  <david.sherwood@arm.com>
1332         * tree-vect-loop.c (vectorizable_induction): Treat the number
1333         of units as polynomial.  Punt on SLP inductions.  Use an integer
1334         VEC_SERIES_EXPR for variable-length integer reductions.  Use a
1335         cast of such a series for variable-length floating-point
1336         reductions.
1338 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1339             Alan Hayward  <alan.hayward@arm.com>
1340             David Sherwood  <david.sherwood@arm.com>
1342         * tree.h (build_index_vector): Declare.
1343         * tree.c (build_index_vector): New function.
1344         * tree-vect-loop.c (get_initial_defs_for_reduction): Treat the number
1345         of units as polynomial, forcibly converting it to a constant if
1346         vectorizable_reduction has already enforced the condition.
1347         (vect_create_epilog_for_reduction): Likewise.  Use build_index_vector
1348         to create a {1,2,3,...} vector.
1349         (vectorizable_reduction): Treat the number of units as polynomial.
1350         Choose vectype_in based on the largest scalar element size rather
1351         than the smallest number of units.  Enforce the restrictions
1352         relied on above.
1354 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1355             Alan Hayward  <alan.hayward@arm.com>
1356             David Sherwood  <david.sherwood@arm.com>
1358         * tree-vect-data-refs.c (vector_alignment_reachable_p): Treat the
1359         number of units as polynomial.
1361 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1362             Alan Hayward  <alan.hayward@arm.com>
1363             David Sherwood  <david.sherwood@arm.com>
1365         * target.h (vector_sizes, auto_vector_sizes): New typedefs.
1366         * target.def (autovectorize_vector_sizes): Return the vector sizes
1367         by pointer, using vector_sizes rather than a bitmask.
1368         * targhooks.h (default_autovectorize_vector_sizes): Update accordingly.
1369         * targhooks.c (default_autovectorize_vector_sizes): Likewise.
1370         * config/aarch64/aarch64.c (aarch64_autovectorize_vector_sizes):
1371         Likewise.
1372         * config/arc/arc.c (arc_autovectorize_vector_sizes): Likewise.
1373         * config/arm/arm.c (arm_autovectorize_vector_sizes): Likewise.
1374         * config/i386/i386.c (ix86_autovectorize_vector_sizes): Likewise.
1375         * config/mips/mips.c (mips_autovectorize_vector_sizes): Likewise.
1376         * omp-general.c (omp_max_vf): Likewise.
1377         * omp-low.c (omp_clause_aligned_alignment): Likewise.
1378         * optabs-query.c (can_vec_mask_load_store_p): Likewise.
1379         * tree-vect-loop.c (vect_analyze_loop): Likewise.
1380         * tree-vect-slp.c (vect_slp_bb): Likewise.
1381         * doc/tm.texi: Regenerate.
1382         * tree-vectorizer.h (current_vector_size): Change from an unsigned int
1383         to a poly_uint64.
1384         * tree-vect-stmts.c (get_vectype_for_scalar_type_and_size): Take
1385         the vector size as a poly_uint64 rather than an unsigned int.
1386         (current_vector_size): Change from an unsigned int to a poly_uint64.
1387         (get_vectype_for_scalar_type): Update accordingly.
1388         * tree.h (build_truth_vector_type): Take the size and number of
1389         units as a poly_uint64 rather than an unsigned int.
1390         (build_vector_type): Add a temporary overload that takes
1391         the number of units as a poly_uint64 rather than an unsigned int.
1392         * tree.c (make_vector_type): Likewise.
1393         (build_truth_vector_type): Take the number of units as a poly_uint64
1394         rather than an unsigned int.
1396 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1397             Alan Hayward  <alan.hayward@arm.com>
1398             David Sherwood  <david.sherwood@arm.com>
1400         * target.def (get_mask_mode): Take the number of units and length
1401         as poly_uint64s rather than unsigned ints.
1402         * targhooks.h (default_get_mask_mode): Update accordingly.
1403         * targhooks.c (default_get_mask_mode): Likewise.
1404         * config/i386/i386.c (ix86_get_mask_mode): Likewise.
1405         * doc/tm.texi: Regenerate.
1407 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1408             Alan Hayward  <alan.hayward@arm.com>
1409             David Sherwood  <david.sherwood@arm.com>
1411         * omp-general.h (omp_max_vf): Return a poly_uint64 instead of an int.
1412         * omp-general.c (omp_max_vf): Likewise.
1413         * omp-expand.c (omp_adjust_chunk_size): Update call to omp_max_vf.
1414         (expand_omp_simd): Handle polynomial safelen.
1415         * omp-low.c (omplow_simd_context): Add a default constructor.
1416         (omplow_simd_context::max_vf): Change from int to poly_uint64.
1417         (lower_rec_simd_input_clauses): Update accordingly.
1418         (lower_rec_input_clauses): Likewise.
1420 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1421             Alan Hayward  <alan.hayward@arm.com>
1422             David Sherwood  <david.sherwood@arm.com>
1424         * tree-vectorizer.h (vect_nunits_for_cost): New function.
1425         * tree-vect-loop.c (vect_model_reduction_cost): Use it.
1426         * tree-vect-slp.c (vect_analyze_slp_cost_1): Likewise.
1427         (vect_analyze_slp_cost): Likewise.
1428         * tree-vect-stmts.c (vect_model_store_cost): Likewise.
1429         (vect_model_load_cost): Likewise.
1431 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1432             Alan Hayward  <alan.hayward@arm.com>
1433             David Sherwood  <david.sherwood@arm.com>
1435         * tree-vect-slp.c (vect_record_max_nunits, vect_build_slp_tree_1)
1436         (vect_build_slp_tree_2, vect_build_slp_tree): Change max_nunits
1437         from an unsigned int * to a poly_uint64_pod *.
1438         (calculate_unrolling_factor): New function.
1439         (vect_analyze_slp_instance): Use it.  Track polynomial max_nunits.
1441 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1442             Alan Hayward  <alan.hayward@arm.com>
1443             David Sherwood  <david.sherwood@arm.com>
1445         * tree-vectorizer.h (_slp_instance::unrolling_factor): Change
1446         from an unsigned int to a poly_uint64.
1447         (_loop_vec_info::slp_unrolling_factor): Likewise.
1448         (_loop_vec_info::vectorization_factor): Change from an int
1449         to a poly_uint64.
1450         (MAX_VECTORIZATION_FACTOR): Bump from 64 to INT_MAX.
1451         (vect_get_num_vectors): New function.
1452         (vect_update_max_nunits, vect_vf_for_cost): Likewise.
1453         (vect_get_num_copies): Use vect_get_num_vectors.
1454         (vect_analyze_data_ref_dependences): Change max_vf from an int *
1455         to an unsigned int *.
1456         (vect_analyze_data_refs): Change min_vf from an int * to a
1457         poly_uint64 *.
1458         (vect_transform_slp_perm_load): Take the vf as a poly_uint64 rather
1459         than an unsigned HOST_WIDE_INT.
1460         * tree-vect-data-refs.c (vect_analyze_possibly_independent_ddr)
1461         (vect_analyze_data_ref_dependence): Change max_vf from an int *
1462         to an unsigned int *.
1463         (vect_analyze_data_ref_dependences): Likewise.
1464         (vect_compute_data_ref_alignment): Handle polynomial vf.
1465         (vect_enhance_data_refs_alignment): Likewise.
1466         (vect_prune_runtime_alias_test_list): Likewise.
1467         (vect_shift_permute_load_chain): Likewise.
1468         (vect_supportable_dr_alignment): Likewise.
1469         (dependence_distance_ge_vf): Take the vectorization factor as a
1470         poly_uint64 rather than an unsigned HOST_WIDE_INT.
1471         (vect_analyze_data_refs): Change min_vf from an int * to a
1472         poly_uint64 *.
1473         * tree-vect-loop-manip.c (vect_gen_scalar_loop_niters): Take
1474         vfm1 as a poly_uint64 rather than an int.  Make the same change
1475         for the returned bound_scalar.
1476         (vect_gen_vector_loop_niters): Handle polynomial vf.
1477         (vect_do_peeling): Likewise.  Update call to
1478         vect_gen_scalar_loop_niters and handle polynomial bound_scalars.
1479         (vect_gen_vector_loop_niters_mult_vf): Assert that the vf must
1480         be constant.
1481         * tree-vect-loop.c (vect_determine_vectorization_factor)
1482         (vect_update_vf_for_slp, vect_analyze_loop_2): Handle polynomial vf.
1483         (vect_get_known_peeling_cost): Likewise.
1484         (vect_estimate_min_profitable_iters, vectorizable_reduction): Likewise.
1485         (vect_worthwhile_without_simd_p, vectorizable_induction): Likewise.
1486         (vect_transform_loop): Likewise.  Use the lowest possible VF when
1487         updating the upper bounds of the loop.
1488         (vect_min_worthwhile_factor): Make static.  Return an unsigned int
1489         rather than an int.
1490         * tree-vect-slp.c (vect_attempt_slp_rearrange_stmts): Cope with
1491         polynomial unroll factors.
1492         (vect_analyze_slp_cost_1, vect_analyze_slp_instance): Likewise.
1493         (vect_make_slp_decision): Likewise.
1494         (vect_supported_load_permutation_p): Likewise, and polynomial
1495         vf too.
1496         (vect_analyze_slp_cost): Handle polynomial vf.
1497         (vect_slp_analyze_node_operations): Likewise.
1498         (vect_slp_analyze_bb_1): Likewise.
1499         (vect_transform_slp_perm_load): Take the vf as a poly_uint64 rather
1500         than an unsigned HOST_WIDE_INT.
1501         * tree-vect-stmts.c (vectorizable_simd_clone_call, vectorizable_store)
1502         (vectorizable_load): Handle polynomial vf.
1503         * tree-vectorizer.c (simduid_to_vf::vf): Change from an int to
1504         a poly_uint64.
1505         (adjust_simduid_builtins, shrink_simd_arrays): Update accordingly.
1507 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1508             Alan Hayward  <alan.hayward@arm.com>
1509             David Sherwood  <david.sherwood@arm.com>
1511         * match.pd: Handle bit operations involving three constants
1512         and try to fold one pair.
1514 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1516         * tree-vect-loop-manip.c: Include gimple-fold.h.
1517         (slpeel_make_loop_iterate_ntimes): Add step, final_iv and
1518         niters_maybe_zero parameters.  Handle other cases besides a step of 1.
1519         (vect_gen_vector_loop_niters): Add a step_vector_ptr parameter.
1520         Add a path that uses a step of VF instead of 1, but disable it
1521         for now.
1522         (vect_do_peeling): Add step_vector, niters_vector_mult_vf_var
1523         and niters_no_overflow parameters.  Update calls to
1524         slpeel_make_loop_iterate_ntimes and vect_gen_vector_loop_niters.
1525         Create a new SSA name if the latter choses to use a ste other
1526         than zero, and return it via niters_vector_mult_vf_var.
1527         * tree-vect-loop.c (vect_transform_loop): Update calls to
1528         vect_do_peeling, vect_gen_vector_loop_niters and
1529         slpeel_make_loop_iterate_ntimes.
1530         * tree-vectorizer.h (slpeel_make_loop_iterate_ntimes, vect_do_peeling)
1531         (vect_gen_vector_loop_niters): Update declarations after above changes.
1533 2018-01-02  Michael Meissner  <meissner@linux.vnet.ibm.com>
1535         * config/rs6000/rs6000.md (floor<mode>2): Add support for IEEE
1536         128-bit round to integer instructions.
1537         (ceil<mode>2): Likewise.
1538         (btrunc<mode>2): Likewise.
1539         (round<mode>2): Likewise.
1541 2018-01-02  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>
1543         * config/rs6000/rs6000-string.c (expand_block_move): Allow the use of
1544         unaligned VSX load/store on P8/P9.
1545         (expand_block_clear): Allow the use of unaligned VSX
1546         load/store on P8/P9.
1548 2018-01-02  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
1550         * config/rs6000/rs6000-p8swap.c (swap_feeds_both_load_and_store):
1551         New function.
1552         (rs6000_analyze_swaps): Mark a web unoptimizable if it contains a
1553         swap associated with both a load and a store.
1555 2018-01-02  Andrew Waterman  <andrew@sifive.com>
1557         * config/riscv/linux.h (ICACHE_FLUSH_FUNC): New.
1558         * config/riscv/riscv.md (clear_cache): Use it.
1560 2018-01-02  Artyom Skrobov  <tyomitch@gmail.com>
1562         * web.c: Remove out-of-date comment.
1564 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1566         * expr.c (fixup_args_size_notes): Check that any existing
1567         REG_ARGS_SIZE notes are correct, and don't try to re-add them.
1568         (emit_single_push_insn_1): Move stack_pointer_delta adjustment to...
1569         (emit_single_push_insn): ...here.
1571 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1573         * rtl.h (CONST_VECTOR_ELT): Redefine to const_vector_elt.
1574         (const_vector_encoded_nelts): New function.
1575         (CONST_VECTOR_NUNITS): Redefine to use GET_MODE_NUNITS.
1576         (const_vector_int_elt, const_vector_elt): Declare.
1577         * emit-rtl.c (const_vector_int_elt_1): New function.
1578         (const_vector_elt): Likewise.
1579         * simplify-rtx.c (simplify_immed_subreg): Avoid taking the address
1580         of CONST_VECTOR_ELT.
1582 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1584         * expr.c: Include rtx-vector-builder.h.
1585         (const_vector_mask_from_tree): Use rtx_vector_builder and operate
1586         directly on the tree encoding.
1587         (const_vector_from_tree): Likewise.
1588         * optabs.c: Include rtx-vector-builder.h.
1589         (expand_vec_perm_var): Use rtx_vector_builder and create a repeating
1590         sequence of "u" values.
1591         * vec-perm-indices.c: Include rtx-vector-builder.h.
1592         (vec_perm_indices_to_rtx): Use rtx_vector_builder and operate
1593         directly on the vec_perm_indices encoding.
1595 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1597         * doc/rtl.texi (const_vector): Describe new encoding scheme.
1598         * Makefile.in (OBJS): Add rtx-vector-builder.o.
1599         * rtx-vector-builder.h: New file.
1600         * rtx-vector-builder.c: Likewise.
1601         * rtl.h (rtx_def::u2): Add a const_vector field.
1602         (CONST_VECTOR_NPATTERNS): New macro.
1603         (CONST_VECTOR_NELTS_PER_PATTERN): Likewise.
1604         (CONST_VECTOR_DUPLICATE_P): Likewise.
1605         (CONST_VECTOR_STEPPED_P): Likewise.
1606         (CONST_VECTOR_ENCODED_ELT): Likewise.
1607         (const_vec_duplicate_p): Check for a duplicated vector encoding.
1608         (unwrap_const_vec_duplicate): Likewise.
1609         (const_vec_series_p): Check for a non-duplicated vector encoding.
1610         Say that the function only returns true for integer vectors.
1611         * emit-rtl.c: Include rtx-vector-builder.h.
1612         (gen_const_vec_duplicate_1): Delete.
1613         (gen_const_vector): Call gen_const_vec_duplicate instead of
1614         gen_const_vec_duplicate_1.
1615         (const_vec_series_p_1): Operate directly on the CONST_VECTOR encoding.
1616         (gen_const_vec_duplicate): Use rtx_vector_builder.
1617         (gen_const_vec_series): Likewise.
1618         (gen_rtx_CONST_VECTOR): Likewise.
1619         * config/powerpcspe/powerpcspe.c: Include rtx-vector-builder.h.
1620         (swap_const_vector_halves): Take an rtx pointer rather than rtx.
1621         Build a new vector rather than modifying a CONST_VECTOR in-place.
1622         (handle_special_swappables): Update call accordingly.
1623         * config/rs6000/rs6000-p8swap.c: Include rtx-vector-builder.h.
1624         (swap_const_vector_halves): Take an rtx pointer rather than rtx.
1625         Build a new vector rather than modifying a CONST_VECTOR in-place.
1626         (handle_special_swappables): Update call accordingly.
1628 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1630         * simplify-rtx.c (simplify_const_binary_operation): Use
1631         CONST_VECTOR_ELT instead of XVECEXP.
1633 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1635         * tree-cfg.c (verify_gimple_assign_ternary): Allow the size of
1636         the selector elements to be different from the data elements
1637         if the selector is a VECTOR_CST.
1638         * tree-vect-stmts.c (vect_gen_perm_mask_any): Use a vector of
1639         ssizetype for the selector.
1641 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1643         * optabs.c (shift_amt_for_vec_perm_mask): Try using series_p
1644         before testing each element individually.
1645         * tree-vect-generic.c (lower_vec_perm): Likewise.
1647 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1649         * selftest.h (selftest::vec_perm_indices_c_tests): Declare.
1650         * selftest-run-tests.c (selftest::run_tests): Call it.
1651         * vector-builder.h (vector_builder::operator ==): New function.
1652         (vector_builder::operator !=): Likewise.
1653         * vec-perm-indices.h (vec_perm_indices::series_p): Declare.
1654         (vec_perm_indices::all_from_input_p): New function.
1655         * vec-perm-indices.c (vec_perm_indices::series_p): Likewise.
1656         (test_vec_perm_12, selftest::vec_perm_indices_c_tests): Likewise.
1657         * fold-const.c (fold_ternary_loc): Use tree_to_vec_perm_builder
1658         instead of reading the VECTOR_CST directly.  Detect whether both
1659         vector inputs are the same before constructing the vec_perm_indices,
1660         and update the number of inputs argument accordingly.  Use the
1661         utility functions added above.  Only construct sel2 if we need to.
1663 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1665         * optabs.c (expand_vec_perm_var): Use an explicit encoding for
1666         the broadcast of the low byte.
1667         (expand_mult_highpart): Use an explicit encoding for the permutes.
1668         * optabs-query.c (can_mult_highpart_p): Likewise.
1669         * tree-vect-loop.c (calc_vec_perm_mask_for_shift): Likewise.
1670         * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
1671         (vectorizable_bswap): Likewise.
1672         * tree-vect-data-refs.c (vect_grouped_store_supported): Use an
1673         explicit encoding for the power-of-2 permutes.
1674         (vect_permute_store_chain): Likewise.
1675         (vect_grouped_load_supported): Likewise.
1676         (vect_permute_load_chain): Likewise.
1678 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1680         * vec-perm-indices.h (vec_perm_indices_to_tree): Declare.
1681         * vec-perm-indices.c (vec_perm_indices_to_tree): New function.
1682         * tree-ssa-forwprop.c (simplify_vector_constructor): Use it.
1683         * tree-vect-slp.c (vect_transform_slp_perm_load): Likewise.
1684         * tree-vect-stmts.c (vectorizable_bswap): Likewise.
1685         (vect_gen_perm_mask_any): Likewise.
1687 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1689         * int-vector-builder.h: New file.
1690         * vec-perm-indices.h: Include int-vector-builder.h.
1691         (vec_perm_indices): Redefine as an int_vector_builder.
1692         (auto_vec_perm_indices): Delete.
1693         (vec_perm_builder): Redefine as a stand-alone class.
1694         (vec_perm_indices::vec_perm_indices): New function.
1695         (vec_perm_indices::clamp): Likewise.
1696         * vec-perm-indices.c: Include fold-const.h and tree-vector-builder.h.
1697         (vec_perm_indices::new_vector): New function.
1698         (vec_perm_indices::new_expanded_vector): Update for new
1699         vec_perm_indices class.
1700         (vec_perm_indices::rotate_inputs): New function.
1701         (vec_perm_indices::all_in_range_p): Operate directly on the
1702         encoded form, without computing elided elements.
1703         (tree_to_vec_perm_builder): Operate directly on the VECTOR_CST
1704         encoding.  Update for new vec_perm_indices class.
1705         * optabs.c (expand_vec_perm_const): Create a vec_perm_indices for
1706         the given vec_perm_builder.
1707         (expand_vec_perm_var): Update vec_perm_builder constructor.
1708         (expand_mult_highpart): Use vec_perm_builder instead of
1709         auto_vec_perm_indices.
1710         * optabs-query.c (can_mult_highpart_p): Use vec_perm_builder and
1711         vec_perm_indices instead of auto_vec_perm_indices.  Use a single
1712         or double series encoding as appropriate.
1713         * fold-const.c (fold_ternary_loc): Use vec_perm_builder and
1714         vec_perm_indices instead of auto_vec_perm_indices.
1715         * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
1716         * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
1717         (vect_permute_store_chain): Likewise.
1718         (vect_grouped_load_supported): Likewise.
1719         (vect_permute_load_chain): Likewise.
1720         (vect_shift_permute_load_chain): Likewise.
1721         * tree-vect-slp.c (vect_build_slp_tree_1): Likewise.
1722         (vect_transform_slp_perm_load): Likewise.
1723         (vect_schedule_slp_instance): Likewise.
1724         * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
1725         (vectorizable_mask_load_store): Likewise.
1726         (vectorizable_bswap): Likewise.
1727         (vectorizable_store): Likewise.
1728         (vectorizable_load): Likewise.
1729         * tree-vect-generic.c (lower_vec_perm): Use vec_perm_builder and
1730         vec_perm_indices instead of auto_vec_perm_indices.  Use
1731         tree_to_vec_perm_builder to read the vector from a tree.
1732         * tree-vect-loop.c (calc_vec_perm_mask_for_shift): Take a
1733         vec_perm_builder instead of a vec_perm_indices.
1734         (have_whole_vector_shift): Use vec_perm_builder and
1735         vec_perm_indices instead of auto_vec_perm_indices.  Leave the
1736         truncation to calc_vec_perm_mask_for_shift.
1737         (vect_create_epilog_for_reduction): Likewise.
1738         * config/aarch64/aarch64.c (expand_vec_perm_d::perm): Change
1739         from auto_vec_perm_indices to vec_perm_indices.
1740         (aarch64_expand_vec_perm_const_1): Use rotate_inputs on d.perm
1741         instead of changing individual elements.
1742         (aarch64_vectorize_vec_perm_const): Use new_vector to install
1743         the vector in d.perm.
1744         * config/arm/arm.c (expand_vec_perm_d::perm): Change
1745         from auto_vec_perm_indices to vec_perm_indices.
1746         (arm_expand_vec_perm_const_1): Use rotate_inputs on d.perm
1747         instead of changing individual elements.
1748         (arm_vectorize_vec_perm_const): Use new_vector to install
1749         the vector in d.perm.
1750         * config/powerpcspe/powerpcspe.c (rs6000_expand_extract_even):
1751         Update vec_perm_builder constructor.
1752         (rs6000_expand_interleave): Likewise.
1753         * config/rs6000/rs6000.c (rs6000_expand_extract_even): Likewise.
1754         (rs6000_expand_interleave): Likewise.
1756 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1758         * optabs-query.c (can_vec_perm_var_p): Check whether lowering
1759         to qimode could truncate the indices.
1760         * optabs.c (expand_vec_perm_var): Likewise.
1762 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1764         * Makefile.in (OBJS): Add vec-perm-indices.o.
1765         * vec-perm-indices.h: New file.
1766         * vec-perm-indices.c: Likewise.
1767         * target.h (vec_perm_indices): Replace with a forward class
1768         declaration.
1769         (auto_vec_perm_indices): Move to vec-perm-indices.h.
1770         * optabs.h: Include vec-perm-indices.h.
1771         (expand_vec_perm): Delete.
1772         (selector_fits_mode_p, expand_vec_perm_var): Declare.
1773         (expand_vec_perm_const): Declare.
1774         * target.def (vec_perm_const_ok): Replace with...
1775         (vec_perm_const): ...this new hook.
1776         * doc/tm.texi.in (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Replace with...
1777         (TARGET_VECTORIZE_VEC_PERM_CONST): ...this new hook.
1778         * doc/tm.texi: Regenerate.
1779         * optabs.def (vec_perm_const): Delete.
1780         * doc/md.texi (vec_perm_const): Likewise.
1781         (vec_perm): Refer to TARGET_VECTORIZE_VEC_PERM_CONST.
1782         * expr.c (expand_expr_real_2): Use expand_vec_perm_const rather than
1783         expand_vec_perm for constant permutation vectors.  Assert that
1784         the mode of variable permutation vectors is the integer equivalent
1785         of the mode that is being permuted.
1786         * optabs-query.h (selector_fits_mode_p): Declare.
1787         * optabs-query.c: Include vec-perm-indices.h.
1788         (selector_fits_mode_p): New function.
1789         (can_vec_perm_const_p): Check whether targetm.vectorize.vec_perm_const
1790         is defined, instead of checking whether the vec_perm_const_optab
1791         exists.  Use targetm.vectorize.vec_perm_const instead of
1792         targetm.vectorize.vec_perm_const_ok.  Check whether the indices
1793         fit in the vector mode before using a variable permute.
1794         * optabs.c (shift_amt_for_vec_perm_mask): Take a mode and a
1795         vec_perm_indices instead of an rtx.
1796         (expand_vec_perm): Replace with...
1797         (expand_vec_perm_const): ...this new function.  Take the selector
1798         as a vec_perm_indices rather than an rtx.  Also take the mode of
1799         the selector.  Update call to shift_amt_for_vec_perm_mask.
1800         Use targetm.vectorize.vec_perm_const instead of vec_perm_const_optab.
1801         Use vec_perm_indices::new_expanded_vector to expand the original
1802         selector into bytes.  Check whether the indices fit in the vector
1803         mode before using a variable permute.
1804         (expand_vec_perm_var): Make global.
1805         (expand_mult_highpart): Use expand_vec_perm_const.
1806         * fold-const.c: Includes vec-perm-indices.h.
1807         * tree-ssa-forwprop.c: Likewise.
1808         * tree-vect-data-refs.c: Likewise.
1809         * tree-vect-generic.c: Likewise.
1810         * tree-vect-loop.c: Likewise.
1811         * tree-vect-slp.c: Likewise.
1812         * tree-vect-stmts.c: Likewise.
1813         * config/aarch64/aarch64-protos.h (aarch64_expand_vec_perm_const):
1814         Delete.
1815         * config/aarch64/aarch64-simd.md (vec_perm_const<mode>): Delete.
1816         * config/aarch64/aarch64.c (aarch64_expand_vec_perm_const)
1817         (aarch64_vectorize_vec_perm_const_ok): Fuse into...
1818         (aarch64_vectorize_vec_perm_const): ...this new function.
1819         (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
1820         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
1821         * config/arm/arm-protos.h (arm_expand_vec_perm_const): Delete.
1822         * config/arm/vec-common.md (vec_perm_const<mode>): Delete.
1823         * config/arm/arm.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
1824         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
1825         (arm_expand_vec_perm_const, arm_vectorize_vec_perm_const_ok): Merge
1826         into...
1827         (arm_vectorize_vec_perm_const): ...this new function.  Explicitly
1828         check for NEON modes.
1829         * config/i386/i386-protos.h (ix86_expand_vec_perm_const): Delete.
1830         * config/i386/sse.md (VEC_PERM_CONST, vec_perm_const<mode>): Delete.
1831         * config/i386/i386.c (ix86_expand_vec_perm_const_1): Update comment.
1832         (ix86_expand_vec_perm_const, ix86_vectorize_vec_perm_const_ok): Merge
1833         into...
1834         (ix86_vectorize_vec_perm_const): ...this new function.  Incorporate
1835         the old VEC_PERM_CONST conditions.
1836         * config/ia64/ia64-protos.h (ia64_expand_vec_perm_const): Delete.
1837         * config/ia64/vect.md (vec_perm_const<mode>): Delete.
1838         * config/ia64/ia64.c (ia64_expand_vec_perm_const)
1839         (ia64_vectorize_vec_perm_const_ok): Merge into...
1840         (ia64_vectorize_vec_perm_const): ...this new function.
1841         * config/mips/loongson.md (vec_perm_const<mode>): Delete.
1842         * config/mips/mips-msa.md (vec_perm_const<mode>): Delete.
1843         * config/mips/mips-ps-3d.md (vec_perm_constv2sf): Delete.
1844         * config/mips/mips-protos.h (mips_expand_vec_perm_const): Delete.
1845         * config/mips/mips.c (mips_expand_vec_perm_const)
1846         (mips_vectorize_vec_perm_const_ok): Merge into...
1847         (mips_vectorize_vec_perm_const): ...this new function.
1848         * config/powerpcspe/altivec.md (vec_perm_constv16qi): Delete.
1849         * config/powerpcspe/paired.md (vec_perm_constv2sf): Delete.
1850         * config/powerpcspe/spe.md (vec_perm_constv2si): Delete.
1851         * config/powerpcspe/vsx.md (vec_perm_const<mode>): Delete.
1852         * config/powerpcspe/powerpcspe-protos.h (altivec_expand_vec_perm_const)
1853         (rs6000_expand_vec_perm_const): Delete.
1854         * config/powerpcspe/powerpcspe.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK):
1855         Delete.
1856         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
1857         (altivec_expand_vec_perm_const_le): Take each operand individually.
1858         Operate on constant selectors rather than rtxes.
1859         (altivec_expand_vec_perm_const): Likewise.  Update call to
1860         altivec_expand_vec_perm_const_le.
1861         (rs6000_expand_vec_perm_const): Delete.
1862         (rs6000_vectorize_vec_perm_const_ok): Delete.
1863         (rs6000_vectorize_vec_perm_const): New function.
1864         (rs6000_do_expand_vec_perm): Take a vec_perm_builder instead of
1865         an element count and rtx array.
1866         (rs6000_expand_extract_even): Update call accordingly.
1867         (rs6000_expand_interleave): Likewise.
1868         * config/rs6000/altivec.md (vec_perm_constv16qi): Delete.
1869         * config/rs6000/paired.md (vec_perm_constv2sf): Delete.
1870         * config/rs6000/vsx.md (vec_perm_const<mode>): Delete.
1871         * config/rs6000/rs6000-protos.h (altivec_expand_vec_perm_const)
1872         (rs6000_expand_vec_perm_const): Delete.
1873         * config/rs6000/rs6000.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
1874         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
1875         (altivec_expand_vec_perm_const_le): Take each operand individually.
1876         Operate on constant selectors rather than rtxes.
1877         (altivec_expand_vec_perm_const): Likewise.  Update call to
1878         altivec_expand_vec_perm_const_le.
1879         (rs6000_expand_vec_perm_const): Delete.
1880         (rs6000_vectorize_vec_perm_const_ok): Delete.
1881         (rs6000_vectorize_vec_perm_const): New function.  Remove stray
1882         reference to the SPE evmerge intructions.
1883         (rs6000_do_expand_vec_perm): Take a vec_perm_builder instead of
1884         an element count and rtx array.
1885         (rs6000_expand_extract_even): Update call accordingly.
1886         (rs6000_expand_interleave): Likewise.
1887         * config/sparc/sparc.md (vec_perm_constv8qi): Delete in favor of...
1888         * config/sparc/sparc.c (sparc_vectorize_vec_perm_const): ...this
1889         new function.
1890         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
1892 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1894         * optabs.c (expand_vec_perm_1): Assert that SEL has an integer
1895         vector mode and that that mode matches the mode of the data
1896         being permuted.
1897         (expand_vec_perm): Split handling of non-CONST_VECTOR selectors
1898         out into expand_vec_perm_var.  Do all CONST_VECTOR handling here,
1899         directly using expand_vec_perm_1 when forcing selectors into
1900         registers.
1901         (expand_vec_perm_var): New function, split out from expand_vec_perm.
1903 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1905         * optabs-query.h (can_vec_perm_p): Delete.
1906         (can_vec_perm_var_p, can_vec_perm_const_p): Declare.
1907         * optabs-query.c (can_vec_perm_p): Split into...
1908         (can_vec_perm_var_p, can_vec_perm_const_p): ...these two functions.
1909         (can_mult_highpart_p): Use can_vec_perm_const_p to test whether a
1910         particular selector is valid.
1911         * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
1912         * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
1913         (vect_grouped_load_supported): Likewise.
1914         (vect_shift_permute_load_chain): Likewise.
1915         * tree-vect-slp.c (vect_build_slp_tree_1): Likewise.
1916         (vect_transform_slp_perm_load): Likewise.
1917         * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
1918         (vectorizable_bswap): Likewise.
1919         (vect_gen_perm_mask_checked): Likewise.
1920         * fold-const.c (fold_ternary_loc): Likewise.  Don't take
1921         implementations of variable permutation vectors into account
1922         when deciding which selector to use.
1923         * tree-vect-loop.c (have_whole_vector_shift): Don't check whether
1924         vec_perm_const_optab is supported; instead use can_vec_perm_const_p
1925         with a false third argument.
1926         * tree-vect-generic.c (lower_vec_perm): Use can_vec_perm_const_p
1927         to test whether the constant selector is valid and can_vec_perm_var_p
1928         to test whether a variable selector is valid.
1930 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1932         * optabs-query.h (can_vec_perm_p): Take a const vec_perm_indices *.
1933         * optabs-query.c (can_vec_perm_p): Likewise.
1934         * fold-const.c (fold_vec_perm): Take a const vec_perm_indices &
1935         instead of vec_perm_indices.
1936         * tree-vectorizer.h (vect_gen_perm_mask_any): Likewise,
1937         (vect_gen_perm_mask_checked): Likewise,
1938         * tree-vect-stmts.c (vect_gen_perm_mask_any): Likewise,
1939         (vect_gen_perm_mask_checked): Likewise,
1941 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1943         * optabs-query.h (qimode_for_vec_perm): Declare.
1944         * optabs-query.c (can_vec_perm_p): Split out qimode search to...
1945         (qimode_for_vec_perm): ...this new function.
1946         * optabs.c (expand_vec_perm): Use qimode_for_vec_perm.
1948 2018-01-02  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>
1950         * rtlanal.c (canonicalize_condition): Return 0 if final rtx
1951         does not have a conditional at the top.
1953 2018-01-02  Richard Biener  <rguenther@suse.de>
1955         * ipa-inline.c (big_speedup_p): Fix expression.
1957 2018-01-02  Jan Hubicka  <hubicka@ucw.cz>
1959         PR target/81616
1960         * config/i386/x86-tune-costs.h: Increase cost of integer load costs
1961         for generic 4->6.
1963 2018-01-02  Jan Hubicka  <hubicka@ucw.cz>
1965         PR target/81616
1966         Generic tuning.
1967         * x86-tune-costs.h (generic_cost): Reduce cost of FDIV 20->17,
1968         cost of sqrt 20->14, DIVSS 18->13, DIVSD 32->17, SQRtSS 30->14
1969         and SQRTsD 58->18, cond_not_taken_branch_cost. 2->1. Increase
1970         cond_taken_branch_cost 3->4.
1972 2018-01-01  Jakub Jelinek  <jakub@redhat.com>
1974         PR tree-optimization/83581
1975         * tree-loop-distribution.c (pass_loop_distribution::execute): Return
1976         TODO_cleanup_cfg if any changes have been made.
1978         PR middle-end/83608
1979         * expr.c (store_expr_with_bounds): Use simplify_gen_subreg instead of
1980         convert_modes if target mode has the right side, but different mode
1981         class.
1983         PR middle-end/83609
1984         * expr.c (expand_assignment): Fix up a typo in simplify_gen_subreg
1985         last argument when extracting from CONCAT.  If either from_real or
1986         from_imag is NULL, use expansion through memory.  If result is not
1987         a CONCAT and simplify_gen_subreg fails, try to simplify_gen_subreg
1988         the parts directly to inner mode, if even that fails, use expansion
1989         through memory.
1991         PR middle-end/83623
1992         * expmed.c (expand_shift_1): For 2-byte rotates by BITS_PER_UNIT,
1993         check for bswap in mode rather than HImode and use that in expand_unop
1994         too.
1996 Copyright (C) 2018 Free Software Foundation, Inc.
1998 Copying and distribution of this file, with or without modification,
1999 are permitted in any medium without royalty provided the copyright
2000 notice and this notice are preserved.