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