1 2018-01-09 Richard Sandiford <richard.sandiford@linaro.org>
3 * config/aarch64/aarch64.c (aarch64_evpc_trn): Use d.perm.series_p
4 instead of checking each element individually.
5 (aarch64_evpc_uzp): Likewise.
6 (aarch64_evpc_zip): Likewise.
7 (aarch64_evpc_ext): Likewise.
8 (aarch64_evpc_rev): Likewise.
9 (aarch64_evpc_dup): Test the encoding for a single duplicated element,
10 instead of checking each element individually. Return true without
12 (aarch64_vectorize_vec_perm_const): Use all_from_input_p to test
13 whether all selected elements come from the same input, instead of
14 checking each element individually. Remove calls to gen_rtx_REG,
15 start_sequence and end_sequence and instead assert that no rtl is
18 2018-01-09 Richard Sandiford <richard.sandiford@linaro.org>
20 * config/aarch64/aarch64.c (aarch64_legitimate_constant_p): Fix
21 order of HIGH and CONST checks.
23 2018-01-09 Richard Sandiford <richard.sandiford@linaro.org>
25 * tree-vect-stmts.c (permute_vec_elements): Create a fresh variable
26 if the destination isn't an SSA_NAME.
28 2018-01-09 Richard Biener <rguenther@suse.de>
30 PR tree-optimization/83668
31 * graphite.c (canonicalize_loop_closed_ssa): Add edge argument,
33 (canonicalize_loop_form): ... here, renamed from ...
34 (canonicalize_loop_closed_ssa_form): ... this and amended to
35 swap successor edges for loop exit blocks to make us use
36 the RPO order we need for initial schedule generation.
38 2018-01-09 Joseph Myers <joseph@codesourcery.com>
40 PR tree-optimization/64811
41 * match.pd: When optimizing comparisons with Inf, avoid
42 introducing or losing exceptions from comparisons with NaN.
44 2018-01-09 Martin Liska <mliska@suse.cz>
47 * asan.c (shadow_mem_size): Add gcc_assert.
49 2018-01-09 Georg-Johann Lay <avr@gjlay.de>
51 Don't save registers in main().
54 * doc/invoke.texi (AVR Options) [-mmain-is-OS_task]: Document it.
55 * config/avr/avr.opt (-mmain-is-OS_task): New target option.
56 * config/avr/avr.c (avr_set_current_function): Don't error if
57 naked, OS_task or OS_main are specified at the same time.
58 (avr_function_ok_for_sibcall): Don't disable sibcalls for OS_task,
60 (avr_insert_attributes) [-mmain-is-OS_task] <main>: Add OS_task
62 * common/config/avr/avr-common.c (avr_option_optimization_table):
63 Switch on -mmain-is-OS_task for optimizing compilations.
65 2018-01-09 Richard Biener <rguenther@suse.de>
67 PR tree-optimization/83572
68 * graphite.c: Include cfganal.h.
69 (graphite_transform_loops): Connect infinite loops to exit
70 and remove fake edges at the end.
72 2018-01-09 Jan Hubicka <hubicka@ucw.cz>
74 * ipa-inline.c (edge_badness): Revert accidental checkin.
76 2018-01-09 Jan Hubicka <hubicka@ucw.cz>
79 * ipa-comdats.c (set_comdat_group): Only set comdat group of real
80 symbols; not inline clones.
82 2018-01-09 Jakub Jelinek <jakub@redhat.com>
85 * modulo-sched.c (schedule_reg_moves): Punt if we'd need to move
86 hard registers. Formatting fixes.
89 * gcc.c (try_generate_repro): Pass
90 &temp_stderr_files[RETRY_ICE_ATTEMPTS - 1] rather than
91 &temp_stdout_files[RETRY_ICE_ATTEMPTS - 1] as last argument to
94 2018-01-08 Monk Chiang <sh.chiang04@gmail.com>
95 Kito Cheng <kito.cheng@gmail.com>
97 * config/riscv/riscv.c (machine_function::is_leaf): Remove field.
98 (riscv_leaf_function_p): Delete.
99 (riscv_function_ok_for_sibcall): Return false when TARGET_SAVE_RESTORE.
101 2018-01-08 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
104 * config/rs6000/altivec.md (*altivec_vpermr_<mode>_internal):
105 Reverse order of second and third operands in first alternative.
106 * config/rs6000/rs6000.c (rs6000_expand_vector_set): Reverse order
107 of first and second elements in UNSPEC_VPERMR vector.
108 (altivec_expand_vec_perm_le): Likewise.
110 2017-01-08 Jeff Law <law@redhat.com>
112 PR rtl-optimizatin/81308
113 * tree-switch-conversion.c (cfg_altered): New file scoped static.
114 (process_switch): If group_case_labels makes a change, then set
116 (pass_convert_switch::execute): If a switch is converted, then
117 set cfg_altered. Return TODO_cfg_cleanup if cfg_altered is true.
119 PR rtl-optimization/81308
120 * recog.c (split_all_insns): Conditionally cleanup the CFG after
123 2018-01-08 Vidya Praveen <vidyapraveen@arm.com>
125 PR target/83663 - Revert r255946
126 * config/aarch64/aarch64.c (aarch64_expand_vector_init): Modify code
127 generation for cases where splatting a value is not useful.
128 * simplify-rtx.c (simplify_ternary_operation): Simplify vec_merge
129 across a vec_duplicate and a paradoxical subreg forming a vector
130 mode to a vec_concat.
132 2018-01-08 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
134 * config/arm/t-aprofile (MULTILIB_MATCHES): Add mapping rules for
135 -march=armv8.3-a variants.
136 * config/arm/t-multilib: Likewise.
137 * config/arm/t-arm-elf: Likewise. Handle dotprod extension.
139 2018-01-08 Aaron Sawdey <acsawdey@linux.vnet.ibm.com>
141 * config/rs6000/rs6000.md (cceq_ior_compare): Remove * so I can use it
143 (cceq_ior_compare_complement): Give it a name so I can use it, and
144 change boolean_or_operator predicate to boolean_operator so it can
145 be used to generate a crand.
146 (eqne): New code iterator.
147 (bd/bd_neg): New code_attrs.
148 (<bd>_<mode>): New name for ctr<mode>_internal[12] now combined into
149 a single define_insn.
150 (<bd>tf_<mode>): A new insn pattern for the conditional form branch
151 decrement (bdnzt/bdnzf/bdzt/bdzf).
152 * config/rs6000/rs6000.c (rs6000_legitimate_combined_insn): Updated
153 with the new names of the branch decrement patterns, and added the
154 names of the branch decrement conditional patterns.
156 2018-01-08 Richard Biener <rguenther@suse.de>
158 PR tree-optimization/83563
159 * graphite.c (canonicalize_loop_closed_ssa_form): Reset the SCEV
162 2018-01-08 Richard Biener <rguenther@suse.de>
165 * convert.c (do_narrow): Properly guard TYPE_OVERFLOW_WRAPS checks.
167 2018-01-08 Richard Biener <rguenther@suse.de>
169 PR tree-optimization/83685
170 * tree-ssa-pre.c (create_expression_by_pieces): Do not insert
171 references to abnormals.
173 2018-01-08 Richard Biener <rguenther@suse.de>
176 * dwarf2out.c (output_indirect_strings): Handle empty
177 skeleton_debug_str_hash.
178 (dwarf2out_early_finish): Index strings for -gsplit-dwarf.
180 2018-01-08 Claudiu Zissulescu <claziss@synopsys.com>
182 * config/arc/arc.c (TARGET_TRAMPOLINE_ADJUST_ADDRESS): Delete.
183 (emit_store_direct): Likewise.
184 (arc_trampoline_adjust_address): Likewise.
185 (arc_asm_trampoline_template): New function.
186 (arc_initialize_trampoline): Use asm_trampoline_template.
187 (TARGET_ASM_TRAMPOLINE_TEMPLATE): Define.
188 * config/arc/arc.h (TRAMPOLINE_SIZE): Adjust to 16.
189 * config/arc/arc.md (flush_icache): Delete pattern.
191 2018-01-08 Claudiu Zissulescu <claziss@synopsys.com>
193 * config/arc/arc-c.def (__ARC_UNALIGNED__): New define.
194 * config/arc/arc.h (STRICT_ALIGNMENT): Control this macro using
197 2018-01-08 Sebastian Huber <sebastian.huber@embedded-brains.de>
200 * config/epiphany/epiphany.h (make_pass_mode_switch_use): Guard
201 by not USED_FOR_TARGET.
202 (make_pass_resolve_sw_modes): Likewise.
204 2018-01-08 Sebastian Huber <sebastian.huber@embedded-brains.de>
206 * config/nios2/nios2.h (nios2_section_threshold): Guard by not
209 2018-01-08 Richard Biener <rguenther@suse.de>
212 * tree-data-ref.c (split_constant_offset): Remove STRIP_NOPS.
214 2018-01-08 Richard Biener <rguenther@suse.de>
217 * match.pd ((t * 2) / 2) -> t): Add missing :c.
219 2018-01-06 Aldy Hernandez <aldyh@redhat.com>
222 * tree-ssa-uninit.c (compute_control_dep_chain): Do not bail on
223 basic blocks with a small number of successors.
224 (convert_control_dep_chain_into_preds): Improve handling of
226 (dump_predicates): Split apart into...
227 (dump_pred_chain): ...here...
228 (dump_pred_info): ...and here.
229 (can_one_predicate_be_invalidated_p): Add debugging printfs.
230 (can_chain_union_be_invalidated_p): Improve check for invalidation
232 (uninit_uses_cannot_happen): Avoid unnecessary if
233 convert_control_dep_chain_into_preds yielded nothing.
235 2018-01-06 Martin Sebor <msebor@redhat.com>
237 PR tree-optimization/83640
238 * gimple-ssa-warn-restrict.c (builtin_access::builtin_access): Avoid
239 subtracting negative offset from size.
240 (builtin_access::overlap): Adjust offset bounds of the access to fall
241 within the size of the object if possible.
243 2018-01-06 Richard Sandiford <richard.sandiford@linaro.org>
245 PR rtl-optimization/83699
246 * expmed.c (extract_bit_field_1): Restrict the vector usage of
247 extract_bit_field_as_subreg to cases in which the extracted
248 value is also a vector.
250 * lra-constraints.c (process_alt_operands): Test for the equivalence
251 substitutions when detecting a possible reload cycle.
253 2018-01-06 Jakub Jelinek <jakub@redhat.com>
256 * toplev.c (process_options): Don't enable debug_nonbind_markers_p
257 by default if flag_selective_schedling{,2}. Formatting fixes.
259 PR rtl-optimization/83682
260 * rtl.h (const_vec_duplicate_p): Only return true for VEC_DUPLICATE
261 if it has non-VECTOR_MODE element mode.
262 (vec_duplicate_p): Likewise.
265 * cfgexpand.c (expand_debug_expr): Punt if mode1 is VOIDmode
266 and bitsize might be greater than MAX_BITSIZE_MODE_ANY_INT.
268 2018-01-05 Jakub Jelinek <jakub@redhat.com>
271 * config/i386/i386-builtin.def
272 (__builtin_ia32_vgf2p8affineinvqb_v64qi,
273 __builtin_ia32_vgf2p8affineqb_v64qi, __builtin_ia32_vgf2p8mulb_v64qi):
274 Require also OPTION_MASK_ISA_AVX512F in addition to
275 OPTION_MASK_ISA_GFNI.
276 (__builtin_ia32_vgf2p8affineinvqb_v16qi_mask,
277 __builtin_ia32_vgf2p8affineqb_v16qi_mask): Require
278 OPTION_MASK_ISA_AVX512VL instead of OPTION_MASK_ISA_SSE in addition
279 to OPTION_MASK_ISA_GFNI.
280 (__builtin_ia32_vgf2p8mulb_v32qi_mask): Require
281 OPTION_MASK_ISA_AVX512VL in addition to OPTION_MASK_ISA_GFNI and
282 OPTION_MASK_ISA_AVX512BW.
283 (__builtin_ia32_vgf2p8mulb_v16qi_mask): Require
284 OPTION_MASK_ISA_AVX512VL instead of OPTION_MASK_ISA_AVX512BW in
285 addition to OPTION_MASK_ISA_GFNI.
286 (__builtin_ia32_vgf2p8affineinvqb_v16qi,
287 __builtin_ia32_vgf2p8affineqb_v16qi, __builtin_ia32_vgf2p8mulb_v16qi):
288 Require OPTION_MASK_ISA_SSE2 instead of OPTION_MASK_ISA_SSE in addition
289 to OPTION_MASK_ISA_GFNI.
290 * config/i386/i386.c (def_builtin): Change to builtin isa/isa2 being
291 a requirement for all ISAs rather than any of them with a few
293 (ix86_add_new_builtins): Clear OPTION_MASK_ISA_64BIT from isa before
295 (ix86_expand_builtin): Require all ISAs from builtin's isa and isa2
296 bitmasks to be enabled with 3 exceptions, instead of requiring any
297 enabled ISA with lots of exceptions.
298 * config/i386/sse.md (vgf2p8affineinvqb_<mode><mask_name>,
299 vgf2p8affineqb_<mode><mask_name>, vgf2p8mulb_<mode><mask_name>):
300 Change avx512bw in isa attribute to avx512f.
301 * config/i386/sgxintrin.h: Add license boilerplate.
302 * config/i386/vaesintrin.h: Likewise. Fix macro spelling __AVX512F
303 to __AVX512F__ and __AVX512VL to __AVX512VL__.
304 (_mm256_aesdec_epi128, _mm256_aesdeclast_epi128, _mm256_aesenc_epi128,
305 _mm256_aesenclast_epi128): Enable temporarily avx if __AVX__ is not
307 * config/i386/gfniintrin.h (_mm_gf2p8mul_epi8,
308 _mm_gf2p8affineinv_epi64_epi8, _mm_gf2p8affine_epi64_epi8): Enable
309 temporarily sse2 rather than sse if not enabled already.
312 * config/i386/sse.md (VI248_VLBW): Rename to ...
313 (VI248_AVX512VL): ... this. Don't guard V32HI with TARGET_AVX512BW.
314 (vpshrd_<mode><mask_name>, vpshld_<mode><mask_name>,
315 vpshrdv_<mode>, vpshrdv_<mode>_mask, vpshrdv_<mode>_maskz,
316 vpshrdv_<mode>_maskz_1, vpshldv_<mode>, vpshldv_<mode>_mask,
317 vpshldv_<mode>_maskz, vpshldv_<mode>_maskz_1): Use VI248_AVX512VL
318 mode iterator instead of VI248_VLBW.
320 2018-01-05 Jan Hubicka <hubicka@ucw.cz>
322 * ipa-fnsummary.c (record_modified_bb_info): Add OP.
323 (record_modified): Skip clobbers; add debug output.
324 (param_change_prob): Use sreal frequencies.
326 2018-01-05 Richard Sandiford <richard.sandiford@linaro.org>
328 * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Don't
329 punt for user-aligned variables.
331 2018-01-05 Richard Sandiford <richard.sandiford@linaro.org>
333 * tree-chrec.c (chrec_contains_symbols): Return true for
336 2018-01-05 Sudakshina Das <sudi.das@arm.com>
339 * simplify-rtx.c (simplify_relational_operation_1): Add simplifications
340 of (x|y) == x for BICS pattern.
342 2018-01-05 Jakub Jelinek <jakub@redhat.com>
344 PR tree-optimization/83605
345 * gimple-ssa-strength-reduction.c: Include tree-eh.h.
346 (find_candidates_dom_walker::before_dom_children): Ignore stmts that
349 2018-01-05 Sebastian Huber <sebastian.huber@embedded-brains.de>
351 * config.gcc (epiphany-*-elf*): Add (epiphany-*-rtems*) configuration.
352 * config/epiphany/rtems.h: New file.
354 2018-01-04 Jakub Jelinek <jakub@redhat.com>
355 Uros Bizjak <ubizjak@gmail.com>
358 * config/i386/i386.md (*<rotate_insn>hi3_1 splitter): Use
359 QIreg_operand instead of register_operand predicate.
360 * config/i386/i386.c (ix86_rop_should_change_byte_p,
361 set_rop_modrm_reg_bits, ix86_mitigate_rop): Use -mmitigate-rop in
362 comments instead of -fmitigate[-_]rop.
364 2018-01-04 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
367 * cgraphunit.c (symbol_table::compile): Switch to text_section
368 before calling assembly_start debug hook.
369 * run-rtl-passes.c (run_rtl_passes): Likewise.
372 2018-01-04 Richard Sandiford <richard.sandiford@linaro.org>
374 * tree-vrp.c (extract_range_from_binary_expr_1): Check
375 range_int_cst_p rather than !symbolic_range_p before calling
376 extract_range_from_multiplicative_op_1.
378 2017-01-04 Jeff Law <law@redhat.com>
380 * tree-ssa-math-opts.c (execute_cse_reciprocals_1): Remove
381 redundant test in assertion.
383 2018-01-04 Richard Sandiford <richard.sandiford@linaro.org>
385 * doc/rtl.texi: Document machine_mode wrapper classes.
387 2018-01-04 Richard Sandiford <richard.sandiford@linaro.org>
389 * fold-const.c (fold_ternary_loc): Check tree_fits_uhwi_p before
392 2018-01-04 Richard Sandiford <richard.sandiford@linaro.org>
394 * tree-ssa-forwprop.c (is_combined_permutation_identity): Allow
395 the VEC_PERM_EXPR fold to fail.
397 2018-01-04 Jakub Jelinek <jakub@redhat.com>
400 * bb-reorder.c (insert_section_boundary_note): Set has_bb_partition
401 to switched_sections.
403 2018-01-04 Richard Sandiford <richard.sandiford@linaro.org>
406 * config/arm/arm.c (arm_vectorize_vec_perm_const): Fix inverted
409 2018-01-04 Peter Bergner <bergner@vnet.ibm.com>
412 * config/rs6000/rs6000.c (rs6000_discover_homogeneous_aggregate): Do not
413 allow arguments in FP registers if TARGET_HARD_FLOAT is false.
415 2018-01-04 Jakub Jelinek <jakub@redhat.com>
418 * cfgexpand.c (expand_dbeug_expr) <case BIT_FIELD_REF>: Punt if mode
419 is BLKmode and bitpos not zero or mode change is needed.
421 2018-01-04 Richard Sandiford <richard.sandiford@linaro.org>
424 * config/sparc/sparc.c (sparc_vectorize_vec_perm_const): Require
427 2018-01-04 Uros Bizjak <ubizjak@gmail.com>
430 * config/alpha/alpha.md (*sadd<modesuffix>): Use ASHIFT
431 instead of MULT rtx. Update all corresponding splitters.
433 (*ssub<modesuffix>): Ditto.
435 (*cmp_sadd_di): Update split patterns.
436 (*cmp_sadd_si): Ditto.
437 (*cmp_sadd_sidi): Ditto.
438 (*cmp_ssub_di): Ditto.
439 (*cmp_ssub_si): Ditto.
440 (*cmp_ssub_sidi): Ditto.
441 * config/alpha/predicates.md (const23_operand): New predicate.
442 * config/alpha/alpha.c (alpha_rtx_costs) [PLUS, MINUS]:
443 Look for ASHIFT, not MULT inner operand.
444 (alpha_split_conditional_move): Update for *sadd<modesuffix> change.
446 2018-01-04 Martin Liska <mliska@suse.cz>
448 PR gcov-profile/83669
449 * gcov.c (output_intermediate_file): Add version to intermediate
451 * doc/gcov.texi: Document new field 'version' in intermediate
452 file format. Fix location of '-k' option of gcov command.
454 2018-01-04 Martin Liska <mliska@suse.cz>
457 * ipa-icf.c (sem_function::merge): Do not cross comdat boundary.
459 2018-01-04 Jakub Jelinek <jakub@redhat.com>
461 * gimple-ssa-sprintf.c (parse_directive): Cast second dir.len to uhwi.
463 2018-01-03 Martin Sebor <msebor@redhat.com>
465 PR tree-optimization/83655
466 * gimple-ssa-warn-restrict.c (wrestrict_dom_walker::check_call): Avoid
467 checking calls with invalid arguments.
469 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
471 * tree-vect-stmts.c (vect_get_store_rhs): New function.
472 (vectorizable_mask_load_store): Delete.
473 (vectorizable_call): Return false for masked loads and stores.
474 (vectorizable_store): Handle IFN_MASK_STORE. Use vect_get_store_rhs
475 instead of gimple_assign_rhs1.
476 (vectorizable_load): Handle IFN_MASK_LOAD.
477 (vect_transform_stmt): Don't set is_store for call_vec_info_type.
479 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
481 * tree-vect-stmts.c (vect_build_gather_load_calls): New function,
483 (vectorizable_mask_load_store): ...here.
484 (vectorizable_load): ...and here.
486 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
488 * tree-vect-stmts.c (vect_build_all_ones_mask)
489 (vect_build_zero_merge_argument): New functions, split out from...
490 (vectorizable_load): ...here.
492 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
494 * tree-vect-stmts.c (vect_check_store_rhs): New function,
496 (vectorizable_mask_load_store): ...here.
497 (vectorizable_store): ...and here.
499 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
501 * tree-vect-stmts.c (vect_check_load_store_mask): New function,
503 (vectorizable_mask_load_store): ...here.
505 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
507 * tree-vectorizer.h (vec_load_store_type): Moved from tree-vec-stmts.c
508 (vect_model_store_cost): Take a vec_load_store_type instead of a
510 * tree-vect-stmts.c (vec_load_store_type): Move to tree-vectorizer.h.
511 (vect_model_store_cost): Take a vec_load_store_type instead of a
513 (vectorizable_mask_load_store): Update accordingly.
514 (vectorizable_store): Likewise.
515 * tree-vect-slp.c (vect_analyze_slp_cost_1): Update accordingly.
517 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
519 * tree-vect-loop.c (vect_transform_loop): Stub out scalar
520 IFN_MASK_LOAD calls here rather than...
521 * tree-vect-stmts.c (vectorizable_mask_load_store): ...here.
523 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
524 Alan Hayward <alan.hayward@arm.com>
525 David Sherwood <david.sherwood@arm.com>
527 * expmed.c (extract_bit_field_1): For vector extracts,
528 fall back to extract_bit_field_as_subreg if vec_extract
531 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
532 Alan Hayward <alan.hayward@arm.com>
533 David Sherwood <david.sherwood@arm.com>
535 * lra-spills.c (pseudo_reg_slot_compare): Sort slots by whether
536 they are variable or constant sized.
537 (assign_stack_slot_num_and_sort_pseudos): Don't reuse variable-sized
538 slots for constant-sized data.
540 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
541 Alan Hayward <alan.hayward@arm.com>
542 David Sherwood <david.sherwood@arm.com>
544 * tree-vect-patterns.c (vect_recog_mask_conversion_pattern): When
545 handling COND_EXPRs with boolean comparisons, try to find a better
546 basis for the mask type than the boolean itself.
548 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
550 * doc/rtl.texi (MAX_BITSIZE_MODE_ANY_MODE): Describe how the default
551 is calculated and how it can be overridden.
552 * genmodes.c (max_bitsize_mode_any_mode): New variable.
553 (create_modes): Initialize it from MAX_BITSIZE_MODE_ANY_MODE,
555 (emit_max_int): Use it to set the output MAX_BITSIZE_MODE_ANY_MODE,
558 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
559 Alan Hayward <alan.hayward@arm.com>
560 David Sherwood <david.sherwood@arm.com>
562 * config/aarch64/aarch64-protos.h (aarch64_output_simd_mov_immediate):
563 Remove the mode argument.
564 (aarch64_simd_valid_immediate): Remove the mode and inverse
566 * config/aarch64/iterators.md (bitsize): New iterator.
567 * config/aarch64/aarch64-simd.md (*aarch64_simd_mov<mode>, and<mode>3)
568 (ior<mode>3): Update calls to aarch64_output_simd_mov_immediate.
569 * config/aarch64/constraints.md (Do, Db, Dn): Update calls to
570 aarch64_simd_valid_immediate.
571 * config/aarch64/predicates.md (aarch64_reg_or_orr_imm): Likewise.
572 (aarch64_reg_or_bic_imm): Likewise.
573 * config/aarch64/aarch64.c (simd_immediate_info): Replace mvn
574 with an insn_type enum and msl with a modifier_type enum.
575 Replace element_width with a scalar_mode. Change the shift
576 to unsigned int. Add constructors for scalar_float_mode and
577 scalar_int_mode elements.
578 (aarch64_vect_float_const_representable_p): Delete.
579 (aarch64_can_const_movi_rtx_p)
580 (aarch64_simd_scalar_immediate_valid_for_move)
581 (aarch64_simd_make_constant): Update call to
582 aarch64_simd_valid_immediate.
583 (aarch64_advsimd_valid_immediate_hs): New function.
584 (aarch64_advsimd_valid_immediate): Likewise.
585 (aarch64_simd_valid_immediate): Remove mode and inverse
586 arguments. Rewrite to use the above. Use const_vec_duplicate_p
587 to detect duplicated constants and use aarch64_float_const_zero_rtx_p
588 and aarch64_float_const_representable_p on the result.
589 (aarch64_output_simd_mov_immediate): Remove mode argument.
590 Update call to aarch64_simd_valid_immediate and use of
592 (aarch64_output_scalar_simd_mov_immediate): Update call
595 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
596 Alan Hayward <alan.hayward@arm.com>
597 David Sherwood <david.sherwood@arm.com>
599 * machmode.h (mode_precision): Prefix with CONST_MODE_PRECISION.
600 (mode_nunits): Likewise CONST_MODE_NUNITS.
601 * machmode.def (ADJUST_NUNITS): Document.
602 * genmodes.c (mode_data::need_nunits_adj): New field.
603 (blank_mode): Update accordingly.
604 (adj_nunits): New variable.
605 (print_maybe_const_decl): Replace CATEGORY with a NEEDS_ADJ
607 (emit_mode_size_inline): Set need_bytesize_adj for all modes
608 listed in adj_nunits.
609 (emit_mode_nunits_inline): Set need_nunits_adj for all modes
610 listed in adj_nunits. Don't emit case statements for such modes.
611 (emit_insn_modes_h): Emit definitions of CONST_MODE_NUNITS
612 and CONST_MODE_PRECISION. Make CONST_MODE_SIZE expand to
613 nothing if adj_nunits is nonnull.
614 (emit_mode_precision, emit_mode_nunits): Use print_maybe_const_decl.
615 (emit_mode_unit_size, emit_mode_base_align, emit_mode_ibit)
616 (emit_mode_fbit): Update use of print_maybe_const_decl.
617 (emit_move_size): Likewise. Treat the array as non-const
619 (emit_mode_adjustments): Handle adj_nunits.
621 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
623 * machmode.def (VECTOR_MODES_WITH_PREFIX): Document.
624 * genmodes.c (VECTOR_MODES_WITH_PREFIX): New macro.
625 (VECTOR_MODES): Use it.
626 (make_vector_modes): Take the prefix as an argument.
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 * mode-classes.def (MODE_VECTOR_BOOL): New mode class.
633 * machmode.h (INTEGRAL_MODE_P, VECTOR_MODE_P): Return true
634 for MODE_VECTOR_BOOL.
635 * machmode.def (VECTOR_BOOL_MODE): Document.
636 * genmodes.c (VECTOR_BOOL_MODE): New macro.
637 (make_vector_bool_mode): New function.
638 (complete_mode, emit_mode_wider, emit_mode_adjustments): Handle
640 * lto-streamer-in.c (lto_input_mode_table): Likewise.
641 * rtx-vector-builder.c (rtx_vector_builder::find_cached_value):
643 * stor-layout.c (int_mode_for_mode): Likewise.
644 * tree.c (build_vector_type_for_mode): Likewise.
645 * varasm.c (output_constant_pool_2): Likewise.
646 * emit-rtl.c (init_emit_once): Make sure that CONST1_RTX (BImode) and
647 CONSTM1_RTX (BImode) are the same thing. Initialize const_tiny_rtx
648 for MODE_VECTOR_BOOL.
649 * expr.c (expand_expr_real_1): Use VECTOR_MODE_P instead of a list
650 of mode class checks.
651 * tree-vect-generic.c (expand_vector_operation): Use VECTOR_MODE_P
652 instead of a list of mode class checks.
653 (expand_vector_scalar_condition): Likewise.
654 (type_for_widest_vector_mode): Handle BImode as an inner mode.
656 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
657 Alan Hayward <alan.hayward@arm.com>
658 David Sherwood <david.sherwood@arm.com>
660 * machmode.h (mode_size): Change from unsigned short to
662 (mode_to_bytes): Return a poly_uint16 rather than an unsigned short.
663 (GET_MODE_SIZE): Return a constant if ONLY_FIXED_SIZE_MODES,
664 or if measurement_type is not polynomial.
665 (fixed_size_mode::includes_p): Check for constant-sized modes.
666 * genmodes.c (emit_mode_size_inline): Make mode_size_inline
667 return a poly_uint16 rather than an unsigned short.
668 (emit_mode_size): Change the type of mode_size from unsigned short
669 to poly_uint16_pod. Use ZERO_COEFFS for the initializer.
670 (emit_mode_adjustments): Cope with polynomial vector sizes.
671 * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
673 * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
675 * auto-inc-dec.c (try_merge): Treat GET_MODE_SIZE as polynomial.
676 * builtins.c (expand_ifn_atomic_compare_exchange_into_call): Likewise.
677 * caller-save.c (setup_save_areas): Likewise.
678 (replace_reg_with_saved_mem): Likewise.
679 * calls.c (emit_library_call_value_1): Likewise.
680 * combine-stack-adj.c (combine_stack_adjustments_for_block): Likewise.
681 * combine.c (simplify_set, make_extraction, simplify_shift_const_1)
682 (gen_lowpart_for_combine): Likewise.
683 * convert.c (convert_to_integer_1): Likewise.
684 * cse.c (equiv_constant, cse_insn): Likewise.
685 * cselib.c (autoinc_split, cselib_hash_rtx): Likewise.
686 (cselib_subst_to_values): Likewise.
687 * dce.c (word_dce_process_block): Likewise.
688 * df-problems.c (df_word_lr_mark_ref): Likewise.
689 * dwarf2cfi.c (init_one_dwarf_reg_size): Likewise.
690 * dwarf2out.c (multiple_reg_loc_descriptor, mem_loc_descriptor)
691 (concat_loc_descriptor, concatn_loc_descriptor, loc_descriptor)
692 (rtl_for_decl_location): Likewise.
693 * emit-rtl.c (gen_highpart, widen_memory_access): Likewise.
694 * expmed.c (extract_bit_field_1, extract_integral_bit_field): Likewise.
695 * expr.c (emit_group_load_1, clear_storage_hints): Likewise.
696 (emit_move_complex, emit_move_multi_word, emit_push_insn): Likewise.
697 (expand_expr_real_1): Likewise.
698 * function.c (assign_parm_setup_block_p, assign_parm_setup_block)
699 (pad_below): Likewise.
700 * gimple-fold.c (optimize_atomic_compare_exchange_p): Likewise.
701 * gimple-ssa-store-merging.c (rhs_valid_for_store_merging_p): Likewise.
702 * ira.c (get_subreg_tracking_sizes): Likewise.
703 * ira-build.c (ira_create_allocno_objects): Likewise.
704 * ira-color.c (coalesced_pseudo_reg_slot_compare): Likewise.
705 (ira_sort_regnos_for_alter_reg): Likewise.
706 * ira-costs.c (record_operand_costs): Likewise.
707 * lower-subreg.c (interesting_mode_p, simplify_gen_subreg_concatn)
708 (resolve_simple_move): Likewise.
709 * lra-constraints.c (get_reload_reg, operands_match_p): Likewise.
710 (process_addr_reg, simplify_operand_subreg, curr_insn_transform)
711 (lra_constraints): Likewise.
712 (CONST_POOL_OK_P): Reject variable-sized modes.
713 * lra-spills.c (slot, assign_mem_slot, pseudo_reg_slot_compare)
714 (add_pseudo_to_slot, lra_spill): Likewise.
715 * omp-low.c (omp_clause_aligned_alignment): Likewise.
716 * optabs-query.c (get_best_extraction_insn): Likewise.
717 * optabs-tree.c (expand_vec_cond_expr_p): Likewise.
718 * optabs.c (expand_vec_perm_var, expand_vec_cond_expr): Likewise.
719 (expand_mult_highpart, valid_multiword_target_p): Likewise.
720 * recog.c (offsettable_address_addr_space_p): Likewise.
721 * regcprop.c (maybe_mode_change): Likewise.
722 * reginfo.c (choose_hard_reg_mode, record_subregs_of_mode): Likewise.
723 * regrename.c (build_def_use): Likewise.
724 * regstat.c (dump_reg_info): Likewise.
725 * reload.c (complex_word_subreg_p, push_reload, find_dummy_reload)
726 (find_reloads, find_reloads_subreg_address): Likewise.
727 * reload1.c (eliminate_regs_1): Likewise.
728 * rtlanal.c (for_each_inc_dec_find_inc_dec, rtx_cost): Likewise.
729 * simplify-rtx.c (avoid_constant_pool_reference): Likewise.
730 (simplify_binary_operation_1, simplify_subreg): Likewise.
731 * targhooks.c (default_function_arg_padding): Likewise.
732 (default_hard_regno_nregs, default_class_max_nregs): Likewise.
733 * tree-cfg.c (verify_gimple_assign_binary): Likewise.
734 (verify_gimple_assign_ternary): Likewise.
735 * tree-inline.c (estimate_move_cost): Likewise.
736 * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
737 * tree-ssa-loop-ivopts.c (add_autoinc_candidates): Likewise.
738 (get_address_cost_ainc): Likewise.
739 * tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Likewise.
740 (vect_supportable_dr_alignment): Likewise.
741 * tree-vect-loop.c (vect_determine_vectorization_factor): Likewise.
742 (vectorizable_reduction): Likewise.
743 * tree-vect-stmts.c (vectorizable_assignment, vectorizable_shift)
744 (vectorizable_operation, vectorizable_load): Likewise.
745 * tree.c (build_same_sized_truth_vector_type): Likewise.
746 * valtrack.c (cleanup_auto_inc_dec): Likewise.
747 * var-tracking.c (emit_note_insn_var_location): Likewise.
748 * config/arc/arc.h (ASM_OUTPUT_CASE_END): Use as_a <scalar_int_mode>.
749 (ADDR_VEC_ALIGN): Likewise.
751 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
752 Alan Hayward <alan.hayward@arm.com>
753 David Sherwood <david.sherwood@arm.com>
755 * machmode.h (mode_to_bits): Return a poly_uint16 rather than an
757 (GET_MODE_BITSIZE): Return a constant if ONLY_FIXED_SIZE_MODES,
758 or if measurement_type is polynomial.
759 * calls.c (shift_return_value): Treat GET_MODE_BITSIZE as polynomial.
760 * combine.c (make_extraction): Likewise.
761 * dse.c (find_shift_sequence): Likewise.
762 * dwarf2out.c (mem_loc_descriptor): Likewise.
763 * expmed.c (store_integral_bit_field, extract_bit_field_1): Likewise.
764 (extract_bit_field, extract_low_bits): Likewise.
765 * expr.c (convert_move, convert_modes, emit_move_insn_1): Likewise.
766 (optimize_bitfield_assignment_op, expand_assignment): Likewise.
767 (store_expr_with_bounds, store_field, expand_expr_real_1): Likewise.
768 * fold-const.c (optimize_bit_field_compare, merge_ranges): Likewise.
769 * gimple-fold.c (optimize_atomic_compare_exchange_p): Likewise.
770 * reload.c (find_reloads): Likewise.
771 * reload1.c (alter_reg): Likewise.
772 * stor-layout.c (bitwise_mode_for_mode, compute_record_mode): Likewise.
773 * targhooks.c (default_secondary_memory_needed_mode): Likewise.
774 * tree-if-conv.c (predicate_mem_writes): Likewise.
775 * tree-ssa-strlen.c (handle_builtin_memcmp): Likewise.
776 * tree-vect-patterns.c (adjust_bool_pattern): Likewise.
777 * tree-vect-stmts.c (vectorizable_simd_clone_call): Likewise.
778 * valtrack.c (dead_debug_insert_temp): Likewise.
779 * varasm.c (mergeable_constant_section): Likewise.
780 * config/sh/sh.h (LOCAL_ALIGNMENT): Use as_a <fixed_size_mode>.
782 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
783 Alan Hayward <alan.hayward@arm.com>
784 David Sherwood <david.sherwood@arm.com>
786 * expr.c (expand_assignment): Cope with polynomial mode sizes
787 when assigning to a CONCAT.
789 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
790 Alan Hayward <alan.hayward@arm.com>
791 David Sherwood <david.sherwood@arm.com>
793 * machmode.h (mode_precision): Change from unsigned short to
795 (mode_to_precision): Return a poly_uint16 rather than an unsigned
797 (GET_MODE_PRECISION): Return a constant if ONLY_FIXED_SIZE_MODES,
798 or if measurement_type is not polynomial.
799 (HWI_COMPUTABLE_MODE_P): Turn into a function. Optimize the case
800 in which the mode is already known to be a scalar_int_mode.
801 * genmodes.c (emit_mode_precision): Change the type of mode_precision
802 from unsigned short to poly_uint16_pod. Use ZERO_COEFFS for the
804 * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
805 for GET_MODE_PRECISION.
806 * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
807 for GET_MODE_PRECISION.
808 * combine.c (update_rsp_from_reg_equal): Treat GET_MODE_PRECISION
810 (try_combine, find_split_point, combine_simplify_rtx): Likewise.
811 (expand_field_assignment, make_extraction): Likewise.
812 (make_compound_operation_int, record_dead_and_set_regs_1): Likewise.
813 (get_last_value): Likewise.
814 * convert.c (convert_to_integer_1): Likewise.
815 * cse.c (cse_insn): Likewise.
816 * expr.c (expand_expr_real_1): Likewise.
817 * lra-constraints.c (simplify_operand_subreg): Likewise.
818 * optabs-query.c (can_atomic_load_p): Likewise.
819 * optabs.c (expand_atomic_load): Likewise.
820 (expand_atomic_store): Likewise.
821 * ree.c (combine_reaching_defs): Likewise.
822 * rtl.h (partial_subreg_p, paradoxical_subreg_p): Likewise.
823 * rtlanal.c (nonzero_bits1, lsb_bitfield_op_p): Likewise.
824 * tree.h (type_has_mode_precision_p): Likewise.
825 * ubsan.c (instrument_si_overflow): Likewise.
827 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
828 Alan Hayward <alan.hayward@arm.com>
829 David Sherwood <david.sherwood@arm.com>
831 * tree.h (TYPE_VECTOR_SUBPARTS): Turn into a function and handle
832 polynomial numbers of units.
833 (SET_TYPE_VECTOR_SUBPARTS): Likewise.
834 (valid_vector_subparts_p): New function.
835 (build_vector_type): Remove temporary shim and take the number
836 of units as a poly_uint64 rather than an int.
837 (build_opaque_vector_type): Take the number of units as a
838 poly_uint64 rather than an int.
839 * tree.c (build_vector_from_ctor): Handle polynomial
840 TYPE_VECTOR_SUBPARTS.
841 (type_hash_canon_hash, type_cache_hasher::equal): Likewise.
842 (uniform_vector_p, vector_type_mode, build_vector): Likewise.
843 (build_vector_from_val): If the number of units is variable,
844 use build_vec_duplicate_cst for constant operands and
845 VEC_DUPLICATE_EXPR otherwise.
846 (make_vector_type): Remove temporary is_constant ().
847 (build_vector_type, build_opaque_vector_type): Take the number of
848 units as a poly_uint64 rather than an int.
849 (check_vector_cst): Handle polynomial TYPE_VECTOR_SUBPARTS and
851 * cfgexpand.c (expand_debug_expr): Likewise.
852 * expr.c (count_type_elements, categorize_ctor_elements_1): Likewise.
853 (store_constructor, expand_expr_real_1): Likewise.
854 (const_scalar_mask_from_tree): Likewise.
855 * fold-const-call.c (fold_const_reduction): Likewise.
856 * fold-const.c (const_binop, const_unop, fold_convert_const): Likewise.
857 (operand_equal_p, fold_vec_perm, fold_ternary_loc): Likewise.
858 (native_encode_vector, vec_cst_ctor_to_array): Likewise.
859 (fold_relational_const): Likewise.
860 (native_interpret_vector): Likewise. Change the size from an
861 int to an unsigned int.
862 * gimple-fold.c (gimple_fold_stmt_to_constant_1): Handle polynomial
863 TYPE_VECTOR_SUBPARTS.
864 (gimple_fold_indirect_ref, gimple_build_vector): Likewise.
865 (gimple_build_vector_from_val): Use VEC_DUPLICATE_EXPR when
866 duplicating a non-constant operand into a variable-length vector.
867 * hsa-brig.c (hsa_op_immed::emit_to_buffer): Handle polynomial
868 TYPE_VECTOR_SUBPARTS and VECTOR_CST_NELTS.
869 * ipa-icf.c (sem_variable::equals): Likewise.
870 * match.pd: Likewise.
871 * omp-simd-clone.c (simd_clone_subparts): Likewise.
872 * print-tree.c (print_node): Likewise.
873 * stor-layout.c (layout_type): Likewise.
874 * targhooks.c (default_builtin_vectorization_cost): Likewise.
875 * tree-cfg.c (verify_gimple_comparison): Likewise.
876 (verify_gimple_assign_binary): Likewise.
877 (verify_gimple_assign_ternary): Likewise.
878 (verify_gimple_assign_single): Likewise.
879 * tree-pretty-print.c (dump_generic_node): Likewise.
880 * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
881 (simplify_bitfield_ref, is_combined_permutation_identity): Likewise.
882 * tree-vect-data-refs.c (vect_permute_store_chain): Likewise.
883 (vect_grouped_load_supported, vect_permute_load_chain): Likewise.
884 (vect_shift_permute_load_chain): Likewise.
885 * tree-vect-generic.c (nunits_for_known_piecewise_op): Likewise.
886 (expand_vector_condition, optimize_vector_constructor): Likewise.
887 (lower_vec_perm, get_compute_type): Likewise.
888 * tree-vect-loop.c (vect_determine_vectorization_factor): Likewise.
889 (get_initial_defs_for_reduction, vect_transform_loop): Likewise.
890 * tree-vect-patterns.c (vect_recog_bool_pattern): Likewise.
891 (vect_recog_mask_conversion_pattern): Likewise.
892 * tree-vect-slp.c (vect_supported_load_permutation_p): Likewise.
893 (vect_get_constant_vectors, vect_transform_slp_perm_load): Likewise.
894 * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
895 (get_group_load_store_type, vectorizable_mask_load_store): Likewise.
896 (vectorizable_bswap, simd_clone_subparts, vectorizable_assignment)
897 (vectorizable_shift, vectorizable_operation, vectorizable_store)
898 (vectorizable_load, vect_is_simple_cond, vectorizable_comparison)
899 (supportable_widening_operation): Likewise.
900 (supportable_narrowing_operation): Likewise.
901 * tree-vector-builder.c (tree_vector_builder::binary_encoded_nelts):
903 * varasm.c (output_constant): Likewise.
905 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
906 Alan Hayward <alan.hayward@arm.com>
907 David Sherwood <david.sherwood@arm.com>
909 * tree-vect-data-refs.c (vect_permute_store_chain): Reorganize
910 so that both the length == 3 and length != 3 cases set up their
911 own permute vectors. Add comments explaining why we know the
912 number of elements is constant.
913 (vect_permute_load_chain): Likewise.
915 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
916 Alan Hayward <alan.hayward@arm.com>
917 David Sherwood <david.sherwood@arm.com>
919 * machmode.h (mode_nunits): Change from unsigned char to
921 (ONLY_FIXED_SIZE_MODES): New macro.
922 (pod_mode::measurement_type, scalar_int_mode::measurement_type)
923 (scalar_float_mode::measurement_type, scalar_mode::measurement_type)
924 (complex_mode::measurement_type, fixed_size_mode::measurement_type):
926 (mode_to_nunits): Return a poly_uint16 rather than an unsigned short.
927 (GET_MODE_NUNITS): Return a constant if ONLY_FIXED_SIZE_MODES,
928 or if measurement_type is not polynomial.
929 * genmodes.c (ZERO_COEFFS): New macro.
930 (emit_mode_nunits_inline): Make mode_nunits_inline return a
932 (emit_mode_nunits): Change the type of mode_nunits to poly_uint16_pod.
933 Use ZERO_COEFFS when emitting initializers.
934 * data-streamer.h (bp_pack_poly_value): New function.
935 (bp_unpack_poly_value): Likewise.
936 * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
938 * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
940 * tree.c (make_vector_type): Remove temporary shim and make
941 the real function take the number of units as a poly_uint64
943 (build_vector_type_for_mode): Handle polynomial nunits.
944 * dwarf2out.c (loc_descriptor, add_const_value_attribute): Likewise.
945 * emit-rtl.c (const_vec_series_p_1): Likewise.
946 (gen_rtx_CONST_VECTOR): Likewise.
947 * fold-const.c (test_vec_duplicate_folding): Likewise.
948 * genrecog.c (validate_pattern): Likewise.
949 * optabs-query.c (can_vec_perm_var_p, can_mult_highpart_p): Likewise.
950 * optabs-tree.c (expand_vec_cond_expr_p): Likewise.
951 * optabs.c (expand_vector_broadcast, expand_binop_directly): Likewise.
952 (shift_amt_for_vec_perm_mask, expand_vec_perm_var): Likewise.
953 (expand_vec_cond_expr, expand_mult_highpart): Likewise.
954 * rtlanal.c (subreg_get_info): Likewise.
955 * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
956 (vect_grouped_load_supported): Likewise.
957 * tree-vect-generic.c (type_for_widest_vector_mode): Likewise.
958 * tree-vect-loop.c (have_whole_vector_shift): Likewise.
959 * simplify-rtx.c (simplify_unary_operation_1): Likewise.
960 (simplify_const_unary_operation, simplify_binary_operation_1)
961 (simplify_const_binary_operation, simplify_ternary_operation)
962 (test_vector_ops_duplicate, test_vector_ops): Likewise.
963 (simplify_immed_subreg): Use GET_MODE_NUNITS on a fixed_size_mode
964 instead of CONST_VECTOR_NUNITS.
965 * varasm.c (output_constant_pool_2): Likewise.
966 * rtx-vector-builder.c (rtx_vector_builder::build): Only include the
967 explicit-encoded elements in the XVEC for variable-length vectors.
969 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
971 * lra-constraints.c (curr_insn_transform): Use partial_subreg_p.
973 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
974 Alan Hayward <alan.hayward@arm.com>
975 David Sherwood <david.sherwood@arm.com>
977 * coretypes.h (fixed_size_mode): Declare.
978 (fixed_size_mode_pod): New typedef.
979 * builtins.h (target_builtins::x_apply_args_mode)
980 (target_builtins::x_apply_result_mode): Change type to
982 * builtins.c (apply_args_size, apply_result_size, result_vector)
983 (expand_builtin_apply_args_1, expand_builtin_apply)
984 (expand_builtin_return): Update accordingly.
986 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
988 * cse.c (hash_rtx_cb): Hash only the encoded elements.
989 * cselib.c (cselib_hash_rtx): Likewise.
990 * expmed.c (make_tree): Build VECTOR_CSTs directly from the
991 CONST_VECTOR encoding.
993 2017-01-03 Jakub Jelinek <jakub@redhat.com>
994 Jeff Law <law@redhat.com>
997 * config/i386/i386.c (ix86_adjust_stack_and_probe_stack_clash): For
998 noreturn probe, use gen_pop instead of ix86_emit_restore_reg_using_pop,
999 only set RTX_FRAME_RELATED_P on both the push and pop if cfa_reg is sp
1000 and add REG_CFA_ADJUST_CFA notes in that case to both insns.
1003 * config/i386/i386.c (ix86_adjust_stack_and_probe_stack_clash): Do not
1004 explicitly probe *sp in a noreturn function if there were any callee
1005 register saves or frame pointer is needed.
1007 2018-01-03 Jakub Jelinek <jakub@redhat.com>
1010 * cfgexpand.c (expand_debug_expr): Return NULL if mode is
1011 BLKmode for ternary, binary or unary expressions.
1014 * var-tracking.c (delete_vta_debug_insn): New inline function.
1015 (delete_vta_debug_insns): Add USE_CFG argument, if true, walk just
1016 insns from get_insns () to NULL instead of each bb separately.
1017 Use delete_vta_debug_insn. No longer static.
1018 (vt_debug_insns_local, variable_tracking_main_1): Adjust
1019 delete_vta_debug_insns callers.
1020 * rtl.h (delete_vta_debug_insns): Declare.
1021 * final.c (rest_of_handle_final): Call delete_vta_debug_insns
1022 instead of variable_tracking_main.
1024 2018-01-03 Martin Sebor <msebor@redhat.com>
1026 PR tree-optimization/83603
1027 * calls.c (maybe_warn_nonstring_arg): Avoid accessing function
1028 arguments past the endof the argument list in functions declared
1029 without a prototype.
1030 * gimple-ssa-warn-restrict.c (wrestrict_dom_walker::check_call):
1031 Avoid checking when arguments are null.
1033 2018-01-03 Martin Sebor <msebor@redhat.com>
1036 * doc/extend.texi (attribute const): Fix a typo.
1037 * ipa-pure-const.c ((warn_function_const, warn_function_pure): Avoid
1038 issuing -Wsuggest-attribute for void functions.
1040 2018-01-03 Martin Sebor <msebor@redhat.com>
1042 * gimple-ssa-warn-restrict.c (builtin_memref::builtin_memref): Use
1043 offset_int::from instead of wide_int::to_shwi.
1044 (maybe_diag_overlap): Remove assertion.
1045 Use HOST_WIDE_INT_PRINT_DEC instead of %lli.
1046 * gimple-ssa-sprintf.c (format_directive): Same.
1047 (parse_directive): Same.
1048 (sprintf_dom_walker::compute_format_length): Same.
1049 (try_substitute_return_value): Same.
1051 2017-01-03 Jeff Law <law@redhat.com>
1054 * explow.c (anti_adjust_stack_and_probe_stack_clash): Test a
1055 non-constant residual for zero at runtime and avoid probing in
1056 that case. Reorganize code for trailing problem to mirror handling
1059 2018-01-03 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
1061 PR tree-optimization/83501
1062 * tree-ssa-strlen.c (get_string_cst): New.
1063 (handle_char_store): Call get_string_cst.
1065 2018-01-03 Martin Liska <mliska@suse.cz>
1067 PR tree-optimization/83593
1068 * tree-ssa-strlen.c: Include tree-cfg.h.
1069 (strlen_check_and_optimize_stmt): Add new argument cleanup_eh.
1070 (strlen_dom_walker): Add new member variable m_cleanup_cfg.
1071 (strlen_dom_walker::strlen_dom_walker): Initialize m_cleanup_cfg
1073 (strlen_dom_walker::before_dom_children): Call
1074 gimple_purge_dead_eh_edges. Dump tranformation with details
1076 (strlen_dom_walker::before_dom_children): Update call by adding
1077 new argument cleanup_eh.
1078 (pass_strlen::execute): Return TODO_cleanup_cfg if needed.
1080 2018-01-03 Martin Liska <mliska@suse.cz>
1083 * cif-code.def (VARIADIC_THUNK): New enum value.
1084 * ipa-fnsummary.c (compute_fn_summary): Do not inline variadic
1087 2018-01-03 Jan Beulich <jbeulich@suse.com>
1089 * sse.md (mov<mode>_internal): Tighten condition for when to use
1090 vmovdqu<ssescalarsize> for TI and OI modes.
1092 2018-01-03 Jakub Jelinek <jakub@redhat.com>
1094 Update copyright years.
1096 2018-01-03 Martin Liska <mliska@suse.cz>
1099 * ipa-visibility.c (function_and_variable_visibility): Skip
1100 functions with noipa attribure.
1102 2018-01-03 Jakub Jelinek <jakub@redhat.com>
1104 * gcc.c (process_command): Update copyright notice dates.
1105 * gcov-dump.c (print_version): Ditto.
1106 * gcov.c (print_version): Ditto.
1107 * gcov-tool.c (print_version): Ditto.
1108 * gengtype.c (create_file): Ditto.
1109 * doc/cpp.texi: Bump @copying's copyright year.
1110 * doc/cppinternals.texi: Ditto.
1111 * doc/gcc.texi: Ditto.
1112 * doc/gccint.texi: Ditto.
1113 * doc/gcov.texi: Ditto.
1114 * doc/install.texi: Ditto.
1115 * doc/invoke.texi: Ditto.
1117 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1119 * vector-builder.h (vector_builder::m_full_nelts): Change from
1120 unsigned int to poly_uint64.
1121 (vector_builder::full_nelts): Update prototype accordingly.
1122 (vector_builder::new_vector): Likewise.
1123 (vector_builder::encoded_full_vector_p): Handle polynomial full_nelts.
1124 (vector_builder::operator ==): Likewise.
1125 (vector_builder::finalize): Likewise.
1126 * int-vector-builder.h (int_vector_builder::int_vector_builder):
1127 Take the number of elements as a poly_uint64 rather than an
1129 * vec-perm-indices.h (vec_perm_indices::m_nelts_per_input): Change
1130 from unsigned int to poly_uint64.
1131 (vec_perm_indices::vec_perm_indices): Update prototype accordingly.
1132 (vec_perm_indices::new_vector): Likewise.
1133 (vec_perm_indices::length): Likewise.
1134 (vec_perm_indices::nelts_per_input): Likewise.
1135 (vec_perm_indices::input_nelts): Likewise.
1136 * vec-perm-indices.c (vec_perm_indices::new_vector): Take the
1137 number of elements per input as a poly_uint64 rather than an
1138 unsigned int. Use the original encoding for variable-length
1139 vectors, rather than clamping each individual element.
1140 For the second and subsequent elements in each pattern,
1141 clamp the step and base before clamping their sum.
1142 (vec_perm_indices::series_p): Handle polynomial element counts.
1143 (vec_perm_indices::all_in_range_p): Likewise.
1144 (vec_perm_indices_to_tree): Likewise.
1145 (vec_perm_indices_to_rtx): Likewise.
1146 * tree-vect-stmts.c (vect_gen_perm_mask_any): Likewise.
1147 * tree-vector-builder.c (tree_vector_builder::new_unary_operation)
1148 (tree_vector_builder::new_binary_operation): Handle polynomial
1149 element counts. Return false if we need to know the number
1150 of elements at compile time.
1151 * fold-const.c (fold_vec_perm): Punt if the number of elements
1152 isn't known at compile time.
1154 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1156 * vec-perm-indices.h (vec_perm_builder): Change element type
1157 from HOST_WIDE_INT to poly_int64.
1158 (vec_perm_indices::element_type): Update accordingly.
1159 (vec_perm_indices::clamp): Handle polynomial element_types.
1160 * vec-perm-indices.c (vec_perm_indices::series_p): Likewise.
1161 (vec_perm_indices::all_in_range_p): Likewise.
1162 (tree_to_vec_perm_builder): Check for poly_int64 trees rather
1164 * vector-builder.h (vector_builder::stepped_sequence_p): Handle
1165 polynomial vec_perm_indices element types.
1166 * int-vector-builder.h (int_vector_builder::equal_p): Likewise.
1167 * fold-const.c (fold_vec_perm): Likewise.
1168 * optabs.c (shift_amt_for_vec_perm_mask): Likewise.
1169 * tree-vect-generic.c (lower_vec_perm): Likewise.
1170 * tree-vect-slp.c (vect_transform_slp_perm_load): Likewise.
1171 * config/aarch64/aarch64.c (aarch64_evpc_tbl): Cast d->perm
1172 element type to HOST_WIDE_INT.
1174 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1175 Alan Hayward <alan.hayward@arm.com>
1176 David Sherwood <david.sherwood@arm.com>
1178 * alias.c (addr_side_effect_eval): Take the size as a poly_int64
1179 rather than an int. Use plus_constant.
1180 (memrefs_conflict_p): Take the sizes as poly_int64s rather than ints.
1181 Take the offset "c" as a poly_int64 rather than a HOST_WIDE_INT.
1183 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1184 Alan Hayward <alan.hayward@arm.com>
1185 David Sherwood <david.sherwood@arm.com>
1187 * calls.c (emit_call_1, expand_call): Change struct_value_size from
1188 a HOST_WIDE_INT to a poly_int64.
1190 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1191 Alan Hayward <alan.hayward@arm.com>
1192 David Sherwood <david.sherwood@arm.com>
1194 * calls.c (load_register_parameters): Cope with polynomial
1195 mode sizes. Require a constant size for BLKmode parameters
1196 that aren't described by a PARALLEL. If BLOCK_REG_PADDING
1197 forces a parameter to be padded at the lsb end in order to
1198 fill a complete number of words, require the parameter size
1199 to be ordered wrt UNITS_PER_WORD.
1201 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1202 Alan Hayward <alan.hayward@arm.com>
1203 David Sherwood <david.sherwood@arm.com>
1205 * reload1.c (spill_stack_slot_width): Change element type
1206 from unsigned int to poly_uint64_pod.
1207 (alter_reg): Treat mode sizes as polynomial.
1209 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1210 Alan Hayward <alan.hayward@arm.com>
1211 David Sherwood <david.sherwood@arm.com>
1213 * reload.c (complex_word_subreg_p): New function.
1214 (reload_inner_reg_of_subreg, push_reload): Use it.
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 * lra-constraints.c (process_alt_operands): Reject matched
1221 operands whose sizes aren't ordered.
1222 (match_reload): Refer to this check here.
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 * builtins.c (expand_ifn_atomic_compare_exchange_into_call): Assert
1229 that the mode size is in the set {1, 2, 4, 8, 16}.
1231 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1232 Alan Hayward <alan.hayward@arm.com>
1233 David Sherwood <david.sherwood@arm.com>
1235 * var-tracking.c (adjust_mems): Treat mode sizes as polynomial.
1236 Use plus_constant instead of gen_rtx_PLUS.
1238 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1239 Alan Hayward <alan.hayward@arm.com>
1240 David Sherwood <david.sherwood@arm.com>
1242 * config/cr16/cr16-protos.h (cr16_push_rounding): Declare.
1243 * config/cr16/cr16.h (PUSH_ROUNDING): Move implementation to...
1244 * config/cr16/cr16.c (cr16_push_rounding): ...this new function.
1245 * config/h8300/h8300-protos.h (h8300_push_rounding): Declare.
1246 * config/h8300/h8300.h (PUSH_ROUNDING): Move implementation to...
1247 * config/h8300/h8300.c (h8300_push_rounding): ...this new function.
1248 * config/i386/i386-protos.h (ix86_push_rounding): Declare.
1249 * config/i386/i386.h (PUSH_ROUNDING): Move implementation to...
1250 * config/i386/i386.c (ix86_push_rounding): ...this new function.
1251 * config/m32c/m32c-protos.h (m32c_push_rounding): Take and return
1253 * config/m32c/m32c.c (m32c_push_rounding): Likewise.
1254 * config/m68k/m68k-protos.h (m68k_push_rounding): Declare.
1255 * config/m68k/m68k.h (PUSH_ROUNDING): Move implementation to...
1256 * config/m68k/m68k.c (m68k_push_rounding): ...this new function.
1257 * config/pdp11/pdp11-protos.h (pdp11_push_rounding): Declare.
1258 * config/pdp11/pdp11.h (PUSH_ROUNDING): Move implementation to...
1259 * config/pdp11/pdp11.c (pdp11_push_rounding): ...this new function.
1260 * config/stormy16/stormy16-protos.h (xstormy16_push_rounding): Declare.
1261 * config/stormy16/stormy16.h (PUSH_ROUNDING): Move implementation to...
1262 * config/stormy16/stormy16.c (xstormy16_push_rounding): ...this new
1264 * expr.c (emit_move_resolve_push): Treat the input and result
1265 of PUSH_ROUNDING as a poly_int64.
1266 (emit_move_complex_push, emit_single_push_insn_1): Likewise.
1267 (emit_push_insn): Likewise.
1268 * lra-eliminations.c (mark_not_eliminable): Likewise.
1269 * recog.c (push_operand): Likewise.
1270 * reload1.c (elimination_effects): Likewise.
1271 * rtlanal.c (nonzero_bits1): Likewise.
1272 * calls.c (store_one_arg): Likewise. Require the padding to be
1273 known at compile time.
1275 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1276 Alan Hayward <alan.hayward@arm.com>
1277 David Sherwood <david.sherwood@arm.com>
1279 * expr.c (emit_single_push_insn_1): Treat mode sizes as polynomial.
1280 Use plus_constant instead of gen_rtx_PLUS.
1282 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1283 Alan Hayward <alan.hayward@arm.com>
1284 David Sherwood <david.sherwood@arm.com>
1286 * auto-inc-dec.c (set_inc_state): Take the mode size as a poly_int64
1289 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1290 Alan Hayward <alan.hayward@arm.com>
1291 David Sherwood <david.sherwood@arm.com>
1293 * expr.c (expand_expr_real_1): Use tree_to_poly_uint64
1294 instead of int_size_in_bytes when handling VIEW_CONVERT_EXPRs
1295 via stack temporaries. Treat the mode size as polynomial too.
1297 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1298 Alan Hayward <alan.hayward@arm.com>
1299 David Sherwood <david.sherwood@arm.com>
1301 * expr.c (expand_expr_real_2): When handling conversions involving
1302 unions, apply tree_to_poly_uint64 to the TYPE_SIZE rather than
1303 multiplying int_size_in_bytes by BITS_PER_UNIT. Treat GET_MODE_BISIZE
1304 as a poly_uint64 too.
1306 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1307 Alan Hayward <alan.hayward@arm.com>
1308 David Sherwood <david.sherwood@arm.com>
1310 * rtlanal.c (subreg_get_info): Handle polynomial mode sizes.
1312 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1313 Alan Hayward <alan.hayward@arm.com>
1314 David Sherwood <david.sherwood@arm.com>
1316 * combine.c (can_change_dest_mode): Handle polynomial
1317 REGMODE_NATURAL_SIZE.
1318 * expmed.c (store_bit_field_1): Likewise.
1319 * expr.c (store_constructor): Likewise.
1320 * emit-rtl.c (validate_subreg): Operate on polynomial mode sizes
1321 and polynomial REGMODE_NATURAL_SIZE.
1322 (gen_lowpart_common): Likewise.
1323 * reginfo.c (record_subregs_of_mode): Likewise.
1324 * rtlanal.c (read_modify_subreg_p): Likewise.
1326 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1327 Alan Hayward <alan.hayward@arm.com>
1328 David Sherwood <david.sherwood@arm.com>
1330 * internal-fn.c (expand_vector_ubsan_overflow): Handle polynomial
1331 numbers of elements.
1333 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1334 Alan Hayward <alan.hayward@arm.com>
1335 David Sherwood <david.sherwood@arm.com>
1337 * match.pd: Cope with polynomial numbers of vector elements.
1339 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1340 Alan Hayward <alan.hayward@arm.com>
1341 David Sherwood <david.sherwood@arm.com>
1343 * fold-const.c (fold_indirect_ref_1): Handle polynomial offsets
1344 in a POINTER_PLUS_EXPR.
1346 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1347 Alan Hayward <alan.hayward@arm.com>
1348 David Sherwood <david.sherwood@arm.com>
1350 * omp-simd-clone.c (simd_clone_subparts): New function.
1351 (simd_clone_init_simd_arrays): Use it instead of TYPE_VECTOR_SUBPARTS.
1352 (ipa_simd_modify_function_body): Likewise.
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-generic.c (nunits_for_known_piecewise_op): New function.
1359 (expand_vector_piecewise): Use it instead of TYPE_VECTOR_SUBPARTS.
1360 (expand_vector_addition, add_rshift, expand_vector_divmod): Likewise.
1361 (expand_vector_condition, vector_element): Likewise.
1362 (subparts_gt): New function.
1363 (get_compute_type): Use subparts_gt.
1364 (count_type_subparts): Delete.
1365 (expand_vector_operations_1): Use subparts_gt instead of
1366 count_type_subparts.
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-vect-data-refs.c (vect_no_alias_p): Replace with...
1373 (vect_compile_time_alias): ...this new function. Do the calculation
1374 on poly_ints rather than trees.
1375 (vect_prune_runtime_alias_test_list): Update call accordingly.
1377 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1378 Alan Hayward <alan.hayward@arm.com>
1379 David Sherwood <david.sherwood@arm.com>
1381 * tree-vect-slp.c (vect_build_slp_tree_1): Handle polynomial
1383 (vect_schedule_slp_instance): Likewise.
1385 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1386 Alan Hayward <alan.hayward@arm.com>
1387 David Sherwood <david.sherwood@arm.com>
1389 * tree-vect-slp.c (vect_get_and_check_slp_defs): Reject
1390 constant and extern definitions for variable-length vectors.
1391 (vect_get_constant_vectors): Note that the number of units
1392 is known to be constant.
1394 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1395 Alan Hayward <alan.hayward@arm.com>
1396 David Sherwood <david.sherwood@arm.com>
1398 * tree-vect-stmts.c (vectorizable_conversion): Treat the number
1399 of units as polynomial. Choose between WIDE and NARROW based
1402 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1403 Alan Hayward <alan.hayward@arm.com>
1404 David Sherwood <david.sherwood@arm.com>
1406 * tree-vect-stmts.c (simd_clone_subparts): New function.
1407 (vectorizable_simd_clone_call): Use it instead of TYPE_VECTOR_SUBPARTS.
1409 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1410 Alan Hayward <alan.hayward@arm.com>
1411 David Sherwood <david.sherwood@arm.com>
1413 * tree-vect-stmts.c (vectorizable_call): Treat the number of
1414 vectors as polynomial. Use build_index_vector for
1417 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1418 Alan Hayward <alan.hayward@arm.com>
1419 David Sherwood <david.sherwood@arm.com>
1421 * tree-vect-stmts.c (get_load_store_type): Treat the number of
1422 units as polynomial. Reject VMAT_ELEMENTWISE and VMAT_STRIDED_SLP
1423 for variable-length vectors.
1424 (vectorizable_mask_load_store): Treat the number of units as
1425 polynomial, asserting that it is constant if the condition has
1426 already been enforced.
1427 (vectorizable_store, vectorizable_load): Likewise.
1429 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1430 Alan Hayward <alan.hayward@arm.com>
1431 David Sherwood <david.sherwood@arm.com>
1433 * tree-vect-loop.c (vectorizable_live_operation): Treat the number
1434 of units as polynomial. Punt if we can't tell at compile time
1435 which vector contains the final result.
1437 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1438 Alan Hayward <alan.hayward@arm.com>
1439 David Sherwood <david.sherwood@arm.com>
1441 * tree-vect-loop.c (vectorizable_induction): Treat the number
1442 of units as polynomial. Punt on SLP inductions. Use an integer
1443 VEC_SERIES_EXPR for variable-length integer reductions. Use a
1444 cast of such a series for variable-length floating-point
1447 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1448 Alan Hayward <alan.hayward@arm.com>
1449 David Sherwood <david.sherwood@arm.com>
1451 * tree.h (build_index_vector): Declare.
1452 * tree.c (build_index_vector): New function.
1453 * tree-vect-loop.c (get_initial_defs_for_reduction): Treat the number
1454 of units as polynomial, forcibly converting it to a constant if
1455 vectorizable_reduction has already enforced the condition.
1456 (vect_create_epilog_for_reduction): Likewise. Use build_index_vector
1457 to create a {1,2,3,...} vector.
1458 (vectorizable_reduction): Treat the number of units as polynomial.
1459 Choose vectype_in based on the largest scalar element size rather
1460 than the smallest number of units. Enforce the restrictions
1463 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1464 Alan Hayward <alan.hayward@arm.com>
1465 David Sherwood <david.sherwood@arm.com>
1467 * tree-vect-data-refs.c (vector_alignment_reachable_p): Treat the
1468 number of units as polynomial.
1470 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1471 Alan Hayward <alan.hayward@arm.com>
1472 David Sherwood <david.sherwood@arm.com>
1474 * target.h (vector_sizes, auto_vector_sizes): New typedefs.
1475 * target.def (autovectorize_vector_sizes): Return the vector sizes
1476 by pointer, using vector_sizes rather than a bitmask.
1477 * targhooks.h (default_autovectorize_vector_sizes): Update accordingly.
1478 * targhooks.c (default_autovectorize_vector_sizes): Likewise.
1479 * config/aarch64/aarch64.c (aarch64_autovectorize_vector_sizes):
1481 * config/arc/arc.c (arc_autovectorize_vector_sizes): Likewise.
1482 * config/arm/arm.c (arm_autovectorize_vector_sizes): Likewise.
1483 * config/i386/i386.c (ix86_autovectorize_vector_sizes): Likewise.
1484 * config/mips/mips.c (mips_autovectorize_vector_sizes): Likewise.
1485 * omp-general.c (omp_max_vf): Likewise.
1486 * omp-low.c (omp_clause_aligned_alignment): Likewise.
1487 * optabs-query.c (can_vec_mask_load_store_p): Likewise.
1488 * tree-vect-loop.c (vect_analyze_loop): Likewise.
1489 * tree-vect-slp.c (vect_slp_bb): Likewise.
1490 * doc/tm.texi: Regenerate.
1491 * tree-vectorizer.h (current_vector_size): Change from an unsigned int
1493 * tree-vect-stmts.c (get_vectype_for_scalar_type_and_size): Take
1494 the vector size as a poly_uint64 rather than an unsigned int.
1495 (current_vector_size): Change from an unsigned int to a poly_uint64.
1496 (get_vectype_for_scalar_type): Update accordingly.
1497 * tree.h (build_truth_vector_type): Take the size and number of
1498 units as a poly_uint64 rather than an unsigned int.
1499 (build_vector_type): Add a temporary overload that takes
1500 the number of units as a poly_uint64 rather than an unsigned int.
1501 * tree.c (make_vector_type): Likewise.
1502 (build_truth_vector_type): Take the number of units as a poly_uint64
1503 rather than an unsigned int.
1505 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1506 Alan Hayward <alan.hayward@arm.com>
1507 David Sherwood <david.sherwood@arm.com>
1509 * target.def (get_mask_mode): Take the number of units and length
1510 as poly_uint64s rather than unsigned ints.
1511 * targhooks.h (default_get_mask_mode): Update accordingly.
1512 * targhooks.c (default_get_mask_mode): Likewise.
1513 * config/i386/i386.c (ix86_get_mask_mode): Likewise.
1514 * doc/tm.texi: Regenerate.
1516 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1517 Alan Hayward <alan.hayward@arm.com>
1518 David Sherwood <david.sherwood@arm.com>
1520 * omp-general.h (omp_max_vf): Return a poly_uint64 instead of an int.
1521 * omp-general.c (omp_max_vf): Likewise.
1522 * omp-expand.c (omp_adjust_chunk_size): Update call to omp_max_vf.
1523 (expand_omp_simd): Handle polynomial safelen.
1524 * omp-low.c (omplow_simd_context): Add a default constructor.
1525 (omplow_simd_context::max_vf): Change from int to poly_uint64.
1526 (lower_rec_simd_input_clauses): Update accordingly.
1527 (lower_rec_input_clauses): Likewise.
1529 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1530 Alan Hayward <alan.hayward@arm.com>
1531 David Sherwood <david.sherwood@arm.com>
1533 * tree-vectorizer.h (vect_nunits_for_cost): New function.
1534 * tree-vect-loop.c (vect_model_reduction_cost): Use it.
1535 * tree-vect-slp.c (vect_analyze_slp_cost_1): Likewise.
1536 (vect_analyze_slp_cost): Likewise.
1537 * tree-vect-stmts.c (vect_model_store_cost): Likewise.
1538 (vect_model_load_cost): Likewise.
1540 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1541 Alan Hayward <alan.hayward@arm.com>
1542 David Sherwood <david.sherwood@arm.com>
1544 * tree-vect-slp.c (vect_record_max_nunits, vect_build_slp_tree_1)
1545 (vect_build_slp_tree_2, vect_build_slp_tree): Change max_nunits
1546 from an unsigned int * to a poly_uint64_pod *.
1547 (calculate_unrolling_factor): New function.
1548 (vect_analyze_slp_instance): Use it. Track polynomial max_nunits.
1550 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1551 Alan Hayward <alan.hayward@arm.com>
1552 David Sherwood <david.sherwood@arm.com>
1554 * tree-vectorizer.h (_slp_instance::unrolling_factor): Change
1555 from an unsigned int to a poly_uint64.
1556 (_loop_vec_info::slp_unrolling_factor): Likewise.
1557 (_loop_vec_info::vectorization_factor): Change from an int
1559 (MAX_VECTORIZATION_FACTOR): Bump from 64 to INT_MAX.
1560 (vect_get_num_vectors): New function.
1561 (vect_update_max_nunits, vect_vf_for_cost): Likewise.
1562 (vect_get_num_copies): Use vect_get_num_vectors.
1563 (vect_analyze_data_ref_dependences): Change max_vf from an int *
1564 to an unsigned int *.
1565 (vect_analyze_data_refs): Change min_vf from an int * to a
1567 (vect_transform_slp_perm_load): Take the vf as a poly_uint64 rather
1568 than an unsigned HOST_WIDE_INT.
1569 * tree-vect-data-refs.c (vect_analyze_possibly_independent_ddr)
1570 (vect_analyze_data_ref_dependence): Change max_vf from an int *
1571 to an unsigned int *.
1572 (vect_analyze_data_ref_dependences): Likewise.
1573 (vect_compute_data_ref_alignment): Handle polynomial vf.
1574 (vect_enhance_data_refs_alignment): Likewise.
1575 (vect_prune_runtime_alias_test_list): Likewise.
1576 (vect_shift_permute_load_chain): Likewise.
1577 (vect_supportable_dr_alignment): Likewise.
1578 (dependence_distance_ge_vf): Take the vectorization factor as a
1579 poly_uint64 rather than an unsigned HOST_WIDE_INT.
1580 (vect_analyze_data_refs): Change min_vf from an int * to a
1582 * tree-vect-loop-manip.c (vect_gen_scalar_loop_niters): Take
1583 vfm1 as a poly_uint64 rather than an int. Make the same change
1584 for the returned bound_scalar.
1585 (vect_gen_vector_loop_niters): Handle polynomial vf.
1586 (vect_do_peeling): Likewise. Update call to
1587 vect_gen_scalar_loop_niters and handle polynomial bound_scalars.
1588 (vect_gen_vector_loop_niters_mult_vf): Assert that the vf must
1590 * tree-vect-loop.c (vect_determine_vectorization_factor)
1591 (vect_update_vf_for_slp, vect_analyze_loop_2): Handle polynomial vf.
1592 (vect_get_known_peeling_cost): Likewise.
1593 (vect_estimate_min_profitable_iters, vectorizable_reduction): Likewise.
1594 (vect_worthwhile_without_simd_p, vectorizable_induction): Likewise.
1595 (vect_transform_loop): Likewise. Use the lowest possible VF when
1596 updating the upper bounds of the loop.
1597 (vect_min_worthwhile_factor): Make static. Return an unsigned int
1599 * tree-vect-slp.c (vect_attempt_slp_rearrange_stmts): Cope with
1600 polynomial unroll factors.
1601 (vect_analyze_slp_cost_1, vect_analyze_slp_instance): Likewise.
1602 (vect_make_slp_decision): Likewise.
1603 (vect_supported_load_permutation_p): Likewise, and polynomial
1605 (vect_analyze_slp_cost): Handle polynomial vf.
1606 (vect_slp_analyze_node_operations): Likewise.
1607 (vect_slp_analyze_bb_1): Likewise.
1608 (vect_transform_slp_perm_load): Take the vf as a poly_uint64 rather
1609 than an unsigned HOST_WIDE_INT.
1610 * tree-vect-stmts.c (vectorizable_simd_clone_call, vectorizable_store)
1611 (vectorizable_load): Handle polynomial vf.
1612 * tree-vectorizer.c (simduid_to_vf::vf): Change from an int to
1614 (adjust_simduid_builtins, shrink_simd_arrays): Update accordingly.
1616 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1617 Alan Hayward <alan.hayward@arm.com>
1618 David Sherwood <david.sherwood@arm.com>
1620 * match.pd: Handle bit operations involving three constants
1621 and try to fold one pair.
1623 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1625 * tree-vect-loop-manip.c: Include gimple-fold.h.
1626 (slpeel_make_loop_iterate_ntimes): Add step, final_iv and
1627 niters_maybe_zero parameters. Handle other cases besides a step of 1.
1628 (vect_gen_vector_loop_niters): Add a step_vector_ptr parameter.
1629 Add a path that uses a step of VF instead of 1, but disable it
1631 (vect_do_peeling): Add step_vector, niters_vector_mult_vf_var
1632 and niters_no_overflow parameters. Update calls to
1633 slpeel_make_loop_iterate_ntimes and vect_gen_vector_loop_niters.
1634 Create a new SSA name if the latter choses to use a ste other
1635 than zero, and return it via niters_vector_mult_vf_var.
1636 * tree-vect-loop.c (vect_transform_loop): Update calls to
1637 vect_do_peeling, vect_gen_vector_loop_niters and
1638 slpeel_make_loop_iterate_ntimes.
1639 * tree-vectorizer.h (slpeel_make_loop_iterate_ntimes, vect_do_peeling)
1640 (vect_gen_vector_loop_niters): Update declarations after above changes.
1642 2018-01-02 Michael Meissner <meissner@linux.vnet.ibm.com>
1644 * config/rs6000/rs6000.md (floor<mode>2): Add support for IEEE
1645 128-bit round to integer instructions.
1646 (ceil<mode>2): Likewise.
1647 (btrunc<mode>2): Likewise.
1648 (round<mode>2): Likewise.
1650 2018-01-02 Aaron Sawdey <acsawdey@linux.vnet.ibm.com>
1652 * config/rs6000/rs6000-string.c (expand_block_move): Allow the use of
1653 unaligned VSX load/store on P8/P9.
1654 (expand_block_clear): Allow the use of unaligned VSX
1655 load/store on P8/P9.
1657 2018-01-02 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
1659 * config/rs6000/rs6000-p8swap.c (swap_feeds_both_load_and_store):
1661 (rs6000_analyze_swaps): Mark a web unoptimizable if it contains a
1662 swap associated with both a load and a store.
1664 2018-01-02 Andrew Waterman <andrew@sifive.com>
1666 * config/riscv/linux.h (ICACHE_FLUSH_FUNC): New.
1667 * config/riscv/riscv.md (clear_cache): Use it.
1669 2018-01-02 Artyom Skrobov <tyomitch@gmail.com>
1671 * web.c: Remove out-of-date comment.
1673 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1675 * expr.c (fixup_args_size_notes): Check that any existing
1676 REG_ARGS_SIZE notes are correct, and don't try to re-add them.
1677 (emit_single_push_insn_1): Move stack_pointer_delta adjustment to...
1678 (emit_single_push_insn): ...here.
1680 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1682 * rtl.h (CONST_VECTOR_ELT): Redefine to const_vector_elt.
1683 (const_vector_encoded_nelts): New function.
1684 (CONST_VECTOR_NUNITS): Redefine to use GET_MODE_NUNITS.
1685 (const_vector_int_elt, const_vector_elt): Declare.
1686 * emit-rtl.c (const_vector_int_elt_1): New function.
1687 (const_vector_elt): Likewise.
1688 * simplify-rtx.c (simplify_immed_subreg): Avoid taking the address
1689 of CONST_VECTOR_ELT.
1691 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1693 * expr.c: Include rtx-vector-builder.h.
1694 (const_vector_mask_from_tree): Use rtx_vector_builder and operate
1695 directly on the tree encoding.
1696 (const_vector_from_tree): Likewise.
1697 * optabs.c: Include rtx-vector-builder.h.
1698 (expand_vec_perm_var): Use rtx_vector_builder and create a repeating
1699 sequence of "u" values.
1700 * vec-perm-indices.c: Include rtx-vector-builder.h.
1701 (vec_perm_indices_to_rtx): Use rtx_vector_builder and operate
1702 directly on the vec_perm_indices encoding.
1704 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1706 * doc/rtl.texi (const_vector): Describe new encoding scheme.
1707 * Makefile.in (OBJS): Add rtx-vector-builder.o.
1708 * rtx-vector-builder.h: New file.
1709 * rtx-vector-builder.c: Likewise.
1710 * rtl.h (rtx_def::u2): Add a const_vector field.
1711 (CONST_VECTOR_NPATTERNS): New macro.
1712 (CONST_VECTOR_NELTS_PER_PATTERN): Likewise.
1713 (CONST_VECTOR_DUPLICATE_P): Likewise.
1714 (CONST_VECTOR_STEPPED_P): Likewise.
1715 (CONST_VECTOR_ENCODED_ELT): Likewise.
1716 (const_vec_duplicate_p): Check for a duplicated vector encoding.
1717 (unwrap_const_vec_duplicate): Likewise.
1718 (const_vec_series_p): Check for a non-duplicated vector encoding.
1719 Say that the function only returns true for integer vectors.
1720 * emit-rtl.c: Include rtx-vector-builder.h.
1721 (gen_const_vec_duplicate_1): Delete.
1722 (gen_const_vector): Call gen_const_vec_duplicate instead of
1723 gen_const_vec_duplicate_1.
1724 (const_vec_series_p_1): Operate directly on the CONST_VECTOR encoding.
1725 (gen_const_vec_duplicate): Use rtx_vector_builder.
1726 (gen_const_vec_series): Likewise.
1727 (gen_rtx_CONST_VECTOR): Likewise.
1728 * config/powerpcspe/powerpcspe.c: Include rtx-vector-builder.h.
1729 (swap_const_vector_halves): Take an rtx pointer rather than rtx.
1730 Build a new vector rather than modifying a CONST_VECTOR in-place.
1731 (handle_special_swappables): Update call accordingly.
1732 * config/rs6000/rs6000-p8swap.c: Include rtx-vector-builder.h.
1733 (swap_const_vector_halves): Take an rtx pointer rather than rtx.
1734 Build a new vector rather than modifying a CONST_VECTOR in-place.
1735 (handle_special_swappables): Update call accordingly.
1737 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1739 * simplify-rtx.c (simplify_const_binary_operation): Use
1740 CONST_VECTOR_ELT instead of XVECEXP.
1742 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1744 * tree-cfg.c (verify_gimple_assign_ternary): Allow the size of
1745 the selector elements to be different from the data elements
1746 if the selector is a VECTOR_CST.
1747 * tree-vect-stmts.c (vect_gen_perm_mask_any): Use a vector of
1748 ssizetype for the selector.
1750 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1752 * optabs.c (shift_amt_for_vec_perm_mask): Try using series_p
1753 before testing each element individually.
1754 * tree-vect-generic.c (lower_vec_perm): Likewise.
1756 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1758 * selftest.h (selftest::vec_perm_indices_c_tests): Declare.
1759 * selftest-run-tests.c (selftest::run_tests): Call it.
1760 * vector-builder.h (vector_builder::operator ==): New function.
1761 (vector_builder::operator !=): Likewise.
1762 * vec-perm-indices.h (vec_perm_indices::series_p): Declare.
1763 (vec_perm_indices::all_from_input_p): New function.
1764 * vec-perm-indices.c (vec_perm_indices::series_p): Likewise.
1765 (test_vec_perm_12, selftest::vec_perm_indices_c_tests): Likewise.
1766 * fold-const.c (fold_ternary_loc): Use tree_to_vec_perm_builder
1767 instead of reading the VECTOR_CST directly. Detect whether both
1768 vector inputs are the same before constructing the vec_perm_indices,
1769 and update the number of inputs argument accordingly. Use the
1770 utility functions added above. Only construct sel2 if we need to.
1772 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1774 * optabs.c (expand_vec_perm_var): Use an explicit encoding for
1775 the broadcast of the low byte.
1776 (expand_mult_highpart): Use an explicit encoding for the permutes.
1777 * optabs-query.c (can_mult_highpart_p): Likewise.
1778 * tree-vect-loop.c (calc_vec_perm_mask_for_shift): Likewise.
1779 * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
1780 (vectorizable_bswap): Likewise.
1781 * tree-vect-data-refs.c (vect_grouped_store_supported): Use an
1782 explicit encoding for the power-of-2 permutes.
1783 (vect_permute_store_chain): Likewise.
1784 (vect_grouped_load_supported): Likewise.
1785 (vect_permute_load_chain): Likewise.
1787 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1789 * vec-perm-indices.h (vec_perm_indices_to_tree): Declare.
1790 * vec-perm-indices.c (vec_perm_indices_to_tree): New function.
1791 * tree-ssa-forwprop.c (simplify_vector_constructor): Use it.
1792 * tree-vect-slp.c (vect_transform_slp_perm_load): Likewise.
1793 * tree-vect-stmts.c (vectorizable_bswap): Likewise.
1794 (vect_gen_perm_mask_any): Likewise.
1796 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1798 * int-vector-builder.h: New file.
1799 * vec-perm-indices.h: Include int-vector-builder.h.
1800 (vec_perm_indices): Redefine as an int_vector_builder.
1801 (auto_vec_perm_indices): Delete.
1802 (vec_perm_builder): Redefine as a stand-alone class.
1803 (vec_perm_indices::vec_perm_indices): New function.
1804 (vec_perm_indices::clamp): Likewise.
1805 * vec-perm-indices.c: Include fold-const.h and tree-vector-builder.h.
1806 (vec_perm_indices::new_vector): New function.
1807 (vec_perm_indices::new_expanded_vector): Update for new
1808 vec_perm_indices class.
1809 (vec_perm_indices::rotate_inputs): New function.
1810 (vec_perm_indices::all_in_range_p): Operate directly on the
1811 encoded form, without computing elided elements.
1812 (tree_to_vec_perm_builder): Operate directly on the VECTOR_CST
1813 encoding. Update for new vec_perm_indices class.
1814 * optabs.c (expand_vec_perm_const): Create a vec_perm_indices for
1815 the given vec_perm_builder.
1816 (expand_vec_perm_var): Update vec_perm_builder constructor.
1817 (expand_mult_highpart): Use vec_perm_builder instead of
1818 auto_vec_perm_indices.
1819 * optabs-query.c (can_mult_highpart_p): Use vec_perm_builder and
1820 vec_perm_indices instead of auto_vec_perm_indices. Use a single
1821 or double series encoding as appropriate.
1822 * fold-const.c (fold_ternary_loc): Use vec_perm_builder and
1823 vec_perm_indices instead of auto_vec_perm_indices.
1824 * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
1825 * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
1826 (vect_permute_store_chain): Likewise.
1827 (vect_grouped_load_supported): Likewise.
1828 (vect_permute_load_chain): Likewise.
1829 (vect_shift_permute_load_chain): Likewise.
1830 * tree-vect-slp.c (vect_build_slp_tree_1): Likewise.
1831 (vect_transform_slp_perm_load): Likewise.
1832 (vect_schedule_slp_instance): Likewise.
1833 * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
1834 (vectorizable_mask_load_store): Likewise.
1835 (vectorizable_bswap): Likewise.
1836 (vectorizable_store): Likewise.
1837 (vectorizable_load): Likewise.
1838 * tree-vect-generic.c (lower_vec_perm): Use vec_perm_builder and
1839 vec_perm_indices instead of auto_vec_perm_indices. Use
1840 tree_to_vec_perm_builder to read the vector from a tree.
1841 * tree-vect-loop.c (calc_vec_perm_mask_for_shift): Take a
1842 vec_perm_builder instead of a vec_perm_indices.
1843 (have_whole_vector_shift): Use vec_perm_builder and
1844 vec_perm_indices instead of auto_vec_perm_indices. Leave the
1845 truncation to calc_vec_perm_mask_for_shift.
1846 (vect_create_epilog_for_reduction): Likewise.
1847 * config/aarch64/aarch64.c (expand_vec_perm_d::perm): Change
1848 from auto_vec_perm_indices to vec_perm_indices.
1849 (aarch64_expand_vec_perm_const_1): Use rotate_inputs on d.perm
1850 instead of changing individual elements.
1851 (aarch64_vectorize_vec_perm_const): Use new_vector to install
1852 the vector in d.perm.
1853 * config/arm/arm.c (expand_vec_perm_d::perm): Change
1854 from auto_vec_perm_indices to vec_perm_indices.
1855 (arm_expand_vec_perm_const_1): Use rotate_inputs on d.perm
1856 instead of changing individual elements.
1857 (arm_vectorize_vec_perm_const): Use new_vector to install
1858 the vector in d.perm.
1859 * config/powerpcspe/powerpcspe.c (rs6000_expand_extract_even):
1860 Update vec_perm_builder constructor.
1861 (rs6000_expand_interleave): Likewise.
1862 * config/rs6000/rs6000.c (rs6000_expand_extract_even): Likewise.
1863 (rs6000_expand_interleave): Likewise.
1865 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1867 * optabs-query.c (can_vec_perm_var_p): Check whether lowering
1868 to qimode could truncate the indices.
1869 * optabs.c (expand_vec_perm_var): Likewise.
1871 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1873 * Makefile.in (OBJS): Add vec-perm-indices.o.
1874 * vec-perm-indices.h: New file.
1875 * vec-perm-indices.c: Likewise.
1876 * target.h (vec_perm_indices): Replace with a forward class
1878 (auto_vec_perm_indices): Move to vec-perm-indices.h.
1879 * optabs.h: Include vec-perm-indices.h.
1880 (expand_vec_perm): Delete.
1881 (selector_fits_mode_p, expand_vec_perm_var): Declare.
1882 (expand_vec_perm_const): Declare.
1883 * target.def (vec_perm_const_ok): Replace with...
1884 (vec_perm_const): ...this new hook.
1885 * doc/tm.texi.in (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Replace with...
1886 (TARGET_VECTORIZE_VEC_PERM_CONST): ...this new hook.
1887 * doc/tm.texi: Regenerate.
1888 * optabs.def (vec_perm_const): Delete.
1889 * doc/md.texi (vec_perm_const): Likewise.
1890 (vec_perm): Refer to TARGET_VECTORIZE_VEC_PERM_CONST.
1891 * expr.c (expand_expr_real_2): Use expand_vec_perm_const rather than
1892 expand_vec_perm for constant permutation vectors. Assert that
1893 the mode of variable permutation vectors is the integer equivalent
1894 of the mode that is being permuted.
1895 * optabs-query.h (selector_fits_mode_p): Declare.
1896 * optabs-query.c: Include vec-perm-indices.h.
1897 (selector_fits_mode_p): New function.
1898 (can_vec_perm_const_p): Check whether targetm.vectorize.vec_perm_const
1899 is defined, instead of checking whether the vec_perm_const_optab
1900 exists. Use targetm.vectorize.vec_perm_const instead of
1901 targetm.vectorize.vec_perm_const_ok. Check whether the indices
1902 fit in the vector mode before using a variable permute.
1903 * optabs.c (shift_amt_for_vec_perm_mask): Take a mode and a
1904 vec_perm_indices instead of an rtx.
1905 (expand_vec_perm): Replace with...
1906 (expand_vec_perm_const): ...this new function. Take the selector
1907 as a vec_perm_indices rather than an rtx. Also take the mode of
1908 the selector. Update call to shift_amt_for_vec_perm_mask.
1909 Use targetm.vectorize.vec_perm_const instead of vec_perm_const_optab.
1910 Use vec_perm_indices::new_expanded_vector to expand the original
1911 selector into bytes. Check whether the indices fit in the vector
1912 mode before using a variable permute.
1913 (expand_vec_perm_var): Make global.
1914 (expand_mult_highpart): Use expand_vec_perm_const.
1915 * fold-const.c: Includes vec-perm-indices.h.
1916 * tree-ssa-forwprop.c: Likewise.
1917 * tree-vect-data-refs.c: Likewise.
1918 * tree-vect-generic.c: Likewise.
1919 * tree-vect-loop.c: Likewise.
1920 * tree-vect-slp.c: Likewise.
1921 * tree-vect-stmts.c: Likewise.
1922 * config/aarch64/aarch64-protos.h (aarch64_expand_vec_perm_const):
1924 * config/aarch64/aarch64-simd.md (vec_perm_const<mode>): Delete.
1925 * config/aarch64/aarch64.c (aarch64_expand_vec_perm_const)
1926 (aarch64_vectorize_vec_perm_const_ok): Fuse into...
1927 (aarch64_vectorize_vec_perm_const): ...this new function.
1928 (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
1929 (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
1930 * config/arm/arm-protos.h (arm_expand_vec_perm_const): Delete.
1931 * config/arm/vec-common.md (vec_perm_const<mode>): Delete.
1932 * config/arm/arm.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
1933 (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
1934 (arm_expand_vec_perm_const, arm_vectorize_vec_perm_const_ok): Merge
1936 (arm_vectorize_vec_perm_const): ...this new function. Explicitly
1937 check for NEON modes.
1938 * config/i386/i386-protos.h (ix86_expand_vec_perm_const): Delete.
1939 * config/i386/sse.md (VEC_PERM_CONST, vec_perm_const<mode>): Delete.
1940 * config/i386/i386.c (ix86_expand_vec_perm_const_1): Update comment.
1941 (ix86_expand_vec_perm_const, ix86_vectorize_vec_perm_const_ok): Merge
1943 (ix86_vectorize_vec_perm_const): ...this new function. Incorporate
1944 the old VEC_PERM_CONST conditions.
1945 * config/ia64/ia64-protos.h (ia64_expand_vec_perm_const): Delete.
1946 * config/ia64/vect.md (vec_perm_const<mode>): Delete.
1947 * config/ia64/ia64.c (ia64_expand_vec_perm_const)
1948 (ia64_vectorize_vec_perm_const_ok): Merge into...
1949 (ia64_vectorize_vec_perm_const): ...this new function.
1950 * config/mips/loongson.md (vec_perm_const<mode>): Delete.
1951 * config/mips/mips-msa.md (vec_perm_const<mode>): Delete.
1952 * config/mips/mips-ps-3d.md (vec_perm_constv2sf): Delete.
1953 * config/mips/mips-protos.h (mips_expand_vec_perm_const): Delete.
1954 * config/mips/mips.c (mips_expand_vec_perm_const)
1955 (mips_vectorize_vec_perm_const_ok): Merge into...
1956 (mips_vectorize_vec_perm_const): ...this new function.
1957 * config/powerpcspe/altivec.md (vec_perm_constv16qi): Delete.
1958 * config/powerpcspe/paired.md (vec_perm_constv2sf): Delete.
1959 * config/powerpcspe/spe.md (vec_perm_constv2si): Delete.
1960 * config/powerpcspe/vsx.md (vec_perm_const<mode>): Delete.
1961 * config/powerpcspe/powerpcspe-protos.h (altivec_expand_vec_perm_const)
1962 (rs6000_expand_vec_perm_const): Delete.
1963 * config/powerpcspe/powerpcspe.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK):
1965 (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
1966 (altivec_expand_vec_perm_const_le): Take each operand individually.
1967 Operate on constant selectors rather than rtxes.
1968 (altivec_expand_vec_perm_const): Likewise. Update call to
1969 altivec_expand_vec_perm_const_le.
1970 (rs6000_expand_vec_perm_const): Delete.
1971 (rs6000_vectorize_vec_perm_const_ok): Delete.
1972 (rs6000_vectorize_vec_perm_const): New function.
1973 (rs6000_do_expand_vec_perm): Take a vec_perm_builder instead of
1974 an element count and rtx array.
1975 (rs6000_expand_extract_even): Update call accordingly.
1976 (rs6000_expand_interleave): Likewise.
1977 * config/rs6000/altivec.md (vec_perm_constv16qi): Delete.
1978 * config/rs6000/paired.md (vec_perm_constv2sf): Delete.
1979 * config/rs6000/vsx.md (vec_perm_const<mode>): Delete.
1980 * config/rs6000/rs6000-protos.h (altivec_expand_vec_perm_const)
1981 (rs6000_expand_vec_perm_const): Delete.
1982 * config/rs6000/rs6000.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
1983 (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
1984 (altivec_expand_vec_perm_const_le): Take each operand individually.
1985 Operate on constant selectors rather than rtxes.
1986 (altivec_expand_vec_perm_const): Likewise. Update call to
1987 altivec_expand_vec_perm_const_le.
1988 (rs6000_expand_vec_perm_const): Delete.
1989 (rs6000_vectorize_vec_perm_const_ok): Delete.
1990 (rs6000_vectorize_vec_perm_const): New function. Remove stray
1991 reference to the SPE evmerge intructions.
1992 (rs6000_do_expand_vec_perm): Take a vec_perm_builder instead of
1993 an element count and rtx array.
1994 (rs6000_expand_extract_even): Update call accordingly.
1995 (rs6000_expand_interleave): Likewise.
1996 * config/sparc/sparc.md (vec_perm_constv8qi): Delete in favor of...
1997 * config/sparc/sparc.c (sparc_vectorize_vec_perm_const): ...this
1999 (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
2001 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
2003 * optabs.c (expand_vec_perm_1): Assert that SEL has an integer
2004 vector mode and that that mode matches the mode of the data
2006 (expand_vec_perm): Split handling of non-CONST_VECTOR selectors
2007 out into expand_vec_perm_var. Do all CONST_VECTOR handling here,
2008 directly using expand_vec_perm_1 when forcing selectors into
2010 (expand_vec_perm_var): New function, split out from expand_vec_perm.
2012 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
2014 * optabs-query.h (can_vec_perm_p): Delete.
2015 (can_vec_perm_var_p, can_vec_perm_const_p): Declare.
2016 * optabs-query.c (can_vec_perm_p): Split into...
2017 (can_vec_perm_var_p, can_vec_perm_const_p): ...these two functions.
2018 (can_mult_highpart_p): Use can_vec_perm_const_p to test whether a
2019 particular selector is valid.
2020 * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
2021 * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
2022 (vect_grouped_load_supported): Likewise.
2023 (vect_shift_permute_load_chain): Likewise.
2024 * tree-vect-slp.c (vect_build_slp_tree_1): Likewise.
2025 (vect_transform_slp_perm_load): Likewise.
2026 * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
2027 (vectorizable_bswap): Likewise.
2028 (vect_gen_perm_mask_checked): Likewise.
2029 * fold-const.c (fold_ternary_loc): Likewise. Don't take
2030 implementations of variable permutation vectors into account
2031 when deciding which selector to use.
2032 * tree-vect-loop.c (have_whole_vector_shift): Don't check whether
2033 vec_perm_const_optab is supported; instead use can_vec_perm_const_p
2034 with a false third argument.
2035 * tree-vect-generic.c (lower_vec_perm): Use can_vec_perm_const_p
2036 to test whether the constant selector is valid and can_vec_perm_var_p
2037 to test whether a variable selector is valid.
2039 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
2041 * optabs-query.h (can_vec_perm_p): Take a const vec_perm_indices *.
2042 * optabs-query.c (can_vec_perm_p): Likewise.
2043 * fold-const.c (fold_vec_perm): Take a const vec_perm_indices &
2044 instead of vec_perm_indices.
2045 * tree-vectorizer.h (vect_gen_perm_mask_any): Likewise,
2046 (vect_gen_perm_mask_checked): Likewise,
2047 * tree-vect-stmts.c (vect_gen_perm_mask_any): Likewise,
2048 (vect_gen_perm_mask_checked): Likewise,
2050 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
2052 * optabs-query.h (qimode_for_vec_perm): Declare.
2053 * optabs-query.c (can_vec_perm_p): Split out qimode search to...
2054 (qimode_for_vec_perm): ...this new function.
2055 * optabs.c (expand_vec_perm): Use qimode_for_vec_perm.
2057 2018-01-02 Aaron Sawdey <acsawdey@linux.vnet.ibm.com>
2059 * rtlanal.c (canonicalize_condition): Return 0 if final rtx
2060 does not have a conditional at the top.
2062 2018-01-02 Richard Biener <rguenther@suse.de>
2064 * ipa-inline.c (big_speedup_p): Fix expression.
2066 2018-01-02 Jan Hubicka <hubicka@ucw.cz>
2069 * config/i386/x86-tune-costs.h: Increase cost of integer load costs
2072 2018-01-02 Jan Hubicka <hubicka@ucw.cz>
2076 * x86-tune-costs.h (generic_cost): Reduce cost of FDIV 20->17,
2077 cost of sqrt 20->14, DIVSS 18->13, DIVSD 32->17, SQRtSS 30->14
2078 and SQRTsD 58->18, cond_not_taken_branch_cost. 2->1. Increase
2079 cond_taken_branch_cost 3->4.
2081 2018-01-01 Jakub Jelinek <jakub@redhat.com>
2083 PR tree-optimization/83581
2084 * tree-loop-distribution.c (pass_loop_distribution::execute): Return
2085 TODO_cleanup_cfg if any changes have been made.
2088 * expr.c (store_expr_with_bounds): Use simplify_gen_subreg instead of
2089 convert_modes if target mode has the right side, but different mode
2093 * expr.c (expand_assignment): Fix up a typo in simplify_gen_subreg
2094 last argument when extracting from CONCAT. If either from_real or
2095 from_imag is NULL, use expansion through memory. If result is not
2096 a CONCAT and simplify_gen_subreg fails, try to simplify_gen_subreg
2097 the parts directly to inner mode, if even that fails, use expansion
2101 * expmed.c (expand_shift_1): For 2-byte rotates by BITS_PER_UNIT,
2102 check for bswap in mode rather than HImode and use that in expand_unop
2105 Copyright (C) 2018 Free Software Foundation, Inc.
2107 Copying and distribution of this file, with or without modification,
2108 are permitted in any medium without royalty provided the copyright
2109 notice and this notice are preserved.