rguenth [Mon, 25 Jun 2018 11:02:10 +0000 (11:02 +0000)]
2018-06-25 Richard Biener <rguenther@suse.de>
* tree-vect-data-refs.c (vect_find_stmt_data_reference): Modify
DR for SIMD lane accesses here and mark DR with (void *)-1 aux.
(vect_analyze_data_refs): Remove similar code from here and
simplify accordingly.
krebbel [Mon, 25 Jun 2018 07:16:59 +0000 (07:16 +0000)]
C++: Fix PR86082
When turning a user-defined numerical literal into an operator
invocation the literal needs to be translated to the execution
character set.
gcc/cp/ChangeLog:
2018-06-25 Andreas Krebbel <krebbel@linux.ibm.com>
PR C++/86082
* parser.c (make_char_string_pack): Pass this literal chars
through cpp_interpret_string.
(cp_parser_userdef_numeric_literal): Check the result of
make_char_string_pack.
gcc/testsuite/ChangeLog:
2018-06-25 Andreas Krebbel <krebbel@linux.ibm.com>
vries [Sat, 23 Jun 2018 23:41:51 +0000 (23:41 +0000)]
[testsuite/guality] Fix tcl error on missing gdb
2018-06-24 Tom de Vries <tdevries@suse.de>
* g++.dg/guality/guality.exp: Don't use which on gdb arg to report_gdb.
* gcc.dg/guality/guality.exp: Same.
* gfortran.dg/guality/guality.exp: Same.
* lib/gcc-gdb-test.exp: Do early out if which gdb fails.
paolo [Sat, 23 Jun 2018 07:32:45 +0000 (07:32 +0000)]
/cp
2018-06-23 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (bad_specifiers): Add const location_t* parameter and
use locations in error messages about 'inline' and 'virtual'.
(mark_inline_variable): Add location_t parameter and use it in
error_at and pedwarn messages.
(grokdeclarator): Use declspecs->locations[ds_constexpr],
declspecs->locations[ds_concept], declspecs->locations[ds_virtual],
declspecs->locations[ds_inline] in many error messages; adjust
bad_specifiers and mark_inline_variable calls.
(grokvardecl): Use declspecs->locations[ds_concept] in error message.
/testsuite
2018-06-23 Paolo Carlini <paolo.carlini@oracle.com>
ian [Sat, 23 Jun 2018 02:44:36 +0000 (02:44 +0000)]
runtime: use #ifdef instead of #if for USING_SPLIT_STACK
USING_SPLIT_STACK is configured as defined/undefined, not 0/1.
Most of the places test USING_SPLIT_STACK with #ifdef, with a
few exceptions. This CL fixes the exceptions.
kelvin [Fri, 22 Jun 2018 22:28:49 +0000 (22:28 +0000)]
gcc/ChangeLog:
2018-06-22 Kelvin Nilsen <kelvin@gcc.gnu.org>
* config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Change
behavior of vec_pack (vector double, vector double) to match
behavior of vec_float2 (vector double, vector double).
gcc/testsuite/ChangeLog:
2018-06-22 Kelvin Nilsen <kelvin@gcc.gnu.org>
* gcc.target/powerpc/builtins-3-p8.c (test_pack_float): Remove
this test.
* gcc.target/powerpc/builtins-9.c: New test.
* gcc.target/powerpc/fold-vec-pack-double.c: Modify dg directives
to expect different code generation on big-endian vs.
little-endian targets.
jason [Fri, 22 Jun 2018 21:57:07 +0000 (21:57 +0000)]
PR c++/86219 - ICE with erroneous initializer in template.
* constexpr.c (fold_non_dependent_expr): Add complain parm.
* call.c, expr.c, init.c, pt.c, semantics.c, typeck.c, typeck2.c:
Pass it.
* call.c (build_cxx_call): Don't mess with builtins in a template.
* typeck2.c (store_init_value): If fold_non_dependent_expr didn't
produce a constant value, go back to the uninstantiated form.
jason [Fri, 22 Jun 2018 21:57:01 +0000 (21:57 +0000)]
Avoid taking the address of something just because it's in parens.
* constexpr.c (same_type_ignoring_tlq_and_bounds_p): New.
(cxx_fold_indirect_ref): Use it.
(cxx_eval_constant_expression) [VIEW_CONVERT_EXPR]: Use it.
* cp-tree.h (REF_PARENTHESIZED_P): Allow VIEW_CONVERT_EXPR.
* semantics.c (force_paren_expr): Use VIEW_CONVERT_EXPR instead of
static_cast to reference type.
(maybe_undo_parenthesized_ref): Handle VIEW_CONVERT_EXPR.
vries [Fri, 22 Jun 2018 19:50:03 +0000 (19:50 +0000)]
[testsuite/guality] Be verbose about gdb version used
2018-06-22 Tom de Vries <tdevries@suse.de>
* lib/gcc-gdb-test.exp (report_gdb): New proc.
* g++.dg/guality/guality.exp: Use report_gdb.
* gcc.dg/guality/guality.exp: Same.
* gfortran.dg/guality/guality.exp: Same.
hainque [Fri, 22 Jun 2018 16:46:22 +0000 (16:46 +0000)]
Improve entry/exit instrumentation for nested functions
2018-06-22 Olivier Hainque <hainque@adacore.com>
* gimplify.c (gimplify_function_tree): Prevent creation
of a trampoline for the address of the current function
passed to entry/exit instrumentation hooks.
carll [Fri, 22 Jun 2018 15:01:34 +0000 (15:01 +0000)]
gcc/testsuite/ChangeLog:
2018-06-22 Carl Love <cel@us.ibm.com>
* gcc.target/powerpc/altivec-7.c: Add qualifiers for counts on AIX
versus Linux. Change checks for xxlnor, xxland and xxlxor to also look
for the vnor, vand and vxor instructions.
* gcc.target/powerpc/builtins-1.c: Move vec_or tests to a new file.
Remove counts for xxlor. Fix match on bl __divdi3 and bl __udivdi3.
* gcc.target/powerpc/builtins-4.c: Fix matching for vsl instructions.
* gcc.target/powerpc/builtins-5.c: New test file for vec_or test cases.
* gcc.target/powerpc/vsx-vector-6.p7.c: Fix xxlnor BE expected count.
Add -dp to dg-options, update expected counts.
redi [Fri, 22 Jun 2018 13:05:20 +0000 (13:05 +0000)]
PR libstdc++/86280 fix undefined left shift on 32-bit targets
PR libstdc++/86280
* include/experimental/memory_resource
(__resource_adaptor_common::_AlignMgr::_M_token_size): Use type large
enough for result of left shift.
marxin [Fri, 22 Jun 2018 11:32:20 +0000 (11:32 +0000)]
Fix emission of jump tables (PR tree-optimization/86263).
2018-06-22 Martin Liska <mliska@suse.cz>
PR tree-optimization/86263
* tree-switch-conversion.c (jump_table_cluster::find_jump_tables):
Bail out if is_enabled is false.
* tree-switch-conversion.h (jump_table_cluster::is_enabled):
New declaration.
(jump_table_cluster::is_enabled): New function.
marxin [Fri, 22 Jun 2018 08:56:18 +0000 (08:56 +0000)]
Make symbol_summary::get and call_summary::get pure.
2018-06-22 Martin Liska <mliska@suse.cz>
* symbol-summary.h (get): Make it pure and inline move
functionality from ::get function.
(get): Remove and inline into ::get and ::get_create.
(get_create): Move code from ::get function.
redi [Thu, 21 Jun 2018 23:29:01 +0000 (23:29 +0000)]
PR libstdc++/86138 prevent implicit instantiation of COW empty rep
The explicit instantiation declarations for std::basic_string are
disabled for C++17 (and later) so that basic_string symbols get
implicitly instantiated in every translation unit that needs them. On
targets that don't support STB_GNU_UNIQUE this leads to multiple copies
of the empty rep symbol for COW strings. In order to detect whether a
COW string needs to deallocate its storage it compares the address with
the empty rep. When there are multiple copies of the empty rep object
the address is not unique, and so string destructors try to delete the
empty rep, which crashes.
In order to guarantee uniqueness of the _S_empty_rep_storage symbol this
patch adds an explicit instantiation declaration for just that symbol.
This means the other symbols are still implicitly instantiated in C++17
code, but for the empty rep the definition in the library gets used.
Separately, there is no need for C++17 code to implicitly instantiate
the I/O functions for strings, so this also restores the explicit
instantiation declarations for those functions.
meissner [Thu, 21 Jun 2018 23:13:25 +0000 (23:13 +0000)]
2018-06-21 Michael Meissner <meissner@linux.ibm.com>
* gcc.target/powerpc/pack02.c: Use __ibm128 instead of long double
if the long double format is IEEE 128-bit for tests that are
explicitly testing IBM extended double support. Use the
appropriate pack and unpack built-in functions. Change calls from
__builtin_isinfl to __builtin_isinf since the later supports all
floating point types.
* gcc.target/powerpc/pr57150.c: Likewise.
* gcc.target/powerpc/pr60203.c: Likewise.
* gcc.target/powerpc/pr67808.c: Likewise.
* gcc.target/powerpc/pr70117.c: Likewise.
* gcc.target/powerpc/tfmode_off.c: Likewise.
pault [Thu, 21 Jun 2018 22:38:55 +0000 (22:38 +0000)]
2018-06-21 Paul Thomas <pault@gcc.gnu.org>
PR fortran/49630
* resolve.c (resolve_contained_fntype): Change standard ref.
from F95 to F2003: C418. Correct a spelling error in a comment.
It is an error for an abstract interface to have an assumed
character length result.
* trans-expr.c (gfc_conv_procedure_call): Likewise change the
standard reference.
2018-06-21 Paul Thomas <pault@gcc.gnu.org>
PR fortran/49630
* gfortran.dg/assumed_charlen_function_7.f90: New test.
meissner [Thu, 21 Jun 2018 22:16:20 +0000 (22:16 +0000)]
2018-06-21 Michael Meissner <meissner@linux.ibm.com>
* config/rs6000/rs6000.md (extendtfif2): Add missing 128-bit
conversion insn that shows up when pr85657-3.c is compiled using
IEEE 128-bit long double.
redi [Thu, 21 Jun 2018 22:01:25 +0000 (22:01 +0000)]
PR libstdc++/83328 add correct basic_string::insert for initializer_list
The SSO basic_string has a non-standard insert(iterator, initializer_list)
overload, from a C++0x draft. This adds the correct overload, while also
preserving the old one so that the old symbol is still exported from the
library.
The COW basic_string doesn't have any of the C++11 changes to the insert
overloads (they all still have non-const iterator parameters and the
ones that should return an iterator still return void). This doesn't
make any change to the COW string.
PR libstdc++/83328
* acinclude.m4 (libtool_VERSION): Bump to 6:26:0.
* config/abi/pre/gnu.ver: Add GLIBCXX_3.4.26 and export new symbol.
* configure: Regenerate.
* include/bits/basic_string.h [_GLIBCXX_USE_CXX11_ABI]
(basic_string::insert(const_iterator, initializer_list<C>)): Add.
[_GLIBCXX_USE_CXX11_ABI && !_GLIBCXX_DEFINING_STRING_INSTANTIATIONS]
(basic_string::insert(iterator, initializer_list<C>)): Suppress
definition.
* include/debug/string (basic_string::insert(iterator, C)): Change
first parameter to const_iterator.
(basic_string::insert(iterator, size_type, C)): Likewise. Change
return type to iterator.
(basic_string::insert(iterator, InputIterator, InputIterator)):
Likewise.
(basic_string::insert(iterator, initializer_list<C>)): Change first
parameter to const_iterator and return type to iterator.
* src/c++11/string-inst.cc: Extend comment.
* testsuite/21_strings/basic_string/modifiers/insert/char/83328.cc:
New.
* testsuite/21_strings/basic_string/modifiers/insert/wchar_t/83328.cc:
New.
* testsuite/util/testsuite_abi.cc: Add new symbol version.
pault [Thu, 21 Jun 2018 17:34:31 +0000 (17:34 +0000)]
2018-06-21 Paul Thomas <pault@gcc.gnu.org>
PR fortran/83118
* resolve.c (resolve_ordinary_assign): Force the creation of a
vtable for assignment of non-polymorphic expressions to an
unlimited polymorphic object.
* trans-array.c (gfc_alloc_allocatable_for_assignment): Use the
size of the rhs type for such assignments. Set the dtype, _len
and vptrs appropriately.
* trans-expr.c (gfc_trans_assignment): Force the use of the
_copy function for these assignments.
2018-06-21 Paul Thomas <pault@gcc.gnu.org>
PR fortran/83118
* gfortran.dg/unlimited_polymorphic_30.f03: New test.
ebotcazou [Thu, 21 Jun 2018 17:03:58 +0000 (17:03 +0000)]
* cfgrtl.c (fixup_reorder_chain): Do not emit NOPs in DECL_IGNORED_P
functions.
(rtl_merge_blocks): Likewise. Do not emit a NOP if the location of
the edge can be forwarded.
(cfg_layout_merge_blocks): Likewise.
ebotcazou [Thu, 21 Jun 2018 17:01:12 +0000 (17:01 +0000)]
* tree-nested.c (get_frame_type): Use create_tmp_var_raw instead of
create_tmp_var_for to create the FRAME decl.
(finalize_nesting_tree_1): Do not unchain the FRAME decl.
ebotcazou [Thu, 21 Jun 2018 16:59:28 +0000 (16:59 +0000)]
* tree-inline.c (copy_edges_for_bb): Minor tweak.
(maybe_move_debug_stmts_to_successors): Also reset the locus of the
debug statement when resetting its value.
(expand_call_inline): Copy the locus of the call onto the assignment
of the return value, if any. Use local variable in more cases.
redi [Thu, 21 Jun 2018 14:01:11 +0000 (14:01 +0000)]
PR libstdc++/70940 make pmr::resource_adaptor return aligned memory
PR libstdc++/70940
* include/experimental/memory_resource (__resource_adaptor_common):
New base class.
(__resource_adaptor_common::_AlignMgr): Helper for obtaining aligned
pointer from unaligned, and vice versa.
(__resource_adaptor_imp::do_allocate): Use _AlignMgr to adjust
allocated pointer to meet alignment request.
(__resource_adaptor_imp::do_deallocate): Use _AlignMgr to retrieve
original pointer for deallocation.
(__resource_adaptor_imp::do_is_equal): Reformat.
(__resource_adaptor_imp::_S_aligned_size): Remove.
(__resource_adaptor_imp::_S_supported): Remove.
(new_delete_resource): Use __gnu_cxx::new_allocator.
* testsuite/experimental/memory_resource/resource_adaptor.cc: Test
extended alignments and use debug_allocator to check for matching
allocate/deallocate pairs.
dmalcolm [Thu, 21 Jun 2018 13:44:38 +0000 (13:44 +0000)]
Fix IPA crash in libgccjit
gcc/ChangeLog:
* ipa-cp.c (ipcp_driver): Set edge_clone_summaries to NULL after
deleting it.
* ipa-reference.c (ipa_reference_c_finalize): Delete
ipa_ref_opt_sum_summaries and set it to NULL.
vries [Thu, 21 Jun 2018 13:37:59 +0000 (13:37 +0000)]
[testsuite] Fix guality/pr45882.c for flto
Atm this test in pr45882.c fails:
...
int d = a[i]; /* { dg-final { gdb-test 16 "d" "112" } } */
...
as follows:
...
FAIL: gcc.dg/guality/pr45882.c -O2 -flto -fuse-linker-plugin \
-fno-fat-lto-objects line 16 d == 112
...
In more detail, gdb fails to print the value of d:
...
Breakpoint 1, foo (i=i@entry=7, j=j@entry=7) at pr45882.c:16
16 ++v;
$1 = <optimized out>
$2 = 112
<optimized out> != 112
...
Variable d is a local variable in function foo, initialized from global array a.
When compiling, first cddce1 removes the initialization of d in foo, given
that d is not used afterwards. Then ipa marks array a as write-only, and
removes the stores to array a in main. This invalidates the location
expression for d, which points to a[i], so it is removed, which is why gdb
ends up printing <optimized out> for d.
This patches fixes the fail by adding attribute used to array a, preventing
array a from being marked as write-only.
Tested on x86_64.
2018-06-21 Tom de Vries <tdevries@suse.de>
* gcc.dg/guality/pr45882.c (a): Add used attribute.
libatomic/
* config/arm/arm-config.h (__ARM_ARCH__): Remove definitions, use
__ARM_ARCH instead. Use __ARM_FEATURE_LDREX to define HAVE_STREX
and HAVE_STREXBHD
libgcc/
* config/arm/lib1funcs.S (__ARM_ARCH__): Remove definitions, use
__ARM_ARCH and __ARM_FEATURE_CLZ instead.
(HAVE_ARM_CLZ): Remove definition, use __ARM_FEATURE_CLZ instead.
* config/arm/ieee754-df.S: Use __ARM_FEATURE_CLZ instead of
__ARM_ARCH__.
* config/arm/ieee754-sf.S: Likewise.
* config/arm/libunwind.S: Use __ARM_ARCH instead of __ARM_ARCH__.
rguenth [Thu, 21 Jun 2018 07:46:43 +0000 (07:46 +0000)]
2018-06-21 Richard Biener <rguenther@suse.de>
* tree-data-ref.c (dr_step_indicator): Handle NULL DR_STEP.
* tree-vect-data-refs.c (vect_analyze_possibly_independent_ddr):
Avoid calling vect_mark_for_runtime_alias_test with gathers or scatters.
(vect_analyze_data_ref_dependence): Re-order checks to deal with
NULL DR_STEP.
(vect_record_base_alignments): Do not record base alignment
for gathers or scatters.
(vect_compute_data_ref_alignment): Drop return value that is always
true. Bail out early for gathers or scatters.
(vect_enhance_data_refs_alignment): Bail out early for gathers
or scatters.
(vect_find_same_alignment_drs): Likewise.
(vect_analyze_data_refs_alignment): Remove dead code.
(vect_slp_analyze_and_verify_node_alignment): Likewise.
(vect_analyze_data_refs): For possible gathers or scatters do
not create an alternate DR, just check their possible validity
and mark them. Adjust DECL_NONALIASED handling to not rely
on DR_BASE_ADDRESS.
* tree-vect-loop-manip.c (vect_update_inits_of_drs): Do not
update inits of gathers or scatters.
* tree-vect-patterns.c (vect_recog_mask_conversion_pattern):
Also copy gather/scatter flag to pattern vinfo.
fdumont [Thu, 21 Jun 2018 05:36:48 +0000 (05:36 +0000)]
2018-06-21 François Dumont <fdumont@gcc.gnu.org>
* include/debug/debug.h
(_Safe_iterator<>(const _Safe_iterator<_MutableIterator,>& __x)):
Compare __x base iterator with a default initialized iterator of the
same type.
ian [Wed, 20 Jun 2018 21:11:23 +0000 (21:11 +0000)]
libgcc/:
PR libgcc/86213
* generic-morestack.c (allocate_segment): Move calls to getenv and
getpagesize to __morestack_load_mmap.
(__morestack_load_mmap) Initialize static_pagesize and
use_guard_page here so as to avoid clobbering SSE regs during a
__morestack call.
gcc/testsuite/:
* gcc.dg/split-8.c: New.
kelvin [Wed, 20 Jun 2018 20:06:51 +0000 (20:06 +0000)]
gcc/ChangeLog:
2018-06-20 Kelvin Nilsen <kelvin@gcc.gnu.org>
* config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Change
behavior of vec_packsu (vector unsigned long long, vector unsigned
long long) to match behavior of vec_packs with same signature.
gcc/testsuite/ChangeLog:
2018-06-20 Kelvin Nilsen <kelvin@gcc.gnu.org>
* gcc.target/powerpc/builtins-1.c: Adjust dg directives to scan
for vpkudus in place of vpksdus.
* gcc.target/powerpc/builtins-3-p8.c: Likewise.
redi [Wed, 20 Jun 2018 19:34:53 +0000 (19:34 +0000)]
PR libstdc++/70966 make pmr::new_delete_resource() immortal
Construct the program-wide resource objects using placement new. This
means they have dynamic storage duration and won't be destroyed during
termination.
PR libstdc++/70966
* include/experimental/memory_resource (__resource_adaptor_imp): Add
static assertions to enforce requirements on pointer types.
(__resource_adaptor_imp::get_allocator()): Add noexcept.
(new_delete_resource, null_memory_resource): Return address of an
object with dynamic storage duration.
(__null_memory_resource): Remove.
* testsuite/experimental/memory_resource/70966.cc: New.
paolo [Wed, 20 Jun 2018 19:07:37 +0000 (19:07 +0000)]
/cp
2018-06-20 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (grokfndecl): Add const cp_decl_specifier_seq* parameter;
tidy handling of a null location_t argument; use proper location
information in a few additional error messages.
(grokdeclarator): Update calls.
/testsuite
2018-06-20 Paolo Carlini <paolo.carlini@oracle.com>
jakub [Wed, 20 Jun 2018 14:47:28 +0000 (14:47 +0000)]
PR tree-optimization/86231
* tree-vrp.c (union_ranges): For ( [ ) ] or ( )[ ] range and
anti-range don't overwrite *vr0min before using it to compute *vr0max.
* gcc.dg/tree-ssa/vrp119.c: New test.
* gcc.c-torture/execute/pr86231.c: New test.
vries [Wed, 20 Jun 2018 14:44:45 +0000 (14:44 +0000)]
Generate correctly typed compare in canonicalize_loop_ivs
2018-06-20 Tom de Vries <tdevries@suse.de>
PR tree-optimization/86097
* tree-ssa-loop-manip.c (canonicalize_loop_ivs): Also convert *nit to
iv type if signedness of iv type is not the same as that of *nit.
ktkachov [Wed, 20 Jun 2018 08:57:17 +0000 (08:57 +0000)]
[AArch64] Support for LDP/STP of Q-registers
This patch adds support for generating LDPs and STPs of Q-registers.
This allows for more compact code generation and makes better use of the ISA.
It's implemented in a straightforward way by allowing 16-byte modes in the
sched-fusion machinery and adding appropriate peepholes in aarch64-ldpstp.md
as well as the patterns themselves in aarch64-simd.md.
It adds a new no_ldp_stp_qregs tuning flag.
I use it to restrict the peepholes in aarch64-ldpstp.md from merging the
operations together into PARALLELs. I also use it to restrict the sched fusion
check that brings such loads and stores together. This is enough to avoid
forming the pairs when the tuning flag is set.
I didn't see any non-noise performance effect on SPEC2017 on Cortex-A72 and Cortex-A53.
* config/aarch64/aarch64-tuning-flags.def (no_ldp_stp_qregs): New.
* config/aarch64/aarch64.c (xgene1_tunings): Add
AARCH64_EXTRA_TUNE_NO_LDP_STP_QREGS to tune_flags.
(aarch64_mode_valid_for_sched_fusion_p):
Allow 16-byte modes.
(aarch64_classify_address): Allow 16-byte modes for load_store_pair_p.
* config/aarch64/aarch64-ldpstp.md: Add peepholes for LDP STP of
128-bit modes.
* config/aarch64/aarch64-simd.md (load_pair<VQ:mode><VQ2:mode>):
New pattern.
(vec_store_pair<VQ:mode><VQ2:mode>): Likewise.
* config/aarch64/iterators.md (VQ2): New mode iterator.
* gcc.target/aarch64/ldp_stp_q.c: New test.
* gcc.target/aarch64/stp_vec_128_1.c: Likewise.
* gcc.target/aarch64/ldp_stp_q_disable.c: Likewise.
rsandifo [Wed, 20 Jun 2018 08:16:08 +0000 (08:16 +0000)]
[8/n] PR85694: Make patterns check for target support
This patch makes pattern recognisers do their own checking for vector
types and target support. Previously some recognisers did this
themselves and some left it to vect_pattern_recog_1.
Doing this means we can get rid of the type_in argument, which was
ignored if the recogniser did its own checking. It also means
we create fewer junk statements.
2018-06-20 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* tree-vectorizer.h (NUM_PATTERNS, vect_recog_func_ptr): Move to
tree-vect-patterns.c.
* tree-vect-patterns.c (vect_supportable_direct_optab_p): New function.
(vect_recog_dot_prod_pattern): Use it. Remove the type_in argument.
(vect_recog_sad_pattern): Likewise.
(vect_recog_widen_sum_pattern): Likewise.
(vect_recog_pow_pattern): Likewise. Check for a null vectype.
(vect_recog_widen_shift_pattern): Remove the type_in argument.
(vect_recog_rotate_pattern): Likewise.
(vect_recog_mult_pattern): Likewise.
(vect_recog_vector_vector_shift_pattern): Likewise.
(vect_recog_divmod_pattern): Likewise.
(vect_recog_mixed_size_cond_pattern): Likewise.
(vect_recog_bool_pattern): Likewise.
(vect_recog_mask_conversion_pattern): Likewise.
(vect_try_gather_scatter_pattern): Likewise.
(vect_recog_widen_mult_pattern): Likewise. Check for a null vectype.
(vect_recog_over_widening_pattern): Likewise.
(vect_recog_gather_scatter_pattern): Likewise.
(vect_recog_func_ptr): Move from tree-vectorizer.h
(vect_vect_recog_func_ptrs): Move further down the file.
(vect_recog_func): Likewise. Remove the third argument.
(NUM_PATTERNS): Define based on vect_vect_recog_func_ptrs.
(vect_pattern_recog_1): Expect the pattern function to do any
necessary target tests. Also expect it to provide a vector type.
Remove the type_in handling.
rsandifo [Wed, 20 Jun 2018 08:11:46 +0000 (08:11 +0000)]
[7/n] PR85694: Add a vect_pattern_detected helper
This message is a long write-up for a patch that simply adds a common
routine for printing the "vector_foo_pattern: detected:" messages.
The reason for doing this is that some routines check for target support
themselves and some leave it to vect_pattern_recog_1. Those that leave
it to vect_pattern_recog_1 currently print these "detected:" messages if
the statements have the right form, even if the pattern is eventually
discarded. IMO that's useful, and a lot of existing scan tests rely on it.
However, a later patch makes patterns do their own testing, and stops
them creating pattern statements until the tests have passed. This means
(a) they need to print the "detected:" message earlier and (b) the pattern
statement won't be around to print.
The patch therefore makes all routines print the original statement
rather than the pattern one. That information isn't obvious otherwise,
whereas vect_pattern_recog_1 already prints the pattern statement
in the case of a successful match. This also avoids the previous
situation in which a routine could print "detected:" and then
silently bail out before saying what had been detected.
2018-06-20 Richard Sandiford <richard.sandiford@arm.com>
rsandifo [Wed, 20 Jun 2018 08:09:48 +0000 (08:09 +0000)]
[6/n] PR85694: Add a vect_get_internal_def helper
This patch adds a helper for pattern code that wants to find an
internal (vectorisable) definition of an SSA name.
A later patch will make more use of this, and alter the definition.
2018-06-20 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* tree-vect-patterns.c (vect_get_internal_def): New function.
(vect_recog_dot_prod_pattern, vect_recog_sad_pattern)
(vect_recog_vector_vector_shift_pattern, check_bool_pattern)
(search_type_for_mask_1): Use it.
rsandifo [Wed, 20 Jun 2018 08:08:21 +0000 (08:08 +0000)]
[5/n] PR85694: Remove dead WIDEN_SUM handling
vect_recog_dot_prod_pattern and vect_recog_sad_pattern both checked
whether the statement passed in had already been recognised as a
WIDEN_SUM_EXPR pattern. That isn't possible (any more?), since the
first recognised pattern wins, and since vect_recog_widen_sum_pattern
never matches a later statement than the one it's given.
2018-06-20 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* tree-vect-patterns.c (vect_recog_dot_prod_pattern): Remove
redundant WIDEN_SUM_EXPR handling.
(vect_recog_sad_pattern): Likewise.
rsandifo [Wed, 20 Jun 2018 08:07:37 +0000 (08:07 +0000)]
[4/n] PR85694: Remove redundant calls to types_compatible_p
tree-vect-patterns.c checked that operands to primitive arithmetic ops
are compatible with each other and with the result. The checks date
back years and have long been redundant with verify_gimple_stmt.
2018-06-20 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* tree-vect-patterns.c (vect_recog_dot_prod_pattern): Remove
redundant check that the types of a PLUS_EXPR or MULT_EXPR agree.
(vect_recog_sad_pattern): Likewise PLUS_EXPR, ABS_EXPR and MINUS_EXPR.
(vect_recog_widen_mult_pattern): Likewise MULT_EXPR.
(vect_recog_widen_sum_pattern): Likewise PLUS_EXPR.
rsandifo [Wed, 20 Jun 2018 08:06:33 +0000 (08:06 +0000)]
[3/n] PR85694: Fix dummy assignment handling in vectorizable_call
vectorizable_call stubs out the original scalar statement with
a dummy assignment to the same lhs, so that we don't leave any bogus
scalar calls around. If the call is actually a pattern statement,
the code rightly took the lhs of the original bb statement:
But it then associated the new statement with the stmt_vec_info of the
pattern statement rather than the bb statement, which meant we had two
stmt_vec_infos assigning to the same lhs. This seems to be latent at
the moment but caused problems further into the series.
2018-06-20 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* tree-vect-stmts.c (vectorizable_call): Make sure that we
use the stmt_vec_info of the original bb statement for the
new zero assignment, even if the call is part of a pattern.