[AArch64] Avoid GET_MODE_NUNITS in v8.4 support
[official-gcc.git] / gcc / ChangeLog
blob8654289e58b8072fd003f54e9054f6449bc4c24a
1 2018-01-11  Richard Sandiford  <richard.sandiford@linaro.org>
3         * config/aarch64/aarch64-simd.md
4         (aarch64_fml<f16mac1>l<f16quad>_low<mode>): Avoid GET_MODE_NUNITS.
5         (aarch64_fml<f16mac1>l<f16quad>_high<mode>): Likewise.
6         (aarch64_fml<f16mac1>l_lane_lowv2sf): Likewise.
7         (aarch64_fml<f16mac1>l_lane_highv2sf): Likewise.
8         (aarch64_fml<f16mac1>lq_laneq_lowv4sf): Likewise.
9         (aarch64_fml<f16mac1>lq_laneq_highv4sf): Likewise.
10         (aarch64_fml<f16mac1>l_laneq_lowv2sf): Likewise.
11         (aarch64_fml<f16mac1>l_laneq_highv2sf): Likewise.
12         (aarch64_fml<f16mac1>lq_lane_lowv4sf): Likewise.
13         (aarch64_fml<f16mac1>lq_lane_highv4sf): Likewise.
15 2018-01-11  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
17         PR target/83514
18         * config/arm/arm.c (arm_declare_function_name): Set arch_to_print if
19         targ_options->x_arm_arch_string is non NULL.
21 2018-01-11  Tamar Christina  <tamar.christina@arm.com>
23         * config/aarch64/aarch64.h
24         (AARCH64_FL_FOR_ARCH8_4): Add  AARCH64_FL_DOTPROD.
26 2018-01-11  Sudakshina Das  <sudi.das@arm.com>
28         PR target/82096
29         * expmed.c (emit_store_flag_force): Swap if const op0
30         and change VOIDmode to mode of op0.
32 2018-01-11  Richard Sandiford  <richard.sandiford@linaro.org>
34         PR rtl-optimization/83761
35         * caller-save.c (replace_reg_with_saved_mem): Pass bits rather
36         than bytes to mode_for_size.
38 2018-01-10  Jan Hubicka  <hubicka@ucw.cz>
40         PR middle-end/83189
41         * gfortran.fortran-torture/compile/pr83189.f90: New testcase.
42         * tree-ssa-loop-manip.c (tree_transform_and_unroll_loop): Handle zero
43         profile.
45 2018-01-10  Jan Hubicka  <hubicka@ucw.cz>
47         PR middle-end/83575
48         * cfgrtl.c (rtl_verify_edges): Only verify fixability of partition
49         when in layout mode.
50         (cfg_layout_finalize): Do not verify cfg before we are out of layout.
51         * cfgcleanup.c (try_optimize_cfg): Only verify flow info when doing
52         partition fixup.
54 2018-01-10  Michael Collison  <michael.collison@arm.com>
56         * config/aarch64/aarch64-modes.def (V2HF): New VECTOR_MODE.
57         * config/aarch64/aarch64-option-extension.def: Add
58         AARCH64_OPT_EXTENSION of 'fp16fml'.
59         * config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins):
60         (__ARM_FEATURE_FP16_FML): Define if TARGET_F16FML is true.
61         * config/aarch64/predicates.md (aarch64_lane_imm3): New predicate.
62         * config/aarch64/constraints.md (Ui7): New constraint.
63         * config/aarch64/iterators.md (VFMLA_W): New mode iterator.
64         (VFMLA_SEL_W): Ditto.
65         (f16quad): Ditto.
66         (f16mac1): Ditto.
67         (VFMLA16_LOW): New int iterator.
68         (VFMLA16_HIGH): Ditto.
69         (UNSPEC_FMLAL): New unspec.
70         (UNSPEC_FMLSL): Ditto.
71         (UNSPEC_FMLAL2): Ditto.
72         (UNSPEC_FMLSL2): Ditto.
73         (f16mac): New code attribute.
74         * config/aarch64/aarch64-simd-builtins.def
75         (aarch64_fmlal_lowv2sf): Ditto.
76         (aarch64_fmlsl_lowv2sf): Ditto.
77         (aarch64_fmlalq_lowv4sf): Ditto.
78         (aarch64_fmlslq_lowv4sf): Ditto.
79         (aarch64_fmlal_highv2sf): Ditto.
80         (aarch64_fmlsl_highv2sf): Ditto.
81         (aarch64_fmlalq_highv4sf): Ditto.
82         (aarch64_fmlslq_highv4sf): Ditto.
83         (aarch64_fmlal_lane_lowv2sf): Ditto.
84         (aarch64_fmlsl_lane_lowv2sf): Ditto.
85         (aarch64_fmlal_laneq_lowv2sf): Ditto.
86         (aarch64_fmlsl_laneq_lowv2sf): Ditto.
87         (aarch64_fmlalq_lane_lowv4sf): Ditto.
88         (aarch64_fmlsl_lane_lowv4sf): Ditto.
89         (aarch64_fmlalq_laneq_lowv4sf): Ditto.
90         (aarch64_fmlsl_laneq_lowv4sf): Ditto.
91         (aarch64_fmlal_lane_highv2sf): Ditto.
92         (aarch64_fmlsl_lane_highv2sf): Ditto.
93         (aarch64_fmlal_laneq_highv2sf): Ditto.
94         (aarch64_fmlsl_laneq_highv2sf): Ditto.
95         (aarch64_fmlalq_lane_highv4sf): Ditto.
96         (aarch64_fmlsl_lane_highv4sf): Ditto.
97         (aarch64_fmlalq_laneq_highv4sf): Ditto.
98         (aarch64_fmlsl_laneq_highv4sf): Ditto.
99         * config/aarch64/aarch64-simd.md:
100         (aarch64_fml<f16mac1>l<f16quad>_low<mode>): New pattern.
101         (aarch64_fml<f16mac1>l<f16quad>_high<mode>): Ditto.
102         (aarch64_simd_fml<f16mac1>l<f16quad>_low<mode>): Ditto.
103         (aarch64_simd_fml<f16mac1>l<f16quad>_high<mode>): Ditto.
104         (aarch64_fml<f16mac1>l_lane_lowv2sf): Ditto.
105         (aarch64_fml<f16mac1>l_lane_highv2sf): Ditto.
106         (aarch64_simd_fml<f16mac>l_lane_lowv2sf): Ditto.
107         (aarch64_simd_fml<f16mac>l_lane_highv2sf): Ditto.
108         (aarch64_fml<f16mac1>lq_laneq_lowv4sf): Ditto.
109         (aarch64_fml<f16mac1>lq_laneq_highv4sf): Ditto.
110         (aarch64_simd_fml<f16mac>lq_laneq_lowv4sf): Ditto.
111         (aarch64_simd_fml<f16mac>lq_laneq_highv4sf): Ditto.
112         (aarch64_fml<f16mac1>l_laneq_lowv2sf): Ditto.
113         (aarch64_fml<f16mac1>l_laneq_highv2sf): Ditto.
114         (aarch64_simd_fml<f16mac>l_laneq_lowv2sf): Ditto.
115         (aarch64_simd_fml<f16mac>l_laneq_highv2sf): Ditto.
116         (aarch64_fml<f16mac1>lq_lane_lowv4sf): Ditto.
117         (aarch64_fml<f16mac1>lq_lane_highv4sf): Ditto.
118         (aarch64_simd_fml<f16mac>lq_lane_lowv4sf): Ditto.
119         (aarch64_simd_fml<f16mac>lq_lane_highv4sf): Ditto.
120         * config/aarch64/arm_neon.h (vfmlal_low_u32): New intrinsic.
121         (vfmlsl_low_u32): Ditto.
122         (vfmlalq_low_u32): Ditto.
123         (vfmlslq_low_u32): Ditto.
124         (vfmlal_high_u32): Ditto.
125         (vfmlsl_high_u32): Ditto.
126         (vfmlalq_high_u32): Ditto.
127         (vfmlslq_high_u32): Ditto.
128         (vfmlal_lane_low_u32): Ditto.
129         (vfmlsl_lane_low_u32): Ditto.
130         (vfmlal_laneq_low_u32): Ditto.
131         (vfmlsl_laneq_low_u32): Ditto.
132         (vfmlalq_lane_low_u32): Ditto.
133         (vfmlslq_lane_low_u32): Ditto.
134         (vfmlalq_laneq_low_u32): Ditto.
135         (vfmlslq_laneq_low_u32): Ditto.
136         (vfmlal_lane_high_u32): Ditto.
137         (vfmlsl_lane_high_u32): Ditto.
138         (vfmlal_laneq_high_u32): Ditto.
139         (vfmlsl_laneq_high_u32): Ditto.
140         (vfmlalq_lane_high_u32): Ditto.
141         (vfmlslq_lane_high_u32): Ditto.
142         (vfmlalq_laneq_high_u32): Ditto.
143         (vfmlslq_laneq_high_u32): Ditto.
144         * config/aarch64/aarch64.h (AARCH64_FL_F16SML): New flag.
145         (AARCH64_FL_FOR_ARCH8_4): New.
146         (AARCH64_ISA_F16FML): New ISA flag.
147         (TARGET_F16FML): New feature flag for fp16fml.
148         (doc/invoke.texi): Document new fp16fml option.
150 2018-01-10  Michael Collison  <michael.collison@arm.com>
152         * config/aarch64/aarch64-builtins.c:
153         (aarch64_types_ternopu_imm_qualifiers, TYPES_TERNOPUI): New.
154         * config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins):
155         (__ARM_FEATURE_SHA3): Define if TARGET_SHA3 is true.
156         * config/aarch64/aarch64.h (AARCH64_FL_SHA3): New flags.
157         (AARCH64_ISA_SHA3): New ISA flag.
158         (TARGET_SHA3): New feature flag for sha3.
159         * config/aarch64/iterators.md (sha512_op): New int attribute.
160         (CRYPTO_SHA512): New int iterator.
161         (UNSPEC_SHA512H): New unspec.
162         (UNSPEC_SHA512H2): Ditto.
163         (UNSPEC_SHA512SU0): Ditto.
164         (UNSPEC_SHA512SU1): Ditto.
165         * config/aarch64/aarch64-simd-builtins.def
166         (aarch64_crypto_sha512hqv2di): New builtin.
167         (aarch64_crypto_sha512h2qv2di): Ditto.
168         (aarch64_crypto_sha512su0qv2di): Ditto.
169         (aarch64_crypto_sha512su1qv2di): Ditto.
170         (aarch64_eor3qv8hi): Ditto.
171         (aarch64_rax1qv2di): Ditto.
172         (aarch64_xarqv2di): Ditto.
173         (aarch64_bcaxqv8hi): Ditto.
174         * config/aarch64/aarch64-simd.md:
175         (aarch64_crypto_sha512h<sha512_op>qv2di): New pattern.
176         (aarch64_crypto_sha512su0qv2di): Ditto.
177         (aarch64_crypto_sha512su1qv2di): Ditto.
178         (aarch64_eor3qv8hi): Ditto.
179         (aarch64_rax1qv2di): Ditto.
180         (aarch64_xarqv2di): Ditto.
181         (aarch64_bcaxqv8hi): Ditto.
182         * config/aarch64/arm_neon.h (vsha512hq_u64): New intrinsic.
183         (vsha512h2q_u64): Ditto.
184         (vsha512su0q_u64): Ditto.
185         (vsha512su1q_u64): Ditto.
186         (veor3q_u16): Ditto.
187         (vrax1q_u64): Ditto.
188         (vxarq_u64): Ditto.
189         (vbcaxq_u16): Ditto.
190         * config/arm/types.md (crypto_sha512): New type attribute.
191         (crypto_sha3): Ditto.
192         (doc/invoke.texi): Document new sha3 option.
194 2018-01-10  Michael Collison  <michael.collison@arm.com>
196         * config/aarch64/aarch64-builtins.c:
197         (aarch64_types_quadopu_imm_qualifiers, TYPES_QUADOPUI): New.
198         * config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins):
199         (__ARM_FEATURE_SM3): Define if TARGET_SM4 is true.
200         (__ARM_FEATURE_SM4): Define if TARGET_SM4 is true.
201         * config/aarch64/aarch64.h (AARCH64_FL_SM4): New flags.
202         (AARCH64_ISA_SM4): New ISA flag.
203         (TARGET_SM4): New feature flag for sm4.
204         * config/aarch64/aarch64-simd-builtins.def
205         (aarch64_sm3ss1qv4si): Ditto.
206         (aarch64_sm3tt1aq4si): Ditto.
207         (aarch64_sm3tt1bq4si): Ditto.
208         (aarch64_sm3tt2aq4si): Ditto.
209         (aarch64_sm3tt2bq4si): Ditto.
210         (aarch64_sm3partw1qv4si): Ditto.
211         (aarch64_sm3partw2qv4si): Ditto.
212         (aarch64_sm4eqv4si): Ditto.
213         (aarch64_sm4ekeyqv4si): Ditto.
214         * config/aarch64/aarch64-simd.md:
215         (aarch64_sm3ss1qv4si): Ditto.
216         (aarch64_sm3tt<sm3tt_op>qv4si): Ditto.
217         (aarch64_sm3partw<sm3part_op>qv4si): Ditto.
218         (aarch64_sm4eqv4si): Ditto.
219         (aarch64_sm4ekeyqv4si): Ditto.
220         * config/aarch64/iterators.md (sm3tt_op): New int iterator.
221         (sm3part_op): Ditto.
222         (CRYPTO_SM3TT): Ditto.
223         (CRYPTO_SM3PART): Ditto.
224         (UNSPEC_SM3SS1): New unspec.
225         (UNSPEC_SM3TT1A): Ditto.
226         (UNSPEC_SM3TT1B): Ditto.
227         (UNSPEC_SM3TT2A): Ditto.
228         (UNSPEC_SM3TT2B): Ditto.
229         (UNSPEC_SM3PARTW1): Ditto.
230         (UNSPEC_SM3PARTW2): Ditto.
231         (UNSPEC_SM4E): Ditto.
232         (UNSPEC_SM4EKEY): Ditto.
233         * config/aarch64/constraints.md (Ui2): New constraint.
234         * config/aarch64/predicates.md (aarch64_imm2): New predicate.
235         * config/arm/types.md (crypto_sm3): New type attribute.
236         (crypto_sm4): Ditto.
237         * config/aarch64/arm_neon.h (vsm3ss1q_u32): New intrinsic.
238         (vsm3tt1aq_u32): Ditto.
239         (vsm3tt1bq_u32): Ditto.
240         (vsm3tt2aq_u32): Ditto.
241         (vsm3tt2bq_u32): Ditto.
242         (vsm3partw1q_u32): Ditto.
243         (vsm3partw2q_u32): Ditto.
244         (vsm4eq_u32): Ditto.
245         (vsm4ekeyq_u32): Ditto.
246         (doc/invoke.texi): Document new sm4 option.
248 2018-01-10  Michael Collison  <michael.collison@arm.com>
250         * config/aarch64/aarch64-arches.def (armv8.4-a): New architecture.
251         * config/aarch64/aarch64.h (AARCH64_ISA_V8_4): New ISA flag.
252         (AARCH64_FL_FOR_ARCH8_4): New.
253         (AARCH64_FL_V8_4): New flag.
254         (doc/invoke.texi): Document new armv8.4-a option.
256 2018-01-10  Michael Collison  <michael.collison@arm.com>
258         * config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins):
259         (__ARM_FEATURE_AES): Define if TARGET_AES is true.
260         (__ARM_FEATURE_SHA2): Define if TARGET_SHA2 is true.
261         * config/aarch64/aarch64-option-extension.def: Add
262         AARCH64_OPT_EXTENSION of 'sha2'.
263         (aes): Add AARCH64_OPT_EXTENSION of 'aes'.
264         (crypto): Disable sha2 and aes if crypto disabled.
265         (crypto): Enable aes and sha2 if enabled.
266         (simd): Disable sha2 and aes if simd disabled.
267         * config/aarch64/aarch64.h (AARCH64_FL_AES, AARCH64_FL_SHA2):
268         New flags.
269         (AARCH64_ISA_AES, AARCH64_ISA_SHA2): New ISA flags.
270         (TARGET_SHA2): New feature flag for sha2.
271         (TARGET_AES): New feature flag for aes.
272         * config/aarch64/aarch64-simd.md:
273         (aarch64_crypto_aes<aes_op>v16qi): Make pattern
274         conditional on TARGET_AES.
275         (aarch64_crypto_aes<aesmc_op>v16qi): Ditto.
276         (aarch64_crypto_sha1hsi): Make pattern conditional
277         on TARGET_SHA2.
278         (aarch64_crypto_sha1hv4si): Ditto.
279         (aarch64_be_crypto_sha1hv4si): Ditto.
280         (aarch64_crypto_sha1su1v4si): Ditto.
281         (aarch64_crypto_sha1<sha1_op>v4si): Ditto.
282         (aarch64_crypto_sha1su0v4si): Ditto.
283         (aarch64_crypto_sha256h<sha256_op>v4si): Ditto.
284         (aarch64_crypto_sha256su0v4si): Ditto.
285         (aarch64_crypto_sha256su1v4si): Ditto.
286         (doc/invoke.texi): Document new aes and sha2 options.
288 2018-01-10  Martin Sebor  <msebor@redhat.com>
290         PR tree-optimization/83781
291         * gimple-fold.c (get_range_strlen): Avoid treating arrays of pointers
292         as string arrays.
294 2018-01-11  Martin Sebor  <msebor@gmail.com>
295             Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
297         PR tree-optimization/83501
298         PR tree-optimization/81703
300         * tree-ssa-strlen.c (get_string_cst): Rename...
301         (get_string_len): ...to this.  Handle global constants.
302         (handle_char_store): Adjust.
304 2018-01-10  Kito Cheng  <kito.cheng@gmail.com>
305             Jim Wilson  <jimw@sifive.com>
307         * config/riscv/riscv-protos.h (riscv_output_return): New.
308         * config/riscv/riscv.c (struct machine_function): New naked_p field.
309         (riscv_attribute_table, riscv_output_return),
310         (riscv_handle_fndecl_attribute, riscv_naked_function_p),
311         (riscv_allocate_stack_slots_for_args, riscv_warn_func_return): New.
312         (riscv_compute_frame_info): Only compute frame->mask if not a naked
313         function.
314         (riscv_expand_prologue): Add early return for naked function.
315         (riscv_expand_epilogue): Likewise.
316         (riscv_function_ok_for_sibcall): Return false for naked function.
317         (riscv_set_current_function): New.
318         (TARGET_SET_CURRENT_FUNCTION, TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS),
319         (TARGET_ATTRIBUTE_TABLE, TARGET_WARN_FUNC_RETURN): New.
320         * config/riscv/riscv.md (simple_return): Call riscv_output_return.
321         * doc/extend.texi (RISC-V Function Attributes): New.
323 2018-01-10  Michael Meissner  <meissner@linux.vnet.ibm.com>
325         * config/rs6000/rs6000.c (is_complex_IBM_long_double): Explicitly
326         check for 128-bit long double before checking TCmode.
327         * config/rs6000/rs6000.h (FLOAT128_IEEE_P): Explicitly check for
328         128-bit long doubles before checking TFmode or TCmode.
329         (FLOAT128_IBM_P): Likewise.
331 2018-01-10  Martin Sebor  <msebor@redhat.com>
333         PR tree-optimization/83671
334         * builtins.c (c_strlen): Unconditionally return zero for the empty
335         string.
336         Use -Warray-bounds for warnings.
337         * gimple-fold.c (get_range_strlen): Handle non-constant lengths
338         for non-constant array indices with COMPONENT_REF, arrays of
339         arrays, and pointers to arrays.
340         (gimple_fold_builtin_strlen): Determine and set length range for
341         non-constant character arrays.
343 2018-01-10  Aldy Hernandez  <aldyh@redhat.com>
345         PR middle-end/81897
346         * tree-ssa-uninit.c (convert_control_dep_chain_into_preds): Skip
347         empty blocks.
349 2018-01-10  Eric Botcazou  <ebotcazou@adacore.com>
351         * dwarf2out.c (dwarf2out_var_location): Do not pass NULL to fprintf.
353 2018-01-10  Peter Bergner  <bergner@vnet.ibm.com>
355         PR target/83399
356         * config/rs6000/rs6000.c (print_operand) <'y'>: Use
357         VECTOR_MEM_ALTIVEC_OR_VSX_P.
358         * config/rs6000/vsx.md (*vsx_le_perm_load_<mode> for VSX_D): Use
359         indexed_or_indirect_operand predicate.
360         (*vsx_le_perm_load_<mode> for VSX_W): Likewise.
361         (*vsx_le_perm_load_v8hi): Likewise.
362         (*vsx_le_perm_load_v16qi): Likewise.
363         (*vsx_le_perm_store_<mode> for VSX_D): Likewise.
364         (*vsx_le_perm_store_<mode> for VSX_W): Likewise.
365         (*vsx_le_perm_store_v8hi): Likewise.
366         (*vsx_le_perm_store_v16qi): Likewise.
367         (eight unnamed splitters): Likewise.
369 2018-01-10  Peter Bergner  <bergner@vnet.ibm.com>
371         * config/rs6000/x86intrin.h: Change #warning to #error. Update message.
372         * config/rs6000/emmintrin.h: Likewise.
373         * config/rs6000/mmintrin.h: Likewise.
374         * config/rs6000/xmmintrin.h: Likewise.
376 2018-01-10  David Malcolm  <dmalcolm@redhat.com>
378         PR c++/43486
379         * tree-core.h: Document EXPR_LOCATION_WRAPPER_P's usage of
380         "public_flag".
381         * tree.c (tree_nop_conversion): Return true for location wrapper
382         nodes.
383         (maybe_wrap_with_location): New function.
384         (selftest::check_strip_nops): New function.
385         (selftest::test_location_wrappers): New function.
386         (selftest::tree_c_tests): Call it.
387         * tree.h (STRIP_ANY_LOCATION_WRAPPER): New macro.
388         (maybe_wrap_with_location): New decl.
389         (EXPR_LOCATION_WRAPPER_P): New macro.
390         (location_wrapper_p): New inline function.
391         (tree_strip_any_location_wrapper): New inline function.
393 2018-01-10  H.J. Lu  <hongjiu.lu@intel.com>
395         PR target/83735
396         * config/i386/i386.c (ix86_compute_frame_layout): Always adjust
397         stack_realign_offset for the largest alignment of stack slot
398         actually used.
399         (ix86_find_max_used_stack_alignment): New function.
400         (ix86_finalize_stack_frame_flags): Use it.  Set
401         max_used_stack_alignment if we don't realign stack.
402         * config/i386/i386.h (machine_function): Add
403         max_used_stack_alignment.
405 2018-01-10  Christophe Lyon  <christophe.lyon@linaro.org>
407         * config/arm/arm.opt (-mbranch-cost): New option.
408         * config/arm/arm.h (BRANCH_COST): Take arm_branch_cost into
409         account.
411 2018-01-10  Segher Boessenkool  <segher@kernel.crashing.org>
413         PR target/83629
414         * config/rs6000/rs6000.md (load_toc_v4_PIC_2, load_toc_v4_PIC_3b,
415         load_toc_v4_PIC_3c): Wrap const term in CONST RTL.
417 2018-01-10  Richard Biener  <rguenther@suse.de>
419         PR debug/83765
420         * dwarf2out.c (gen_subprogram_die): Hoist old_die && declaration
421         early out so it also covers the case where we have a non-NULL
422         origin.
424 2018-01-10  Richard Sandiford  <richard.sandiford@linaro.org>
426         PR tree-optimization/83753
427         * tree-vect-stmts.c (get_group_load_store_type): Use VMAT_CONTIGUOUS
428         for non-strided grouped accesses if the number of elements is 1.
430 2018-01-10  Jan Hubicka  <hubicka@ucw.cz>
432         PR target/81616
433         * i386.c (ix86_vectorize_builtin_gather): Check TARGET_USE_GATHER.
434         * i386.h (TARGET_USE_GATHER): Define.
435         * x86-tune.def (X86_TUNE_USE_GATHER): New.
437 2018-01-10  Martin Liska  <mliska@suse.cz>
439         PR bootstrap/82831
440         * basic-block.h (CLEANUP_NO_PARTITIONING): New define.
441         * bb-reorder.c (pass_reorder_blocks::execute): Do not clean up
442         partitioning.
443         * cfgcleanup.c (try_optimize_cfg): Fix up partitioning if
444         CLEANUP_NO_PARTITIONING is not set.
446 2018-01-10  Richard Sandiford  <richard.sandiford@linaro.org>
448         * doc/rtl.texi: Remove documentation of (const ...) wrappers
449         for vectors, as a partial revert of r254296.
450         * rtl.h (const_vec_p): Delete.
451         (const_vec_duplicate_p): Don't test for vector CONSTs.
452         (unwrap_const_vec_duplicate, const_vec_series_p): Likewise.
453         * expmed.c (make_tree): Likewise.
455         Revert:
456         * common.md (E, F): Use CONSTANT_P instead of checking for
457         CONST_VECTOR.
458         * emit-rtl.c (gen_lowpart_common): Use const_vec_p instead of
459         checking for CONST_VECTOR.
461 2018-01-09  Jan Hubicka  <hubicka@ucw.cz>
463         PR middle-end/83575
464         * predict.c (force_edge_cold): Handle in more sane way edges
465         with no prediction.
467 2018-01-09  Carl Love  <cel@us.ibm.com>
469         * config/rs6002/altivec.md (p8_vmrgow): Add support for V2DI, V2DF,
470         V4SI, V4SF types.
471         (p8_vmrgew): Add support for V2DI, V2DF, V4SF types.
472         * config/rs6000/rs6000-builtin.def: Add definitions for FLOAT2_V2DF,
473         VMRGEW_V2DI, VMRGEW_V2DF, VMRGEW_V4SF, VMRGOW_V4SI, VMRGOW_V4SF,
474         VMRGOW_V2DI, VMRGOW_V2DF.  Remove definition for VMRGOW.
475         * config/rs6000/rs6000-c.c (VSX_BUILTIN_VEC_FLOAT2,
476         P8V_BUILTIN_VEC_VMRGEW, P8V_BUILTIN_VEC_VMRGOW):  Add definitions.
477         * config/rs6000/rs6000-protos.h: Add extern defition for
478         rs6000_generate_float2_double_code.
479         * config/rs6000/rs6000.c (rs6000_generate_float2_double_code): Add
480         function.
481         * config/rs6000/vsx.md (vsx_xvcdpsp): Add define_insn.
482         (float2_v2df): Add define_expand.
484 2018-01-09  Uros Bizjak  <ubizjak@gmail.com>
486         PR target/83628
487         * combine.c (force_int_to_mode) <case ASHIFT>: Use mode instead of
488         op_mode in the force_to_mode call.
490 2018-01-09  Richard Sandiford  <richard.sandiford@linaro.org>
492         * config/aarch64/aarch64.c (aarch64_evpc_trn): Use d.perm.series_p
493         instead of checking each element individually.
494         (aarch64_evpc_uzp): Likewise.
495         (aarch64_evpc_zip): Likewise.
496         (aarch64_evpc_ext): Likewise.
497         (aarch64_evpc_rev): Likewise.
498         (aarch64_evpc_dup): Test the encoding for a single duplicated element,
499         instead of checking each element individually.  Return true without
500         generating rtl if
501         (aarch64_vectorize_vec_perm_const): Use all_from_input_p to test
502         whether all selected elements come from the same input, instead of
503         checking each element individually.  Remove calls to gen_rtx_REG,
504         start_sequence and end_sequence and instead assert that no rtl is
505         generated.
507 2018-01-09  Richard Sandiford  <richard.sandiford@linaro.org>
509         * config/aarch64/aarch64.c (aarch64_legitimate_constant_p): Fix
510         order of HIGH and CONST checks.
512 2018-01-09  Richard Sandiford  <richard.sandiford@linaro.org>
514         * tree-vect-stmts.c (permute_vec_elements): Create a fresh variable
515         if the destination isn't an SSA_NAME.
517 2018-01-09  Richard Biener  <rguenther@suse.de>
519         PR tree-optimization/83668
520         * graphite.c (canonicalize_loop_closed_ssa): Add edge argument,
521         move prologue...
522         (canonicalize_loop_form): ... here, renamed from ...
523         (canonicalize_loop_closed_ssa_form): ... this and amended to
524         swap successor edges for loop exit blocks to make us use
525         the RPO order we need for initial schedule generation.
527 2018-01-09  Joseph Myers  <joseph@codesourcery.com>
529         PR tree-optimization/64811
530         * match.pd: When optimizing comparisons with Inf, avoid
531         introducing or losing exceptions from comparisons with NaN.
533 2018-01-09  Martin Liska  <mliska@suse.cz>
535         PR sanitizer/82517
536         * asan.c (shadow_mem_size): Add gcc_assert.
538 2018-01-09  Georg-Johann Lay  <avr@gjlay.de>
540         Don't save registers in main().
542         PR target/83738
543         * doc/invoke.texi (AVR Options) [-mmain-is-OS_task]: Document it.
544         * config/avr/avr.opt (-mmain-is-OS_task): New target option.
545         * config/avr/avr.c (avr_set_current_function): Don't error if
546         naked, OS_task or OS_main are specified at the same time.
547         (avr_function_ok_for_sibcall): Don't disable sibcalls for OS_task,
548         OS_main.
549         (avr_insert_attributes) [-mmain-is-OS_task] <main>: Add OS_task
550         attribute.
551         * common/config/avr/avr-common.c (avr_option_optimization_table):
552         Switch on -mmain-is-OS_task for optimizing compilations.
554 2018-01-09  Richard Biener  <rguenther@suse.de>
556         PR tree-optimization/83572
557         * graphite.c: Include cfganal.h.
558         (graphite_transform_loops): Connect infinite loops to exit
559         and remove fake edges at the end.
561 2018-01-09  Jan Hubicka  <hubicka@ucw.cz>
563         * ipa-inline.c (edge_badness): Revert accidental checkin.
565 2018-01-09  Jan Hubicka  <hubicka@ucw.cz>
567         PR ipa/80763
568         * ipa-comdats.c (set_comdat_group): Only set comdat group of real
569         symbols; not inline clones.
571 2018-01-09  Jakub Jelinek  <jakub@redhat.com>
573         PR target/83507
574         * modulo-sched.c (schedule_reg_moves): Punt if we'd need to move
575         hard registers.  Formatting fixes.
577         PR preprocessor/83722
578         * gcc.c (try_generate_repro): Pass
579         &temp_stderr_files[RETRY_ICE_ATTEMPTS - 1] rather than
580         &temp_stdout_files[RETRY_ICE_ATTEMPTS - 1] as last argument to
581         do_report_bug.
583 2018-01-08  Monk Chiang  <sh.chiang04@gmail.com>
584             Kito Cheng  <kito.cheng@gmail.com>
586         * config/riscv/riscv.c (machine_function::is_leaf): Remove field.
587         (riscv_leaf_function_p): Delete.
588         (riscv_function_ok_for_sibcall): Return false when TARGET_SAVE_RESTORE.
590 2018-01-08  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>
592         * config/rs6000/rs6000-string.c (do_load_for_compare_from_addr): New
593         function.
594         (do_ifelse): New function.
595         (do_isel): New function.
596         (do_sub3): New function.
597         (do_add3): New function.
598         (do_load_mask_compare): New function.
599         (do_overlap_load_compare): New function.
600         (expand_compare_loop): New function.
601         (expand_block_compare): Call expand_compare_loop() when appropriate.
602         * config/rs6000/rs6000.opt (-mblock-compare-inline-limit): Change
603         option description.
604         (-mblock-compare-inline-loop-limit): New option.
606 2018-01-08  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
608         PR target/83677
609         * config/rs6000/altivec.md (*altivec_vpermr_<mode>_internal):
610         Reverse order of second and third operands in first alternative.
611         * config/rs6000/rs6000.c (rs6000_expand_vector_set): Reverse order
612         of first and second elements in UNSPEC_VPERMR vector.
613         (altivec_expand_vec_perm_le): Likewise.
615 2017-01-08  Jeff Law  <law@redhat.com>
617         PR rtl-optimizatin/81308
618         * tree-switch-conversion.c (cfg_altered): New file scoped static.
619         (process_switch): If group_case_labels makes a change, then set
620         cfg_altered.
621         (pass_convert_switch::execute): If a switch is converted, then
622         set cfg_altered.  Return TODO_cfg_cleanup if cfg_altered is true.
624         PR rtl-optimization/81308
625         * recog.c (split_all_insns): Conditionally cleanup the CFG after
626         splitting insns.
628 2018-01-08  Vidya Praveen  <vidyapraveen@arm.com>
630         PR target/83663 - Revert r255946
631         * config/aarch64/aarch64.c (aarch64_expand_vector_init): Modify code
632         generation for cases where splatting a value is not useful.
633         * simplify-rtx.c (simplify_ternary_operation): Simplify vec_merge
634         across a vec_duplicate and a paradoxical subreg forming a vector
635         mode to a vec_concat.
637 2018-01-08  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
639         * config/arm/t-aprofile (MULTILIB_MATCHES): Add mapping rules for
640         -march=armv8.3-a variants.
641         * config/arm/t-multilib: Likewise.
642         * config/arm/t-arm-elf: Likewise.  Handle dotprod extension.
644 2018-01-08  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>
646         * config/rs6000/rs6000.md (cceq_ior_compare): Remove * so I can use it
647         to generate rtl.
648         (cceq_ior_compare_complement): Give it a name so I can use it, and
649         change boolean_or_operator predicate to boolean_operator so it can
650         be used to generate a crand.
651         (eqne): New code iterator.
652         (bd/bd_neg): New code_attrs.
653         (<bd>_<mode>): New name for ctr<mode>_internal[12] now combined into
654         a single define_insn.
655         (<bd>tf_<mode>): A new insn pattern for the conditional form branch
656         decrement (bdnzt/bdnzf/bdzt/bdzf).
657         * config/rs6000/rs6000.c (rs6000_legitimate_combined_insn): Updated
658         with the new names of the branch decrement patterns, and added the
659         names of the branch decrement conditional patterns.
661 2018-01-08  Richard Biener  <rguenther@suse.de>
663         PR tree-optimization/83563
664         * graphite.c (canonicalize_loop_closed_ssa_form): Reset the SCEV
665         cache.
667 2018-01-08  Richard Biener  <rguenther@suse.de>
669         PR middle-end/83713
670         * convert.c (do_narrow): Properly guard TYPE_OVERFLOW_WRAPS checks.
672 2018-01-08  Richard Biener  <rguenther@suse.de>
674         PR tree-optimization/83685
675         * tree-ssa-pre.c (create_expression_by_pieces): Do not insert
676         references to abnormals.
678 2018-01-08  Richard Biener  <rguenther@suse.de>
680         PR lto/83719
681         * dwarf2out.c (output_indirect_strings): Handle empty
682         skeleton_debug_str_hash.
683         (dwarf2out_early_finish): Index strings for -gsplit-dwarf.
685 2018-01-08  Claudiu Zissulescu  <claziss@synopsys.com>
687         * config/arc/arc.c (TARGET_TRAMPOLINE_ADJUST_ADDRESS): Delete.
688         (emit_store_direct): Likewise.
689         (arc_trampoline_adjust_address): Likewise.
690         (arc_asm_trampoline_template): New function.
691         (arc_initialize_trampoline): Use asm_trampoline_template.
692         (TARGET_ASM_TRAMPOLINE_TEMPLATE): Define.
693         * config/arc/arc.h (TRAMPOLINE_SIZE): Adjust to 16.
694         * config/arc/arc.md (flush_icache): Delete pattern.
696 2018-01-08  Claudiu Zissulescu  <claziss@synopsys.com>
698         * config/arc/arc-c.def (__ARC_UNALIGNED__): New define.
699         * config/arc/arc.h (STRICT_ALIGNMENT): Control this macro using
700         munaligned-access.
702 2018-01-08  Sebastian Huber  <sebastian.huber@embedded-brains.de>
704         PR target/83681
705         * config/epiphany/epiphany.h (make_pass_mode_switch_use): Guard
706         by not USED_FOR_TARGET.
707         (make_pass_resolve_sw_modes): Likewise.
709 2018-01-08  Sebastian Huber  <sebastian.huber@embedded-brains.de>
711         * config/nios2/nios2.h (nios2_section_threshold): Guard by not
712         USED_FOR_TARGET.
714 2018-01-08  Richard Biener  <rguenther@suse.de>
716         PR middle-end/83580
717         * tree-data-ref.c (split_constant_offset): Remove STRIP_NOPS.
719 2018-01-08  Richard Biener  <rguenther@suse.de>
721         PR middle-end/83517
722         * match.pd ((t * 2) / 2) -> t): Add missing :c.
724 2018-01-06  Aldy Hernandez  <aldyh@redhat.com>
726         PR middle-end/81897
727         * tree-ssa-uninit.c (compute_control_dep_chain): Do not bail on
728         basic blocks with a small number of successors.
729         (convert_control_dep_chain_into_preds): Improve handling of
730         forwarder blocks.
731         (dump_predicates): Split apart into...
732         (dump_pred_chain): ...here...
733         (dump_pred_info): ...and here.
734         (can_one_predicate_be_invalidated_p): Add debugging printfs.
735         (can_chain_union_be_invalidated_p): Improve check for invalidation
736         of paths.
737         (uninit_uses_cannot_happen): Avoid unnecessary if
738         convert_control_dep_chain_into_preds yielded nothing.
740 2018-01-06  Martin Sebor  <msebor@redhat.com>
742         PR tree-optimization/83640
743         * gimple-ssa-warn-restrict.c (builtin_access::builtin_access): Avoid
744         subtracting negative offset from size.
745         (builtin_access::overlap): Adjust offset bounds of the access to fall
746         within the size of the object if possible.
748 2018-01-06  Richard Sandiford  <richard.sandiford@linaro.org>
750         PR rtl-optimization/83699
751         * expmed.c (extract_bit_field_1): Restrict the vector usage of
752         extract_bit_field_as_subreg to cases in which the extracted
753         value is also a vector.
755         * lra-constraints.c (process_alt_operands): Test for the equivalence
756         substitutions when detecting a possible reload cycle.
758 2018-01-06  Jakub Jelinek  <jakub@redhat.com>
760         PR debug/83480
761         * toplev.c (process_options): Don't enable debug_nonbind_markers_p
762         by default if flag_selective_schedling{,2}.  Formatting fixes.
764         PR rtl-optimization/83682
765         * rtl.h (const_vec_duplicate_p): Only return true for VEC_DUPLICATE
766         if it has non-VECTOR_MODE element mode.
767         (vec_duplicate_p): Likewise.
769         PR middle-end/83694
770         * cfgexpand.c (expand_debug_expr): Punt if mode1 is VOIDmode
771         and bitsize might be greater than MAX_BITSIZE_MODE_ANY_INT.
773 2018-01-05  Jakub Jelinek  <jakub@redhat.com>
775         PR target/83604
776         * config/i386/i386-builtin.def
777         (__builtin_ia32_vgf2p8affineinvqb_v64qi,
778         __builtin_ia32_vgf2p8affineqb_v64qi, __builtin_ia32_vgf2p8mulb_v64qi):
779         Require also OPTION_MASK_ISA_AVX512F in addition to
780         OPTION_MASK_ISA_GFNI.
781         (__builtin_ia32_vgf2p8affineinvqb_v16qi_mask,
782         __builtin_ia32_vgf2p8affineqb_v16qi_mask): Require
783         OPTION_MASK_ISA_AVX512VL instead of OPTION_MASK_ISA_SSE in addition
784         to OPTION_MASK_ISA_GFNI.
785         (__builtin_ia32_vgf2p8mulb_v32qi_mask): Require
786         OPTION_MASK_ISA_AVX512VL in addition to OPTION_MASK_ISA_GFNI and
787         OPTION_MASK_ISA_AVX512BW.
788         (__builtin_ia32_vgf2p8mulb_v16qi_mask): Require
789         OPTION_MASK_ISA_AVX512VL instead of OPTION_MASK_ISA_AVX512BW in
790         addition to OPTION_MASK_ISA_GFNI.
791         (__builtin_ia32_vgf2p8affineinvqb_v16qi,
792         __builtin_ia32_vgf2p8affineqb_v16qi, __builtin_ia32_vgf2p8mulb_v16qi):
793         Require OPTION_MASK_ISA_SSE2 instead of OPTION_MASK_ISA_SSE in addition
794         to OPTION_MASK_ISA_GFNI.
795         * config/i386/i386.c (def_builtin): Change to builtin isa/isa2 being
796         a requirement for all ISAs rather than any of them with a few
797         exceptions.
798         (ix86_add_new_builtins): Clear OPTION_MASK_ISA_64BIT from isa before
799         processing.
800         (ix86_expand_builtin): Require all ISAs from builtin's isa and isa2
801         bitmasks to be enabled with 3 exceptions, instead of requiring any
802         enabled ISA with lots of exceptions.
803         * config/i386/sse.md (vgf2p8affineinvqb_<mode><mask_name>,
804         vgf2p8affineqb_<mode><mask_name>, vgf2p8mulb_<mode><mask_name>):
805         Change avx512bw in isa attribute to avx512f.
806         * config/i386/sgxintrin.h: Add license boilerplate.
807         * config/i386/vaesintrin.h: Likewise.  Fix macro spelling __AVX512F
808         to __AVX512F__ and __AVX512VL to __AVX512VL__.
809         (_mm256_aesdec_epi128, _mm256_aesdeclast_epi128, _mm256_aesenc_epi128,
810         _mm256_aesenclast_epi128): Enable temporarily avx if __AVX__ is not
811         defined.
812         * config/i386/gfniintrin.h (_mm_gf2p8mul_epi8,
813         _mm_gf2p8affineinv_epi64_epi8, _mm_gf2p8affine_epi64_epi8): Enable
814         temporarily sse2 rather than sse if not enabled already.
816         PR target/83604
817         * config/i386/sse.md (VI248_VLBW): Rename to ...
818         (VI248_AVX512VL): ... this.  Don't guard V32HI with TARGET_AVX512BW.
819         (vpshrd_<mode><mask_name>, vpshld_<mode><mask_name>,
820         vpshrdv_<mode>, vpshrdv_<mode>_mask, vpshrdv_<mode>_maskz,
821         vpshrdv_<mode>_maskz_1, vpshldv_<mode>, vpshldv_<mode>_mask,
822         vpshldv_<mode>_maskz, vpshldv_<mode>_maskz_1): Use VI248_AVX512VL
823         mode iterator instead of VI248_VLBW.
825 2018-01-05  Jan Hubicka  <hubicka@ucw.cz>
827         * ipa-fnsummary.c (record_modified_bb_info): Add OP.
828         (record_modified): Skip clobbers; add debug output.
829         (param_change_prob): Use sreal frequencies.
831 2018-01-05  Richard Sandiford  <richard.sandiford@linaro.org>
833         * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Don't
834         punt for user-aligned variables.
836 2018-01-05  Richard Sandiford  <richard.sandiford@linaro.org>
838         * tree-chrec.c (chrec_contains_symbols): Return true for
839         POLY_INT_CST.
841 2018-01-05  Sudakshina Das  <sudi.das@arm.com>
843         PR target/82439
844         * simplify-rtx.c (simplify_relational_operation_1): Add simplifications
845         of (x|y) == x for BICS pattern.
847 2018-01-05  Jakub Jelinek  <jakub@redhat.com>
849         PR tree-optimization/83605
850         * gimple-ssa-strength-reduction.c: Include tree-eh.h.
851         (find_candidates_dom_walker::before_dom_children): Ignore stmts that
852         can throw.
854 2018-01-05  Sebastian Huber  <sebastian.huber@embedded-brains.de>
856         * config.gcc (epiphany-*-elf*): Add (epiphany-*-rtems*) configuration.
857         * config/epiphany/rtems.h: New file.
859 2018-01-04  Jakub Jelinek  <jakub@redhat.com>
860             Uros Bizjak  <ubizjak@gmail.com>
862         PR target/83554
863         * config/i386/i386.md (*<rotate_insn>hi3_1 splitter): Use
864         QIreg_operand instead of register_operand predicate.
865         * config/i386/i386.c (ix86_rop_should_change_byte_p,
866         set_rop_modrm_reg_bits, ix86_mitigate_rop): Use -mmitigate-rop in
867         comments instead of -fmitigate[-_]rop.
869 2018-01-04  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
871         PR bootstrap/81926
872         * cgraphunit.c (symbol_table::compile): Switch to text_section
873         before calling assembly_start debug hook.
874         * run-rtl-passes.c (run_rtl_passes): Likewise.
875         Include output.h.
877 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
879         * tree-vrp.c (extract_range_from_binary_expr_1): Check
880         range_int_cst_p rather than !symbolic_range_p before calling
881         extract_range_from_multiplicative_op_1.
883 2017-01-04  Jeff Law  <law@redhat.com>
885         * tree-ssa-math-opts.c (execute_cse_reciprocals_1): Remove
886         redundant test in assertion.
888 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
890         * doc/rtl.texi: Document machine_mode wrapper classes.
892 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
894         * fold-const.c (fold_ternary_loc): Check tree_fits_uhwi_p before
895         using tree_to_uhwi.
897 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
899         * tree-ssa-forwprop.c (is_combined_permutation_identity): Allow
900         the VEC_PERM_EXPR fold to fail.
902 2018-01-04  Jakub Jelinek  <jakub@redhat.com>
904         PR debug/83585
905         * bb-reorder.c (insert_section_boundary_note): Set has_bb_partition
906         to switched_sections.
908 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
910         PR target/83680
911         * config/arm/arm.c (arm_vectorize_vec_perm_const): Fix inverted
912         test for d.testing.
914 2018-01-04  Peter Bergner  <bergner@vnet.ibm.com>
916         PR target/83387
917         * config/rs6000/rs6000.c (rs6000_discover_homogeneous_aggregate): Do not
918         allow arguments in FP registers if TARGET_HARD_FLOAT is false.
920 2018-01-04  Jakub Jelinek  <jakub@redhat.com>
922         PR debug/83666
923         * cfgexpand.c (expand_dbeug_expr) <case BIT_FIELD_REF>: Punt if mode
924         is BLKmode and bitpos not zero or mode change is needed.
926 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
928         PR target/83675
929         * config/sparc/sparc.c (sparc_vectorize_vec_perm_const): Require
930         TARGET_VIS2.
932 2018-01-04  Uros Bizjak  <ubizjak@gmail.com>
934         PR target/83628
935         * config/alpha/alpha.md (*sadd<modesuffix>): Use ASHIFT
936         instead of MULT rtx.  Update all corresponding splitters.
937         (*saddl_se): Ditto.
938         (*ssub<modesuffix>): Ditto.
939         (*ssubl_se): Ditto.
940         (*cmp_sadd_di): Update split patterns.
941         (*cmp_sadd_si): Ditto.
942         (*cmp_sadd_sidi): Ditto.
943         (*cmp_ssub_di): Ditto.
944         (*cmp_ssub_si): Ditto.
945         (*cmp_ssub_sidi): Ditto.
946         * config/alpha/predicates.md (const23_operand): New predicate.
947         * config/alpha/alpha.c (alpha_rtx_costs) [PLUS, MINUS]:
948         Look for ASHIFT, not MULT inner operand.
949         (alpha_split_conditional_move): Update for *sadd<modesuffix> change.
951 2018-01-04  Martin Liska  <mliska@suse.cz>
953         PR gcov-profile/83669
954         * gcov.c (output_intermediate_file): Add version to intermediate
955         gcov file.
956         * doc/gcov.texi: Document new field 'version' in intermediate
957         file format. Fix location of '-k' option of gcov command.
959 2018-01-04  Martin Liska  <mliska@suse.cz>
961         PR ipa/82352
962         * ipa-icf.c (sem_function::merge): Do not cross comdat boundary.
964 2018-01-04  Jakub Jelinek  <jakub@redhat.com>
966         * gimple-ssa-sprintf.c (parse_directive): Cast second dir.len to uhwi.
968 2018-01-03  Martin Sebor  <msebor@redhat.com>
970         PR tree-optimization/83655
971         * gimple-ssa-warn-restrict.c (wrestrict_dom_walker::check_call): Avoid
972         checking calls with invalid arguments.
974 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
976         * tree-vect-stmts.c (vect_get_store_rhs): New function.
977         (vectorizable_mask_load_store): Delete.
978         (vectorizable_call): Return false for masked loads and stores.
979         (vectorizable_store): Handle IFN_MASK_STORE.  Use vect_get_store_rhs
980         instead of gimple_assign_rhs1.
981         (vectorizable_load): Handle IFN_MASK_LOAD.
982         (vect_transform_stmt): Don't set is_store for call_vec_info_type.
984 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
986         * tree-vect-stmts.c (vect_build_gather_load_calls): New function,
987         split out from..,
988         (vectorizable_mask_load_store): ...here.
989         (vectorizable_load): ...and here.
991 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
993         * tree-vect-stmts.c (vect_build_all_ones_mask)
994         (vect_build_zero_merge_argument): New functions, split out from...
995         (vectorizable_load): ...here.
997 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
999         * tree-vect-stmts.c (vect_check_store_rhs): New function,
1000         split out from...
1001         (vectorizable_mask_load_store): ...here.
1002         (vectorizable_store): ...and here.
1004 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1006         * tree-vect-stmts.c (vect_check_load_store_mask): New function,
1007         split out from...
1008         (vectorizable_mask_load_store): ...here.
1010 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1012         * tree-vectorizer.h (vec_load_store_type): Moved from tree-vec-stmts.c
1013         (vect_model_store_cost): Take a vec_load_store_type instead of a
1014         vect_def_type.
1015         * tree-vect-stmts.c (vec_load_store_type): Move to tree-vectorizer.h.
1016         (vect_model_store_cost): Take a vec_load_store_type instead of a
1017         vect_def_type.
1018         (vectorizable_mask_load_store): Update accordingly.
1019         (vectorizable_store): Likewise.
1020         * tree-vect-slp.c (vect_analyze_slp_cost_1): Update accordingly.
1022 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1024         * tree-vect-loop.c (vect_transform_loop): Stub out scalar
1025         IFN_MASK_LOAD calls here rather than...
1026         * tree-vect-stmts.c (vectorizable_mask_load_store): ...here.
1028 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1029             Alan Hayward  <alan.hayward@arm.com>
1030             David Sherwood  <david.sherwood@arm.com>
1032         * expmed.c (extract_bit_field_1): For vector extracts,
1033         fall back to extract_bit_field_as_subreg if vec_extract
1034         isn't available.
1036 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1037             Alan Hayward  <alan.hayward@arm.com>
1038             David Sherwood  <david.sherwood@arm.com>
1040         * lra-spills.c (pseudo_reg_slot_compare): Sort slots by whether
1041         they are variable or constant sized.
1042         (assign_stack_slot_num_and_sort_pseudos): Don't reuse variable-sized
1043         slots for constant-sized data.
1045 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1046             Alan Hayward  <alan.hayward@arm.com>
1047             David Sherwood  <david.sherwood@arm.com>
1049         * tree-vect-patterns.c (vect_recog_mask_conversion_pattern): When
1050         handling COND_EXPRs with boolean comparisons, try to find a better
1051         basis for the mask type than the boolean itself.
1053 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1055         * doc/rtl.texi (MAX_BITSIZE_MODE_ANY_MODE): Describe how the default
1056         is calculated and how it can be overridden.
1057         * genmodes.c (max_bitsize_mode_any_mode): New variable.
1058         (create_modes): Initialize it from MAX_BITSIZE_MODE_ANY_MODE,
1059         if defined.
1060         (emit_max_int): Use it to set the output MAX_BITSIZE_MODE_ANY_MODE,
1061         if nonzero.
1063 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1064             Alan Hayward  <alan.hayward@arm.com>
1065             David Sherwood  <david.sherwood@arm.com>
1067         * config/aarch64/aarch64-protos.h (aarch64_output_simd_mov_immediate):
1068         Remove the mode argument.
1069         (aarch64_simd_valid_immediate): Remove the mode and inverse
1070         arguments.
1071         * config/aarch64/iterators.md (bitsize): New iterator.
1072         * config/aarch64/aarch64-simd.md (*aarch64_simd_mov<mode>, and<mode>3)
1073         (ior<mode>3): Update calls to aarch64_output_simd_mov_immediate.
1074         * config/aarch64/constraints.md (Do, Db, Dn): Update calls to
1075         aarch64_simd_valid_immediate.
1076         * config/aarch64/predicates.md (aarch64_reg_or_orr_imm): Likewise.
1077         (aarch64_reg_or_bic_imm): Likewise.
1078         * config/aarch64/aarch64.c (simd_immediate_info): Replace mvn
1079         with an insn_type enum and msl with a modifier_type enum.
1080         Replace element_width with a scalar_mode.  Change the shift
1081         to unsigned int.  Add constructors for scalar_float_mode and
1082         scalar_int_mode elements.
1083         (aarch64_vect_float_const_representable_p): Delete.
1084         (aarch64_can_const_movi_rtx_p)
1085         (aarch64_simd_scalar_immediate_valid_for_move)
1086         (aarch64_simd_make_constant): Update call to
1087         aarch64_simd_valid_immediate.
1088         (aarch64_advsimd_valid_immediate_hs): New function.
1089         (aarch64_advsimd_valid_immediate): Likewise.
1090         (aarch64_simd_valid_immediate): Remove mode and inverse
1091         arguments.  Rewrite to use the above.  Use const_vec_duplicate_p
1092         to detect duplicated constants and use aarch64_float_const_zero_rtx_p
1093         and aarch64_float_const_representable_p on the result.
1094         (aarch64_output_simd_mov_immediate): Remove mode argument.
1095         Update call to aarch64_simd_valid_immediate and use of
1096         simd_immediate_info.
1097         (aarch64_output_scalar_simd_mov_immediate): Update call
1098         accordingly.
1100 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1101             Alan Hayward  <alan.hayward@arm.com>
1102             David Sherwood  <david.sherwood@arm.com>
1104         * machmode.h (mode_precision): Prefix with CONST_MODE_PRECISION.
1105         (mode_nunits): Likewise CONST_MODE_NUNITS.
1106         * machmode.def (ADJUST_NUNITS): Document.
1107         * genmodes.c (mode_data::need_nunits_adj): New field.
1108         (blank_mode): Update accordingly.
1109         (adj_nunits): New variable.
1110         (print_maybe_const_decl): Replace CATEGORY with a NEEDS_ADJ
1111         parameter.
1112         (emit_mode_size_inline): Set need_bytesize_adj for all modes
1113         listed in adj_nunits.
1114         (emit_mode_nunits_inline): Set need_nunits_adj for all modes
1115         listed in adj_nunits.  Don't emit case statements for such modes.
1116         (emit_insn_modes_h): Emit definitions of CONST_MODE_NUNITS
1117         and CONST_MODE_PRECISION.  Make CONST_MODE_SIZE expand to
1118         nothing if adj_nunits is nonnull.
1119         (emit_mode_precision, emit_mode_nunits): Use print_maybe_const_decl.
1120         (emit_mode_unit_size, emit_mode_base_align, emit_mode_ibit)
1121         (emit_mode_fbit): Update use of print_maybe_const_decl.
1122         (emit_move_size): Likewise.  Treat the array as non-const
1123         if adj_nunits.
1124         (emit_mode_adjustments): Handle adj_nunits.
1126 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1128         * machmode.def (VECTOR_MODES_WITH_PREFIX): Document.
1129         * genmodes.c (VECTOR_MODES_WITH_PREFIX): New macro.
1130         (VECTOR_MODES): Use it.
1131         (make_vector_modes): Take the prefix as an argument.
1133 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1134             Alan Hayward  <alan.hayward@arm.com>
1135             David Sherwood  <david.sherwood@arm.com>
1137         * mode-classes.def (MODE_VECTOR_BOOL): New mode class.
1138         * machmode.h (INTEGRAL_MODE_P, VECTOR_MODE_P): Return true
1139         for MODE_VECTOR_BOOL.
1140         * machmode.def (VECTOR_BOOL_MODE): Document.
1141         * genmodes.c (VECTOR_BOOL_MODE): New macro.
1142         (make_vector_bool_mode): New function.
1143         (complete_mode, emit_mode_wider, emit_mode_adjustments): Handle
1144         MODE_VECTOR_BOOL.
1145         * lto-streamer-in.c (lto_input_mode_table): Likewise.
1146         * rtx-vector-builder.c (rtx_vector_builder::find_cached_value):
1147         Likewise.
1148         * stor-layout.c (int_mode_for_mode): Likewise.
1149         * tree.c (build_vector_type_for_mode): Likewise.
1150         * varasm.c (output_constant_pool_2): Likewise.
1151         * emit-rtl.c (init_emit_once): Make sure that CONST1_RTX (BImode) and
1152         CONSTM1_RTX (BImode) are the same thing.  Initialize const_tiny_rtx
1153         for MODE_VECTOR_BOOL.
1154         * expr.c (expand_expr_real_1): Use VECTOR_MODE_P instead of a list
1155         of mode class checks.
1156         * tree-vect-generic.c (expand_vector_operation): Use VECTOR_MODE_P
1157         instead of a list of mode class checks.
1158         (expand_vector_scalar_condition): Likewise.
1159         (type_for_widest_vector_mode): Handle BImode as an inner mode.
1161 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1162             Alan Hayward  <alan.hayward@arm.com>
1163             David Sherwood  <david.sherwood@arm.com>
1165         * machmode.h (mode_size): Change from unsigned short to
1166         poly_uint16_pod.
1167         (mode_to_bytes): Return a poly_uint16 rather than an unsigned short.
1168         (GET_MODE_SIZE): Return a constant if ONLY_FIXED_SIZE_MODES,
1169         or if measurement_type is not polynomial.
1170         (fixed_size_mode::includes_p): Check for constant-sized modes.
1171         * genmodes.c (emit_mode_size_inline): Make mode_size_inline
1172         return a poly_uint16 rather than an unsigned short.
1173         (emit_mode_size): Change the type of mode_size from unsigned short
1174         to poly_uint16_pod.  Use ZERO_COEFFS for the initializer.
1175         (emit_mode_adjustments): Cope with polynomial vector sizes.
1176         * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
1177         for GET_MODE_SIZE.
1178         * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
1179         for GET_MODE_SIZE.
1180         * auto-inc-dec.c (try_merge): Treat GET_MODE_SIZE as polynomial.
1181         * builtins.c (expand_ifn_atomic_compare_exchange_into_call): Likewise.
1182         * caller-save.c (setup_save_areas): Likewise.
1183         (replace_reg_with_saved_mem): Likewise.
1184         * calls.c (emit_library_call_value_1): Likewise.
1185         * combine-stack-adj.c (combine_stack_adjustments_for_block): Likewise.
1186         * combine.c (simplify_set, make_extraction, simplify_shift_const_1)
1187         (gen_lowpart_for_combine): Likewise.
1188         * convert.c (convert_to_integer_1): Likewise.
1189         * cse.c (equiv_constant, cse_insn): Likewise.
1190         * cselib.c (autoinc_split, cselib_hash_rtx): Likewise.
1191         (cselib_subst_to_values): Likewise.
1192         * dce.c (word_dce_process_block): Likewise.
1193         * df-problems.c (df_word_lr_mark_ref): Likewise.
1194         * dwarf2cfi.c (init_one_dwarf_reg_size): Likewise.
1195         * dwarf2out.c (multiple_reg_loc_descriptor, mem_loc_descriptor)
1196         (concat_loc_descriptor, concatn_loc_descriptor, loc_descriptor)
1197         (rtl_for_decl_location): Likewise.
1198         * emit-rtl.c (gen_highpart, widen_memory_access): Likewise.
1199         * expmed.c (extract_bit_field_1, extract_integral_bit_field): Likewise.
1200         * expr.c (emit_group_load_1, clear_storage_hints): Likewise.
1201         (emit_move_complex, emit_move_multi_word, emit_push_insn): Likewise.
1202         (expand_expr_real_1): Likewise.
1203         * function.c (assign_parm_setup_block_p, assign_parm_setup_block)
1204         (pad_below): Likewise.
1205         * gimple-fold.c (optimize_atomic_compare_exchange_p): Likewise.
1206         * gimple-ssa-store-merging.c (rhs_valid_for_store_merging_p): Likewise.
1207         * ira.c (get_subreg_tracking_sizes): Likewise.
1208         * ira-build.c (ira_create_allocno_objects): Likewise.
1209         * ira-color.c (coalesced_pseudo_reg_slot_compare): Likewise.
1210         (ira_sort_regnos_for_alter_reg): Likewise.
1211         * ira-costs.c (record_operand_costs): Likewise.
1212         * lower-subreg.c (interesting_mode_p, simplify_gen_subreg_concatn)
1213         (resolve_simple_move): Likewise.
1214         * lra-constraints.c (get_reload_reg, operands_match_p): Likewise.
1215         (process_addr_reg, simplify_operand_subreg, curr_insn_transform)
1216         (lra_constraints): Likewise.
1217         (CONST_POOL_OK_P): Reject variable-sized modes.
1218         * lra-spills.c (slot, assign_mem_slot, pseudo_reg_slot_compare)
1219         (add_pseudo_to_slot, lra_spill): Likewise.
1220         * omp-low.c (omp_clause_aligned_alignment): Likewise.
1221         * optabs-query.c (get_best_extraction_insn): Likewise.
1222         * optabs-tree.c (expand_vec_cond_expr_p): Likewise.
1223         * optabs.c (expand_vec_perm_var, expand_vec_cond_expr): Likewise.
1224         (expand_mult_highpart, valid_multiword_target_p): Likewise.
1225         * recog.c (offsettable_address_addr_space_p): Likewise.
1226         * regcprop.c (maybe_mode_change): Likewise.
1227         * reginfo.c (choose_hard_reg_mode, record_subregs_of_mode): Likewise.
1228         * regrename.c (build_def_use): Likewise.
1229         * regstat.c (dump_reg_info): Likewise.
1230         * reload.c (complex_word_subreg_p, push_reload, find_dummy_reload)
1231         (find_reloads, find_reloads_subreg_address): Likewise.
1232         * reload1.c (eliminate_regs_1): Likewise.
1233         * rtlanal.c (for_each_inc_dec_find_inc_dec, rtx_cost): Likewise.
1234         * simplify-rtx.c (avoid_constant_pool_reference): Likewise.
1235         (simplify_binary_operation_1, simplify_subreg): Likewise.
1236         * targhooks.c (default_function_arg_padding): Likewise.
1237         (default_hard_regno_nregs, default_class_max_nregs): Likewise.
1238         * tree-cfg.c (verify_gimple_assign_binary): Likewise.
1239         (verify_gimple_assign_ternary): Likewise.
1240         * tree-inline.c (estimate_move_cost): Likewise.
1241         * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
1242         * tree-ssa-loop-ivopts.c (add_autoinc_candidates): Likewise.
1243         (get_address_cost_ainc): Likewise.
1244         * tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Likewise.
1245         (vect_supportable_dr_alignment): Likewise.
1246         * tree-vect-loop.c (vect_determine_vectorization_factor): Likewise.
1247         (vectorizable_reduction): Likewise.
1248         * tree-vect-stmts.c (vectorizable_assignment, vectorizable_shift)
1249         (vectorizable_operation, vectorizable_load): Likewise.
1250         * tree.c (build_same_sized_truth_vector_type): Likewise.
1251         * valtrack.c (cleanup_auto_inc_dec): Likewise.
1252         * var-tracking.c (emit_note_insn_var_location): Likewise.
1253         * config/arc/arc.h (ASM_OUTPUT_CASE_END): Use as_a <scalar_int_mode>.
1254         (ADDR_VEC_ALIGN): Likewise.
1256 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1257             Alan Hayward  <alan.hayward@arm.com>
1258             David Sherwood  <david.sherwood@arm.com>
1260         * machmode.h (mode_to_bits): Return a poly_uint16 rather than an
1261         unsigned short.
1262         (GET_MODE_BITSIZE): Return a constant if ONLY_FIXED_SIZE_MODES,
1263         or if measurement_type is polynomial.
1264         * calls.c (shift_return_value): Treat GET_MODE_BITSIZE as polynomial.
1265         * combine.c (make_extraction): Likewise.
1266         * dse.c (find_shift_sequence): Likewise.
1267         * dwarf2out.c (mem_loc_descriptor): Likewise.
1268         * expmed.c (store_integral_bit_field, extract_bit_field_1): Likewise.
1269         (extract_bit_field, extract_low_bits): Likewise.
1270         * expr.c (convert_move, convert_modes, emit_move_insn_1): Likewise.
1271         (optimize_bitfield_assignment_op, expand_assignment): Likewise.
1272         (store_expr_with_bounds, store_field, expand_expr_real_1): Likewise.
1273         * fold-const.c (optimize_bit_field_compare, merge_ranges): Likewise.
1274         * gimple-fold.c (optimize_atomic_compare_exchange_p): Likewise.
1275         * reload.c (find_reloads): Likewise.
1276         * reload1.c (alter_reg): Likewise.
1277         * stor-layout.c (bitwise_mode_for_mode, compute_record_mode): Likewise.
1278         * targhooks.c (default_secondary_memory_needed_mode): Likewise.
1279         * tree-if-conv.c (predicate_mem_writes): Likewise.
1280         * tree-ssa-strlen.c (handle_builtin_memcmp): Likewise.
1281         * tree-vect-patterns.c (adjust_bool_pattern): Likewise.
1282         * tree-vect-stmts.c (vectorizable_simd_clone_call): Likewise.
1283         * valtrack.c (dead_debug_insert_temp): Likewise.
1284         * varasm.c (mergeable_constant_section): Likewise.
1285         * config/sh/sh.h (LOCAL_ALIGNMENT): Use as_a <fixed_size_mode>.
1287 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1288             Alan Hayward  <alan.hayward@arm.com>
1289             David Sherwood  <david.sherwood@arm.com>
1291         * expr.c (expand_assignment): Cope with polynomial mode sizes
1292         when assigning to a CONCAT.
1294 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1295             Alan Hayward  <alan.hayward@arm.com>
1296             David Sherwood  <david.sherwood@arm.com>
1298         * machmode.h (mode_precision): Change from unsigned short to
1299         poly_uint16_pod.
1300         (mode_to_precision): Return a poly_uint16 rather than an unsigned
1301         short.
1302         (GET_MODE_PRECISION): Return a constant if ONLY_FIXED_SIZE_MODES,
1303         or if measurement_type is not polynomial.
1304         (HWI_COMPUTABLE_MODE_P): Turn into a function.  Optimize the case
1305         in which the mode is already known to be a scalar_int_mode.
1306         * genmodes.c (emit_mode_precision): Change the type of mode_precision
1307         from unsigned short to poly_uint16_pod.  Use ZERO_COEFFS for the
1308         initializer.
1309         * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
1310         for GET_MODE_PRECISION.
1311         * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
1312         for GET_MODE_PRECISION.
1313         * combine.c (update_rsp_from_reg_equal): Treat GET_MODE_PRECISION
1314         as polynomial.
1315         (try_combine, find_split_point, combine_simplify_rtx): Likewise.
1316         (expand_field_assignment, make_extraction): Likewise.
1317         (make_compound_operation_int, record_dead_and_set_regs_1): Likewise.
1318         (get_last_value): Likewise.
1319         * convert.c (convert_to_integer_1): Likewise.
1320         * cse.c (cse_insn): Likewise.
1321         * expr.c (expand_expr_real_1): Likewise.
1322         * lra-constraints.c (simplify_operand_subreg): Likewise.
1323         * optabs-query.c (can_atomic_load_p): Likewise.
1324         * optabs.c (expand_atomic_load): Likewise.
1325         (expand_atomic_store): Likewise.
1326         * ree.c (combine_reaching_defs): Likewise.
1327         * rtl.h (partial_subreg_p, paradoxical_subreg_p): Likewise.
1328         * rtlanal.c (nonzero_bits1, lsb_bitfield_op_p): Likewise.
1329         * tree.h (type_has_mode_precision_p): Likewise.
1330         * ubsan.c (instrument_si_overflow): Likewise.
1332 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1333             Alan Hayward  <alan.hayward@arm.com>
1334             David Sherwood  <david.sherwood@arm.com>
1336         * tree.h (TYPE_VECTOR_SUBPARTS): Turn into a function and handle
1337         polynomial numbers of units.
1338         (SET_TYPE_VECTOR_SUBPARTS): Likewise.
1339         (valid_vector_subparts_p): New function.
1340         (build_vector_type): Remove temporary shim and take the number
1341         of units as a poly_uint64 rather than an int.
1342         (build_opaque_vector_type): Take the number of units as a
1343         poly_uint64 rather than an int.
1344         * tree.c (build_vector_from_ctor): Handle polynomial
1345         TYPE_VECTOR_SUBPARTS.
1346         (type_hash_canon_hash, type_cache_hasher::equal): Likewise.
1347         (uniform_vector_p, vector_type_mode, build_vector): Likewise.
1348         (build_vector_from_val): If the number of units is variable,
1349         use build_vec_duplicate_cst for constant operands and
1350         VEC_DUPLICATE_EXPR otherwise.
1351         (make_vector_type): Remove temporary is_constant ().
1352         (build_vector_type, build_opaque_vector_type): Take the number of
1353         units as a poly_uint64 rather than an int.
1354         (check_vector_cst): Handle polynomial TYPE_VECTOR_SUBPARTS and
1355         VECTOR_CST_NELTS.
1356         * cfgexpand.c (expand_debug_expr): Likewise.
1357         * expr.c (count_type_elements, categorize_ctor_elements_1): Likewise.
1358         (store_constructor, expand_expr_real_1): Likewise.
1359         (const_scalar_mask_from_tree): Likewise.
1360         * fold-const-call.c (fold_const_reduction): Likewise.
1361         * fold-const.c (const_binop, const_unop, fold_convert_const): Likewise.
1362         (operand_equal_p, fold_vec_perm, fold_ternary_loc): Likewise.
1363         (native_encode_vector, vec_cst_ctor_to_array): Likewise.
1364         (fold_relational_const): Likewise.
1365         (native_interpret_vector): Likewise.  Change the size from an
1366         int to an unsigned int.
1367         * gimple-fold.c (gimple_fold_stmt_to_constant_1): Handle polynomial
1368         TYPE_VECTOR_SUBPARTS.
1369         (gimple_fold_indirect_ref, gimple_build_vector): Likewise.
1370         (gimple_build_vector_from_val): Use VEC_DUPLICATE_EXPR when
1371         duplicating a non-constant operand into a variable-length vector.
1372         * hsa-brig.c (hsa_op_immed::emit_to_buffer): Handle polynomial
1373         TYPE_VECTOR_SUBPARTS and VECTOR_CST_NELTS.
1374         * ipa-icf.c (sem_variable::equals): Likewise.
1375         * match.pd: Likewise.
1376         * omp-simd-clone.c (simd_clone_subparts): Likewise.
1377         * print-tree.c (print_node): Likewise.
1378         * stor-layout.c (layout_type): Likewise.
1379         * targhooks.c (default_builtin_vectorization_cost): Likewise.
1380         * tree-cfg.c (verify_gimple_comparison): Likewise.
1381         (verify_gimple_assign_binary): Likewise.
1382         (verify_gimple_assign_ternary): Likewise.
1383         (verify_gimple_assign_single): Likewise.
1384         * tree-pretty-print.c (dump_generic_node): Likewise.
1385         * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
1386         (simplify_bitfield_ref, is_combined_permutation_identity): Likewise.
1387         * tree-vect-data-refs.c (vect_permute_store_chain): Likewise.
1388         (vect_grouped_load_supported, vect_permute_load_chain): Likewise.
1389         (vect_shift_permute_load_chain): Likewise.
1390         * tree-vect-generic.c (nunits_for_known_piecewise_op): Likewise.
1391         (expand_vector_condition, optimize_vector_constructor): Likewise.
1392         (lower_vec_perm, get_compute_type): Likewise.
1393         * tree-vect-loop.c (vect_determine_vectorization_factor): Likewise.
1394         (get_initial_defs_for_reduction, vect_transform_loop): Likewise.
1395         * tree-vect-patterns.c (vect_recog_bool_pattern): Likewise.
1396         (vect_recog_mask_conversion_pattern): Likewise.
1397         * tree-vect-slp.c (vect_supported_load_permutation_p): Likewise.
1398         (vect_get_constant_vectors, vect_transform_slp_perm_load): Likewise.
1399         * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
1400         (get_group_load_store_type, vectorizable_mask_load_store): Likewise.
1401         (vectorizable_bswap, simd_clone_subparts, vectorizable_assignment)
1402         (vectorizable_shift, vectorizable_operation, vectorizable_store)
1403         (vectorizable_load, vect_is_simple_cond, vectorizable_comparison)
1404         (supportable_widening_operation): Likewise.
1405         (supportable_narrowing_operation): Likewise.
1406         * tree-vector-builder.c (tree_vector_builder::binary_encoded_nelts):
1407         Likewise.
1408         * varasm.c (output_constant): Likewise.
1410 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1411             Alan Hayward  <alan.hayward@arm.com>
1412             David Sherwood  <david.sherwood@arm.com>
1414         * tree-vect-data-refs.c (vect_permute_store_chain): Reorganize
1415         so that both the length == 3 and length != 3 cases set up their
1416         own permute vectors.  Add comments explaining why we know the
1417         number of elements is constant.
1418         (vect_permute_load_chain): Likewise.
1420 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1421             Alan Hayward  <alan.hayward@arm.com>
1422             David Sherwood  <david.sherwood@arm.com>
1424         * machmode.h (mode_nunits): Change from unsigned char to
1425         poly_uint16_pod.
1426         (ONLY_FIXED_SIZE_MODES): New macro.
1427         (pod_mode::measurement_type, scalar_int_mode::measurement_type)
1428         (scalar_float_mode::measurement_type, scalar_mode::measurement_type)
1429         (complex_mode::measurement_type, fixed_size_mode::measurement_type):
1430         New typedefs.
1431         (mode_to_nunits): Return a poly_uint16 rather than an unsigned short.
1432         (GET_MODE_NUNITS): Return a constant if ONLY_FIXED_SIZE_MODES,
1433         or if measurement_type is not polynomial.
1434         * genmodes.c (ZERO_COEFFS): New macro.
1435         (emit_mode_nunits_inline): Make mode_nunits_inline return a
1436         poly_uint16.
1437         (emit_mode_nunits): Change the type of mode_nunits to poly_uint16_pod.
1438         Use ZERO_COEFFS when emitting initializers.
1439         * data-streamer.h (bp_pack_poly_value): New function.
1440         (bp_unpack_poly_value): Likewise.
1441         * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
1442         for GET_MODE_NUNITS.
1443         * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
1444         for GET_MODE_NUNITS.
1445         * tree.c (make_vector_type): Remove temporary shim and make
1446         the real function take the number of units as a poly_uint64
1447         rather than an int.
1448         (build_vector_type_for_mode): Handle polynomial nunits.
1449         * dwarf2out.c (loc_descriptor, add_const_value_attribute): Likewise.
1450         * emit-rtl.c (const_vec_series_p_1): Likewise.
1451         (gen_rtx_CONST_VECTOR): Likewise.
1452         * fold-const.c (test_vec_duplicate_folding): Likewise.
1453         * genrecog.c (validate_pattern): Likewise.
1454         * optabs-query.c (can_vec_perm_var_p, can_mult_highpart_p): Likewise.
1455         * optabs-tree.c (expand_vec_cond_expr_p): Likewise.
1456         * optabs.c (expand_vector_broadcast, expand_binop_directly): Likewise.
1457         (shift_amt_for_vec_perm_mask, expand_vec_perm_var): Likewise.
1458         (expand_vec_cond_expr, expand_mult_highpart): Likewise.
1459         * rtlanal.c (subreg_get_info): Likewise.
1460         * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
1461         (vect_grouped_load_supported): Likewise.
1462         * tree-vect-generic.c (type_for_widest_vector_mode): Likewise.
1463         * tree-vect-loop.c (have_whole_vector_shift): Likewise.
1464         * simplify-rtx.c (simplify_unary_operation_1): Likewise.
1465         (simplify_const_unary_operation, simplify_binary_operation_1)
1466         (simplify_const_binary_operation, simplify_ternary_operation)
1467         (test_vector_ops_duplicate, test_vector_ops): Likewise.
1468         (simplify_immed_subreg): Use GET_MODE_NUNITS on a fixed_size_mode
1469         instead of CONST_VECTOR_NUNITS.
1470         * varasm.c (output_constant_pool_2): Likewise.
1471         * rtx-vector-builder.c (rtx_vector_builder::build): Only include the
1472         explicit-encoded elements in the XVEC for variable-length vectors.
1474 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1476         * lra-constraints.c (curr_insn_transform): Use partial_subreg_p.
1478 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1479             Alan Hayward  <alan.hayward@arm.com>
1480             David Sherwood  <david.sherwood@arm.com>
1482         * coretypes.h (fixed_size_mode): Declare.
1483         (fixed_size_mode_pod): New typedef.
1484         * builtins.h (target_builtins::x_apply_args_mode)
1485         (target_builtins::x_apply_result_mode): Change type to
1486         fixed_size_mode_pod.
1487         * builtins.c (apply_args_size, apply_result_size, result_vector)
1488         (expand_builtin_apply_args_1, expand_builtin_apply)
1489         (expand_builtin_return): Update accordingly.
1491 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1493         * cse.c (hash_rtx_cb): Hash only the encoded elements.
1494         * cselib.c (cselib_hash_rtx): Likewise.
1495         * expmed.c (make_tree): Build VECTOR_CSTs directly from the
1496         CONST_VECTOR encoding.
1498 2017-01-03  Jakub Jelinek  <jakub@redhat.com>
1499             Jeff Law  <law@redhat.com>
1501         PR target/83641
1502         * config/i386/i386.c (ix86_adjust_stack_and_probe_stack_clash): For
1503         noreturn probe, use gen_pop instead of ix86_emit_restore_reg_using_pop,
1504         only set RTX_FRAME_RELATED_P on both the push and pop if cfa_reg is sp
1505         and add REG_CFA_ADJUST_CFA notes in that case to both insns.
1507         PR target/83641
1508         * config/i386/i386.c (ix86_adjust_stack_and_probe_stack_clash): Do not
1509         explicitly probe *sp in a noreturn function if there were any callee
1510         register saves or frame pointer is needed.
1512 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
1514         PR debug/83621
1515         * cfgexpand.c (expand_debug_expr): Return NULL if mode is
1516         BLKmode for ternary, binary or unary expressions.
1518         PR debug/83645
1519         * var-tracking.c (delete_vta_debug_insn): New inline function.
1520         (delete_vta_debug_insns): Add USE_CFG argument, if true, walk just
1521         insns from get_insns () to NULL instead of each bb separately.
1522         Use delete_vta_debug_insn.  No longer static.
1523         (vt_debug_insns_local, variable_tracking_main_1): Adjust
1524         delete_vta_debug_insns callers.
1525         * rtl.h (delete_vta_debug_insns): Declare.
1526         * final.c (rest_of_handle_final): Call delete_vta_debug_insns
1527         instead of variable_tracking_main.
1529 2018-01-03  Martin Sebor  <msebor@redhat.com>
1531         PR tree-optimization/83603
1532         * calls.c (maybe_warn_nonstring_arg): Avoid accessing function
1533         arguments past the endof the argument list in functions declared
1534         without a prototype.
1535         * gimple-ssa-warn-restrict.c (wrestrict_dom_walker::check_call):
1536         Avoid checking when arguments are null.
1538 2018-01-03  Martin Sebor  <msebor@redhat.com>
1540         PR c/83559
1541         * doc/extend.texi (attribute const): Fix a typo.
1542         * ipa-pure-const.c ((warn_function_const, warn_function_pure): Avoid
1543         issuing -Wsuggest-attribute for void functions.
1545 2018-01-03  Martin Sebor  <msebor@redhat.com>
1547         * gimple-ssa-warn-restrict.c (builtin_memref::builtin_memref): Use
1548         offset_int::from instead of wide_int::to_shwi.
1549         (maybe_diag_overlap): Remove assertion.
1550         Use HOST_WIDE_INT_PRINT_DEC instead of %lli.
1551         * gimple-ssa-sprintf.c (format_directive): Same.
1552         (parse_directive): Same.
1553         (sprintf_dom_walker::compute_format_length): Same.
1554         (try_substitute_return_value): Same.
1556 2017-01-03  Jeff Law  <law@redhat.com>
1558         PR middle-end/83654
1559         * explow.c (anti_adjust_stack_and_probe_stack_clash): Test a
1560         non-constant residual for zero at runtime and avoid probing in
1561         that case.  Reorganize code for trailing problem to mirror handling
1562         of the residual.
1564 2018-01-03  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
1566         PR tree-optimization/83501
1567         * tree-ssa-strlen.c (get_string_cst): New.
1568         (handle_char_store): Call get_string_cst.
1570 2018-01-03  Martin Liska  <mliska@suse.cz>
1572         PR tree-optimization/83593
1573         * tree-ssa-strlen.c: Include tree-cfg.h.
1574         (strlen_check_and_optimize_stmt): Add new argument cleanup_eh.
1575         (strlen_dom_walker): Add new member variable m_cleanup_cfg.
1576         (strlen_dom_walker::strlen_dom_walker): Initialize m_cleanup_cfg
1577         to false.
1578         (strlen_dom_walker::before_dom_children): Call
1579         gimple_purge_dead_eh_edges. Dump tranformation with details
1580         dump flags.
1581         (strlen_dom_walker::before_dom_children): Update call by adding
1582         new argument cleanup_eh.
1583         (pass_strlen::execute): Return TODO_cleanup_cfg if needed.
1585 2018-01-03  Martin Liska  <mliska@suse.cz>
1587         PR ipa/83549
1588         * cif-code.def (VARIADIC_THUNK): New enum value.
1589         * ipa-fnsummary.c (compute_fn_summary): Do not inline variadic
1590         thunks.
1592 2018-01-03  Jan Beulich  <jbeulich@suse.com>
1594         * sse.md (mov<mode>_internal): Tighten condition for when to use
1595         vmovdqu<ssescalarsize> for TI and OI modes.
1597 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
1599         Update copyright years.
1601 2018-01-03  Martin Liska  <mliska@suse.cz>
1603         PR ipa/83594
1604         * ipa-visibility.c (function_and_variable_visibility): Skip
1605         functions with noipa attribure.
1607 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
1609         * gcc.c (process_command): Update copyright notice dates.
1610         * gcov-dump.c (print_version): Ditto.
1611         * gcov.c (print_version): Ditto.
1612         * gcov-tool.c (print_version): Ditto.
1613         * gengtype.c (create_file): Ditto.
1614         * doc/cpp.texi: Bump @copying's copyright year.
1615         * doc/cppinternals.texi: Ditto.
1616         * doc/gcc.texi: Ditto.
1617         * doc/gccint.texi: Ditto.
1618         * doc/gcov.texi: Ditto.
1619         * doc/install.texi: Ditto.
1620         * doc/invoke.texi: Ditto.
1622 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1624         * vector-builder.h (vector_builder::m_full_nelts): Change from
1625         unsigned int to poly_uint64.
1626         (vector_builder::full_nelts): Update prototype accordingly.
1627         (vector_builder::new_vector): Likewise.
1628         (vector_builder::encoded_full_vector_p): Handle polynomial full_nelts.
1629         (vector_builder::operator ==): Likewise.
1630         (vector_builder::finalize): Likewise.
1631         * int-vector-builder.h (int_vector_builder::int_vector_builder):
1632         Take the number of elements as a poly_uint64 rather than an
1633         unsigned int.
1634         * vec-perm-indices.h (vec_perm_indices::m_nelts_per_input): Change
1635         from unsigned int to poly_uint64.
1636         (vec_perm_indices::vec_perm_indices): Update prototype accordingly.
1637         (vec_perm_indices::new_vector): Likewise.
1638         (vec_perm_indices::length): Likewise.
1639         (vec_perm_indices::nelts_per_input): Likewise.
1640         (vec_perm_indices::input_nelts): Likewise.
1641         * vec-perm-indices.c (vec_perm_indices::new_vector): Take the
1642         number of elements per input as a poly_uint64 rather than an
1643         unsigned int.  Use the original encoding for variable-length
1644         vectors, rather than clamping each individual element.
1645         For the second and subsequent elements in each pattern,
1646         clamp the step and base before clamping their sum.
1647         (vec_perm_indices::series_p): Handle polynomial element counts.
1648         (vec_perm_indices::all_in_range_p): Likewise.
1649         (vec_perm_indices_to_tree): Likewise.
1650         (vec_perm_indices_to_rtx): Likewise.
1651         * tree-vect-stmts.c (vect_gen_perm_mask_any): Likewise.
1652         * tree-vector-builder.c (tree_vector_builder::new_unary_operation)
1653         (tree_vector_builder::new_binary_operation): Handle polynomial
1654         element counts.  Return false if we need to know the number
1655         of elements at compile time.
1656         * fold-const.c (fold_vec_perm): Punt if the number of elements
1657         isn't known at compile time.
1659 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1661         * vec-perm-indices.h (vec_perm_builder): Change element type
1662         from HOST_WIDE_INT to poly_int64.
1663         (vec_perm_indices::element_type): Update accordingly.
1664         (vec_perm_indices::clamp): Handle polynomial element_types.
1665         * vec-perm-indices.c (vec_perm_indices::series_p): Likewise.
1666         (vec_perm_indices::all_in_range_p): Likewise.
1667         (tree_to_vec_perm_builder): Check for poly_int64 trees rather
1668         than shwi trees.
1669         * vector-builder.h (vector_builder::stepped_sequence_p): Handle
1670         polynomial vec_perm_indices element types.
1671         * int-vector-builder.h (int_vector_builder::equal_p): Likewise.
1672         * fold-const.c (fold_vec_perm): Likewise.
1673         * optabs.c (shift_amt_for_vec_perm_mask): Likewise.
1674         * tree-vect-generic.c (lower_vec_perm): Likewise.
1675         * tree-vect-slp.c (vect_transform_slp_perm_load): Likewise.
1676         * config/aarch64/aarch64.c (aarch64_evpc_tbl): Cast d->perm
1677         element type to HOST_WIDE_INT.
1679 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1680             Alan Hayward  <alan.hayward@arm.com>
1681             David Sherwood  <david.sherwood@arm.com>
1683         * alias.c (addr_side_effect_eval): Take the size as a poly_int64
1684         rather than an int.  Use plus_constant.
1685         (memrefs_conflict_p): Take the sizes as poly_int64s rather than ints.
1686         Take the offset "c" as a poly_int64 rather than a HOST_WIDE_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         * calls.c (emit_call_1, expand_call): Change struct_value_size from
1693         a HOST_WIDE_INT to a poly_int64.
1695 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1696             Alan Hayward  <alan.hayward@arm.com>
1697             David Sherwood  <david.sherwood@arm.com>
1699         * calls.c (load_register_parameters): Cope with polynomial
1700         mode sizes.  Require a constant size for BLKmode parameters
1701         that aren't described by a PARALLEL.  If BLOCK_REG_PADDING
1702         forces a parameter to be padded at the lsb end in order to
1703         fill a complete number of words, require the parameter size
1704         to be ordered wrt UNITS_PER_WORD.
1706 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1707             Alan Hayward  <alan.hayward@arm.com>
1708             David Sherwood  <david.sherwood@arm.com>
1710         * reload1.c (spill_stack_slot_width): Change element type
1711         from unsigned int to poly_uint64_pod.
1712         (alter_reg): Treat mode sizes as polynomial.
1714 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1715             Alan Hayward  <alan.hayward@arm.com>
1716             David Sherwood  <david.sherwood@arm.com>
1718         * reload.c (complex_word_subreg_p): New function.
1719         (reload_inner_reg_of_subreg, push_reload): Use it.
1721 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1722             Alan Hayward  <alan.hayward@arm.com>
1723             David Sherwood  <david.sherwood@arm.com>
1725         * lra-constraints.c (process_alt_operands): Reject matched
1726         operands whose sizes aren't ordered.
1727         (match_reload): Refer to this check here.
1729 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1730             Alan Hayward  <alan.hayward@arm.com>
1731             David Sherwood  <david.sherwood@arm.com>
1733         * builtins.c (expand_ifn_atomic_compare_exchange_into_call): Assert
1734         that the mode size is in the set {1, 2, 4, 8, 16}.
1736 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1737             Alan Hayward  <alan.hayward@arm.com>
1738             David Sherwood  <david.sherwood@arm.com>
1740         * var-tracking.c (adjust_mems): Treat mode sizes as polynomial.
1741         Use plus_constant instead of gen_rtx_PLUS.
1743 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1744             Alan Hayward  <alan.hayward@arm.com>
1745             David Sherwood  <david.sherwood@arm.com>
1747         * config/cr16/cr16-protos.h (cr16_push_rounding): Declare.
1748         * config/cr16/cr16.h (PUSH_ROUNDING): Move implementation to...
1749         * config/cr16/cr16.c (cr16_push_rounding): ...this new function.
1750         * config/h8300/h8300-protos.h (h8300_push_rounding): Declare.
1751         * config/h8300/h8300.h (PUSH_ROUNDING): Move implementation to...
1752         * config/h8300/h8300.c (h8300_push_rounding): ...this new function.
1753         * config/i386/i386-protos.h (ix86_push_rounding): Declare.
1754         * config/i386/i386.h (PUSH_ROUNDING): Move implementation to...
1755         * config/i386/i386.c (ix86_push_rounding): ...this new function.
1756         * config/m32c/m32c-protos.h (m32c_push_rounding): Take and return
1757         a poly_int64.
1758         * config/m32c/m32c.c (m32c_push_rounding): Likewise.
1759         * config/m68k/m68k-protos.h (m68k_push_rounding): Declare.
1760         * config/m68k/m68k.h (PUSH_ROUNDING): Move implementation to...
1761         * config/m68k/m68k.c (m68k_push_rounding): ...this new function.
1762         * config/pdp11/pdp11-protos.h (pdp11_push_rounding): Declare.
1763         * config/pdp11/pdp11.h (PUSH_ROUNDING): Move implementation to...
1764         * config/pdp11/pdp11.c (pdp11_push_rounding): ...this new function.
1765         * config/stormy16/stormy16-protos.h (xstormy16_push_rounding): Declare.
1766         * config/stormy16/stormy16.h (PUSH_ROUNDING): Move implementation to...
1767         * config/stormy16/stormy16.c (xstormy16_push_rounding): ...this new
1768         function.
1769         * expr.c (emit_move_resolve_push): Treat the input and result
1770         of PUSH_ROUNDING as a poly_int64.
1771         (emit_move_complex_push, emit_single_push_insn_1): Likewise.
1772         (emit_push_insn): Likewise.
1773         * lra-eliminations.c (mark_not_eliminable): Likewise.
1774         * recog.c (push_operand): Likewise.
1775         * reload1.c (elimination_effects): Likewise.
1776         * rtlanal.c (nonzero_bits1): Likewise.
1777         * calls.c (store_one_arg): Likewise.  Require the padding to be
1778         known at compile time.
1780 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1781             Alan Hayward  <alan.hayward@arm.com>
1782             David Sherwood  <david.sherwood@arm.com>
1784         * expr.c (emit_single_push_insn_1): Treat mode sizes as polynomial.
1785         Use plus_constant instead of gen_rtx_PLUS.
1787 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1788             Alan Hayward  <alan.hayward@arm.com>
1789             David Sherwood  <david.sherwood@arm.com>
1791         * auto-inc-dec.c (set_inc_state): Take the mode size as a poly_int64
1792         rather than an int.
1794 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1795             Alan Hayward  <alan.hayward@arm.com>
1796             David Sherwood  <david.sherwood@arm.com>
1798         * expr.c (expand_expr_real_1): Use tree_to_poly_uint64
1799         instead of int_size_in_bytes when handling VIEW_CONVERT_EXPRs
1800         via stack temporaries.  Treat the mode size as polynomial too.
1802 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1803             Alan Hayward  <alan.hayward@arm.com>
1804             David Sherwood  <david.sherwood@arm.com>
1806         * expr.c (expand_expr_real_2): When handling conversions involving
1807         unions, apply tree_to_poly_uint64 to the TYPE_SIZE rather than
1808         multiplying int_size_in_bytes by BITS_PER_UNIT.  Treat GET_MODE_BISIZE
1809         as a poly_uint64 too.
1811 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1812             Alan Hayward  <alan.hayward@arm.com>
1813             David Sherwood  <david.sherwood@arm.com>
1815         * rtlanal.c (subreg_get_info): Handle polynomial mode sizes.
1817 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1818             Alan Hayward  <alan.hayward@arm.com>
1819             David Sherwood  <david.sherwood@arm.com>
1821         * combine.c (can_change_dest_mode): Handle polynomial
1822         REGMODE_NATURAL_SIZE.
1823         * expmed.c (store_bit_field_1): Likewise.
1824         * expr.c (store_constructor): Likewise.
1825         * emit-rtl.c (validate_subreg): Operate on polynomial mode sizes
1826         and polynomial REGMODE_NATURAL_SIZE.
1827         (gen_lowpart_common): Likewise.
1828         * reginfo.c (record_subregs_of_mode): Likewise.
1829         * rtlanal.c (read_modify_subreg_p): Likewise.
1831 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1832             Alan Hayward  <alan.hayward@arm.com>
1833             David Sherwood  <david.sherwood@arm.com>
1835         * internal-fn.c (expand_vector_ubsan_overflow): Handle polynomial
1836         numbers of elements.
1838 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1839             Alan Hayward  <alan.hayward@arm.com>
1840             David Sherwood  <david.sherwood@arm.com>
1842         * match.pd: Cope with polynomial numbers of vector elements.
1844 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1845             Alan Hayward  <alan.hayward@arm.com>
1846             David Sherwood  <david.sherwood@arm.com>
1848         * fold-const.c (fold_indirect_ref_1): Handle polynomial offsets
1849         in a POINTER_PLUS_EXPR.
1851 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1852             Alan Hayward  <alan.hayward@arm.com>
1853             David Sherwood  <david.sherwood@arm.com>
1855         * omp-simd-clone.c (simd_clone_subparts): New function.
1856         (simd_clone_init_simd_arrays): Use it instead of TYPE_VECTOR_SUBPARTS.
1857         (ipa_simd_modify_function_body): Likewise.
1859 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1860             Alan Hayward  <alan.hayward@arm.com>
1861             David Sherwood  <david.sherwood@arm.com>
1863         * tree-vect-generic.c (nunits_for_known_piecewise_op): New function.
1864         (expand_vector_piecewise): Use it instead of TYPE_VECTOR_SUBPARTS.
1865         (expand_vector_addition, add_rshift, expand_vector_divmod): Likewise.
1866         (expand_vector_condition, vector_element): Likewise.
1867         (subparts_gt): New function.
1868         (get_compute_type): Use subparts_gt.
1869         (count_type_subparts): Delete.
1870         (expand_vector_operations_1): Use subparts_gt instead of
1871         count_type_subparts.
1873 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1874             Alan Hayward  <alan.hayward@arm.com>
1875             David Sherwood  <david.sherwood@arm.com>
1877         * tree-vect-data-refs.c (vect_no_alias_p): Replace with...
1878         (vect_compile_time_alias): ...this new function.  Do the calculation
1879         on poly_ints rather than trees.
1880         (vect_prune_runtime_alias_test_list): Update call accordingly.
1882 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1883             Alan Hayward  <alan.hayward@arm.com>
1884             David Sherwood  <david.sherwood@arm.com>
1886         * tree-vect-slp.c (vect_build_slp_tree_1): Handle polynomial
1887         numbers of units.
1888         (vect_schedule_slp_instance): Likewise.
1890 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1891             Alan Hayward  <alan.hayward@arm.com>
1892             David Sherwood  <david.sherwood@arm.com>
1894         * tree-vect-slp.c (vect_get_and_check_slp_defs): Reject
1895         constant and extern definitions for variable-length vectors.
1896         (vect_get_constant_vectors): Note that the number of units
1897         is known to be constant.
1899 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1900             Alan Hayward  <alan.hayward@arm.com>
1901             David Sherwood  <david.sherwood@arm.com>
1903         * tree-vect-stmts.c (vectorizable_conversion): Treat the number
1904         of units as polynomial.  Choose between WIDE and NARROW based
1905         on multiple_p.
1907 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1908             Alan Hayward  <alan.hayward@arm.com>
1909             David Sherwood  <david.sherwood@arm.com>
1911         * tree-vect-stmts.c (simd_clone_subparts): New function.
1912         (vectorizable_simd_clone_call): Use it instead of TYPE_VECTOR_SUBPARTS.
1914 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1915             Alan Hayward  <alan.hayward@arm.com>
1916             David Sherwood  <david.sherwood@arm.com>
1918         * tree-vect-stmts.c (vectorizable_call): Treat the number of
1919         vectors as polynomial.  Use build_index_vector for
1920         IFN_GOMP_SIMD_LANE.
1922 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1923             Alan Hayward  <alan.hayward@arm.com>
1924             David Sherwood  <david.sherwood@arm.com>
1926         * tree-vect-stmts.c (get_load_store_type): Treat the number of
1927         units as polynomial.  Reject VMAT_ELEMENTWISE and VMAT_STRIDED_SLP
1928         for variable-length vectors.
1929         (vectorizable_mask_load_store): Treat the number of units as
1930         polynomial, asserting that it is constant if the condition has
1931         already been enforced.
1932         (vectorizable_store, vectorizable_load): Likewise.
1934 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1935             Alan Hayward  <alan.hayward@arm.com>
1936             David Sherwood  <david.sherwood@arm.com>
1938         * tree-vect-loop.c (vectorizable_live_operation): Treat the number
1939         of units as polynomial.  Punt if we can't tell at compile time
1940         which vector contains the final result.
1942 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1943             Alan Hayward  <alan.hayward@arm.com>
1944             David Sherwood  <david.sherwood@arm.com>
1946         * tree-vect-loop.c (vectorizable_induction): Treat the number
1947         of units as polynomial.  Punt on SLP inductions.  Use an integer
1948         VEC_SERIES_EXPR for variable-length integer reductions.  Use a
1949         cast of such a series for variable-length floating-point
1950         reductions.
1952 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1953             Alan Hayward  <alan.hayward@arm.com>
1954             David Sherwood  <david.sherwood@arm.com>
1956         * tree.h (build_index_vector): Declare.
1957         * tree.c (build_index_vector): New function.
1958         * tree-vect-loop.c (get_initial_defs_for_reduction): Treat the number
1959         of units as polynomial, forcibly converting it to a constant if
1960         vectorizable_reduction has already enforced the condition.
1961         (vect_create_epilog_for_reduction): Likewise.  Use build_index_vector
1962         to create a {1,2,3,...} vector.
1963         (vectorizable_reduction): Treat the number of units as polynomial.
1964         Choose vectype_in based on the largest scalar element size rather
1965         than the smallest number of units.  Enforce the restrictions
1966         relied on above.
1968 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1969             Alan Hayward  <alan.hayward@arm.com>
1970             David Sherwood  <david.sherwood@arm.com>
1972         * tree-vect-data-refs.c (vector_alignment_reachable_p): Treat the
1973         number of units as polynomial.
1975 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1976             Alan Hayward  <alan.hayward@arm.com>
1977             David Sherwood  <david.sherwood@arm.com>
1979         * target.h (vector_sizes, auto_vector_sizes): New typedefs.
1980         * target.def (autovectorize_vector_sizes): Return the vector sizes
1981         by pointer, using vector_sizes rather than a bitmask.
1982         * targhooks.h (default_autovectorize_vector_sizes): Update accordingly.
1983         * targhooks.c (default_autovectorize_vector_sizes): Likewise.
1984         * config/aarch64/aarch64.c (aarch64_autovectorize_vector_sizes):
1985         Likewise.
1986         * config/arc/arc.c (arc_autovectorize_vector_sizes): Likewise.
1987         * config/arm/arm.c (arm_autovectorize_vector_sizes): Likewise.
1988         * config/i386/i386.c (ix86_autovectorize_vector_sizes): Likewise.
1989         * config/mips/mips.c (mips_autovectorize_vector_sizes): Likewise.
1990         * omp-general.c (omp_max_vf): Likewise.
1991         * omp-low.c (omp_clause_aligned_alignment): Likewise.
1992         * optabs-query.c (can_vec_mask_load_store_p): Likewise.
1993         * tree-vect-loop.c (vect_analyze_loop): Likewise.
1994         * tree-vect-slp.c (vect_slp_bb): Likewise.
1995         * doc/tm.texi: Regenerate.
1996         * tree-vectorizer.h (current_vector_size): Change from an unsigned int
1997         to a poly_uint64.
1998         * tree-vect-stmts.c (get_vectype_for_scalar_type_and_size): Take
1999         the vector size as a poly_uint64 rather than an unsigned int.
2000         (current_vector_size): Change from an unsigned int to a poly_uint64.
2001         (get_vectype_for_scalar_type): Update accordingly.
2002         * tree.h (build_truth_vector_type): Take the size and number of
2003         units as a poly_uint64 rather than an unsigned int.
2004         (build_vector_type): Add a temporary overload that takes
2005         the number of units as a poly_uint64 rather than an unsigned int.
2006         * tree.c (make_vector_type): Likewise.
2007         (build_truth_vector_type): Take the number of units as a poly_uint64
2008         rather than an unsigned int.
2010 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2011             Alan Hayward  <alan.hayward@arm.com>
2012             David Sherwood  <david.sherwood@arm.com>
2014         * target.def (get_mask_mode): Take the number of units and length
2015         as poly_uint64s rather than unsigned ints.
2016         * targhooks.h (default_get_mask_mode): Update accordingly.
2017         * targhooks.c (default_get_mask_mode): Likewise.
2018         * config/i386/i386.c (ix86_get_mask_mode): Likewise.
2019         * doc/tm.texi: Regenerate.
2021 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2022             Alan Hayward  <alan.hayward@arm.com>
2023             David Sherwood  <david.sherwood@arm.com>
2025         * omp-general.h (omp_max_vf): Return a poly_uint64 instead of an int.
2026         * omp-general.c (omp_max_vf): Likewise.
2027         * omp-expand.c (omp_adjust_chunk_size): Update call to omp_max_vf.
2028         (expand_omp_simd): Handle polynomial safelen.
2029         * omp-low.c (omplow_simd_context): Add a default constructor.
2030         (omplow_simd_context::max_vf): Change from int to poly_uint64.
2031         (lower_rec_simd_input_clauses): Update accordingly.
2032         (lower_rec_input_clauses): Likewise.
2034 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2035             Alan Hayward  <alan.hayward@arm.com>
2036             David Sherwood  <david.sherwood@arm.com>
2038         * tree-vectorizer.h (vect_nunits_for_cost): New function.
2039         * tree-vect-loop.c (vect_model_reduction_cost): Use it.
2040         * tree-vect-slp.c (vect_analyze_slp_cost_1): Likewise.
2041         (vect_analyze_slp_cost): Likewise.
2042         * tree-vect-stmts.c (vect_model_store_cost): Likewise.
2043         (vect_model_load_cost): Likewise.
2045 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2046             Alan Hayward  <alan.hayward@arm.com>
2047             David Sherwood  <david.sherwood@arm.com>
2049         * tree-vect-slp.c (vect_record_max_nunits, vect_build_slp_tree_1)
2050         (vect_build_slp_tree_2, vect_build_slp_tree): Change max_nunits
2051         from an unsigned int * to a poly_uint64_pod *.
2052         (calculate_unrolling_factor): New function.
2053         (vect_analyze_slp_instance): Use it.  Track polynomial max_nunits.
2055 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2056             Alan Hayward  <alan.hayward@arm.com>
2057             David Sherwood  <david.sherwood@arm.com>
2059         * tree-vectorizer.h (_slp_instance::unrolling_factor): Change
2060         from an unsigned int to a poly_uint64.
2061         (_loop_vec_info::slp_unrolling_factor): Likewise.
2062         (_loop_vec_info::vectorization_factor): Change from an int
2063         to a poly_uint64.
2064         (MAX_VECTORIZATION_FACTOR): Bump from 64 to INT_MAX.
2065         (vect_get_num_vectors): New function.
2066         (vect_update_max_nunits, vect_vf_for_cost): Likewise.
2067         (vect_get_num_copies): Use vect_get_num_vectors.
2068         (vect_analyze_data_ref_dependences): Change max_vf from an int *
2069         to an unsigned int *.
2070         (vect_analyze_data_refs): Change min_vf from an int * to a
2071         poly_uint64 *.
2072         (vect_transform_slp_perm_load): Take the vf as a poly_uint64 rather
2073         than an unsigned HOST_WIDE_INT.
2074         * tree-vect-data-refs.c (vect_analyze_possibly_independent_ddr)
2075         (vect_analyze_data_ref_dependence): Change max_vf from an int *
2076         to an unsigned int *.
2077         (vect_analyze_data_ref_dependences): Likewise.
2078         (vect_compute_data_ref_alignment): Handle polynomial vf.
2079         (vect_enhance_data_refs_alignment): Likewise.
2080         (vect_prune_runtime_alias_test_list): Likewise.
2081         (vect_shift_permute_load_chain): Likewise.
2082         (vect_supportable_dr_alignment): Likewise.
2083         (dependence_distance_ge_vf): Take the vectorization factor as a
2084         poly_uint64 rather than an unsigned HOST_WIDE_INT.
2085         (vect_analyze_data_refs): Change min_vf from an int * to a
2086         poly_uint64 *.
2087         * tree-vect-loop-manip.c (vect_gen_scalar_loop_niters): Take
2088         vfm1 as a poly_uint64 rather than an int.  Make the same change
2089         for the returned bound_scalar.
2090         (vect_gen_vector_loop_niters): Handle polynomial vf.
2091         (vect_do_peeling): Likewise.  Update call to
2092         vect_gen_scalar_loop_niters and handle polynomial bound_scalars.
2093         (vect_gen_vector_loop_niters_mult_vf): Assert that the vf must
2094         be constant.
2095         * tree-vect-loop.c (vect_determine_vectorization_factor)
2096         (vect_update_vf_for_slp, vect_analyze_loop_2): Handle polynomial vf.
2097         (vect_get_known_peeling_cost): Likewise.
2098         (vect_estimate_min_profitable_iters, vectorizable_reduction): Likewise.
2099         (vect_worthwhile_without_simd_p, vectorizable_induction): Likewise.
2100         (vect_transform_loop): Likewise.  Use the lowest possible VF when
2101         updating the upper bounds of the loop.
2102         (vect_min_worthwhile_factor): Make static.  Return an unsigned int
2103         rather than an int.
2104         * tree-vect-slp.c (vect_attempt_slp_rearrange_stmts): Cope with
2105         polynomial unroll factors.
2106         (vect_analyze_slp_cost_1, vect_analyze_slp_instance): Likewise.
2107         (vect_make_slp_decision): Likewise.
2108         (vect_supported_load_permutation_p): Likewise, and polynomial
2109         vf too.
2110         (vect_analyze_slp_cost): Handle polynomial vf.
2111         (vect_slp_analyze_node_operations): Likewise.
2112         (vect_slp_analyze_bb_1): Likewise.
2113         (vect_transform_slp_perm_load): Take the vf as a poly_uint64 rather
2114         than an unsigned HOST_WIDE_INT.
2115         * tree-vect-stmts.c (vectorizable_simd_clone_call, vectorizable_store)
2116         (vectorizable_load): Handle polynomial vf.
2117         * tree-vectorizer.c (simduid_to_vf::vf): Change from an int to
2118         a poly_uint64.
2119         (adjust_simduid_builtins, shrink_simd_arrays): Update accordingly.
2121 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2122             Alan Hayward  <alan.hayward@arm.com>
2123             David Sherwood  <david.sherwood@arm.com>
2125         * match.pd: Handle bit operations involving three constants
2126         and try to fold one pair.
2128 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2130         * tree-vect-loop-manip.c: Include gimple-fold.h.
2131         (slpeel_make_loop_iterate_ntimes): Add step, final_iv and
2132         niters_maybe_zero parameters.  Handle other cases besides a step of 1.
2133         (vect_gen_vector_loop_niters): Add a step_vector_ptr parameter.
2134         Add a path that uses a step of VF instead of 1, but disable it
2135         for now.
2136         (vect_do_peeling): Add step_vector, niters_vector_mult_vf_var
2137         and niters_no_overflow parameters.  Update calls to
2138         slpeel_make_loop_iterate_ntimes and vect_gen_vector_loop_niters.
2139         Create a new SSA name if the latter choses to use a ste other
2140         than zero, and return it via niters_vector_mult_vf_var.
2141         * tree-vect-loop.c (vect_transform_loop): Update calls to
2142         vect_do_peeling, vect_gen_vector_loop_niters and
2143         slpeel_make_loop_iterate_ntimes.
2144         * tree-vectorizer.h (slpeel_make_loop_iterate_ntimes, vect_do_peeling)
2145         (vect_gen_vector_loop_niters): Update declarations after above changes.
2147 2018-01-02  Michael Meissner  <meissner@linux.vnet.ibm.com>
2149         * config/rs6000/rs6000.md (floor<mode>2): Add support for IEEE
2150         128-bit round to integer instructions.
2151         (ceil<mode>2): Likewise.
2152         (btrunc<mode>2): Likewise.
2153         (round<mode>2): Likewise.
2155 2018-01-02  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>
2157         * config/rs6000/rs6000-string.c (expand_block_move): Allow the use of
2158         unaligned VSX load/store on P8/P9.
2159         (expand_block_clear): Allow the use of unaligned VSX
2160         load/store on P8/P9.
2162 2018-01-02  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
2164         * config/rs6000/rs6000-p8swap.c (swap_feeds_both_load_and_store):
2165         New function.
2166         (rs6000_analyze_swaps): Mark a web unoptimizable if it contains a
2167         swap associated with both a load and a store.
2169 2018-01-02  Andrew Waterman  <andrew@sifive.com>
2171         * config/riscv/linux.h (ICACHE_FLUSH_FUNC): New.
2172         * config/riscv/riscv.md (clear_cache): Use it.
2174 2018-01-02  Artyom Skrobov  <tyomitch@gmail.com>
2176         * web.c: Remove out-of-date comment.
2178 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2180         * expr.c (fixup_args_size_notes): Check that any existing
2181         REG_ARGS_SIZE notes are correct, and don't try to re-add them.
2182         (emit_single_push_insn_1): Move stack_pointer_delta adjustment to...
2183         (emit_single_push_insn): ...here.
2185 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2187         * rtl.h (CONST_VECTOR_ELT): Redefine to const_vector_elt.
2188         (const_vector_encoded_nelts): New function.
2189         (CONST_VECTOR_NUNITS): Redefine to use GET_MODE_NUNITS.
2190         (const_vector_int_elt, const_vector_elt): Declare.
2191         * emit-rtl.c (const_vector_int_elt_1): New function.
2192         (const_vector_elt): Likewise.
2193         * simplify-rtx.c (simplify_immed_subreg): Avoid taking the address
2194         of CONST_VECTOR_ELT.
2196 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2198         * expr.c: Include rtx-vector-builder.h.
2199         (const_vector_mask_from_tree): Use rtx_vector_builder and operate
2200         directly on the tree encoding.
2201         (const_vector_from_tree): Likewise.
2202         * optabs.c: Include rtx-vector-builder.h.
2203         (expand_vec_perm_var): Use rtx_vector_builder and create a repeating
2204         sequence of "u" values.
2205         * vec-perm-indices.c: Include rtx-vector-builder.h.
2206         (vec_perm_indices_to_rtx): Use rtx_vector_builder and operate
2207         directly on the vec_perm_indices encoding.
2209 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2211         * doc/rtl.texi (const_vector): Describe new encoding scheme.
2212         * Makefile.in (OBJS): Add rtx-vector-builder.o.
2213         * rtx-vector-builder.h: New file.
2214         * rtx-vector-builder.c: Likewise.
2215         * rtl.h (rtx_def::u2): Add a const_vector field.
2216         (CONST_VECTOR_NPATTERNS): New macro.
2217         (CONST_VECTOR_NELTS_PER_PATTERN): Likewise.
2218         (CONST_VECTOR_DUPLICATE_P): Likewise.
2219         (CONST_VECTOR_STEPPED_P): Likewise.
2220         (CONST_VECTOR_ENCODED_ELT): Likewise.
2221         (const_vec_duplicate_p): Check for a duplicated vector encoding.
2222         (unwrap_const_vec_duplicate): Likewise.
2223         (const_vec_series_p): Check for a non-duplicated vector encoding.
2224         Say that the function only returns true for integer vectors.
2225         * emit-rtl.c: Include rtx-vector-builder.h.
2226         (gen_const_vec_duplicate_1): Delete.
2227         (gen_const_vector): Call gen_const_vec_duplicate instead of
2228         gen_const_vec_duplicate_1.
2229         (const_vec_series_p_1): Operate directly on the CONST_VECTOR encoding.
2230         (gen_const_vec_duplicate): Use rtx_vector_builder.
2231         (gen_const_vec_series): Likewise.
2232         (gen_rtx_CONST_VECTOR): Likewise.
2233         * config/powerpcspe/powerpcspe.c: Include rtx-vector-builder.h.
2234         (swap_const_vector_halves): Take an rtx pointer rather than rtx.
2235         Build a new vector rather than modifying a CONST_VECTOR in-place.
2236         (handle_special_swappables): Update call accordingly.
2237         * config/rs6000/rs6000-p8swap.c: Include rtx-vector-builder.h.
2238         (swap_const_vector_halves): Take an rtx pointer rather than rtx.
2239         Build a new vector rather than modifying a CONST_VECTOR in-place.
2240         (handle_special_swappables): Update call accordingly.
2242 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2244         * simplify-rtx.c (simplify_const_binary_operation): Use
2245         CONST_VECTOR_ELT instead of XVECEXP.
2247 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2249         * tree-cfg.c (verify_gimple_assign_ternary): Allow the size of
2250         the selector elements to be different from the data elements
2251         if the selector is a VECTOR_CST.
2252         * tree-vect-stmts.c (vect_gen_perm_mask_any): Use a vector of
2253         ssizetype for the selector.
2255 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2257         * optabs.c (shift_amt_for_vec_perm_mask): Try using series_p
2258         before testing each element individually.
2259         * tree-vect-generic.c (lower_vec_perm): Likewise.
2261 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2263         * selftest.h (selftest::vec_perm_indices_c_tests): Declare.
2264         * selftest-run-tests.c (selftest::run_tests): Call it.
2265         * vector-builder.h (vector_builder::operator ==): New function.
2266         (vector_builder::operator !=): Likewise.
2267         * vec-perm-indices.h (vec_perm_indices::series_p): Declare.
2268         (vec_perm_indices::all_from_input_p): New function.
2269         * vec-perm-indices.c (vec_perm_indices::series_p): Likewise.
2270         (test_vec_perm_12, selftest::vec_perm_indices_c_tests): Likewise.
2271         * fold-const.c (fold_ternary_loc): Use tree_to_vec_perm_builder
2272         instead of reading the VECTOR_CST directly.  Detect whether both
2273         vector inputs are the same before constructing the vec_perm_indices,
2274         and update the number of inputs argument accordingly.  Use the
2275         utility functions added above.  Only construct sel2 if we need to.
2277 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2279         * optabs.c (expand_vec_perm_var): Use an explicit encoding for
2280         the broadcast of the low byte.
2281         (expand_mult_highpart): Use an explicit encoding for the permutes.
2282         * optabs-query.c (can_mult_highpart_p): Likewise.
2283         * tree-vect-loop.c (calc_vec_perm_mask_for_shift): Likewise.
2284         * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
2285         (vectorizable_bswap): Likewise.
2286         * tree-vect-data-refs.c (vect_grouped_store_supported): Use an
2287         explicit encoding for the power-of-2 permutes.
2288         (vect_permute_store_chain): Likewise.
2289         (vect_grouped_load_supported): Likewise.
2290         (vect_permute_load_chain): Likewise.
2292 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2294         * vec-perm-indices.h (vec_perm_indices_to_tree): Declare.
2295         * vec-perm-indices.c (vec_perm_indices_to_tree): New function.
2296         * tree-ssa-forwprop.c (simplify_vector_constructor): Use it.
2297         * tree-vect-slp.c (vect_transform_slp_perm_load): Likewise.
2298         * tree-vect-stmts.c (vectorizable_bswap): Likewise.
2299         (vect_gen_perm_mask_any): Likewise.
2301 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2303         * int-vector-builder.h: New file.
2304         * vec-perm-indices.h: Include int-vector-builder.h.
2305         (vec_perm_indices): Redefine as an int_vector_builder.
2306         (auto_vec_perm_indices): Delete.
2307         (vec_perm_builder): Redefine as a stand-alone class.
2308         (vec_perm_indices::vec_perm_indices): New function.
2309         (vec_perm_indices::clamp): Likewise.
2310         * vec-perm-indices.c: Include fold-const.h and tree-vector-builder.h.
2311         (vec_perm_indices::new_vector): New function.
2312         (vec_perm_indices::new_expanded_vector): Update for new
2313         vec_perm_indices class.
2314         (vec_perm_indices::rotate_inputs): New function.
2315         (vec_perm_indices::all_in_range_p): Operate directly on the
2316         encoded form, without computing elided elements.
2317         (tree_to_vec_perm_builder): Operate directly on the VECTOR_CST
2318         encoding.  Update for new vec_perm_indices class.
2319         * optabs.c (expand_vec_perm_const): Create a vec_perm_indices for
2320         the given vec_perm_builder.
2321         (expand_vec_perm_var): Update vec_perm_builder constructor.
2322         (expand_mult_highpart): Use vec_perm_builder instead of
2323         auto_vec_perm_indices.
2324         * optabs-query.c (can_mult_highpart_p): Use vec_perm_builder and
2325         vec_perm_indices instead of auto_vec_perm_indices.  Use a single
2326         or double series encoding as appropriate.
2327         * fold-const.c (fold_ternary_loc): Use vec_perm_builder and
2328         vec_perm_indices instead of auto_vec_perm_indices.
2329         * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
2330         * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
2331         (vect_permute_store_chain): Likewise.
2332         (vect_grouped_load_supported): Likewise.
2333         (vect_permute_load_chain): Likewise.
2334         (vect_shift_permute_load_chain): Likewise.
2335         * tree-vect-slp.c (vect_build_slp_tree_1): Likewise.
2336         (vect_transform_slp_perm_load): Likewise.
2337         (vect_schedule_slp_instance): Likewise.
2338         * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
2339         (vectorizable_mask_load_store): Likewise.
2340         (vectorizable_bswap): Likewise.
2341         (vectorizable_store): Likewise.
2342         (vectorizable_load): Likewise.
2343         * tree-vect-generic.c (lower_vec_perm): Use vec_perm_builder and
2344         vec_perm_indices instead of auto_vec_perm_indices.  Use
2345         tree_to_vec_perm_builder to read the vector from a tree.
2346         * tree-vect-loop.c (calc_vec_perm_mask_for_shift): Take a
2347         vec_perm_builder instead of a vec_perm_indices.
2348         (have_whole_vector_shift): Use vec_perm_builder and
2349         vec_perm_indices instead of auto_vec_perm_indices.  Leave the
2350         truncation to calc_vec_perm_mask_for_shift.
2351         (vect_create_epilog_for_reduction): Likewise.
2352         * config/aarch64/aarch64.c (expand_vec_perm_d::perm): Change
2353         from auto_vec_perm_indices to vec_perm_indices.
2354         (aarch64_expand_vec_perm_const_1): Use rotate_inputs on d.perm
2355         instead of changing individual elements.
2356         (aarch64_vectorize_vec_perm_const): Use new_vector to install
2357         the vector in d.perm.
2358         * config/arm/arm.c (expand_vec_perm_d::perm): Change
2359         from auto_vec_perm_indices to vec_perm_indices.
2360         (arm_expand_vec_perm_const_1): Use rotate_inputs on d.perm
2361         instead of changing individual elements.
2362         (arm_vectorize_vec_perm_const): Use new_vector to install
2363         the vector in d.perm.
2364         * config/powerpcspe/powerpcspe.c (rs6000_expand_extract_even):
2365         Update vec_perm_builder constructor.
2366         (rs6000_expand_interleave): Likewise.
2367         * config/rs6000/rs6000.c (rs6000_expand_extract_even): Likewise.
2368         (rs6000_expand_interleave): Likewise.
2370 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2372         * optabs-query.c (can_vec_perm_var_p): Check whether lowering
2373         to qimode could truncate the indices.
2374         * optabs.c (expand_vec_perm_var): Likewise.
2376 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2378         * Makefile.in (OBJS): Add vec-perm-indices.o.
2379         * vec-perm-indices.h: New file.
2380         * vec-perm-indices.c: Likewise.
2381         * target.h (vec_perm_indices): Replace with a forward class
2382         declaration.
2383         (auto_vec_perm_indices): Move to vec-perm-indices.h.
2384         * optabs.h: Include vec-perm-indices.h.
2385         (expand_vec_perm): Delete.
2386         (selector_fits_mode_p, expand_vec_perm_var): Declare.
2387         (expand_vec_perm_const): Declare.
2388         * target.def (vec_perm_const_ok): Replace with...
2389         (vec_perm_const): ...this new hook.
2390         * doc/tm.texi.in (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Replace with...
2391         (TARGET_VECTORIZE_VEC_PERM_CONST): ...this new hook.
2392         * doc/tm.texi: Regenerate.
2393         * optabs.def (vec_perm_const): Delete.
2394         * doc/md.texi (vec_perm_const): Likewise.
2395         (vec_perm): Refer to TARGET_VECTORIZE_VEC_PERM_CONST.
2396         * expr.c (expand_expr_real_2): Use expand_vec_perm_const rather than
2397         expand_vec_perm for constant permutation vectors.  Assert that
2398         the mode of variable permutation vectors is the integer equivalent
2399         of the mode that is being permuted.
2400         * optabs-query.h (selector_fits_mode_p): Declare.
2401         * optabs-query.c: Include vec-perm-indices.h.
2402         (selector_fits_mode_p): New function.
2403         (can_vec_perm_const_p): Check whether targetm.vectorize.vec_perm_const
2404         is defined, instead of checking whether the vec_perm_const_optab
2405         exists.  Use targetm.vectorize.vec_perm_const instead of
2406         targetm.vectorize.vec_perm_const_ok.  Check whether the indices
2407         fit in the vector mode before using a variable permute.
2408         * optabs.c (shift_amt_for_vec_perm_mask): Take a mode and a
2409         vec_perm_indices instead of an rtx.
2410         (expand_vec_perm): Replace with...
2411         (expand_vec_perm_const): ...this new function.  Take the selector
2412         as a vec_perm_indices rather than an rtx.  Also take the mode of
2413         the selector.  Update call to shift_amt_for_vec_perm_mask.
2414         Use targetm.vectorize.vec_perm_const instead of vec_perm_const_optab.
2415         Use vec_perm_indices::new_expanded_vector to expand the original
2416         selector into bytes.  Check whether the indices fit in the vector
2417         mode before using a variable permute.
2418         (expand_vec_perm_var): Make global.
2419         (expand_mult_highpart): Use expand_vec_perm_const.
2420         * fold-const.c: Includes vec-perm-indices.h.
2421         * tree-ssa-forwprop.c: Likewise.
2422         * tree-vect-data-refs.c: Likewise.
2423         * tree-vect-generic.c: Likewise.
2424         * tree-vect-loop.c: Likewise.
2425         * tree-vect-slp.c: Likewise.
2426         * tree-vect-stmts.c: Likewise.
2427         * config/aarch64/aarch64-protos.h (aarch64_expand_vec_perm_const):
2428         Delete.
2429         * config/aarch64/aarch64-simd.md (vec_perm_const<mode>): Delete.
2430         * config/aarch64/aarch64.c (aarch64_expand_vec_perm_const)
2431         (aarch64_vectorize_vec_perm_const_ok): Fuse into...
2432         (aarch64_vectorize_vec_perm_const): ...this new function.
2433         (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
2434         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
2435         * config/arm/arm-protos.h (arm_expand_vec_perm_const): Delete.
2436         * config/arm/vec-common.md (vec_perm_const<mode>): Delete.
2437         * config/arm/arm.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
2438         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
2439         (arm_expand_vec_perm_const, arm_vectorize_vec_perm_const_ok): Merge
2440         into...
2441         (arm_vectorize_vec_perm_const): ...this new function.  Explicitly
2442         check for NEON modes.
2443         * config/i386/i386-protos.h (ix86_expand_vec_perm_const): Delete.
2444         * config/i386/sse.md (VEC_PERM_CONST, vec_perm_const<mode>): Delete.
2445         * config/i386/i386.c (ix86_expand_vec_perm_const_1): Update comment.
2446         (ix86_expand_vec_perm_const, ix86_vectorize_vec_perm_const_ok): Merge
2447         into...
2448         (ix86_vectorize_vec_perm_const): ...this new function.  Incorporate
2449         the old VEC_PERM_CONST conditions.
2450         * config/ia64/ia64-protos.h (ia64_expand_vec_perm_const): Delete.
2451         * config/ia64/vect.md (vec_perm_const<mode>): Delete.
2452         * config/ia64/ia64.c (ia64_expand_vec_perm_const)
2453         (ia64_vectorize_vec_perm_const_ok): Merge into...
2454         (ia64_vectorize_vec_perm_const): ...this new function.
2455         * config/mips/loongson.md (vec_perm_const<mode>): Delete.
2456         * config/mips/mips-msa.md (vec_perm_const<mode>): Delete.
2457         * config/mips/mips-ps-3d.md (vec_perm_constv2sf): Delete.
2458         * config/mips/mips-protos.h (mips_expand_vec_perm_const): Delete.
2459         * config/mips/mips.c (mips_expand_vec_perm_const)
2460         (mips_vectorize_vec_perm_const_ok): Merge into...
2461         (mips_vectorize_vec_perm_const): ...this new function.
2462         * config/powerpcspe/altivec.md (vec_perm_constv16qi): Delete.
2463         * config/powerpcspe/paired.md (vec_perm_constv2sf): Delete.
2464         * config/powerpcspe/spe.md (vec_perm_constv2si): Delete.
2465         * config/powerpcspe/vsx.md (vec_perm_const<mode>): Delete.
2466         * config/powerpcspe/powerpcspe-protos.h (altivec_expand_vec_perm_const)
2467         (rs6000_expand_vec_perm_const): Delete.
2468         * config/powerpcspe/powerpcspe.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK):
2469         Delete.
2470         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
2471         (altivec_expand_vec_perm_const_le): Take each operand individually.
2472         Operate on constant selectors rather than rtxes.
2473         (altivec_expand_vec_perm_const): Likewise.  Update call to
2474         altivec_expand_vec_perm_const_le.
2475         (rs6000_expand_vec_perm_const): Delete.
2476         (rs6000_vectorize_vec_perm_const_ok): Delete.
2477         (rs6000_vectorize_vec_perm_const): New function.
2478         (rs6000_do_expand_vec_perm): Take a vec_perm_builder instead of
2479         an element count and rtx array.
2480         (rs6000_expand_extract_even): Update call accordingly.
2481         (rs6000_expand_interleave): Likewise.
2482         * config/rs6000/altivec.md (vec_perm_constv16qi): Delete.
2483         * config/rs6000/paired.md (vec_perm_constv2sf): Delete.
2484         * config/rs6000/vsx.md (vec_perm_const<mode>): Delete.
2485         * config/rs6000/rs6000-protos.h (altivec_expand_vec_perm_const)
2486         (rs6000_expand_vec_perm_const): Delete.
2487         * config/rs6000/rs6000.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
2488         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
2489         (altivec_expand_vec_perm_const_le): Take each operand individually.
2490         Operate on constant selectors rather than rtxes.
2491         (altivec_expand_vec_perm_const): Likewise.  Update call to
2492         altivec_expand_vec_perm_const_le.
2493         (rs6000_expand_vec_perm_const): Delete.
2494         (rs6000_vectorize_vec_perm_const_ok): Delete.
2495         (rs6000_vectorize_vec_perm_const): New function.  Remove stray
2496         reference to the SPE evmerge intructions.
2497         (rs6000_do_expand_vec_perm): Take a vec_perm_builder instead of
2498         an element count and rtx array.
2499         (rs6000_expand_extract_even): Update call accordingly.
2500         (rs6000_expand_interleave): Likewise.
2501         * config/sparc/sparc.md (vec_perm_constv8qi): Delete in favor of...
2502         * config/sparc/sparc.c (sparc_vectorize_vec_perm_const): ...this
2503         new function.
2504         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
2506 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2508         * optabs.c (expand_vec_perm_1): Assert that SEL has an integer
2509         vector mode and that that mode matches the mode of the data
2510         being permuted.
2511         (expand_vec_perm): Split handling of non-CONST_VECTOR selectors
2512         out into expand_vec_perm_var.  Do all CONST_VECTOR handling here,
2513         directly using expand_vec_perm_1 when forcing selectors into
2514         registers.
2515         (expand_vec_perm_var): New function, split out from expand_vec_perm.
2517 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2519         * optabs-query.h (can_vec_perm_p): Delete.
2520         (can_vec_perm_var_p, can_vec_perm_const_p): Declare.
2521         * optabs-query.c (can_vec_perm_p): Split into...
2522         (can_vec_perm_var_p, can_vec_perm_const_p): ...these two functions.
2523         (can_mult_highpart_p): Use can_vec_perm_const_p to test whether a
2524         particular selector is valid.
2525         * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
2526         * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
2527         (vect_grouped_load_supported): Likewise.
2528         (vect_shift_permute_load_chain): Likewise.
2529         * tree-vect-slp.c (vect_build_slp_tree_1): Likewise.
2530         (vect_transform_slp_perm_load): Likewise.
2531         * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
2532         (vectorizable_bswap): Likewise.
2533         (vect_gen_perm_mask_checked): Likewise.
2534         * fold-const.c (fold_ternary_loc): Likewise.  Don't take
2535         implementations of variable permutation vectors into account
2536         when deciding which selector to use.
2537         * tree-vect-loop.c (have_whole_vector_shift): Don't check whether
2538         vec_perm_const_optab is supported; instead use can_vec_perm_const_p
2539         with a false third argument.
2540         * tree-vect-generic.c (lower_vec_perm): Use can_vec_perm_const_p
2541         to test whether the constant selector is valid and can_vec_perm_var_p
2542         to test whether a variable selector is valid.
2544 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2546         * optabs-query.h (can_vec_perm_p): Take a const vec_perm_indices *.
2547         * optabs-query.c (can_vec_perm_p): Likewise.
2548         * fold-const.c (fold_vec_perm): Take a const vec_perm_indices &
2549         instead of vec_perm_indices.
2550         * tree-vectorizer.h (vect_gen_perm_mask_any): Likewise,
2551         (vect_gen_perm_mask_checked): Likewise,
2552         * tree-vect-stmts.c (vect_gen_perm_mask_any): Likewise,
2553         (vect_gen_perm_mask_checked): Likewise,
2555 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2557         * optabs-query.h (qimode_for_vec_perm): Declare.
2558         * optabs-query.c (can_vec_perm_p): Split out qimode search to...
2559         (qimode_for_vec_perm): ...this new function.
2560         * optabs.c (expand_vec_perm): Use qimode_for_vec_perm.
2562 2018-01-02  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>
2564         * rtlanal.c (canonicalize_condition): Return 0 if final rtx
2565         does not have a conditional at the top.
2567 2018-01-02  Richard Biener  <rguenther@suse.de>
2569         * ipa-inline.c (big_speedup_p): Fix expression.
2571 2018-01-02  Jan Hubicka  <hubicka@ucw.cz>
2573         PR target/81616
2574         * config/i386/x86-tune-costs.h: Increase cost of integer load costs
2575         for generic 4->6.
2577 2018-01-02  Jan Hubicka  <hubicka@ucw.cz>
2579         PR target/81616
2580         Generic tuning.
2581         * x86-tune-costs.h (generic_cost): Reduce cost of FDIV 20->17,
2582         cost of sqrt 20->14, DIVSS 18->13, DIVSD 32->17, SQRtSS 30->14
2583         and SQRTsD 58->18, cond_not_taken_branch_cost. 2->1. Increase
2584         cond_taken_branch_cost 3->4.
2586 2018-01-01  Jakub Jelinek  <jakub@redhat.com>
2588         PR tree-optimization/83581
2589         * tree-loop-distribution.c (pass_loop_distribution::execute): Return
2590         TODO_cleanup_cfg if any changes have been made.
2592         PR middle-end/83608
2593         * expr.c (store_expr_with_bounds): Use simplify_gen_subreg instead of
2594         convert_modes if target mode has the right side, but different mode
2595         class.
2597         PR middle-end/83609
2598         * expr.c (expand_assignment): Fix up a typo in simplify_gen_subreg
2599         last argument when extracting from CONCAT.  If either from_real or
2600         from_imag is NULL, use expansion through memory.  If result is not
2601         a CONCAT and simplify_gen_subreg fails, try to simplify_gen_subreg
2602         the parts directly to inner mode, if even that fails, use expansion
2603         through memory.
2605         PR middle-end/83623
2606         * expmed.c (expand_shift_1): For 2-byte rotates by BITS_PER_UNIT,
2607         check for bswap in mode rather than HImode and use that in expand_unop
2608         too.
2610 Copyright (C) 2018 Free Software Foundation, Inc.
2612 Copying and distribution of this file, with or without modification,
2613 are permitted in any medium without royalty provided the copyright
2614 notice and this notice are preserved.