diff options
author | Renlin Li <renlin.li@arm.com> | 2018-10-15 16:49:05 +0000 |
---|---|---|
committer | Renlin Li <renlin@gcc.gnu.org> | 2018-10-15 16:49:05 +0000 |
commit | 4124119974fd87380de607a6bc9bfdcffe1702d8 (patch) | |
tree | 47feff0e7142f9546cb0f5127556626781cb82d4 /gcc/internal-fn.c | |
parent | e60f68ec460bc5b33a6f75caac9667bf978f37d8 (diff) | |
download | gcc-4124119974fd87380de607a6bc9bfdcffe1702d8.zip gcc-4124119974fd87380de607a6bc9bfdcffe1702d8.tar.gz gcc-4124119974fd87380de607a6bc9bfdcffe1702d8.tar.bz2 |
[PR87563][AARCH64-SVE]: Don't keep ifcvt loop when COND_<OP> ifn could not be vectorized.
ifcvt will created versioned loop and it will permissively generate
scalar COND_<OP> ifn.
If in the loop vectorize pass, COND_<OP> could not get vectoized,
the if-converted loop should be abandoned when the target doesn't support
such ifn.
gcc/
2018-10-12 Renlin Li <renlin.li@arm.com>
PR target/87563
* tree-vectorizer.c (try_vectorize_loop_1): Don't use
if-conversioned loop when it contains ifn with types not
supported by backend.
* internal-fn.c (expand_direct_optab_fn): Add an assert.
(direct_internal_fn_supported_p): New helper function.
* internal-fn.h (direct_internal_fn_supported_p): Declare.
gcc/testsuite/
2018-10-12 Renlin Li <renlin.li@arm.com>
PR target/87563
* gcc.target/aarch64/sve/pr87563.c: New.
From-SVN: r265172
Diffstat (limited to 'gcc/internal-fn.c')
-rw-r--r-- | gcc/internal-fn.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/internal-fn.c b/gcc/internal-fn.c index 34d4f9e..d082dd5 100644 --- a/gcc/internal-fn.c +++ b/gcc/internal-fn.c @@ -2890,6 +2890,7 @@ expand_direct_optab_fn (internal_fn fn, gcall *stmt, direct_optab optab, tree_pair types = direct_internal_fn_types (fn, stmt); insn_code icode = direct_optab_handler (optab, TYPE_MODE (types.first)); + gcc_assert (icode != CODE_FOR_nothing); tree lhs = gimple_call_lhs (stmt); rtx lhs_rtx = NULL_RTX; @@ -3183,6 +3184,17 @@ direct_internal_fn_supported_p (internal_fn fn, tree type, return direct_internal_fn_supported_p (fn, tree_pair (type, type), opt_type); } +/* Return true if the STMT is supported when the optimization type is OPT_TYPE, + given that STMT is a call to a direct internal function. */ + +bool +direct_internal_fn_supported_p (gcall *stmt, optimization_type opt_type) +{ + internal_fn fn = gimple_call_internal_fn (stmt); + tree_pair types = direct_internal_fn_types (fn, stmt); + return direct_internal_fn_supported_p (fn, types, opt_type); +} + /* If FN is commutative in two consecutive arguments, return the index of the first, otherwise return -1. */ |