1 2018-01-10 Michael Meissner <meissner@linux.vnet.ibm.com>
3 * config/rs6000/rs6000.c (is_complex_IBM_long_double): Explicitly
4 check for 128-bit long double before checking TCmode.
5 * config/rs6000/rs6000.h (FLOAT128_IEEE_P): Explicitly check for
6 128-bit long doubles before checking TFmode or TCmode.
7 (FLOAT128_IBM_P): Likewise.
9 2018-01-10 Martin Sebor <msebor@redhat.com>
11 PR tree-optimization/83671
12 * builtins.c (c_strlen): Unconditionally return zero for the empty
14 Use -Warray-bounds for warnings.
15 * gimple-fold.c (get_range_strlen): Handle non-constant lengths
16 for non-constant array indices with COMPONENT_REF, arrays of
17 arrays, and pointers to arrays.
18 (gimple_fold_builtin_strlen): Determine and set length range for
19 non-constant character arrays.
21 2018-01-10 Aldy Hernandez <aldyh@redhat.com>
24 * tree-ssa-uninit.c (convert_control_dep_chain_into_preds): Skip
27 2018-01-10 Eric Botcazou <ebotcazou@adacore.com>
29 * dwarf2out.c (dwarf2out_var_location): Do not pass NULL to fprintf.
31 2018-01-10 Peter Bergner <bergner@vnet.ibm.com>
34 * config/rs6000/rs6000.c (print_operand) <'y'>: Use
35 VECTOR_MEM_ALTIVEC_OR_VSX_P.
36 * config/rs6000/vsx.md (*vsx_le_perm_load_<mode> for VSX_D): Use
37 indexed_or_indirect_operand predicate.
38 (*vsx_le_perm_load_<mode> for VSX_W): Likewise.
39 (*vsx_le_perm_load_v8hi): Likewise.
40 (*vsx_le_perm_load_v16qi): Likewise.
41 (*vsx_le_perm_store_<mode> for VSX_D): Likewise.
42 (*vsx_le_perm_store_<mode> for VSX_W): Likewise.
43 (*vsx_le_perm_store_v8hi): Likewise.
44 (*vsx_le_perm_store_v16qi): Likewise.
45 (eight unnamed splitters): Likewise.
47 2018-01-10 Peter Bergner <bergner@vnet.ibm.com>
49 * config/rs6000/x86intrin.h: Change #warning to #error. Update message.
50 * config/rs6000/emmintrin.h: Likewise.
51 * config/rs6000/mmintrin.h: Likewise.
52 * config/rs6000/xmmintrin.h: Likewise.
54 2018-01-10 David Malcolm <dmalcolm@redhat.com>
57 * tree-core.h: Document EXPR_LOCATION_WRAPPER_P's usage of
59 * tree.c (tree_nop_conversion): Return true for location wrapper
61 (maybe_wrap_with_location): New function.
62 (selftest::check_strip_nops): New function.
63 (selftest::test_location_wrappers): New function.
64 (selftest::tree_c_tests): Call it.
65 * tree.h (STRIP_ANY_LOCATION_WRAPPER): New macro.
66 (maybe_wrap_with_location): New decl.
67 (EXPR_LOCATION_WRAPPER_P): New macro.
68 (location_wrapper_p): New inline function.
69 (tree_strip_any_location_wrapper): New inline function.
71 2018-01-10 H.J. Lu <hongjiu.lu@intel.com>
74 * config/i386/i386.c (ix86_compute_frame_layout): Always adjust
75 stack_realign_offset for the largest alignment of stack slot
77 (ix86_find_max_used_stack_alignment): New function.
78 (ix86_finalize_stack_frame_flags): Use it. Set
79 max_used_stack_alignment if we don't realign stack.
80 * config/i386/i386.h (machine_function): Add
81 max_used_stack_alignment.
83 2018-01-10 Christophe Lyon <christophe.lyon@linaro.org>
85 * config/arm/arm.opt (-mbranch-cost): New option.
86 * config/arm/arm.h (BRANCH_COST): Take arm_branch_cost into
89 2018-01-10 Segher Boessenkool <segher@kernel.crashing.org>
92 * config/rs6000/rs6000.md (load_toc_v4_PIC_2, load_toc_v4_PIC_3b,
93 load_toc_v4_PIC_3c): Wrap const term in CONST RTL.
95 2018-01-10 Richard Biener <rguenther@suse.de>
98 * dwarf2out.c (gen_subprogram_die): Hoist old_die && declaration
99 early out so it also covers the case where we have a non-NULL
102 2018-01-10 Richard Sandiford <richard.sandiford@linaro.org>
104 PR tree-optimization/83753
105 * tree-vect-stmts.c (get_group_load_store_type): Use VMAT_CONTIGUOUS
106 for non-strided grouped accesses if the number of elements is 1.
108 2018-01-10 Jan Hubicka <hubicka@ucw.cz>
111 * i386.c (ix86_vectorize_builtin_gather): Check TARGET_USE_GATHER.
112 * i386.h (TARGET_USE_GATHER): Define.
113 * x86-tune.def (X86_TUNE_USE_GATHER): New.
115 2018-01-10 Martin Liska <mliska@suse.cz>
118 * basic-block.h (CLEANUP_NO_PARTITIONING): New define.
119 * bb-reorder.c (pass_reorder_blocks::execute): Do not clean up
121 * cfgcleanup.c (try_optimize_cfg): Fix up partitioning if
122 CLEANUP_NO_PARTITIONING is not set.
124 2018-01-10 Richard Sandiford <richard.sandiford@linaro.org>
126 * doc/rtl.texi: Remove documentation of (const ...) wrappers
127 for vectors, as a partial revert of r254296.
128 * rtl.h (const_vec_p): Delete.
129 (const_vec_duplicate_p): Don't test for vector CONSTs.
130 (unwrap_const_vec_duplicate, const_vec_series_p): Likewise.
131 * expmed.c (make_tree): Likewise.
134 * common.md (E, F): Use CONSTANT_P instead of checking for
136 * emit-rtl.c (gen_lowpart_common): Use const_vec_p instead of
137 checking for CONST_VECTOR.
139 2018-01-09 Jan Hubicka <hubicka@ucw.cz>
142 * predict.c (force_edge_cold): Handle in more sane way edges
145 2018-01-09 Carl Love <cel@us.ibm.com>
147 * config/rs6002/altivec.md (p8_vmrgow): Add support for V2DI, V2DF,
149 (p8_vmrgew): Add support for V2DI, V2DF, V4SF types.
150 * config/rs6000/rs6000-builtin.def: Add definitions for FLOAT2_V2DF,
151 VMRGEW_V2DI, VMRGEW_V2DF, VMRGEW_V4SF, VMRGOW_V4SI, VMRGOW_V4SF,
152 VMRGOW_V2DI, VMRGOW_V2DF. Remove definition for VMRGOW.
153 * config/rs6000/rs6000-c.c (VSX_BUILTIN_VEC_FLOAT2,
154 P8V_BUILTIN_VEC_VMRGEW, P8V_BUILTIN_VEC_VMRGOW): Add definitions.
155 * config/rs6000/rs6000-protos.h: Add extern defition for
156 rs6000_generate_float2_double_code.
157 * config/rs6000/rs6000.c (rs6000_generate_float2_double_code): Add
159 * config/rs6000/vsx.md (vsx_xvcdpsp): Add define_insn.
160 (float2_v2df): Add define_expand.
162 2018-01-09 Uros Bizjak <ubizjak@gmail.com>
165 * combine.c (force_int_to_mode) <case ASHIFT>: Use mode instead of
166 op_mode in the force_to_mode call.
168 2018-01-09 Richard Sandiford <richard.sandiford@linaro.org>
170 * config/aarch64/aarch64.c (aarch64_evpc_trn): Use d.perm.series_p
171 instead of checking each element individually.
172 (aarch64_evpc_uzp): Likewise.
173 (aarch64_evpc_zip): Likewise.
174 (aarch64_evpc_ext): Likewise.
175 (aarch64_evpc_rev): Likewise.
176 (aarch64_evpc_dup): Test the encoding for a single duplicated element,
177 instead of checking each element individually. Return true without
179 (aarch64_vectorize_vec_perm_const): Use all_from_input_p to test
180 whether all selected elements come from the same input, instead of
181 checking each element individually. Remove calls to gen_rtx_REG,
182 start_sequence and end_sequence and instead assert that no rtl is
185 2018-01-09 Richard Sandiford <richard.sandiford@linaro.org>
187 * config/aarch64/aarch64.c (aarch64_legitimate_constant_p): Fix
188 order of HIGH and CONST checks.
190 2018-01-09 Richard Sandiford <richard.sandiford@linaro.org>
192 * tree-vect-stmts.c (permute_vec_elements): Create a fresh variable
193 if the destination isn't an SSA_NAME.
195 2018-01-09 Richard Biener <rguenther@suse.de>
197 PR tree-optimization/83668
198 * graphite.c (canonicalize_loop_closed_ssa): Add edge argument,
200 (canonicalize_loop_form): ... here, renamed from ...
201 (canonicalize_loop_closed_ssa_form): ... this and amended to
202 swap successor edges for loop exit blocks to make us use
203 the RPO order we need for initial schedule generation.
205 2018-01-09 Joseph Myers <joseph@codesourcery.com>
207 PR tree-optimization/64811
208 * match.pd: When optimizing comparisons with Inf, avoid
209 introducing or losing exceptions from comparisons with NaN.
211 2018-01-09 Martin Liska <mliska@suse.cz>
214 * asan.c (shadow_mem_size): Add gcc_assert.
216 2018-01-09 Georg-Johann Lay <avr@gjlay.de>
218 Don't save registers in main().
221 * doc/invoke.texi (AVR Options) [-mmain-is-OS_task]: Document it.
222 * config/avr/avr.opt (-mmain-is-OS_task): New target option.
223 * config/avr/avr.c (avr_set_current_function): Don't error if
224 naked, OS_task or OS_main are specified at the same time.
225 (avr_function_ok_for_sibcall): Don't disable sibcalls for OS_task,
227 (avr_insert_attributes) [-mmain-is-OS_task] <main>: Add OS_task
229 * common/config/avr/avr-common.c (avr_option_optimization_table):
230 Switch on -mmain-is-OS_task for optimizing compilations.
232 2018-01-09 Richard Biener <rguenther@suse.de>
234 PR tree-optimization/83572
235 * graphite.c: Include cfganal.h.
236 (graphite_transform_loops): Connect infinite loops to exit
237 and remove fake edges at the end.
239 2018-01-09 Jan Hubicka <hubicka@ucw.cz>
241 * ipa-inline.c (edge_badness): Revert accidental checkin.
243 2018-01-09 Jan Hubicka <hubicka@ucw.cz>
246 * ipa-comdats.c (set_comdat_group): Only set comdat group of real
247 symbols; not inline clones.
249 2018-01-09 Jakub Jelinek <jakub@redhat.com>
252 * modulo-sched.c (schedule_reg_moves): Punt if we'd need to move
253 hard registers. Formatting fixes.
255 PR preprocessor/83722
256 * gcc.c (try_generate_repro): Pass
257 &temp_stderr_files[RETRY_ICE_ATTEMPTS - 1] rather than
258 &temp_stdout_files[RETRY_ICE_ATTEMPTS - 1] as last argument to
261 2018-01-08 Monk Chiang <sh.chiang04@gmail.com>
262 Kito Cheng <kito.cheng@gmail.com>
264 * config/riscv/riscv.c (machine_function::is_leaf): Remove field.
265 (riscv_leaf_function_p): Delete.
266 (riscv_function_ok_for_sibcall): Return false when TARGET_SAVE_RESTORE.
268 2018-01-08 Aaron Sawdey <acsawdey@linux.vnet.ibm.com>
270 * config/rs6000/rs6000-string.c (do_load_for_compare_from_addr): New
272 (do_ifelse): New function.
273 (do_isel): New function.
274 (do_sub3): New function.
275 (do_add3): New function.
276 (do_load_mask_compare): New function.
277 (do_overlap_load_compare): New function.
278 (expand_compare_loop): New function.
279 (expand_block_compare): Call expand_compare_loop() when appropriate.
280 * config/rs6000/rs6000.opt (-mblock-compare-inline-limit): Change
282 (-mblock-compare-inline-loop-limit): New option.
284 2018-01-08 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
287 * config/rs6000/altivec.md (*altivec_vpermr_<mode>_internal):
288 Reverse order of second and third operands in first alternative.
289 * config/rs6000/rs6000.c (rs6000_expand_vector_set): Reverse order
290 of first and second elements in UNSPEC_VPERMR vector.
291 (altivec_expand_vec_perm_le): Likewise.
293 2017-01-08 Jeff Law <law@redhat.com>
295 PR rtl-optimizatin/81308
296 * tree-switch-conversion.c (cfg_altered): New file scoped static.
297 (process_switch): If group_case_labels makes a change, then set
299 (pass_convert_switch::execute): If a switch is converted, then
300 set cfg_altered. Return TODO_cfg_cleanup if cfg_altered is true.
302 PR rtl-optimization/81308
303 * recog.c (split_all_insns): Conditionally cleanup the CFG after
306 2018-01-08 Vidya Praveen <vidyapraveen@arm.com>
308 PR target/83663 - Revert r255946
309 * config/aarch64/aarch64.c (aarch64_expand_vector_init): Modify code
310 generation for cases where splatting a value is not useful.
311 * simplify-rtx.c (simplify_ternary_operation): Simplify vec_merge
312 across a vec_duplicate and a paradoxical subreg forming a vector
313 mode to a vec_concat.
315 2018-01-08 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
317 * config/arm/t-aprofile (MULTILIB_MATCHES): Add mapping rules for
318 -march=armv8.3-a variants.
319 * config/arm/t-multilib: Likewise.
320 * config/arm/t-arm-elf: Likewise. Handle dotprod extension.
322 2018-01-08 Aaron Sawdey <acsawdey@linux.vnet.ibm.com>
324 * config/rs6000/rs6000.md (cceq_ior_compare): Remove * so I can use it
326 (cceq_ior_compare_complement): Give it a name so I can use it, and
327 change boolean_or_operator predicate to boolean_operator so it can
328 be used to generate a crand.
329 (eqne): New code iterator.
330 (bd/bd_neg): New code_attrs.
331 (<bd>_<mode>): New name for ctr<mode>_internal[12] now combined into
332 a single define_insn.
333 (<bd>tf_<mode>): A new insn pattern for the conditional form branch
334 decrement (bdnzt/bdnzf/bdzt/bdzf).
335 * config/rs6000/rs6000.c (rs6000_legitimate_combined_insn): Updated
336 with the new names of the branch decrement patterns, and added the
337 names of the branch decrement conditional patterns.
339 2018-01-08 Richard Biener <rguenther@suse.de>
341 PR tree-optimization/83563
342 * graphite.c (canonicalize_loop_closed_ssa_form): Reset the SCEV
345 2018-01-08 Richard Biener <rguenther@suse.de>
348 * convert.c (do_narrow): Properly guard TYPE_OVERFLOW_WRAPS checks.
350 2018-01-08 Richard Biener <rguenther@suse.de>
352 PR tree-optimization/83685
353 * tree-ssa-pre.c (create_expression_by_pieces): Do not insert
354 references to abnormals.
356 2018-01-08 Richard Biener <rguenther@suse.de>
359 * dwarf2out.c (output_indirect_strings): Handle empty
360 skeleton_debug_str_hash.
361 (dwarf2out_early_finish): Index strings for -gsplit-dwarf.
363 2018-01-08 Claudiu Zissulescu <claziss@synopsys.com>
365 * config/arc/arc.c (TARGET_TRAMPOLINE_ADJUST_ADDRESS): Delete.
366 (emit_store_direct): Likewise.
367 (arc_trampoline_adjust_address): Likewise.
368 (arc_asm_trampoline_template): New function.
369 (arc_initialize_trampoline): Use asm_trampoline_template.
370 (TARGET_ASM_TRAMPOLINE_TEMPLATE): Define.
371 * config/arc/arc.h (TRAMPOLINE_SIZE): Adjust to 16.
372 * config/arc/arc.md (flush_icache): Delete pattern.
374 2018-01-08 Claudiu Zissulescu <claziss@synopsys.com>
376 * config/arc/arc-c.def (__ARC_UNALIGNED__): New define.
377 * config/arc/arc.h (STRICT_ALIGNMENT): Control this macro using
380 2018-01-08 Sebastian Huber <sebastian.huber@embedded-brains.de>
383 * config/epiphany/epiphany.h (make_pass_mode_switch_use): Guard
384 by not USED_FOR_TARGET.
385 (make_pass_resolve_sw_modes): Likewise.
387 2018-01-08 Sebastian Huber <sebastian.huber@embedded-brains.de>
389 * config/nios2/nios2.h (nios2_section_threshold): Guard by not
392 2018-01-08 Richard Biener <rguenther@suse.de>
395 * tree-data-ref.c (split_constant_offset): Remove STRIP_NOPS.
397 2018-01-08 Richard Biener <rguenther@suse.de>
400 * match.pd ((t * 2) / 2) -> t): Add missing :c.
402 2018-01-06 Aldy Hernandez <aldyh@redhat.com>
405 * tree-ssa-uninit.c (compute_control_dep_chain): Do not bail on
406 basic blocks with a small number of successors.
407 (convert_control_dep_chain_into_preds): Improve handling of
409 (dump_predicates): Split apart into...
410 (dump_pred_chain): ...here...
411 (dump_pred_info): ...and here.
412 (can_one_predicate_be_invalidated_p): Add debugging printfs.
413 (can_chain_union_be_invalidated_p): Improve check for invalidation
415 (uninit_uses_cannot_happen): Avoid unnecessary if
416 convert_control_dep_chain_into_preds yielded nothing.
418 2018-01-06 Martin Sebor <msebor@redhat.com>
420 PR tree-optimization/83640
421 * gimple-ssa-warn-restrict.c (builtin_access::builtin_access): Avoid
422 subtracting negative offset from size.
423 (builtin_access::overlap): Adjust offset bounds of the access to fall
424 within the size of the object if possible.
426 2018-01-06 Richard Sandiford <richard.sandiford@linaro.org>
428 PR rtl-optimization/83699
429 * expmed.c (extract_bit_field_1): Restrict the vector usage of
430 extract_bit_field_as_subreg to cases in which the extracted
431 value is also a vector.
433 * lra-constraints.c (process_alt_operands): Test for the equivalence
434 substitutions when detecting a possible reload cycle.
436 2018-01-06 Jakub Jelinek <jakub@redhat.com>
439 * toplev.c (process_options): Don't enable debug_nonbind_markers_p
440 by default if flag_selective_schedling{,2}. Formatting fixes.
442 PR rtl-optimization/83682
443 * rtl.h (const_vec_duplicate_p): Only return true for VEC_DUPLICATE
444 if it has non-VECTOR_MODE element mode.
445 (vec_duplicate_p): Likewise.
448 * cfgexpand.c (expand_debug_expr): Punt if mode1 is VOIDmode
449 and bitsize might be greater than MAX_BITSIZE_MODE_ANY_INT.
451 2018-01-05 Jakub Jelinek <jakub@redhat.com>
454 * config/i386/i386-builtin.def
455 (__builtin_ia32_vgf2p8affineinvqb_v64qi,
456 __builtin_ia32_vgf2p8affineqb_v64qi, __builtin_ia32_vgf2p8mulb_v64qi):
457 Require also OPTION_MASK_ISA_AVX512F in addition to
458 OPTION_MASK_ISA_GFNI.
459 (__builtin_ia32_vgf2p8affineinvqb_v16qi_mask,
460 __builtin_ia32_vgf2p8affineqb_v16qi_mask): Require
461 OPTION_MASK_ISA_AVX512VL instead of OPTION_MASK_ISA_SSE in addition
462 to OPTION_MASK_ISA_GFNI.
463 (__builtin_ia32_vgf2p8mulb_v32qi_mask): Require
464 OPTION_MASK_ISA_AVX512VL in addition to OPTION_MASK_ISA_GFNI and
465 OPTION_MASK_ISA_AVX512BW.
466 (__builtin_ia32_vgf2p8mulb_v16qi_mask): Require
467 OPTION_MASK_ISA_AVX512VL instead of OPTION_MASK_ISA_AVX512BW in
468 addition to OPTION_MASK_ISA_GFNI.
469 (__builtin_ia32_vgf2p8affineinvqb_v16qi,
470 __builtin_ia32_vgf2p8affineqb_v16qi, __builtin_ia32_vgf2p8mulb_v16qi):
471 Require OPTION_MASK_ISA_SSE2 instead of OPTION_MASK_ISA_SSE in addition
472 to OPTION_MASK_ISA_GFNI.
473 * config/i386/i386.c (def_builtin): Change to builtin isa/isa2 being
474 a requirement for all ISAs rather than any of them with a few
476 (ix86_add_new_builtins): Clear OPTION_MASK_ISA_64BIT from isa before
478 (ix86_expand_builtin): Require all ISAs from builtin's isa and isa2
479 bitmasks to be enabled with 3 exceptions, instead of requiring any
480 enabled ISA with lots of exceptions.
481 * config/i386/sse.md (vgf2p8affineinvqb_<mode><mask_name>,
482 vgf2p8affineqb_<mode><mask_name>, vgf2p8mulb_<mode><mask_name>):
483 Change avx512bw in isa attribute to avx512f.
484 * config/i386/sgxintrin.h: Add license boilerplate.
485 * config/i386/vaesintrin.h: Likewise. Fix macro spelling __AVX512F
486 to __AVX512F__ and __AVX512VL to __AVX512VL__.
487 (_mm256_aesdec_epi128, _mm256_aesdeclast_epi128, _mm256_aesenc_epi128,
488 _mm256_aesenclast_epi128): Enable temporarily avx if __AVX__ is not
490 * config/i386/gfniintrin.h (_mm_gf2p8mul_epi8,
491 _mm_gf2p8affineinv_epi64_epi8, _mm_gf2p8affine_epi64_epi8): Enable
492 temporarily sse2 rather than sse if not enabled already.
495 * config/i386/sse.md (VI248_VLBW): Rename to ...
496 (VI248_AVX512VL): ... this. Don't guard V32HI with TARGET_AVX512BW.
497 (vpshrd_<mode><mask_name>, vpshld_<mode><mask_name>,
498 vpshrdv_<mode>, vpshrdv_<mode>_mask, vpshrdv_<mode>_maskz,
499 vpshrdv_<mode>_maskz_1, vpshldv_<mode>, vpshldv_<mode>_mask,
500 vpshldv_<mode>_maskz, vpshldv_<mode>_maskz_1): Use VI248_AVX512VL
501 mode iterator instead of VI248_VLBW.
503 2018-01-05 Jan Hubicka <hubicka@ucw.cz>
505 * ipa-fnsummary.c (record_modified_bb_info): Add OP.
506 (record_modified): Skip clobbers; add debug output.
507 (param_change_prob): Use sreal frequencies.
509 2018-01-05 Richard Sandiford <richard.sandiford@linaro.org>
511 * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Don't
512 punt for user-aligned variables.
514 2018-01-05 Richard Sandiford <richard.sandiford@linaro.org>
516 * tree-chrec.c (chrec_contains_symbols): Return true for
519 2018-01-05 Sudakshina Das <sudi.das@arm.com>
522 * simplify-rtx.c (simplify_relational_operation_1): Add simplifications
523 of (x|y) == x for BICS pattern.
525 2018-01-05 Jakub Jelinek <jakub@redhat.com>
527 PR tree-optimization/83605
528 * gimple-ssa-strength-reduction.c: Include tree-eh.h.
529 (find_candidates_dom_walker::before_dom_children): Ignore stmts that
532 2018-01-05 Sebastian Huber <sebastian.huber@embedded-brains.de>
534 * config.gcc (epiphany-*-elf*): Add (epiphany-*-rtems*) configuration.
535 * config/epiphany/rtems.h: New file.
537 2018-01-04 Jakub Jelinek <jakub@redhat.com>
538 Uros Bizjak <ubizjak@gmail.com>
541 * config/i386/i386.md (*<rotate_insn>hi3_1 splitter): Use
542 QIreg_operand instead of register_operand predicate.
543 * config/i386/i386.c (ix86_rop_should_change_byte_p,
544 set_rop_modrm_reg_bits, ix86_mitigate_rop): Use -mmitigate-rop in
545 comments instead of -fmitigate[-_]rop.
547 2018-01-04 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
550 * cgraphunit.c (symbol_table::compile): Switch to text_section
551 before calling assembly_start debug hook.
552 * run-rtl-passes.c (run_rtl_passes): Likewise.
555 2018-01-04 Richard Sandiford <richard.sandiford@linaro.org>
557 * tree-vrp.c (extract_range_from_binary_expr_1): Check
558 range_int_cst_p rather than !symbolic_range_p before calling
559 extract_range_from_multiplicative_op_1.
561 2017-01-04 Jeff Law <law@redhat.com>
563 * tree-ssa-math-opts.c (execute_cse_reciprocals_1): Remove
564 redundant test in assertion.
566 2018-01-04 Richard Sandiford <richard.sandiford@linaro.org>
568 * doc/rtl.texi: Document machine_mode wrapper classes.
570 2018-01-04 Richard Sandiford <richard.sandiford@linaro.org>
572 * fold-const.c (fold_ternary_loc): Check tree_fits_uhwi_p before
575 2018-01-04 Richard Sandiford <richard.sandiford@linaro.org>
577 * tree-ssa-forwprop.c (is_combined_permutation_identity): Allow
578 the VEC_PERM_EXPR fold to fail.
580 2018-01-04 Jakub Jelinek <jakub@redhat.com>
583 * bb-reorder.c (insert_section_boundary_note): Set has_bb_partition
584 to switched_sections.
586 2018-01-04 Richard Sandiford <richard.sandiford@linaro.org>
589 * config/arm/arm.c (arm_vectorize_vec_perm_const): Fix inverted
592 2018-01-04 Peter Bergner <bergner@vnet.ibm.com>
595 * config/rs6000/rs6000.c (rs6000_discover_homogeneous_aggregate): Do not
596 allow arguments in FP registers if TARGET_HARD_FLOAT is false.
598 2018-01-04 Jakub Jelinek <jakub@redhat.com>
601 * cfgexpand.c (expand_dbeug_expr) <case BIT_FIELD_REF>: Punt if mode
602 is BLKmode and bitpos not zero or mode change is needed.
604 2018-01-04 Richard Sandiford <richard.sandiford@linaro.org>
607 * config/sparc/sparc.c (sparc_vectorize_vec_perm_const): Require
610 2018-01-04 Uros Bizjak <ubizjak@gmail.com>
613 * config/alpha/alpha.md (*sadd<modesuffix>): Use ASHIFT
614 instead of MULT rtx. Update all corresponding splitters.
616 (*ssub<modesuffix>): Ditto.
618 (*cmp_sadd_di): Update split patterns.
619 (*cmp_sadd_si): Ditto.
620 (*cmp_sadd_sidi): Ditto.
621 (*cmp_ssub_di): Ditto.
622 (*cmp_ssub_si): Ditto.
623 (*cmp_ssub_sidi): Ditto.
624 * config/alpha/predicates.md (const23_operand): New predicate.
625 * config/alpha/alpha.c (alpha_rtx_costs) [PLUS, MINUS]:
626 Look for ASHIFT, not MULT inner operand.
627 (alpha_split_conditional_move): Update for *sadd<modesuffix> change.
629 2018-01-04 Martin Liska <mliska@suse.cz>
631 PR gcov-profile/83669
632 * gcov.c (output_intermediate_file): Add version to intermediate
634 * doc/gcov.texi: Document new field 'version' in intermediate
635 file format. Fix location of '-k' option of gcov command.
637 2018-01-04 Martin Liska <mliska@suse.cz>
640 * ipa-icf.c (sem_function::merge): Do not cross comdat boundary.
642 2018-01-04 Jakub Jelinek <jakub@redhat.com>
644 * gimple-ssa-sprintf.c (parse_directive): Cast second dir.len to uhwi.
646 2018-01-03 Martin Sebor <msebor@redhat.com>
648 PR tree-optimization/83655
649 * gimple-ssa-warn-restrict.c (wrestrict_dom_walker::check_call): Avoid
650 checking calls with invalid arguments.
652 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
654 * tree-vect-stmts.c (vect_get_store_rhs): New function.
655 (vectorizable_mask_load_store): Delete.
656 (vectorizable_call): Return false for masked loads and stores.
657 (vectorizable_store): Handle IFN_MASK_STORE. Use vect_get_store_rhs
658 instead of gimple_assign_rhs1.
659 (vectorizable_load): Handle IFN_MASK_LOAD.
660 (vect_transform_stmt): Don't set is_store for call_vec_info_type.
662 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
664 * tree-vect-stmts.c (vect_build_gather_load_calls): New function,
666 (vectorizable_mask_load_store): ...here.
667 (vectorizable_load): ...and here.
669 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
671 * tree-vect-stmts.c (vect_build_all_ones_mask)
672 (vect_build_zero_merge_argument): New functions, split out from...
673 (vectorizable_load): ...here.
675 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
677 * tree-vect-stmts.c (vect_check_store_rhs): New function,
679 (vectorizable_mask_load_store): ...here.
680 (vectorizable_store): ...and here.
682 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
684 * tree-vect-stmts.c (vect_check_load_store_mask): New function,
686 (vectorizable_mask_load_store): ...here.
688 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
690 * tree-vectorizer.h (vec_load_store_type): Moved from tree-vec-stmts.c
691 (vect_model_store_cost): Take a vec_load_store_type instead of a
693 * tree-vect-stmts.c (vec_load_store_type): Move to tree-vectorizer.h.
694 (vect_model_store_cost): Take a vec_load_store_type instead of a
696 (vectorizable_mask_load_store): Update accordingly.
697 (vectorizable_store): Likewise.
698 * tree-vect-slp.c (vect_analyze_slp_cost_1): Update accordingly.
700 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
702 * tree-vect-loop.c (vect_transform_loop): Stub out scalar
703 IFN_MASK_LOAD calls here rather than...
704 * tree-vect-stmts.c (vectorizable_mask_load_store): ...here.
706 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
707 Alan Hayward <alan.hayward@arm.com>
708 David Sherwood <david.sherwood@arm.com>
710 * expmed.c (extract_bit_field_1): For vector extracts,
711 fall back to extract_bit_field_as_subreg if vec_extract
714 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
715 Alan Hayward <alan.hayward@arm.com>
716 David Sherwood <david.sherwood@arm.com>
718 * lra-spills.c (pseudo_reg_slot_compare): Sort slots by whether
719 they are variable or constant sized.
720 (assign_stack_slot_num_and_sort_pseudos): Don't reuse variable-sized
721 slots for constant-sized data.
723 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
724 Alan Hayward <alan.hayward@arm.com>
725 David Sherwood <david.sherwood@arm.com>
727 * tree-vect-patterns.c (vect_recog_mask_conversion_pattern): When
728 handling COND_EXPRs with boolean comparisons, try to find a better
729 basis for the mask type than the boolean itself.
731 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
733 * doc/rtl.texi (MAX_BITSIZE_MODE_ANY_MODE): Describe how the default
734 is calculated and how it can be overridden.
735 * genmodes.c (max_bitsize_mode_any_mode): New variable.
736 (create_modes): Initialize it from MAX_BITSIZE_MODE_ANY_MODE,
738 (emit_max_int): Use it to set the output MAX_BITSIZE_MODE_ANY_MODE,
741 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
742 Alan Hayward <alan.hayward@arm.com>
743 David Sherwood <david.sherwood@arm.com>
745 * config/aarch64/aarch64-protos.h (aarch64_output_simd_mov_immediate):
746 Remove the mode argument.
747 (aarch64_simd_valid_immediate): Remove the mode and inverse
749 * config/aarch64/iterators.md (bitsize): New iterator.
750 * config/aarch64/aarch64-simd.md (*aarch64_simd_mov<mode>, and<mode>3)
751 (ior<mode>3): Update calls to aarch64_output_simd_mov_immediate.
752 * config/aarch64/constraints.md (Do, Db, Dn): Update calls to
753 aarch64_simd_valid_immediate.
754 * config/aarch64/predicates.md (aarch64_reg_or_orr_imm): Likewise.
755 (aarch64_reg_or_bic_imm): Likewise.
756 * config/aarch64/aarch64.c (simd_immediate_info): Replace mvn
757 with an insn_type enum and msl with a modifier_type enum.
758 Replace element_width with a scalar_mode. Change the shift
759 to unsigned int. Add constructors for scalar_float_mode and
760 scalar_int_mode elements.
761 (aarch64_vect_float_const_representable_p): Delete.
762 (aarch64_can_const_movi_rtx_p)
763 (aarch64_simd_scalar_immediate_valid_for_move)
764 (aarch64_simd_make_constant): Update call to
765 aarch64_simd_valid_immediate.
766 (aarch64_advsimd_valid_immediate_hs): New function.
767 (aarch64_advsimd_valid_immediate): Likewise.
768 (aarch64_simd_valid_immediate): Remove mode and inverse
769 arguments. Rewrite to use the above. Use const_vec_duplicate_p
770 to detect duplicated constants and use aarch64_float_const_zero_rtx_p
771 and aarch64_float_const_representable_p on the result.
772 (aarch64_output_simd_mov_immediate): Remove mode argument.
773 Update call to aarch64_simd_valid_immediate and use of
775 (aarch64_output_scalar_simd_mov_immediate): Update call
778 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
779 Alan Hayward <alan.hayward@arm.com>
780 David Sherwood <david.sherwood@arm.com>
782 * machmode.h (mode_precision): Prefix with CONST_MODE_PRECISION.
783 (mode_nunits): Likewise CONST_MODE_NUNITS.
784 * machmode.def (ADJUST_NUNITS): Document.
785 * genmodes.c (mode_data::need_nunits_adj): New field.
786 (blank_mode): Update accordingly.
787 (adj_nunits): New variable.
788 (print_maybe_const_decl): Replace CATEGORY with a NEEDS_ADJ
790 (emit_mode_size_inline): Set need_bytesize_adj for all modes
791 listed in adj_nunits.
792 (emit_mode_nunits_inline): Set need_nunits_adj for all modes
793 listed in adj_nunits. Don't emit case statements for such modes.
794 (emit_insn_modes_h): Emit definitions of CONST_MODE_NUNITS
795 and CONST_MODE_PRECISION. Make CONST_MODE_SIZE expand to
796 nothing if adj_nunits is nonnull.
797 (emit_mode_precision, emit_mode_nunits): Use print_maybe_const_decl.
798 (emit_mode_unit_size, emit_mode_base_align, emit_mode_ibit)
799 (emit_mode_fbit): Update use of print_maybe_const_decl.
800 (emit_move_size): Likewise. Treat the array as non-const
802 (emit_mode_adjustments): Handle adj_nunits.
804 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
806 * machmode.def (VECTOR_MODES_WITH_PREFIX): Document.
807 * genmodes.c (VECTOR_MODES_WITH_PREFIX): New macro.
808 (VECTOR_MODES): Use it.
809 (make_vector_modes): Take the prefix as an argument.
811 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
812 Alan Hayward <alan.hayward@arm.com>
813 David Sherwood <david.sherwood@arm.com>
815 * mode-classes.def (MODE_VECTOR_BOOL): New mode class.
816 * machmode.h (INTEGRAL_MODE_P, VECTOR_MODE_P): Return true
817 for MODE_VECTOR_BOOL.
818 * machmode.def (VECTOR_BOOL_MODE): Document.
819 * genmodes.c (VECTOR_BOOL_MODE): New macro.
820 (make_vector_bool_mode): New function.
821 (complete_mode, emit_mode_wider, emit_mode_adjustments): Handle
823 * lto-streamer-in.c (lto_input_mode_table): Likewise.
824 * rtx-vector-builder.c (rtx_vector_builder::find_cached_value):
826 * stor-layout.c (int_mode_for_mode): Likewise.
827 * tree.c (build_vector_type_for_mode): Likewise.
828 * varasm.c (output_constant_pool_2): Likewise.
829 * emit-rtl.c (init_emit_once): Make sure that CONST1_RTX (BImode) and
830 CONSTM1_RTX (BImode) are the same thing. Initialize const_tiny_rtx
831 for MODE_VECTOR_BOOL.
832 * expr.c (expand_expr_real_1): Use VECTOR_MODE_P instead of a list
833 of mode class checks.
834 * tree-vect-generic.c (expand_vector_operation): Use VECTOR_MODE_P
835 instead of a list of mode class checks.
836 (expand_vector_scalar_condition): Likewise.
837 (type_for_widest_vector_mode): Handle BImode as an inner mode.
839 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
840 Alan Hayward <alan.hayward@arm.com>
841 David Sherwood <david.sherwood@arm.com>
843 * machmode.h (mode_size): Change from unsigned short to
845 (mode_to_bytes): Return a poly_uint16 rather than an unsigned short.
846 (GET_MODE_SIZE): Return a constant if ONLY_FIXED_SIZE_MODES,
847 or if measurement_type is not polynomial.
848 (fixed_size_mode::includes_p): Check for constant-sized modes.
849 * genmodes.c (emit_mode_size_inline): Make mode_size_inline
850 return a poly_uint16 rather than an unsigned short.
851 (emit_mode_size): Change the type of mode_size from unsigned short
852 to poly_uint16_pod. Use ZERO_COEFFS for the initializer.
853 (emit_mode_adjustments): Cope with polynomial vector sizes.
854 * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
856 * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
858 * auto-inc-dec.c (try_merge): Treat GET_MODE_SIZE as polynomial.
859 * builtins.c (expand_ifn_atomic_compare_exchange_into_call): Likewise.
860 * caller-save.c (setup_save_areas): Likewise.
861 (replace_reg_with_saved_mem): Likewise.
862 * calls.c (emit_library_call_value_1): Likewise.
863 * combine-stack-adj.c (combine_stack_adjustments_for_block): Likewise.
864 * combine.c (simplify_set, make_extraction, simplify_shift_const_1)
865 (gen_lowpart_for_combine): Likewise.
866 * convert.c (convert_to_integer_1): Likewise.
867 * cse.c (equiv_constant, cse_insn): Likewise.
868 * cselib.c (autoinc_split, cselib_hash_rtx): Likewise.
869 (cselib_subst_to_values): Likewise.
870 * dce.c (word_dce_process_block): Likewise.
871 * df-problems.c (df_word_lr_mark_ref): Likewise.
872 * dwarf2cfi.c (init_one_dwarf_reg_size): Likewise.
873 * dwarf2out.c (multiple_reg_loc_descriptor, mem_loc_descriptor)
874 (concat_loc_descriptor, concatn_loc_descriptor, loc_descriptor)
875 (rtl_for_decl_location): Likewise.
876 * emit-rtl.c (gen_highpart, widen_memory_access): Likewise.
877 * expmed.c (extract_bit_field_1, extract_integral_bit_field): Likewise.
878 * expr.c (emit_group_load_1, clear_storage_hints): Likewise.
879 (emit_move_complex, emit_move_multi_word, emit_push_insn): Likewise.
880 (expand_expr_real_1): Likewise.
881 * function.c (assign_parm_setup_block_p, assign_parm_setup_block)
882 (pad_below): Likewise.
883 * gimple-fold.c (optimize_atomic_compare_exchange_p): Likewise.
884 * gimple-ssa-store-merging.c (rhs_valid_for_store_merging_p): Likewise.
885 * ira.c (get_subreg_tracking_sizes): Likewise.
886 * ira-build.c (ira_create_allocno_objects): Likewise.
887 * ira-color.c (coalesced_pseudo_reg_slot_compare): Likewise.
888 (ira_sort_regnos_for_alter_reg): Likewise.
889 * ira-costs.c (record_operand_costs): Likewise.
890 * lower-subreg.c (interesting_mode_p, simplify_gen_subreg_concatn)
891 (resolve_simple_move): Likewise.
892 * lra-constraints.c (get_reload_reg, operands_match_p): Likewise.
893 (process_addr_reg, simplify_operand_subreg, curr_insn_transform)
894 (lra_constraints): Likewise.
895 (CONST_POOL_OK_P): Reject variable-sized modes.
896 * lra-spills.c (slot, assign_mem_slot, pseudo_reg_slot_compare)
897 (add_pseudo_to_slot, lra_spill): Likewise.
898 * omp-low.c (omp_clause_aligned_alignment): Likewise.
899 * optabs-query.c (get_best_extraction_insn): Likewise.
900 * optabs-tree.c (expand_vec_cond_expr_p): Likewise.
901 * optabs.c (expand_vec_perm_var, expand_vec_cond_expr): Likewise.
902 (expand_mult_highpart, valid_multiword_target_p): Likewise.
903 * recog.c (offsettable_address_addr_space_p): Likewise.
904 * regcprop.c (maybe_mode_change): Likewise.
905 * reginfo.c (choose_hard_reg_mode, record_subregs_of_mode): Likewise.
906 * regrename.c (build_def_use): Likewise.
907 * regstat.c (dump_reg_info): Likewise.
908 * reload.c (complex_word_subreg_p, push_reload, find_dummy_reload)
909 (find_reloads, find_reloads_subreg_address): Likewise.
910 * reload1.c (eliminate_regs_1): Likewise.
911 * rtlanal.c (for_each_inc_dec_find_inc_dec, rtx_cost): Likewise.
912 * simplify-rtx.c (avoid_constant_pool_reference): Likewise.
913 (simplify_binary_operation_1, simplify_subreg): Likewise.
914 * targhooks.c (default_function_arg_padding): Likewise.
915 (default_hard_regno_nregs, default_class_max_nregs): Likewise.
916 * tree-cfg.c (verify_gimple_assign_binary): Likewise.
917 (verify_gimple_assign_ternary): Likewise.
918 * tree-inline.c (estimate_move_cost): Likewise.
919 * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
920 * tree-ssa-loop-ivopts.c (add_autoinc_candidates): Likewise.
921 (get_address_cost_ainc): Likewise.
922 * tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Likewise.
923 (vect_supportable_dr_alignment): Likewise.
924 * tree-vect-loop.c (vect_determine_vectorization_factor): Likewise.
925 (vectorizable_reduction): Likewise.
926 * tree-vect-stmts.c (vectorizable_assignment, vectorizable_shift)
927 (vectorizable_operation, vectorizable_load): Likewise.
928 * tree.c (build_same_sized_truth_vector_type): Likewise.
929 * valtrack.c (cleanup_auto_inc_dec): Likewise.
930 * var-tracking.c (emit_note_insn_var_location): Likewise.
931 * config/arc/arc.h (ASM_OUTPUT_CASE_END): Use as_a <scalar_int_mode>.
932 (ADDR_VEC_ALIGN): Likewise.
934 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
935 Alan Hayward <alan.hayward@arm.com>
936 David Sherwood <david.sherwood@arm.com>
938 * machmode.h (mode_to_bits): Return a poly_uint16 rather than an
940 (GET_MODE_BITSIZE): Return a constant if ONLY_FIXED_SIZE_MODES,
941 or if measurement_type is polynomial.
942 * calls.c (shift_return_value): Treat GET_MODE_BITSIZE as polynomial.
943 * combine.c (make_extraction): Likewise.
944 * dse.c (find_shift_sequence): Likewise.
945 * dwarf2out.c (mem_loc_descriptor): Likewise.
946 * expmed.c (store_integral_bit_field, extract_bit_field_1): Likewise.
947 (extract_bit_field, extract_low_bits): Likewise.
948 * expr.c (convert_move, convert_modes, emit_move_insn_1): Likewise.
949 (optimize_bitfield_assignment_op, expand_assignment): Likewise.
950 (store_expr_with_bounds, store_field, expand_expr_real_1): Likewise.
951 * fold-const.c (optimize_bit_field_compare, merge_ranges): Likewise.
952 * gimple-fold.c (optimize_atomic_compare_exchange_p): Likewise.
953 * reload.c (find_reloads): Likewise.
954 * reload1.c (alter_reg): Likewise.
955 * stor-layout.c (bitwise_mode_for_mode, compute_record_mode): Likewise.
956 * targhooks.c (default_secondary_memory_needed_mode): Likewise.
957 * tree-if-conv.c (predicate_mem_writes): Likewise.
958 * tree-ssa-strlen.c (handle_builtin_memcmp): Likewise.
959 * tree-vect-patterns.c (adjust_bool_pattern): Likewise.
960 * tree-vect-stmts.c (vectorizable_simd_clone_call): Likewise.
961 * valtrack.c (dead_debug_insert_temp): Likewise.
962 * varasm.c (mergeable_constant_section): Likewise.
963 * config/sh/sh.h (LOCAL_ALIGNMENT): Use as_a <fixed_size_mode>.
965 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
966 Alan Hayward <alan.hayward@arm.com>
967 David Sherwood <david.sherwood@arm.com>
969 * expr.c (expand_assignment): Cope with polynomial mode sizes
970 when assigning to a CONCAT.
972 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
973 Alan Hayward <alan.hayward@arm.com>
974 David Sherwood <david.sherwood@arm.com>
976 * machmode.h (mode_precision): Change from unsigned short to
978 (mode_to_precision): Return a poly_uint16 rather than an unsigned
980 (GET_MODE_PRECISION): Return a constant if ONLY_FIXED_SIZE_MODES,
981 or if measurement_type is not polynomial.
982 (HWI_COMPUTABLE_MODE_P): Turn into a function. Optimize the case
983 in which the mode is already known to be a scalar_int_mode.
984 * genmodes.c (emit_mode_precision): Change the type of mode_precision
985 from unsigned short to poly_uint16_pod. Use ZERO_COEFFS for the
987 * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
988 for GET_MODE_PRECISION.
989 * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
990 for GET_MODE_PRECISION.
991 * combine.c (update_rsp_from_reg_equal): Treat GET_MODE_PRECISION
993 (try_combine, find_split_point, combine_simplify_rtx): Likewise.
994 (expand_field_assignment, make_extraction): Likewise.
995 (make_compound_operation_int, record_dead_and_set_regs_1): Likewise.
996 (get_last_value): Likewise.
997 * convert.c (convert_to_integer_1): Likewise.
998 * cse.c (cse_insn): Likewise.
999 * expr.c (expand_expr_real_1): Likewise.
1000 * lra-constraints.c (simplify_operand_subreg): Likewise.
1001 * optabs-query.c (can_atomic_load_p): Likewise.
1002 * optabs.c (expand_atomic_load): Likewise.
1003 (expand_atomic_store): Likewise.
1004 * ree.c (combine_reaching_defs): Likewise.
1005 * rtl.h (partial_subreg_p, paradoxical_subreg_p): Likewise.
1006 * rtlanal.c (nonzero_bits1, lsb_bitfield_op_p): Likewise.
1007 * tree.h (type_has_mode_precision_p): Likewise.
1008 * ubsan.c (instrument_si_overflow): Likewise.
1010 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1011 Alan Hayward <alan.hayward@arm.com>
1012 David Sherwood <david.sherwood@arm.com>
1014 * tree.h (TYPE_VECTOR_SUBPARTS): Turn into a function and handle
1015 polynomial numbers of units.
1016 (SET_TYPE_VECTOR_SUBPARTS): Likewise.
1017 (valid_vector_subparts_p): New function.
1018 (build_vector_type): Remove temporary shim and take the number
1019 of units as a poly_uint64 rather than an int.
1020 (build_opaque_vector_type): Take the number of units as a
1021 poly_uint64 rather than an int.
1022 * tree.c (build_vector_from_ctor): Handle polynomial
1023 TYPE_VECTOR_SUBPARTS.
1024 (type_hash_canon_hash, type_cache_hasher::equal): Likewise.
1025 (uniform_vector_p, vector_type_mode, build_vector): Likewise.
1026 (build_vector_from_val): If the number of units is variable,
1027 use build_vec_duplicate_cst for constant operands and
1028 VEC_DUPLICATE_EXPR otherwise.
1029 (make_vector_type): Remove temporary is_constant ().
1030 (build_vector_type, build_opaque_vector_type): Take the number of
1031 units as a poly_uint64 rather than an int.
1032 (check_vector_cst): Handle polynomial TYPE_VECTOR_SUBPARTS and
1034 * cfgexpand.c (expand_debug_expr): Likewise.
1035 * expr.c (count_type_elements, categorize_ctor_elements_1): Likewise.
1036 (store_constructor, expand_expr_real_1): Likewise.
1037 (const_scalar_mask_from_tree): Likewise.
1038 * fold-const-call.c (fold_const_reduction): Likewise.
1039 * fold-const.c (const_binop, const_unop, fold_convert_const): Likewise.
1040 (operand_equal_p, fold_vec_perm, fold_ternary_loc): Likewise.
1041 (native_encode_vector, vec_cst_ctor_to_array): Likewise.
1042 (fold_relational_const): Likewise.
1043 (native_interpret_vector): Likewise. Change the size from an
1044 int to an unsigned int.
1045 * gimple-fold.c (gimple_fold_stmt_to_constant_1): Handle polynomial
1046 TYPE_VECTOR_SUBPARTS.
1047 (gimple_fold_indirect_ref, gimple_build_vector): Likewise.
1048 (gimple_build_vector_from_val): Use VEC_DUPLICATE_EXPR when
1049 duplicating a non-constant operand into a variable-length vector.
1050 * hsa-brig.c (hsa_op_immed::emit_to_buffer): Handle polynomial
1051 TYPE_VECTOR_SUBPARTS and VECTOR_CST_NELTS.
1052 * ipa-icf.c (sem_variable::equals): Likewise.
1053 * match.pd: Likewise.
1054 * omp-simd-clone.c (simd_clone_subparts): Likewise.
1055 * print-tree.c (print_node): Likewise.
1056 * stor-layout.c (layout_type): Likewise.
1057 * targhooks.c (default_builtin_vectorization_cost): Likewise.
1058 * tree-cfg.c (verify_gimple_comparison): Likewise.
1059 (verify_gimple_assign_binary): Likewise.
1060 (verify_gimple_assign_ternary): Likewise.
1061 (verify_gimple_assign_single): Likewise.
1062 * tree-pretty-print.c (dump_generic_node): Likewise.
1063 * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
1064 (simplify_bitfield_ref, is_combined_permutation_identity): Likewise.
1065 * tree-vect-data-refs.c (vect_permute_store_chain): Likewise.
1066 (vect_grouped_load_supported, vect_permute_load_chain): Likewise.
1067 (vect_shift_permute_load_chain): Likewise.
1068 * tree-vect-generic.c (nunits_for_known_piecewise_op): Likewise.
1069 (expand_vector_condition, optimize_vector_constructor): Likewise.
1070 (lower_vec_perm, get_compute_type): Likewise.
1071 * tree-vect-loop.c (vect_determine_vectorization_factor): Likewise.
1072 (get_initial_defs_for_reduction, vect_transform_loop): Likewise.
1073 * tree-vect-patterns.c (vect_recog_bool_pattern): Likewise.
1074 (vect_recog_mask_conversion_pattern): Likewise.
1075 * tree-vect-slp.c (vect_supported_load_permutation_p): Likewise.
1076 (vect_get_constant_vectors, vect_transform_slp_perm_load): Likewise.
1077 * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
1078 (get_group_load_store_type, vectorizable_mask_load_store): Likewise.
1079 (vectorizable_bswap, simd_clone_subparts, vectorizable_assignment)
1080 (vectorizable_shift, vectorizable_operation, vectorizable_store)
1081 (vectorizable_load, vect_is_simple_cond, vectorizable_comparison)
1082 (supportable_widening_operation): Likewise.
1083 (supportable_narrowing_operation): Likewise.
1084 * tree-vector-builder.c (tree_vector_builder::binary_encoded_nelts):
1086 * varasm.c (output_constant): Likewise.
1088 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1089 Alan Hayward <alan.hayward@arm.com>
1090 David Sherwood <david.sherwood@arm.com>
1092 * tree-vect-data-refs.c (vect_permute_store_chain): Reorganize
1093 so that both the length == 3 and length != 3 cases set up their
1094 own permute vectors. Add comments explaining why we know the
1095 number of elements is constant.
1096 (vect_permute_load_chain): Likewise.
1098 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1099 Alan Hayward <alan.hayward@arm.com>
1100 David Sherwood <david.sherwood@arm.com>
1102 * machmode.h (mode_nunits): Change from unsigned char to
1104 (ONLY_FIXED_SIZE_MODES): New macro.
1105 (pod_mode::measurement_type, scalar_int_mode::measurement_type)
1106 (scalar_float_mode::measurement_type, scalar_mode::measurement_type)
1107 (complex_mode::measurement_type, fixed_size_mode::measurement_type):
1109 (mode_to_nunits): Return a poly_uint16 rather than an unsigned short.
1110 (GET_MODE_NUNITS): Return a constant if ONLY_FIXED_SIZE_MODES,
1111 or if measurement_type is not polynomial.
1112 * genmodes.c (ZERO_COEFFS): New macro.
1113 (emit_mode_nunits_inline): Make mode_nunits_inline return a
1115 (emit_mode_nunits): Change the type of mode_nunits to poly_uint16_pod.
1116 Use ZERO_COEFFS when emitting initializers.
1117 * data-streamer.h (bp_pack_poly_value): New function.
1118 (bp_unpack_poly_value): Likewise.
1119 * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
1120 for GET_MODE_NUNITS.
1121 * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
1122 for GET_MODE_NUNITS.
1123 * tree.c (make_vector_type): Remove temporary shim and make
1124 the real function take the number of units as a poly_uint64
1126 (build_vector_type_for_mode): Handle polynomial nunits.
1127 * dwarf2out.c (loc_descriptor, add_const_value_attribute): Likewise.
1128 * emit-rtl.c (const_vec_series_p_1): Likewise.
1129 (gen_rtx_CONST_VECTOR): Likewise.
1130 * fold-const.c (test_vec_duplicate_folding): Likewise.
1131 * genrecog.c (validate_pattern): Likewise.
1132 * optabs-query.c (can_vec_perm_var_p, can_mult_highpart_p): Likewise.
1133 * optabs-tree.c (expand_vec_cond_expr_p): Likewise.
1134 * optabs.c (expand_vector_broadcast, expand_binop_directly): Likewise.
1135 (shift_amt_for_vec_perm_mask, expand_vec_perm_var): Likewise.
1136 (expand_vec_cond_expr, expand_mult_highpart): Likewise.
1137 * rtlanal.c (subreg_get_info): Likewise.
1138 * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
1139 (vect_grouped_load_supported): Likewise.
1140 * tree-vect-generic.c (type_for_widest_vector_mode): Likewise.
1141 * tree-vect-loop.c (have_whole_vector_shift): Likewise.
1142 * simplify-rtx.c (simplify_unary_operation_1): Likewise.
1143 (simplify_const_unary_operation, simplify_binary_operation_1)
1144 (simplify_const_binary_operation, simplify_ternary_operation)
1145 (test_vector_ops_duplicate, test_vector_ops): Likewise.
1146 (simplify_immed_subreg): Use GET_MODE_NUNITS on a fixed_size_mode
1147 instead of CONST_VECTOR_NUNITS.
1148 * varasm.c (output_constant_pool_2): Likewise.
1149 * rtx-vector-builder.c (rtx_vector_builder::build): Only include the
1150 explicit-encoded elements in the XVEC for variable-length vectors.
1152 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1154 * lra-constraints.c (curr_insn_transform): Use partial_subreg_p.
1156 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1157 Alan Hayward <alan.hayward@arm.com>
1158 David Sherwood <david.sherwood@arm.com>
1160 * coretypes.h (fixed_size_mode): Declare.
1161 (fixed_size_mode_pod): New typedef.
1162 * builtins.h (target_builtins::x_apply_args_mode)
1163 (target_builtins::x_apply_result_mode): Change type to
1164 fixed_size_mode_pod.
1165 * builtins.c (apply_args_size, apply_result_size, result_vector)
1166 (expand_builtin_apply_args_1, expand_builtin_apply)
1167 (expand_builtin_return): Update accordingly.
1169 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1171 * cse.c (hash_rtx_cb): Hash only the encoded elements.
1172 * cselib.c (cselib_hash_rtx): Likewise.
1173 * expmed.c (make_tree): Build VECTOR_CSTs directly from the
1174 CONST_VECTOR encoding.
1176 2017-01-03 Jakub Jelinek <jakub@redhat.com>
1177 Jeff Law <law@redhat.com>
1180 * config/i386/i386.c (ix86_adjust_stack_and_probe_stack_clash): For
1181 noreturn probe, use gen_pop instead of ix86_emit_restore_reg_using_pop,
1182 only set RTX_FRAME_RELATED_P on both the push and pop if cfa_reg is sp
1183 and add REG_CFA_ADJUST_CFA notes in that case to both insns.
1186 * config/i386/i386.c (ix86_adjust_stack_and_probe_stack_clash): Do not
1187 explicitly probe *sp in a noreturn function if there were any callee
1188 register saves or frame pointer is needed.
1190 2018-01-03 Jakub Jelinek <jakub@redhat.com>
1193 * cfgexpand.c (expand_debug_expr): Return NULL if mode is
1194 BLKmode for ternary, binary or unary expressions.
1197 * var-tracking.c (delete_vta_debug_insn): New inline function.
1198 (delete_vta_debug_insns): Add USE_CFG argument, if true, walk just
1199 insns from get_insns () to NULL instead of each bb separately.
1200 Use delete_vta_debug_insn. No longer static.
1201 (vt_debug_insns_local, variable_tracking_main_1): Adjust
1202 delete_vta_debug_insns callers.
1203 * rtl.h (delete_vta_debug_insns): Declare.
1204 * final.c (rest_of_handle_final): Call delete_vta_debug_insns
1205 instead of variable_tracking_main.
1207 2018-01-03 Martin Sebor <msebor@redhat.com>
1209 PR tree-optimization/83603
1210 * calls.c (maybe_warn_nonstring_arg): Avoid accessing function
1211 arguments past the endof the argument list in functions declared
1212 without a prototype.
1213 * gimple-ssa-warn-restrict.c (wrestrict_dom_walker::check_call):
1214 Avoid checking when arguments are null.
1216 2018-01-03 Martin Sebor <msebor@redhat.com>
1219 * doc/extend.texi (attribute const): Fix a typo.
1220 * ipa-pure-const.c ((warn_function_const, warn_function_pure): Avoid
1221 issuing -Wsuggest-attribute for void functions.
1223 2018-01-03 Martin Sebor <msebor@redhat.com>
1225 * gimple-ssa-warn-restrict.c (builtin_memref::builtin_memref): Use
1226 offset_int::from instead of wide_int::to_shwi.
1227 (maybe_diag_overlap): Remove assertion.
1228 Use HOST_WIDE_INT_PRINT_DEC instead of %lli.
1229 * gimple-ssa-sprintf.c (format_directive): Same.
1230 (parse_directive): Same.
1231 (sprintf_dom_walker::compute_format_length): Same.
1232 (try_substitute_return_value): Same.
1234 2017-01-03 Jeff Law <law@redhat.com>
1237 * explow.c (anti_adjust_stack_and_probe_stack_clash): Test a
1238 non-constant residual for zero at runtime and avoid probing in
1239 that case. Reorganize code for trailing problem to mirror handling
1242 2018-01-03 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
1244 PR tree-optimization/83501
1245 * tree-ssa-strlen.c (get_string_cst): New.
1246 (handle_char_store): Call get_string_cst.
1248 2018-01-03 Martin Liska <mliska@suse.cz>
1250 PR tree-optimization/83593
1251 * tree-ssa-strlen.c: Include tree-cfg.h.
1252 (strlen_check_and_optimize_stmt): Add new argument cleanup_eh.
1253 (strlen_dom_walker): Add new member variable m_cleanup_cfg.
1254 (strlen_dom_walker::strlen_dom_walker): Initialize m_cleanup_cfg
1256 (strlen_dom_walker::before_dom_children): Call
1257 gimple_purge_dead_eh_edges. Dump tranformation with details
1259 (strlen_dom_walker::before_dom_children): Update call by adding
1260 new argument cleanup_eh.
1261 (pass_strlen::execute): Return TODO_cleanup_cfg if needed.
1263 2018-01-03 Martin Liska <mliska@suse.cz>
1266 * cif-code.def (VARIADIC_THUNK): New enum value.
1267 * ipa-fnsummary.c (compute_fn_summary): Do not inline variadic
1270 2018-01-03 Jan Beulich <jbeulich@suse.com>
1272 * sse.md (mov<mode>_internal): Tighten condition for when to use
1273 vmovdqu<ssescalarsize> for TI and OI modes.
1275 2018-01-03 Jakub Jelinek <jakub@redhat.com>
1277 Update copyright years.
1279 2018-01-03 Martin Liska <mliska@suse.cz>
1282 * ipa-visibility.c (function_and_variable_visibility): Skip
1283 functions with noipa attribure.
1285 2018-01-03 Jakub Jelinek <jakub@redhat.com>
1287 * gcc.c (process_command): Update copyright notice dates.
1288 * gcov-dump.c (print_version): Ditto.
1289 * gcov.c (print_version): Ditto.
1290 * gcov-tool.c (print_version): Ditto.
1291 * gengtype.c (create_file): Ditto.
1292 * doc/cpp.texi: Bump @copying's copyright year.
1293 * doc/cppinternals.texi: Ditto.
1294 * doc/gcc.texi: Ditto.
1295 * doc/gccint.texi: Ditto.
1296 * doc/gcov.texi: Ditto.
1297 * doc/install.texi: Ditto.
1298 * doc/invoke.texi: Ditto.
1300 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1302 * vector-builder.h (vector_builder::m_full_nelts): Change from
1303 unsigned int to poly_uint64.
1304 (vector_builder::full_nelts): Update prototype accordingly.
1305 (vector_builder::new_vector): Likewise.
1306 (vector_builder::encoded_full_vector_p): Handle polynomial full_nelts.
1307 (vector_builder::operator ==): Likewise.
1308 (vector_builder::finalize): Likewise.
1309 * int-vector-builder.h (int_vector_builder::int_vector_builder):
1310 Take the number of elements as a poly_uint64 rather than an
1312 * vec-perm-indices.h (vec_perm_indices::m_nelts_per_input): Change
1313 from unsigned int to poly_uint64.
1314 (vec_perm_indices::vec_perm_indices): Update prototype accordingly.
1315 (vec_perm_indices::new_vector): Likewise.
1316 (vec_perm_indices::length): Likewise.
1317 (vec_perm_indices::nelts_per_input): Likewise.
1318 (vec_perm_indices::input_nelts): Likewise.
1319 * vec-perm-indices.c (vec_perm_indices::new_vector): Take the
1320 number of elements per input as a poly_uint64 rather than an
1321 unsigned int. Use the original encoding for variable-length
1322 vectors, rather than clamping each individual element.
1323 For the second and subsequent elements in each pattern,
1324 clamp the step and base before clamping their sum.
1325 (vec_perm_indices::series_p): Handle polynomial element counts.
1326 (vec_perm_indices::all_in_range_p): Likewise.
1327 (vec_perm_indices_to_tree): Likewise.
1328 (vec_perm_indices_to_rtx): Likewise.
1329 * tree-vect-stmts.c (vect_gen_perm_mask_any): Likewise.
1330 * tree-vector-builder.c (tree_vector_builder::new_unary_operation)
1331 (tree_vector_builder::new_binary_operation): Handle polynomial
1332 element counts. Return false if we need to know the number
1333 of elements at compile time.
1334 * fold-const.c (fold_vec_perm): Punt if the number of elements
1335 isn't known at compile time.
1337 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1339 * vec-perm-indices.h (vec_perm_builder): Change element type
1340 from HOST_WIDE_INT to poly_int64.
1341 (vec_perm_indices::element_type): Update accordingly.
1342 (vec_perm_indices::clamp): Handle polynomial element_types.
1343 * vec-perm-indices.c (vec_perm_indices::series_p): Likewise.
1344 (vec_perm_indices::all_in_range_p): Likewise.
1345 (tree_to_vec_perm_builder): Check for poly_int64 trees rather
1347 * vector-builder.h (vector_builder::stepped_sequence_p): Handle
1348 polynomial vec_perm_indices element types.
1349 * int-vector-builder.h (int_vector_builder::equal_p): Likewise.
1350 * fold-const.c (fold_vec_perm): Likewise.
1351 * optabs.c (shift_amt_for_vec_perm_mask): Likewise.
1352 * tree-vect-generic.c (lower_vec_perm): Likewise.
1353 * tree-vect-slp.c (vect_transform_slp_perm_load): Likewise.
1354 * config/aarch64/aarch64.c (aarch64_evpc_tbl): Cast d->perm
1355 element type to HOST_WIDE_INT.
1357 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1358 Alan Hayward <alan.hayward@arm.com>
1359 David Sherwood <david.sherwood@arm.com>
1361 * alias.c (addr_side_effect_eval): Take the size as a poly_int64
1362 rather than an int. Use plus_constant.
1363 (memrefs_conflict_p): Take the sizes as poly_int64s rather than ints.
1364 Take the offset "c" as a poly_int64 rather than a HOST_WIDE_INT.
1366 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1367 Alan Hayward <alan.hayward@arm.com>
1368 David Sherwood <david.sherwood@arm.com>
1370 * calls.c (emit_call_1, expand_call): Change struct_value_size from
1371 a HOST_WIDE_INT to a poly_int64.
1373 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1374 Alan Hayward <alan.hayward@arm.com>
1375 David Sherwood <david.sherwood@arm.com>
1377 * calls.c (load_register_parameters): Cope with polynomial
1378 mode sizes. Require a constant size for BLKmode parameters
1379 that aren't described by a PARALLEL. If BLOCK_REG_PADDING
1380 forces a parameter to be padded at the lsb end in order to
1381 fill a complete number of words, require the parameter size
1382 to be ordered wrt UNITS_PER_WORD.
1384 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1385 Alan Hayward <alan.hayward@arm.com>
1386 David Sherwood <david.sherwood@arm.com>
1388 * reload1.c (spill_stack_slot_width): Change element type
1389 from unsigned int to poly_uint64_pod.
1390 (alter_reg): Treat mode sizes as polynomial.
1392 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1393 Alan Hayward <alan.hayward@arm.com>
1394 David Sherwood <david.sherwood@arm.com>
1396 * reload.c (complex_word_subreg_p): New function.
1397 (reload_inner_reg_of_subreg, push_reload): Use it.
1399 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1400 Alan Hayward <alan.hayward@arm.com>
1401 David Sherwood <david.sherwood@arm.com>
1403 * lra-constraints.c (process_alt_operands): Reject matched
1404 operands whose sizes aren't ordered.
1405 (match_reload): Refer to this check here.
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 * builtins.c (expand_ifn_atomic_compare_exchange_into_call): Assert
1412 that the mode size is in the set {1, 2, 4, 8, 16}.
1414 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1415 Alan Hayward <alan.hayward@arm.com>
1416 David Sherwood <david.sherwood@arm.com>
1418 * var-tracking.c (adjust_mems): Treat mode sizes as polynomial.
1419 Use plus_constant instead of gen_rtx_PLUS.
1421 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1422 Alan Hayward <alan.hayward@arm.com>
1423 David Sherwood <david.sherwood@arm.com>
1425 * config/cr16/cr16-protos.h (cr16_push_rounding): Declare.
1426 * config/cr16/cr16.h (PUSH_ROUNDING): Move implementation to...
1427 * config/cr16/cr16.c (cr16_push_rounding): ...this new function.
1428 * config/h8300/h8300-protos.h (h8300_push_rounding): Declare.
1429 * config/h8300/h8300.h (PUSH_ROUNDING): Move implementation to...
1430 * config/h8300/h8300.c (h8300_push_rounding): ...this new function.
1431 * config/i386/i386-protos.h (ix86_push_rounding): Declare.
1432 * config/i386/i386.h (PUSH_ROUNDING): Move implementation to...
1433 * config/i386/i386.c (ix86_push_rounding): ...this new function.
1434 * config/m32c/m32c-protos.h (m32c_push_rounding): Take and return
1436 * config/m32c/m32c.c (m32c_push_rounding): Likewise.
1437 * config/m68k/m68k-protos.h (m68k_push_rounding): Declare.
1438 * config/m68k/m68k.h (PUSH_ROUNDING): Move implementation to...
1439 * config/m68k/m68k.c (m68k_push_rounding): ...this new function.
1440 * config/pdp11/pdp11-protos.h (pdp11_push_rounding): Declare.
1441 * config/pdp11/pdp11.h (PUSH_ROUNDING): Move implementation to...
1442 * config/pdp11/pdp11.c (pdp11_push_rounding): ...this new function.
1443 * config/stormy16/stormy16-protos.h (xstormy16_push_rounding): Declare.
1444 * config/stormy16/stormy16.h (PUSH_ROUNDING): Move implementation to...
1445 * config/stormy16/stormy16.c (xstormy16_push_rounding): ...this new
1447 * expr.c (emit_move_resolve_push): Treat the input and result
1448 of PUSH_ROUNDING as a poly_int64.
1449 (emit_move_complex_push, emit_single_push_insn_1): Likewise.
1450 (emit_push_insn): Likewise.
1451 * lra-eliminations.c (mark_not_eliminable): Likewise.
1452 * recog.c (push_operand): Likewise.
1453 * reload1.c (elimination_effects): Likewise.
1454 * rtlanal.c (nonzero_bits1): Likewise.
1455 * calls.c (store_one_arg): Likewise. Require the padding to be
1456 known at compile time.
1458 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1459 Alan Hayward <alan.hayward@arm.com>
1460 David Sherwood <david.sherwood@arm.com>
1462 * expr.c (emit_single_push_insn_1): Treat mode sizes as polynomial.
1463 Use plus_constant instead of gen_rtx_PLUS.
1465 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1466 Alan Hayward <alan.hayward@arm.com>
1467 David Sherwood <david.sherwood@arm.com>
1469 * auto-inc-dec.c (set_inc_state): Take the mode size as a poly_int64
1472 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1473 Alan Hayward <alan.hayward@arm.com>
1474 David Sherwood <david.sherwood@arm.com>
1476 * expr.c (expand_expr_real_1): Use tree_to_poly_uint64
1477 instead of int_size_in_bytes when handling VIEW_CONVERT_EXPRs
1478 via stack temporaries. Treat the mode size as polynomial too.
1480 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1481 Alan Hayward <alan.hayward@arm.com>
1482 David Sherwood <david.sherwood@arm.com>
1484 * expr.c (expand_expr_real_2): When handling conversions involving
1485 unions, apply tree_to_poly_uint64 to the TYPE_SIZE rather than
1486 multiplying int_size_in_bytes by BITS_PER_UNIT. Treat GET_MODE_BISIZE
1487 as a poly_uint64 too.
1489 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1490 Alan Hayward <alan.hayward@arm.com>
1491 David Sherwood <david.sherwood@arm.com>
1493 * rtlanal.c (subreg_get_info): Handle polynomial mode sizes.
1495 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1496 Alan Hayward <alan.hayward@arm.com>
1497 David Sherwood <david.sherwood@arm.com>
1499 * combine.c (can_change_dest_mode): Handle polynomial
1500 REGMODE_NATURAL_SIZE.
1501 * expmed.c (store_bit_field_1): Likewise.
1502 * expr.c (store_constructor): Likewise.
1503 * emit-rtl.c (validate_subreg): Operate on polynomial mode sizes
1504 and polynomial REGMODE_NATURAL_SIZE.
1505 (gen_lowpart_common): Likewise.
1506 * reginfo.c (record_subregs_of_mode): Likewise.
1507 * rtlanal.c (read_modify_subreg_p): Likewise.
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 * internal-fn.c (expand_vector_ubsan_overflow): Handle polynomial
1514 numbers of elements.
1516 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1517 Alan Hayward <alan.hayward@arm.com>
1518 David Sherwood <david.sherwood@arm.com>
1520 * match.pd: Cope with polynomial numbers of vector elements.
1522 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1523 Alan Hayward <alan.hayward@arm.com>
1524 David Sherwood <david.sherwood@arm.com>
1526 * fold-const.c (fold_indirect_ref_1): Handle polynomial offsets
1527 in a POINTER_PLUS_EXPR.
1529 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1530 Alan Hayward <alan.hayward@arm.com>
1531 David Sherwood <david.sherwood@arm.com>
1533 * omp-simd-clone.c (simd_clone_subparts): New function.
1534 (simd_clone_init_simd_arrays): Use it instead of TYPE_VECTOR_SUBPARTS.
1535 (ipa_simd_modify_function_body): Likewise.
1537 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1538 Alan Hayward <alan.hayward@arm.com>
1539 David Sherwood <david.sherwood@arm.com>
1541 * tree-vect-generic.c (nunits_for_known_piecewise_op): New function.
1542 (expand_vector_piecewise): Use it instead of TYPE_VECTOR_SUBPARTS.
1543 (expand_vector_addition, add_rshift, expand_vector_divmod): Likewise.
1544 (expand_vector_condition, vector_element): Likewise.
1545 (subparts_gt): New function.
1546 (get_compute_type): Use subparts_gt.
1547 (count_type_subparts): Delete.
1548 (expand_vector_operations_1): Use subparts_gt instead of
1549 count_type_subparts.
1551 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1552 Alan Hayward <alan.hayward@arm.com>
1553 David Sherwood <david.sherwood@arm.com>
1555 * tree-vect-data-refs.c (vect_no_alias_p): Replace with...
1556 (vect_compile_time_alias): ...this new function. Do the calculation
1557 on poly_ints rather than trees.
1558 (vect_prune_runtime_alias_test_list): Update call accordingly.
1560 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1561 Alan Hayward <alan.hayward@arm.com>
1562 David Sherwood <david.sherwood@arm.com>
1564 * tree-vect-slp.c (vect_build_slp_tree_1): Handle polynomial
1566 (vect_schedule_slp_instance): 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-vect-slp.c (vect_get_and_check_slp_defs): Reject
1573 constant and extern definitions for variable-length vectors.
1574 (vect_get_constant_vectors): Note that the number of units
1575 is known to be constant.
1577 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1578 Alan Hayward <alan.hayward@arm.com>
1579 David Sherwood <david.sherwood@arm.com>
1581 * tree-vect-stmts.c (vectorizable_conversion): Treat the number
1582 of units as polynomial. Choose between WIDE and NARROW based
1585 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1586 Alan Hayward <alan.hayward@arm.com>
1587 David Sherwood <david.sherwood@arm.com>
1589 * tree-vect-stmts.c (simd_clone_subparts): New function.
1590 (vectorizable_simd_clone_call): Use it instead of TYPE_VECTOR_SUBPARTS.
1592 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1593 Alan Hayward <alan.hayward@arm.com>
1594 David Sherwood <david.sherwood@arm.com>
1596 * tree-vect-stmts.c (vectorizable_call): Treat the number of
1597 vectors as polynomial. Use build_index_vector for
1600 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1601 Alan Hayward <alan.hayward@arm.com>
1602 David Sherwood <david.sherwood@arm.com>
1604 * tree-vect-stmts.c (get_load_store_type): Treat the number of
1605 units as polynomial. Reject VMAT_ELEMENTWISE and VMAT_STRIDED_SLP
1606 for variable-length vectors.
1607 (vectorizable_mask_load_store): Treat the number of units as
1608 polynomial, asserting that it is constant if the condition has
1609 already been enforced.
1610 (vectorizable_store, vectorizable_load): Likewise.
1612 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1613 Alan Hayward <alan.hayward@arm.com>
1614 David Sherwood <david.sherwood@arm.com>
1616 * tree-vect-loop.c (vectorizable_live_operation): Treat the number
1617 of units as polynomial. Punt if we can't tell at compile time
1618 which vector contains the final result.
1620 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1621 Alan Hayward <alan.hayward@arm.com>
1622 David Sherwood <david.sherwood@arm.com>
1624 * tree-vect-loop.c (vectorizable_induction): Treat the number
1625 of units as polynomial. Punt on SLP inductions. Use an integer
1626 VEC_SERIES_EXPR for variable-length integer reductions. Use a
1627 cast of such a series for variable-length floating-point
1630 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1631 Alan Hayward <alan.hayward@arm.com>
1632 David Sherwood <david.sherwood@arm.com>
1634 * tree.h (build_index_vector): Declare.
1635 * tree.c (build_index_vector): New function.
1636 * tree-vect-loop.c (get_initial_defs_for_reduction): Treat the number
1637 of units as polynomial, forcibly converting it to a constant if
1638 vectorizable_reduction has already enforced the condition.
1639 (vect_create_epilog_for_reduction): Likewise. Use build_index_vector
1640 to create a {1,2,3,...} vector.
1641 (vectorizable_reduction): Treat the number of units as polynomial.
1642 Choose vectype_in based on the largest scalar element size rather
1643 than the smallest number of units. Enforce the restrictions
1646 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1647 Alan Hayward <alan.hayward@arm.com>
1648 David Sherwood <david.sherwood@arm.com>
1650 * tree-vect-data-refs.c (vector_alignment_reachable_p): Treat the
1651 number of units as polynomial.
1653 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1654 Alan Hayward <alan.hayward@arm.com>
1655 David Sherwood <david.sherwood@arm.com>
1657 * target.h (vector_sizes, auto_vector_sizes): New typedefs.
1658 * target.def (autovectorize_vector_sizes): Return the vector sizes
1659 by pointer, using vector_sizes rather than a bitmask.
1660 * targhooks.h (default_autovectorize_vector_sizes): Update accordingly.
1661 * targhooks.c (default_autovectorize_vector_sizes): Likewise.
1662 * config/aarch64/aarch64.c (aarch64_autovectorize_vector_sizes):
1664 * config/arc/arc.c (arc_autovectorize_vector_sizes): Likewise.
1665 * config/arm/arm.c (arm_autovectorize_vector_sizes): Likewise.
1666 * config/i386/i386.c (ix86_autovectorize_vector_sizes): Likewise.
1667 * config/mips/mips.c (mips_autovectorize_vector_sizes): Likewise.
1668 * omp-general.c (omp_max_vf): Likewise.
1669 * omp-low.c (omp_clause_aligned_alignment): Likewise.
1670 * optabs-query.c (can_vec_mask_load_store_p): Likewise.
1671 * tree-vect-loop.c (vect_analyze_loop): Likewise.
1672 * tree-vect-slp.c (vect_slp_bb): Likewise.
1673 * doc/tm.texi: Regenerate.
1674 * tree-vectorizer.h (current_vector_size): Change from an unsigned int
1676 * tree-vect-stmts.c (get_vectype_for_scalar_type_and_size): Take
1677 the vector size as a poly_uint64 rather than an unsigned int.
1678 (current_vector_size): Change from an unsigned int to a poly_uint64.
1679 (get_vectype_for_scalar_type): Update accordingly.
1680 * tree.h (build_truth_vector_type): Take the size and number of
1681 units as a poly_uint64 rather than an unsigned int.
1682 (build_vector_type): Add a temporary overload that takes
1683 the number of units as a poly_uint64 rather than an unsigned int.
1684 * tree.c (make_vector_type): Likewise.
1685 (build_truth_vector_type): Take the number of units as a poly_uint64
1686 rather than an unsigned int.
1688 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1689 Alan Hayward <alan.hayward@arm.com>
1690 David Sherwood <david.sherwood@arm.com>
1692 * target.def (get_mask_mode): Take the number of units and length
1693 as poly_uint64s rather than unsigned ints.
1694 * targhooks.h (default_get_mask_mode): Update accordingly.
1695 * targhooks.c (default_get_mask_mode): Likewise.
1696 * config/i386/i386.c (ix86_get_mask_mode): Likewise.
1697 * doc/tm.texi: Regenerate.
1699 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1700 Alan Hayward <alan.hayward@arm.com>
1701 David Sherwood <david.sherwood@arm.com>
1703 * omp-general.h (omp_max_vf): Return a poly_uint64 instead of an int.
1704 * omp-general.c (omp_max_vf): Likewise.
1705 * omp-expand.c (omp_adjust_chunk_size): Update call to omp_max_vf.
1706 (expand_omp_simd): Handle polynomial safelen.
1707 * omp-low.c (omplow_simd_context): Add a default constructor.
1708 (omplow_simd_context::max_vf): Change from int to poly_uint64.
1709 (lower_rec_simd_input_clauses): Update accordingly.
1710 (lower_rec_input_clauses): Likewise.
1712 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1713 Alan Hayward <alan.hayward@arm.com>
1714 David Sherwood <david.sherwood@arm.com>
1716 * tree-vectorizer.h (vect_nunits_for_cost): New function.
1717 * tree-vect-loop.c (vect_model_reduction_cost): Use it.
1718 * tree-vect-slp.c (vect_analyze_slp_cost_1): Likewise.
1719 (vect_analyze_slp_cost): Likewise.
1720 * tree-vect-stmts.c (vect_model_store_cost): Likewise.
1721 (vect_model_load_cost): Likewise.
1723 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1724 Alan Hayward <alan.hayward@arm.com>
1725 David Sherwood <david.sherwood@arm.com>
1727 * tree-vect-slp.c (vect_record_max_nunits, vect_build_slp_tree_1)
1728 (vect_build_slp_tree_2, vect_build_slp_tree): Change max_nunits
1729 from an unsigned int * to a poly_uint64_pod *.
1730 (calculate_unrolling_factor): New function.
1731 (vect_analyze_slp_instance): Use it. Track polynomial max_nunits.
1733 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1734 Alan Hayward <alan.hayward@arm.com>
1735 David Sherwood <david.sherwood@arm.com>
1737 * tree-vectorizer.h (_slp_instance::unrolling_factor): Change
1738 from an unsigned int to a poly_uint64.
1739 (_loop_vec_info::slp_unrolling_factor): Likewise.
1740 (_loop_vec_info::vectorization_factor): Change from an int
1742 (MAX_VECTORIZATION_FACTOR): Bump from 64 to INT_MAX.
1743 (vect_get_num_vectors): New function.
1744 (vect_update_max_nunits, vect_vf_for_cost): Likewise.
1745 (vect_get_num_copies): Use vect_get_num_vectors.
1746 (vect_analyze_data_ref_dependences): Change max_vf from an int *
1747 to an unsigned int *.
1748 (vect_analyze_data_refs): Change min_vf from an int * to a
1750 (vect_transform_slp_perm_load): Take the vf as a poly_uint64 rather
1751 than an unsigned HOST_WIDE_INT.
1752 * tree-vect-data-refs.c (vect_analyze_possibly_independent_ddr)
1753 (vect_analyze_data_ref_dependence): Change max_vf from an int *
1754 to an unsigned int *.
1755 (vect_analyze_data_ref_dependences): Likewise.
1756 (vect_compute_data_ref_alignment): Handle polynomial vf.
1757 (vect_enhance_data_refs_alignment): Likewise.
1758 (vect_prune_runtime_alias_test_list): Likewise.
1759 (vect_shift_permute_load_chain): Likewise.
1760 (vect_supportable_dr_alignment): Likewise.
1761 (dependence_distance_ge_vf): Take the vectorization factor as a
1762 poly_uint64 rather than an unsigned HOST_WIDE_INT.
1763 (vect_analyze_data_refs): Change min_vf from an int * to a
1765 * tree-vect-loop-manip.c (vect_gen_scalar_loop_niters): Take
1766 vfm1 as a poly_uint64 rather than an int. Make the same change
1767 for the returned bound_scalar.
1768 (vect_gen_vector_loop_niters): Handle polynomial vf.
1769 (vect_do_peeling): Likewise. Update call to
1770 vect_gen_scalar_loop_niters and handle polynomial bound_scalars.
1771 (vect_gen_vector_loop_niters_mult_vf): Assert that the vf must
1773 * tree-vect-loop.c (vect_determine_vectorization_factor)
1774 (vect_update_vf_for_slp, vect_analyze_loop_2): Handle polynomial vf.
1775 (vect_get_known_peeling_cost): Likewise.
1776 (vect_estimate_min_profitable_iters, vectorizable_reduction): Likewise.
1777 (vect_worthwhile_without_simd_p, vectorizable_induction): Likewise.
1778 (vect_transform_loop): Likewise. Use the lowest possible VF when
1779 updating the upper bounds of the loop.
1780 (vect_min_worthwhile_factor): Make static. Return an unsigned int
1782 * tree-vect-slp.c (vect_attempt_slp_rearrange_stmts): Cope with
1783 polynomial unroll factors.
1784 (vect_analyze_slp_cost_1, vect_analyze_slp_instance): Likewise.
1785 (vect_make_slp_decision): Likewise.
1786 (vect_supported_load_permutation_p): Likewise, and polynomial
1788 (vect_analyze_slp_cost): Handle polynomial vf.
1789 (vect_slp_analyze_node_operations): Likewise.
1790 (vect_slp_analyze_bb_1): Likewise.
1791 (vect_transform_slp_perm_load): Take the vf as a poly_uint64 rather
1792 than an unsigned HOST_WIDE_INT.
1793 * tree-vect-stmts.c (vectorizable_simd_clone_call, vectorizable_store)
1794 (vectorizable_load): Handle polynomial vf.
1795 * tree-vectorizer.c (simduid_to_vf::vf): Change from an int to
1797 (adjust_simduid_builtins, shrink_simd_arrays): Update accordingly.
1799 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1800 Alan Hayward <alan.hayward@arm.com>
1801 David Sherwood <david.sherwood@arm.com>
1803 * match.pd: Handle bit operations involving three constants
1804 and try to fold one pair.
1806 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1808 * tree-vect-loop-manip.c: Include gimple-fold.h.
1809 (slpeel_make_loop_iterate_ntimes): Add step, final_iv and
1810 niters_maybe_zero parameters. Handle other cases besides a step of 1.
1811 (vect_gen_vector_loop_niters): Add a step_vector_ptr parameter.
1812 Add a path that uses a step of VF instead of 1, but disable it
1814 (vect_do_peeling): Add step_vector, niters_vector_mult_vf_var
1815 and niters_no_overflow parameters. Update calls to
1816 slpeel_make_loop_iterate_ntimes and vect_gen_vector_loop_niters.
1817 Create a new SSA name if the latter choses to use a ste other
1818 than zero, and return it via niters_vector_mult_vf_var.
1819 * tree-vect-loop.c (vect_transform_loop): Update calls to
1820 vect_do_peeling, vect_gen_vector_loop_niters and
1821 slpeel_make_loop_iterate_ntimes.
1822 * tree-vectorizer.h (slpeel_make_loop_iterate_ntimes, vect_do_peeling)
1823 (vect_gen_vector_loop_niters): Update declarations after above changes.
1825 2018-01-02 Michael Meissner <meissner@linux.vnet.ibm.com>
1827 * config/rs6000/rs6000.md (floor<mode>2): Add support for IEEE
1828 128-bit round to integer instructions.
1829 (ceil<mode>2): Likewise.
1830 (btrunc<mode>2): Likewise.
1831 (round<mode>2): Likewise.
1833 2018-01-02 Aaron Sawdey <acsawdey@linux.vnet.ibm.com>
1835 * config/rs6000/rs6000-string.c (expand_block_move): Allow the use of
1836 unaligned VSX load/store on P8/P9.
1837 (expand_block_clear): Allow the use of unaligned VSX
1838 load/store on P8/P9.
1840 2018-01-02 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
1842 * config/rs6000/rs6000-p8swap.c (swap_feeds_both_load_and_store):
1844 (rs6000_analyze_swaps): Mark a web unoptimizable if it contains a
1845 swap associated with both a load and a store.
1847 2018-01-02 Andrew Waterman <andrew@sifive.com>
1849 * config/riscv/linux.h (ICACHE_FLUSH_FUNC): New.
1850 * config/riscv/riscv.md (clear_cache): Use it.
1852 2018-01-02 Artyom Skrobov <tyomitch@gmail.com>
1854 * web.c: Remove out-of-date comment.
1856 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1858 * expr.c (fixup_args_size_notes): Check that any existing
1859 REG_ARGS_SIZE notes are correct, and don't try to re-add them.
1860 (emit_single_push_insn_1): Move stack_pointer_delta adjustment to...
1861 (emit_single_push_insn): ...here.
1863 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1865 * rtl.h (CONST_VECTOR_ELT): Redefine to const_vector_elt.
1866 (const_vector_encoded_nelts): New function.
1867 (CONST_VECTOR_NUNITS): Redefine to use GET_MODE_NUNITS.
1868 (const_vector_int_elt, const_vector_elt): Declare.
1869 * emit-rtl.c (const_vector_int_elt_1): New function.
1870 (const_vector_elt): Likewise.
1871 * simplify-rtx.c (simplify_immed_subreg): Avoid taking the address
1872 of CONST_VECTOR_ELT.
1874 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1876 * expr.c: Include rtx-vector-builder.h.
1877 (const_vector_mask_from_tree): Use rtx_vector_builder and operate
1878 directly on the tree encoding.
1879 (const_vector_from_tree): Likewise.
1880 * optabs.c: Include rtx-vector-builder.h.
1881 (expand_vec_perm_var): Use rtx_vector_builder and create a repeating
1882 sequence of "u" values.
1883 * vec-perm-indices.c: Include rtx-vector-builder.h.
1884 (vec_perm_indices_to_rtx): Use rtx_vector_builder and operate
1885 directly on the vec_perm_indices encoding.
1887 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1889 * doc/rtl.texi (const_vector): Describe new encoding scheme.
1890 * Makefile.in (OBJS): Add rtx-vector-builder.o.
1891 * rtx-vector-builder.h: New file.
1892 * rtx-vector-builder.c: Likewise.
1893 * rtl.h (rtx_def::u2): Add a const_vector field.
1894 (CONST_VECTOR_NPATTERNS): New macro.
1895 (CONST_VECTOR_NELTS_PER_PATTERN): Likewise.
1896 (CONST_VECTOR_DUPLICATE_P): Likewise.
1897 (CONST_VECTOR_STEPPED_P): Likewise.
1898 (CONST_VECTOR_ENCODED_ELT): Likewise.
1899 (const_vec_duplicate_p): Check for a duplicated vector encoding.
1900 (unwrap_const_vec_duplicate): Likewise.
1901 (const_vec_series_p): Check for a non-duplicated vector encoding.
1902 Say that the function only returns true for integer vectors.
1903 * emit-rtl.c: Include rtx-vector-builder.h.
1904 (gen_const_vec_duplicate_1): Delete.
1905 (gen_const_vector): Call gen_const_vec_duplicate instead of
1906 gen_const_vec_duplicate_1.
1907 (const_vec_series_p_1): Operate directly on the CONST_VECTOR encoding.
1908 (gen_const_vec_duplicate): Use rtx_vector_builder.
1909 (gen_const_vec_series): Likewise.
1910 (gen_rtx_CONST_VECTOR): Likewise.
1911 * config/powerpcspe/powerpcspe.c: Include rtx-vector-builder.h.
1912 (swap_const_vector_halves): Take an rtx pointer rather than rtx.
1913 Build a new vector rather than modifying a CONST_VECTOR in-place.
1914 (handle_special_swappables): Update call accordingly.
1915 * config/rs6000/rs6000-p8swap.c: Include rtx-vector-builder.h.
1916 (swap_const_vector_halves): Take an rtx pointer rather than rtx.
1917 Build a new vector rather than modifying a CONST_VECTOR in-place.
1918 (handle_special_swappables): Update call accordingly.
1920 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1922 * simplify-rtx.c (simplify_const_binary_operation): Use
1923 CONST_VECTOR_ELT instead of XVECEXP.
1925 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1927 * tree-cfg.c (verify_gimple_assign_ternary): Allow the size of
1928 the selector elements to be different from the data elements
1929 if the selector is a VECTOR_CST.
1930 * tree-vect-stmts.c (vect_gen_perm_mask_any): Use a vector of
1931 ssizetype for the selector.
1933 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1935 * optabs.c (shift_amt_for_vec_perm_mask): Try using series_p
1936 before testing each element individually.
1937 * tree-vect-generic.c (lower_vec_perm): Likewise.
1939 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1941 * selftest.h (selftest::vec_perm_indices_c_tests): Declare.
1942 * selftest-run-tests.c (selftest::run_tests): Call it.
1943 * vector-builder.h (vector_builder::operator ==): New function.
1944 (vector_builder::operator !=): Likewise.
1945 * vec-perm-indices.h (vec_perm_indices::series_p): Declare.
1946 (vec_perm_indices::all_from_input_p): New function.
1947 * vec-perm-indices.c (vec_perm_indices::series_p): Likewise.
1948 (test_vec_perm_12, selftest::vec_perm_indices_c_tests): Likewise.
1949 * fold-const.c (fold_ternary_loc): Use tree_to_vec_perm_builder
1950 instead of reading the VECTOR_CST directly. Detect whether both
1951 vector inputs are the same before constructing the vec_perm_indices,
1952 and update the number of inputs argument accordingly. Use the
1953 utility functions added above. Only construct sel2 if we need to.
1955 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1957 * optabs.c (expand_vec_perm_var): Use an explicit encoding for
1958 the broadcast of the low byte.
1959 (expand_mult_highpart): Use an explicit encoding for the permutes.
1960 * optabs-query.c (can_mult_highpart_p): Likewise.
1961 * tree-vect-loop.c (calc_vec_perm_mask_for_shift): Likewise.
1962 * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
1963 (vectorizable_bswap): Likewise.
1964 * tree-vect-data-refs.c (vect_grouped_store_supported): Use an
1965 explicit encoding for the power-of-2 permutes.
1966 (vect_permute_store_chain): Likewise.
1967 (vect_grouped_load_supported): Likewise.
1968 (vect_permute_load_chain): Likewise.
1970 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1972 * vec-perm-indices.h (vec_perm_indices_to_tree): Declare.
1973 * vec-perm-indices.c (vec_perm_indices_to_tree): New function.
1974 * tree-ssa-forwprop.c (simplify_vector_constructor): Use it.
1975 * tree-vect-slp.c (vect_transform_slp_perm_load): Likewise.
1976 * tree-vect-stmts.c (vectorizable_bswap): Likewise.
1977 (vect_gen_perm_mask_any): Likewise.
1979 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
1981 * int-vector-builder.h: New file.
1982 * vec-perm-indices.h: Include int-vector-builder.h.
1983 (vec_perm_indices): Redefine as an int_vector_builder.
1984 (auto_vec_perm_indices): Delete.
1985 (vec_perm_builder): Redefine as a stand-alone class.
1986 (vec_perm_indices::vec_perm_indices): New function.
1987 (vec_perm_indices::clamp): Likewise.
1988 * vec-perm-indices.c: Include fold-const.h and tree-vector-builder.h.
1989 (vec_perm_indices::new_vector): New function.
1990 (vec_perm_indices::new_expanded_vector): Update for new
1991 vec_perm_indices class.
1992 (vec_perm_indices::rotate_inputs): New function.
1993 (vec_perm_indices::all_in_range_p): Operate directly on the
1994 encoded form, without computing elided elements.
1995 (tree_to_vec_perm_builder): Operate directly on the VECTOR_CST
1996 encoding. Update for new vec_perm_indices class.
1997 * optabs.c (expand_vec_perm_const): Create a vec_perm_indices for
1998 the given vec_perm_builder.
1999 (expand_vec_perm_var): Update vec_perm_builder constructor.
2000 (expand_mult_highpart): Use vec_perm_builder instead of
2001 auto_vec_perm_indices.
2002 * optabs-query.c (can_mult_highpart_p): Use vec_perm_builder and
2003 vec_perm_indices instead of auto_vec_perm_indices. Use a single
2004 or double series encoding as appropriate.
2005 * fold-const.c (fold_ternary_loc): Use vec_perm_builder and
2006 vec_perm_indices instead of auto_vec_perm_indices.
2007 * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
2008 * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
2009 (vect_permute_store_chain): Likewise.
2010 (vect_grouped_load_supported): Likewise.
2011 (vect_permute_load_chain): Likewise.
2012 (vect_shift_permute_load_chain): Likewise.
2013 * tree-vect-slp.c (vect_build_slp_tree_1): Likewise.
2014 (vect_transform_slp_perm_load): Likewise.
2015 (vect_schedule_slp_instance): Likewise.
2016 * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
2017 (vectorizable_mask_load_store): Likewise.
2018 (vectorizable_bswap): Likewise.
2019 (vectorizable_store): Likewise.
2020 (vectorizable_load): Likewise.
2021 * tree-vect-generic.c (lower_vec_perm): Use vec_perm_builder and
2022 vec_perm_indices instead of auto_vec_perm_indices. Use
2023 tree_to_vec_perm_builder to read the vector from a tree.
2024 * tree-vect-loop.c (calc_vec_perm_mask_for_shift): Take a
2025 vec_perm_builder instead of a vec_perm_indices.
2026 (have_whole_vector_shift): Use vec_perm_builder and
2027 vec_perm_indices instead of auto_vec_perm_indices. Leave the
2028 truncation to calc_vec_perm_mask_for_shift.
2029 (vect_create_epilog_for_reduction): Likewise.
2030 * config/aarch64/aarch64.c (expand_vec_perm_d::perm): Change
2031 from auto_vec_perm_indices to vec_perm_indices.
2032 (aarch64_expand_vec_perm_const_1): Use rotate_inputs on d.perm
2033 instead of changing individual elements.
2034 (aarch64_vectorize_vec_perm_const): Use new_vector to install
2035 the vector in d.perm.
2036 * config/arm/arm.c (expand_vec_perm_d::perm): Change
2037 from auto_vec_perm_indices to vec_perm_indices.
2038 (arm_expand_vec_perm_const_1): Use rotate_inputs on d.perm
2039 instead of changing individual elements.
2040 (arm_vectorize_vec_perm_const): Use new_vector to install
2041 the vector in d.perm.
2042 * config/powerpcspe/powerpcspe.c (rs6000_expand_extract_even):
2043 Update vec_perm_builder constructor.
2044 (rs6000_expand_interleave): Likewise.
2045 * config/rs6000/rs6000.c (rs6000_expand_extract_even): Likewise.
2046 (rs6000_expand_interleave): Likewise.
2048 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
2050 * optabs-query.c (can_vec_perm_var_p): Check whether lowering
2051 to qimode could truncate the indices.
2052 * optabs.c (expand_vec_perm_var): Likewise.
2054 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
2056 * Makefile.in (OBJS): Add vec-perm-indices.o.
2057 * vec-perm-indices.h: New file.
2058 * vec-perm-indices.c: Likewise.
2059 * target.h (vec_perm_indices): Replace with a forward class
2061 (auto_vec_perm_indices): Move to vec-perm-indices.h.
2062 * optabs.h: Include vec-perm-indices.h.
2063 (expand_vec_perm): Delete.
2064 (selector_fits_mode_p, expand_vec_perm_var): Declare.
2065 (expand_vec_perm_const): Declare.
2066 * target.def (vec_perm_const_ok): Replace with...
2067 (vec_perm_const): ...this new hook.
2068 * doc/tm.texi.in (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Replace with...
2069 (TARGET_VECTORIZE_VEC_PERM_CONST): ...this new hook.
2070 * doc/tm.texi: Regenerate.
2071 * optabs.def (vec_perm_const): Delete.
2072 * doc/md.texi (vec_perm_const): Likewise.
2073 (vec_perm): Refer to TARGET_VECTORIZE_VEC_PERM_CONST.
2074 * expr.c (expand_expr_real_2): Use expand_vec_perm_const rather than
2075 expand_vec_perm for constant permutation vectors. Assert that
2076 the mode of variable permutation vectors is the integer equivalent
2077 of the mode that is being permuted.
2078 * optabs-query.h (selector_fits_mode_p): Declare.
2079 * optabs-query.c: Include vec-perm-indices.h.
2080 (selector_fits_mode_p): New function.
2081 (can_vec_perm_const_p): Check whether targetm.vectorize.vec_perm_const
2082 is defined, instead of checking whether the vec_perm_const_optab
2083 exists. Use targetm.vectorize.vec_perm_const instead of
2084 targetm.vectorize.vec_perm_const_ok. Check whether the indices
2085 fit in the vector mode before using a variable permute.
2086 * optabs.c (shift_amt_for_vec_perm_mask): Take a mode and a
2087 vec_perm_indices instead of an rtx.
2088 (expand_vec_perm): Replace with...
2089 (expand_vec_perm_const): ...this new function. Take the selector
2090 as a vec_perm_indices rather than an rtx. Also take the mode of
2091 the selector. Update call to shift_amt_for_vec_perm_mask.
2092 Use targetm.vectorize.vec_perm_const instead of vec_perm_const_optab.
2093 Use vec_perm_indices::new_expanded_vector to expand the original
2094 selector into bytes. Check whether the indices fit in the vector
2095 mode before using a variable permute.
2096 (expand_vec_perm_var): Make global.
2097 (expand_mult_highpart): Use expand_vec_perm_const.
2098 * fold-const.c: Includes vec-perm-indices.h.
2099 * tree-ssa-forwprop.c: Likewise.
2100 * tree-vect-data-refs.c: Likewise.
2101 * tree-vect-generic.c: Likewise.
2102 * tree-vect-loop.c: Likewise.
2103 * tree-vect-slp.c: Likewise.
2104 * tree-vect-stmts.c: Likewise.
2105 * config/aarch64/aarch64-protos.h (aarch64_expand_vec_perm_const):
2107 * config/aarch64/aarch64-simd.md (vec_perm_const<mode>): Delete.
2108 * config/aarch64/aarch64.c (aarch64_expand_vec_perm_const)
2109 (aarch64_vectorize_vec_perm_const_ok): Fuse into...
2110 (aarch64_vectorize_vec_perm_const): ...this new function.
2111 (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
2112 (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
2113 * config/arm/arm-protos.h (arm_expand_vec_perm_const): Delete.
2114 * config/arm/vec-common.md (vec_perm_const<mode>): Delete.
2115 * config/arm/arm.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
2116 (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
2117 (arm_expand_vec_perm_const, arm_vectorize_vec_perm_const_ok): Merge
2119 (arm_vectorize_vec_perm_const): ...this new function. Explicitly
2120 check for NEON modes.
2121 * config/i386/i386-protos.h (ix86_expand_vec_perm_const): Delete.
2122 * config/i386/sse.md (VEC_PERM_CONST, vec_perm_const<mode>): Delete.
2123 * config/i386/i386.c (ix86_expand_vec_perm_const_1): Update comment.
2124 (ix86_expand_vec_perm_const, ix86_vectorize_vec_perm_const_ok): Merge
2126 (ix86_vectorize_vec_perm_const): ...this new function. Incorporate
2127 the old VEC_PERM_CONST conditions.
2128 * config/ia64/ia64-protos.h (ia64_expand_vec_perm_const): Delete.
2129 * config/ia64/vect.md (vec_perm_const<mode>): Delete.
2130 * config/ia64/ia64.c (ia64_expand_vec_perm_const)
2131 (ia64_vectorize_vec_perm_const_ok): Merge into...
2132 (ia64_vectorize_vec_perm_const): ...this new function.
2133 * config/mips/loongson.md (vec_perm_const<mode>): Delete.
2134 * config/mips/mips-msa.md (vec_perm_const<mode>): Delete.
2135 * config/mips/mips-ps-3d.md (vec_perm_constv2sf): Delete.
2136 * config/mips/mips-protos.h (mips_expand_vec_perm_const): Delete.
2137 * config/mips/mips.c (mips_expand_vec_perm_const)
2138 (mips_vectorize_vec_perm_const_ok): Merge into...
2139 (mips_vectorize_vec_perm_const): ...this new function.
2140 * config/powerpcspe/altivec.md (vec_perm_constv16qi): Delete.
2141 * config/powerpcspe/paired.md (vec_perm_constv2sf): Delete.
2142 * config/powerpcspe/spe.md (vec_perm_constv2si): Delete.
2143 * config/powerpcspe/vsx.md (vec_perm_const<mode>): Delete.
2144 * config/powerpcspe/powerpcspe-protos.h (altivec_expand_vec_perm_const)
2145 (rs6000_expand_vec_perm_const): Delete.
2146 * config/powerpcspe/powerpcspe.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK):
2148 (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
2149 (altivec_expand_vec_perm_const_le): Take each operand individually.
2150 Operate on constant selectors rather than rtxes.
2151 (altivec_expand_vec_perm_const): Likewise. Update call to
2152 altivec_expand_vec_perm_const_le.
2153 (rs6000_expand_vec_perm_const): Delete.
2154 (rs6000_vectorize_vec_perm_const_ok): Delete.
2155 (rs6000_vectorize_vec_perm_const): New function.
2156 (rs6000_do_expand_vec_perm): Take a vec_perm_builder instead of
2157 an element count and rtx array.
2158 (rs6000_expand_extract_even): Update call accordingly.
2159 (rs6000_expand_interleave): Likewise.
2160 * config/rs6000/altivec.md (vec_perm_constv16qi): Delete.
2161 * config/rs6000/paired.md (vec_perm_constv2sf): Delete.
2162 * config/rs6000/vsx.md (vec_perm_const<mode>): Delete.
2163 * config/rs6000/rs6000-protos.h (altivec_expand_vec_perm_const)
2164 (rs6000_expand_vec_perm_const): Delete.
2165 * config/rs6000/rs6000.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
2166 (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
2167 (altivec_expand_vec_perm_const_le): Take each operand individually.
2168 Operate on constant selectors rather than rtxes.
2169 (altivec_expand_vec_perm_const): Likewise. Update call to
2170 altivec_expand_vec_perm_const_le.
2171 (rs6000_expand_vec_perm_const): Delete.
2172 (rs6000_vectorize_vec_perm_const_ok): Delete.
2173 (rs6000_vectorize_vec_perm_const): New function. Remove stray
2174 reference to the SPE evmerge intructions.
2175 (rs6000_do_expand_vec_perm): Take a vec_perm_builder instead of
2176 an element count and rtx array.
2177 (rs6000_expand_extract_even): Update call accordingly.
2178 (rs6000_expand_interleave): Likewise.
2179 * config/sparc/sparc.md (vec_perm_constv8qi): Delete in favor of...
2180 * config/sparc/sparc.c (sparc_vectorize_vec_perm_const): ...this
2182 (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
2184 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
2186 * optabs.c (expand_vec_perm_1): Assert that SEL has an integer
2187 vector mode and that that mode matches the mode of the data
2189 (expand_vec_perm): Split handling of non-CONST_VECTOR selectors
2190 out into expand_vec_perm_var. Do all CONST_VECTOR handling here,
2191 directly using expand_vec_perm_1 when forcing selectors into
2193 (expand_vec_perm_var): New function, split out from expand_vec_perm.
2195 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
2197 * optabs-query.h (can_vec_perm_p): Delete.
2198 (can_vec_perm_var_p, can_vec_perm_const_p): Declare.
2199 * optabs-query.c (can_vec_perm_p): Split into...
2200 (can_vec_perm_var_p, can_vec_perm_const_p): ...these two functions.
2201 (can_mult_highpart_p): Use can_vec_perm_const_p to test whether a
2202 particular selector is valid.
2203 * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
2204 * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
2205 (vect_grouped_load_supported): Likewise.
2206 (vect_shift_permute_load_chain): Likewise.
2207 * tree-vect-slp.c (vect_build_slp_tree_1): Likewise.
2208 (vect_transform_slp_perm_load): Likewise.
2209 * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
2210 (vectorizable_bswap): Likewise.
2211 (vect_gen_perm_mask_checked): Likewise.
2212 * fold-const.c (fold_ternary_loc): Likewise. Don't take
2213 implementations of variable permutation vectors into account
2214 when deciding which selector to use.
2215 * tree-vect-loop.c (have_whole_vector_shift): Don't check whether
2216 vec_perm_const_optab is supported; instead use can_vec_perm_const_p
2217 with a false third argument.
2218 * tree-vect-generic.c (lower_vec_perm): Use can_vec_perm_const_p
2219 to test whether the constant selector is valid and can_vec_perm_var_p
2220 to test whether a variable selector is valid.
2222 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
2224 * optabs-query.h (can_vec_perm_p): Take a const vec_perm_indices *.
2225 * optabs-query.c (can_vec_perm_p): Likewise.
2226 * fold-const.c (fold_vec_perm): Take a const vec_perm_indices &
2227 instead of vec_perm_indices.
2228 * tree-vectorizer.h (vect_gen_perm_mask_any): Likewise,
2229 (vect_gen_perm_mask_checked): Likewise,
2230 * tree-vect-stmts.c (vect_gen_perm_mask_any): Likewise,
2231 (vect_gen_perm_mask_checked): Likewise,
2233 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
2235 * optabs-query.h (qimode_for_vec_perm): Declare.
2236 * optabs-query.c (can_vec_perm_p): Split out qimode search to...
2237 (qimode_for_vec_perm): ...this new function.
2238 * optabs.c (expand_vec_perm): Use qimode_for_vec_perm.
2240 2018-01-02 Aaron Sawdey <acsawdey@linux.vnet.ibm.com>
2242 * rtlanal.c (canonicalize_condition): Return 0 if final rtx
2243 does not have a conditional at the top.
2245 2018-01-02 Richard Biener <rguenther@suse.de>
2247 * ipa-inline.c (big_speedup_p): Fix expression.
2249 2018-01-02 Jan Hubicka <hubicka@ucw.cz>
2252 * config/i386/x86-tune-costs.h: Increase cost of integer load costs
2255 2018-01-02 Jan Hubicka <hubicka@ucw.cz>
2259 * x86-tune-costs.h (generic_cost): Reduce cost of FDIV 20->17,
2260 cost of sqrt 20->14, DIVSS 18->13, DIVSD 32->17, SQRtSS 30->14
2261 and SQRTsD 58->18, cond_not_taken_branch_cost. 2->1. Increase
2262 cond_taken_branch_cost 3->4.
2264 2018-01-01 Jakub Jelinek <jakub@redhat.com>
2266 PR tree-optimization/83581
2267 * tree-loop-distribution.c (pass_loop_distribution::execute): Return
2268 TODO_cleanup_cfg if any changes have been made.
2271 * expr.c (store_expr_with_bounds): Use simplify_gen_subreg instead of
2272 convert_modes if target mode has the right side, but different mode
2276 * expr.c (expand_assignment): Fix up a typo in simplify_gen_subreg
2277 last argument when extracting from CONCAT. If either from_real or
2278 from_imag is NULL, use expansion through memory. If result is not
2279 a CONCAT and simplify_gen_subreg fails, try to simplify_gen_subreg
2280 the parts directly to inner mode, if even that fails, use expansion
2284 * expmed.c (expand_shift_1): For 2-byte rotates by BITS_PER_UNIT,
2285 check for bswap in mode rather than HImode and use that in expand_unop
2288 Copyright (C) 2018 Free Software Foundation, Inc.
2290 Copying and distribution of this file, with or without modification,
2291 are permitted in any medium without royalty provided the copyright
2292 notice and this notice are preserved.