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